From 0b6df767c9f4b65cf437e57d55377a258d49c1a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:54:28 +0000 Subject: [PATCH 01/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/carddisputes/CardDispute.kt | 373 +----------------- .../CardDisputeListPageResponseTest.kt | 42 +- .../models/carddisputes/CardDisputeTest.kt | 42 +- 4 files changed, 31 insertions(+), 430 deletions(-) diff --git a/.stats.yml b/.stats.yml index 238098d13..6d6e5b784 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9e8783129ea725992844a51e7d6f6a639cae93753228cef7262eccb2e4bae58d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fcc4e952b005ab1fd26ae67fe0cac46a57699299c92e00680d4d0f6be51d7936.yml openapi_spec_hash: f1a7326721f814625c7d5484956afded -config_hash: 4489d6e123ed885f5cb74fe619668e4b +config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index d8633d825..46bde6b2e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -6452,8 +6452,7 @@ private constructor( private val cardholderNoLongerDisputes: JsonField, private val creditOrReversalProcessed: JsonField, private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField, + private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue, private val nonFiatCurrencyOrNonFungibleTokenReceived: JsonField, private val proofOfCashDisbursement: JsonField, @@ -6477,9 +6476,7 @@ private constructor( invalidDispute: JsonField = JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField = - JsonMissing.of(), + nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue = JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_received") @ExcludeMissing nonFiatCurrencyOrNonFungibleTokenReceived: @@ -6538,15 +6535,11 @@ private constructor( /** * Non-fiat currency or non-fungible token as described details. Present if and only * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed(): - Optional = - nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOptional( - "non_fiat_currency_or_non_fungible_token_as_described" - ) + @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): JsonValue = + nonFiatCurrencyOrNonFungibleTokenAsDescribed /** * Non-fiat currency or non-fungible token received details. Present if and only if @@ -6622,18 +6615,6 @@ private constructor( @ExcludeMissing fun _invalidDispute(): JsonField = invalidDispute - /** - * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenAsDescribed]. - * - * Unlike [nonFiatCurrencyOrNonFungibleTokenAsDescribed], this method doesn't throw - * if the JSON field has an unexpected type. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): - JsonField = - nonFiatCurrencyOrNonFungibleTokenAsDescribed - /** * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. * @@ -6715,9 +6696,7 @@ private constructor( private var creditOrReversalProcessed: JsonField? = null private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField? = - null + private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue? = null private var nonFiatCurrencyOrNonFungibleTokenReceived: JsonField? = null @@ -6826,38 +6805,7 @@ private constructor( * only if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. */ fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - NonFiatCurrencyOrNonFungibleTokenAsDescribed? - ) = - nonFiatCurrencyOrNonFungibleTokenAsDescribed( - JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenAsDescribed) - ) - - /** - * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with - * `nonFiatCurrencyOrNonFungibleTokenAsDescribed.orElse(null)`. - */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - Optional - ) = - nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOrNull() - ) - - /** - * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] to an arbitrary - * JSON value. - * - * You should usually call - * [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with a well-typed - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField + nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue ) = apply { this.nonFiatCurrencyOrNonFungibleTokenAsDescribed = nonFiatCurrencyOrNonFungibleTokenAsDescribed @@ -7038,7 +6986,6 @@ private constructor( cardholderNoLongerDisputes().ifPresent { it.validate() } creditOrReversalProcessed().ifPresent { it.validate() } invalidDispute().ifPresent { it.validate() } - nonFiatCurrencyOrNonFungibleTokenAsDescribed().ifPresent { it.validate() } nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } proofOfCashDisbursement().ifPresent { it.validate() } reason().validate() @@ -7065,10 +7012,6 @@ private constructor( (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + - (nonFiatCurrencyOrNonFungibleTokenAsDescribed - .asKnown() - .getOrNull() - ?.validity() ?: 0) + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() ?: 0) + (proofOfCashDisbursement.asKnown().getOrNull()?.validity() ?: 0) + @@ -8410,132 +8353,6 @@ private constructor( "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" } - /** - * Non-fiat currency or non-fungible token as described details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - */ - class NonFiatCurrencyOrNonFungibleTokenAsDescribed - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val additionalProperties: MutableMap - ) { - - @JsonCreator private constructor() : this(mutableMapOf()) - - @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 - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - NonFiatCurrencyOrNonFungibleTokenAsDescribed - ) = apply { - additionalProperties = - nonFiatCurrencyOrNonFungibleTokenAsDescribed.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 - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = - NonFiatCurrencyOrNonFungibleTokenAsDescribed( - additionalProperties.toMutableMap() - ) - } - - private var validated: Boolean = false - - fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 = 0 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NonFiatCurrencyOrNonFungibleTokenAsDescribed && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" - } - /** * Non-fiat currency or non-fungible token received details. Present if and only if * `reason` is `non_fiat_currency_or_non_fungible_token_received`. @@ -10841,7 +10658,7 @@ private constructor( JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonField, + private val consumerNonReceiptOfCash: JsonValue, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -10906,8 +10723,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonField = - JsonMissing.of(), + consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -11086,12 +10902,10 @@ private constructor( /** * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). */ - fun consumerNonReceiptOfCash(): Optional = - consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` @@ -11298,17 +11112,6 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived - /** - * Returns the raw JSON value of [consumerNonReceiptOfCash]. - * - * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonField = - consumerNonReceiptOfCash - /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -11468,8 +11271,7 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField? = null - private var consumerNonReceiptOfCash: JsonField? = - null + private var consumerNonReceiptOfCash: JsonValue? = null private var consumerOriginalCreditTransactionNotAccepted: JsonField? = null @@ -11868,28 +11670,9 @@ private constructor( * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: ConsumerNonReceiptOfCash? - ) = consumerNonReceiptOfCash(JsonField.ofNullable(consumerNonReceiptOfCash)) - - /** - * Alias for calling [Builder.consumerNonReceiptOfCash] with - * `consumerNonReceiptOfCash.orElse(null)`. - */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: Optional - ) = consumerNonReceiptOfCash(consumerNonReceiptOfCash.getOrNull()) - - /** - * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. - * - * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed - * [ConsumerNonReceiptOfCash] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: JsonField - ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { + this.consumerNonReceiptOfCash = consumerNonReceiptOfCash + } /** * Original Credit Transaction (OCT) not accepted. Present if and only if @@ -12258,7 +12041,6 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } - consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -12300,7 +12082,6 @@ private constructor( ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + - (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted .asKnown() .getOrNull() @@ -27136,126 +26917,6 @@ private constructor( "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantCancellation=$merchantCancellation, merchantResolutionAttempted=$merchantResolutionAttempted, noCancellation=$noCancellation, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, additionalProperties=$additionalProperties}" } - /** - * Non-receipt of cash. Present if and only if `category` is - * `consumer_non_receipt_of_cash`. - */ - class ConsumerNonReceiptOfCash - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val additionalProperties: MutableMap - ) { - - @JsonCreator private constructor() : this(mutableMapOf()) - - @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 - * [ConsumerNonReceiptOfCash]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ConsumerNonReceiptOfCash]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = - apply { - additionalProperties = - consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): ConsumerNonReceiptOfCash = - ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) - } - - private var validated: Boolean = false - - fun validate(): ConsumerNonReceiptOfCash = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 = 0 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ConsumerNonReceiptOfCash && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" - } - /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` * is `consumer_original_credit_transaction_not_accepted`. diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index 72ac6295e..a83b17476 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -206,12 +206,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -885,12 +880,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1507,12 +1497,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2132,12 +2117,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2732,12 +2712,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -3411,12 +3386,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index 560738723..9c1e82b54 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -198,12 +198,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -761,12 +756,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1300,12 +1290,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -1841,12 +1826,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2384,12 +2364,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2947,12 +2922,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted From 1c75baeb3991dc02fa1898d0a77c0f662473f610 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 18:15:26 +0000 Subject: [PATCH 02/33] feat(api): api update --- .stats.yml | 4 +-- .../api/models/checkdeposits/CheckDeposit.kt | 26 ++++++++++++------- .../api/models/transactions/Transaction.kt | 16 +++++++++--- 3 files changed, 31 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6d6e5b784..0ff8edbc9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fcc4e952b005ab1fd26ae67fe0cac46a57699299c92e00680d4d0f6be51d7936.yml -openapi_spec_hash: f1a7326721f814625c7d5484956afded +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2b82894385cf8290541770072636402861719818ea52315b785c281d8cc128eb.yml +openapi_spec_hash: 2493d025c6ea2a47445a32a22d54d711 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt index 8bd543e48..6e6ae71e0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt @@ -152,8 +152,8 @@ private constructor( fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") /** - * If your deposit is successfully parsed and accepted by Increase, this will contain details of - * the parsed check. + * Once your deposit is successfully parsed and accepted by Increase, this will contain details + * of the parsed check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -579,7 +579,7 @@ private constructor( fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } /** - * If your deposit is successfully parsed and accepted by Increase, this will contain + * Once your deposit is successfully parsed and accepted by Increase, this will contain * details of the parsed check. */ fun depositAcceptance(depositAcceptance: DepositAcceptance?) = @@ -957,8 +957,8 @@ private constructor( (type.asKnown().getOrNull()?.validity() ?: 0) /** - * If your deposit is successfully parsed and accepted by Increase, this will contain details of - * the parsed check. + * Once your deposit is successfully parsed and accepted by Increase, this will contain details + * of the parsed check. */ class DepositAcceptance @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -1006,7 +1006,8 @@ private constructor( ) /** - * The account number printed on the check. + * The account number printed on the check. This is an account at the bank that issued the + * check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -1049,7 +1050,8 @@ private constructor( fun currency(): Currency = currency.getRequired("currency") /** - * The routing number printed on the check. + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected value). @@ -1184,7 +1186,10 @@ private constructor( additionalProperties = depositAcceptance.additionalProperties.toMutableMap() } - /** The account number printed on the check. */ + /** + * The account number printed on the check. This is an account at the bank that issued + * the check. + */ fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) /** @@ -1265,7 +1270,10 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The routing number printed on the check. */ + /** + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. + */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 1145d8251..6e94255be 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -37436,7 +37436,8 @@ private constructor( ) /** - * The account number printed on the check. + * The account number printed on the check. This is an account at the bank that issued + * the check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -37483,7 +37484,8 @@ private constructor( fun currency(): Currency = currency.getRequired("currency") /** - * The routing number printed on the check. + * The routing number printed on the check. This is a routing number for the bank that + * issued the check. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -37624,7 +37626,10 @@ private constructor( checkDepositAcceptance.additionalProperties.toMutableMap() } - /** The account number printed on the check. */ + /** + * The account number printed on the check. This is an account at the bank that + * issued the check. + */ fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) @@ -37706,7 +37711,10 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The routing number printed on the check. */ + /** + * The routing number printed on the check. This is a routing number for the bank + * that issued the check. + */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) From 8933f23c50360ad105a07d1b885f4a64143830be Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 7 Oct 2025 22:09:27 +0000 Subject: [PATCH 03/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/oauthtokens/OAuthToken.kt | 42 +++++++++++++++++-- .../api/models/oauthtokens/OAuthTokenTest.kt | 3 ++ 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0ff8edbc9..6612d81f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2b82894385cf8290541770072636402861719818ea52315b785c281d8cc128eb.yml -openapi_spec_hash: 2493d025c6ea2a47445a32a22d54d711 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2f24b343a9f099286b8e3dbd0e38f2bd237a7b174a275ea81cd9173bea33c601.yml +openapi_spec_hash: fd71bd10930be2849fdb5614c1878866 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt index 856fd2ef2..3eccb06f4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/oauthtokens/OAuthToken.kt @@ -25,6 +25,7 @@ class OAuthToken @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val accessToken: JsonField, + private val groupId: JsonField, private val tokenType: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, @@ -35,11 +36,12 @@ private constructor( @JsonProperty("access_token") @ExcludeMissing accessToken: JsonField = JsonMissing.of(), + @JsonProperty("group_id") @ExcludeMissing groupId: JsonField = JsonMissing.of(), @JsonProperty("token_type") @ExcludeMissing tokenType: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), - ) : this(accessToken, tokenType, type, mutableMapOf()) + ) : this(accessToken, groupId, tokenType, type, mutableMapOf()) /** * You may use this token in place of an API key to make OAuth requests on a user's behalf. @@ -49,6 +51,14 @@ private constructor( */ fun accessToken(): String = accessToken.getRequired("access_token") + /** + * The Group's identifier. A Group is the top-level organization in Increase. + * + * @throws IncreaseInvalidDataException 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 groupId(): String = groupId.getRequired("group_id") + /** * The type of OAuth token. * @@ -74,6 +84,13 @@ private constructor( @ExcludeMissing fun _accessToken(): JsonField = accessToken + /** + * Returns the raw JSON value of [groupId]. + * + * Unlike [groupId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("group_id") @ExcludeMissing fun _groupId(): JsonField = groupId + /** * Returns the raw JSON value of [tokenType]. * @@ -108,6 +125,7 @@ private constructor( * The following fields are required: * ```java * .accessToken() + * .groupId() * .tokenType() * .type() * ``` @@ -119,6 +137,7 @@ private constructor( class Builder internal constructor() { private var accessToken: JsonField? = null + private var groupId: JsonField? = null private var tokenType: JsonField? = null private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -126,6 +145,7 @@ private constructor( @JvmSynthetic internal fun from(oauthToken: OAuthToken) = apply { accessToken = oauthToken.accessToken + groupId = oauthToken.groupId tokenType = oauthToken.tokenType type = oauthToken.type additionalProperties = oauthToken.additionalProperties.toMutableMap() @@ -145,6 +165,17 @@ private constructor( */ fun accessToken(accessToken: JsonField) = apply { this.accessToken = accessToken } + /** The Group's identifier. A Group is the top-level organization in Increase. */ + fun groupId(groupId: String) = groupId(JsonField.of(groupId)) + + /** + * Sets [Builder.groupId] to an arbitrary JSON value. + * + * You should usually call [Builder.groupId] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun groupId(groupId: JsonField) = apply { this.groupId = groupId } + /** The type of OAuth token. */ fun tokenType(tokenType: TokenType) = tokenType(JsonField.of(tokenType)) @@ -198,6 +229,7 @@ private constructor( * The following fields are required: * ```java * .accessToken() + * .groupId() * .tokenType() * .type() * ``` @@ -207,6 +239,7 @@ private constructor( fun build(): OAuthToken = OAuthToken( checkRequired("accessToken", accessToken), + checkRequired("groupId", groupId), checkRequired("tokenType", tokenType), checkRequired("type", type), additionalProperties.toMutableMap(), @@ -221,6 +254,7 @@ private constructor( } accessToken() + groupId() tokenType().validate() type().validate() validated = true @@ -242,6 +276,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (accessToken.asKnown().isPresent) 1 else 0) + + (if (groupId.asKnown().isPresent) 1 else 0) + (tokenType.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) @@ -500,17 +535,18 @@ private constructor( return other is OAuthToken && accessToken == other.accessToken && + groupId == other.groupId && tokenType == other.tokenType && type == other.type && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(accessToken, tokenType, type, additionalProperties) + Objects.hash(accessToken, groupId, tokenType, type, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "OAuthToken{accessToken=$accessToken, tokenType=$tokenType, type=$type, additionalProperties=$additionalProperties}" + "OAuthToken{accessToken=$accessToken, groupId=$groupId, tokenType=$tokenType, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt index e9c805322..ba15fe766 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/oauthtokens/OAuthTokenTest.kt @@ -14,11 +14,13 @@ internal class OAuthTokenTest { val oauthToken = OAuthToken.builder() .accessToken("12345") + .groupId("group_1g4mhziu6kvrs3vz35um") .tokenType(OAuthToken.TokenType.BEARER) .type(OAuthToken.Type.OAUTH_TOKEN) .build() assertThat(oauthToken.accessToken()).isEqualTo("12345") + assertThat(oauthToken.groupId()).isEqualTo("group_1g4mhziu6kvrs3vz35um") assertThat(oauthToken.tokenType()).isEqualTo(OAuthToken.TokenType.BEARER) assertThat(oauthToken.type()).isEqualTo(OAuthToken.Type.OAUTH_TOKEN) } @@ -29,6 +31,7 @@ internal class OAuthTokenTest { val oauthToken = OAuthToken.builder() .accessToken("12345") + .groupId("group_1g4mhziu6kvrs3vz35um") .tokenType(OAuthToken.TokenType.BEARER) .type(OAuthToken.Type.OAUTH_TOKEN) .build() From 2344228fddb443ad50a3c4c0b6b6d8a6054f9125 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 16:03:49 +0000 Subject: [PATCH 04/33] feat(api): api update --- .stats.yml | 4 +-- .../api/models/transactions/Transaction.kt | 35 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6612d81f1..8490456b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2f24b343a9f099286b8e3dbd0e38f2bd237a7b174a275ea81cd9173bea33c601.yml -openapi_spec_hash: fd71bd10930be2849fdb5614c1878866 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4d0b54206ef7c159e14154c892fe3146fa1ed1108a06cf53731ba27ac27b962a.yml +openapi_spec_hash: 7a575e29fc5e9fd1e74e9de7ddb8ba67 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 6e94255be..4384a9d8b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -46865,6 +46865,11 @@ private constructor( /** Account closure */ @JvmField val ACCOUNT_CLOSURE = of("account_closure") + /** Account revenue payment distribution */ + @JvmField + val ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION = + of("account_revenue_payment_distribution") + /** Bank-drawn check */ @JvmField val BANK_DRAWN_CHECK = of("bank_drawn_check") @@ -46883,6 +46888,9 @@ private constructor( /** Collection receivable */ @JvmField val COLLECTION_RECEIVABLE = of("collection_receivable") + /** Dishonored ACH return */ + @JvmField val DISHONORED_ACH_RETURN = of("dishonored_ach_return") + /** Empyreal adjustment */ @JvmField val EMPYREAL_ADJUSTMENT = of("empyreal_adjustment") @@ -46907,11 +46915,6 @@ private constructor( /** Sample funds return */ @JvmField val SAMPLE_FUNDS_RETURN = of("sample_funds_return") - /** Account revenue payment distribution */ - @JvmField - val ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION = - of("account_revenue_payment_distribution") - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } @@ -46919,6 +46922,8 @@ private constructor( enum class Known { /** Account closure */ ACCOUNT_CLOSURE, + /** Account revenue payment distribution */ + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** Bank-drawn check */ BANK_DRAWN_CHECK, /** Bank-drawn check credit */ @@ -46931,6 +46936,8 @@ private constructor( COLLECTION_PAYMENT, /** Collection receivable */ COLLECTION_RECEIVABLE, + /** Dishonored ACH return */ + DISHONORED_ACH_RETURN, /** Empyreal adjustment */ EMPYREAL_ADJUSTMENT, /** Error */ @@ -46947,8 +46954,6 @@ private constructor( SAMPLE_FUNDS, /** Sample funds return */ SAMPLE_FUNDS_RETURN, - /** Account revenue payment distribution */ - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, } /** @@ -46963,6 +46968,8 @@ private constructor( enum class Value { /** Account closure */ ACCOUNT_CLOSURE, + /** Account revenue payment distribution */ + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** Bank-drawn check */ BANK_DRAWN_CHECK, /** Bank-drawn check credit */ @@ -46975,6 +46982,8 @@ private constructor( COLLECTION_PAYMENT, /** Collection receivable */ COLLECTION_RECEIVABLE, + /** Dishonored ACH return */ + DISHONORED_ACH_RETURN, /** Empyreal adjustment */ EMPYREAL_ADJUSTMENT, /** Error */ @@ -46991,8 +47000,6 @@ private constructor( SAMPLE_FUNDS, /** Sample funds return */ SAMPLE_FUNDS_RETURN, - /** Account revenue payment distribution */ - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION, /** * An enum member indicating that [Reason] was instantiated with an unknown * value. @@ -47010,12 +47017,15 @@ private constructor( fun value(): Value = when (this) { ACCOUNT_CLOSURE -> Value.ACCOUNT_CLOSURE + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> + Value.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION BANK_DRAWN_CHECK -> Value.BANK_DRAWN_CHECK BANK_DRAWN_CHECK_CREDIT -> Value.BANK_DRAWN_CHECK_CREDIT BANK_MIGRATION -> Value.BANK_MIGRATION CHECK_ADJUSTMENT -> Value.CHECK_ADJUSTMENT COLLECTION_PAYMENT -> Value.COLLECTION_PAYMENT COLLECTION_RECEIVABLE -> Value.COLLECTION_RECEIVABLE + DISHONORED_ACH_RETURN -> Value.DISHONORED_ACH_RETURN EMPYREAL_ADJUSTMENT -> Value.EMPYREAL_ADJUSTMENT ERROR -> Value.ERROR ERROR_CORRECTION -> Value.ERROR_CORRECTION @@ -47024,8 +47034,6 @@ private constructor( NEGATIVE_BALANCE_FORGIVENESS -> Value.NEGATIVE_BALANCE_FORGIVENESS SAMPLE_FUNDS -> Value.SAMPLE_FUNDS SAMPLE_FUNDS_RETURN -> Value.SAMPLE_FUNDS_RETURN - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> - Value.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION else -> Value._UNKNOWN } @@ -47041,12 +47049,15 @@ private constructor( fun known(): Known = when (this) { ACCOUNT_CLOSURE -> Known.ACCOUNT_CLOSURE + ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> + Known.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION BANK_DRAWN_CHECK -> Known.BANK_DRAWN_CHECK BANK_DRAWN_CHECK_CREDIT -> Known.BANK_DRAWN_CHECK_CREDIT BANK_MIGRATION -> Known.BANK_MIGRATION CHECK_ADJUSTMENT -> Known.CHECK_ADJUSTMENT COLLECTION_PAYMENT -> Known.COLLECTION_PAYMENT COLLECTION_RECEIVABLE -> Known.COLLECTION_RECEIVABLE + DISHONORED_ACH_RETURN -> Known.DISHONORED_ACH_RETURN EMPYREAL_ADJUSTMENT -> Known.EMPYREAL_ADJUSTMENT ERROR -> Known.ERROR ERROR_CORRECTION -> Known.ERROR_CORRECTION @@ -47055,8 +47066,6 @@ private constructor( NEGATIVE_BALANCE_FORGIVENESS -> Known.NEGATIVE_BALANCE_FORGIVENESS SAMPLE_FUNDS -> Known.SAMPLE_FUNDS SAMPLE_FUNDS_RETURN -> Known.SAMPLE_FUNDS_RETURN - ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION -> - Known.ACCOUNT_REVENUE_PAYMENT_DISTRIBUTION else -> throw IncreaseInvalidDataException("Unknown Reason: $value") } From a053a213225c53d204b741b9c149ac0448aa60f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:28:12 +0000 Subject: [PATCH 05/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/achtransfers/AchTransfer.kt | 76 ++++++++++++++++++- .../AchTransferListPageResponseTest.kt | 3 + .../models/achtransfers/AchTransferTest.kt | 3 + 4 files changed, 82 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8490456b1..cf55854c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4d0b54206ef7c159e14154c892fe3146fa1ed1108a06cf53731ba27ac27b962a.yml -openapi_spec_hash: 7a575e29fc5e9fd1e74e9de7ddb8ba67 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d5e8c32ee2dc3b3f70e43e439b18ad51e73cb830c01f7bb53290a340be7937ea.yml +openapi_spec_hash: dcf97003cd0f0b49bfc2b1213ef83ed9 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt index da96e5dde..0d61283d3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt @@ -9434,6 +9434,7 @@ private constructor( class Submission @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val administrativeReturnsExpectedBy: JsonField, private val effectiveDate: JsonField, private val expectedFundsSettlementAt: JsonField, private val expectedSettlementSchedule: JsonField, @@ -9444,6 +9445,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("administrative_returns_expected_by") + @ExcludeMissing + administrativeReturnsExpectedBy: JsonField = JsonMissing.of(), @JsonProperty("effective_date") @ExcludeMissing effectiveDate: JsonField = JsonMissing.of(), @@ -9460,6 +9464,7 @@ private constructor( @ExcludeMissing traceNumber: JsonField = JsonMissing.of(), ) : this( + administrativeReturnsExpectedBy, effectiveDate, expectedFundsSettlementAt, expectedSettlementSchedule, @@ -9468,6 +9473,19 @@ private constructor( mutableMapOf(), ) + /** + * The timestamp by which any administrative returns are expected to be received by. This + * follows the NACHA guidelines for return windows, which are: "In general, return entries + * must be received by the RDFI’s ACH Operator by its deposit deadline for the return entry + * to be made available to the ODFI no later than the opening of business on the second + * banking day following the Settlement Date of the original entry.". + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun administrativeReturnsExpectedBy(): Optional = + administrativeReturnsExpectedBy.getOptional("administrative_returns_expected_by") + /** * The ACH transfer's effective date as sent to the Federal Reserve. If a specific date was * configured using `preferred_effective_date`, this will match that value. Otherwise, it @@ -9519,6 +9537,17 @@ private constructor( */ fun traceNumber(): String = traceNumber.getRequired("trace_number") + /** + * Returns the raw JSON value of [administrativeReturnsExpectedBy]. + * + * Unlike [administrativeReturnsExpectedBy], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("administrative_returns_expected_by") + @ExcludeMissing + fun _administrativeReturnsExpectedBy(): JsonField = + administrativeReturnsExpectedBy + /** * Returns the raw JSON value of [effectiveDate]. * @@ -9587,6 +9616,7 @@ private constructor( * * The following fields are required: * ```java + * .administrativeReturnsExpectedBy() * .effectiveDate() * .expectedFundsSettlementAt() * .expectedSettlementSchedule() @@ -9600,6 +9630,7 @@ private constructor( /** A builder for [Submission]. */ class Builder internal constructor() { + private var administrativeReturnsExpectedBy: JsonField? = null private var effectiveDate: JsonField? = null private var expectedFundsSettlementAt: JsonField? = null private var expectedSettlementSchedule: JsonField? = null @@ -9609,6 +9640,7 @@ private constructor( @JvmSynthetic internal fun from(submission: Submission) = apply { + administrativeReturnsExpectedBy = submission.administrativeReturnsExpectedBy effectiveDate = submission.effectiveDate expectedFundsSettlementAt = submission.expectedFundsSettlementAt expectedSettlementSchedule = submission.expectedSettlementSchedule @@ -9617,6 +9649,37 @@ private constructor( additionalProperties = submission.additionalProperties.toMutableMap() } + /** + * The timestamp by which any administrative returns are expected to be received by. + * This follows the NACHA guidelines for return windows, which are: "In general, return + * entries must be received by the RDFI’s ACH Operator by its deposit deadline for the + * return entry to be made available to the ODFI no later than the opening of business + * on the second banking day following the Settlement Date of the original entry.". + */ + fun administrativeReturnsExpectedBy(administrativeReturnsExpectedBy: OffsetDateTime?) = + administrativeReturnsExpectedBy( + JsonField.ofNullable(administrativeReturnsExpectedBy) + ) + + /** + * Alias for calling [Builder.administrativeReturnsExpectedBy] with + * `administrativeReturnsExpectedBy.orElse(null)`. + */ + fun administrativeReturnsExpectedBy( + administrativeReturnsExpectedBy: Optional + ) = administrativeReturnsExpectedBy(administrativeReturnsExpectedBy.getOrNull()) + + /** + * Sets [Builder.administrativeReturnsExpectedBy] to an arbitrary JSON value. + * + * You should usually call [Builder.administrativeReturnsExpectedBy] with a well-typed + * [OffsetDateTime] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun administrativeReturnsExpectedBy( + administrativeReturnsExpectedBy: JsonField + ) = apply { this.administrativeReturnsExpectedBy = administrativeReturnsExpectedBy } + /** * The ACH transfer's effective date as sent to the Federal Reserve. If a specific date * was configured using `preferred_effective_date`, this will match that value. @@ -9734,6 +9797,7 @@ private constructor( * * The following fields are required: * ```java + * .administrativeReturnsExpectedBy() * .effectiveDate() * .expectedFundsSettlementAt() * .expectedSettlementSchedule() @@ -9745,6 +9809,10 @@ private constructor( */ fun build(): Submission = Submission( + checkRequired( + "administrativeReturnsExpectedBy", + administrativeReturnsExpectedBy, + ), checkRequired("effectiveDate", effectiveDate), checkRequired("expectedFundsSettlementAt", expectedFundsSettlementAt), checkRequired("expectedSettlementSchedule", expectedSettlementSchedule), @@ -9761,6 +9829,7 @@ private constructor( return@apply } + administrativeReturnsExpectedBy() effectiveDate() expectedFundsSettlementAt() expectedSettlementSchedule().validate() @@ -9785,7 +9854,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (effectiveDate.asKnown().isPresent) 1 else 0) + + (if (administrativeReturnsExpectedBy.asKnown().isPresent) 1 else 0) + + (if (effectiveDate.asKnown().isPresent) 1 else 0) + (if (expectedFundsSettlementAt.asKnown().isPresent) 1 else 0) + (expectedSettlementSchedule.asKnown().getOrNull()?.validity() ?: 0) + (if (submittedAt.asKnown().isPresent) 1 else 0) + @@ -9944,6 +10014,7 @@ private constructor( } return other is Submission && + administrativeReturnsExpectedBy == other.administrativeReturnsExpectedBy && effectiveDate == other.effectiveDate && expectedFundsSettlementAt == other.expectedFundsSettlementAt && expectedSettlementSchedule == other.expectedSettlementSchedule && @@ -9954,6 +10025,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + administrativeReturnsExpectedBy, effectiveDate, expectedFundsSettlementAt, expectedSettlementSchedule, @@ -9966,7 +10038,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Submission{effectiveDate=$effectiveDate, expectedFundsSettlementAt=$expectedFundsSettlementAt, expectedSettlementSchedule=$expectedSettlementSchedule, submittedAt=$submittedAt, traceNumber=$traceNumber, additionalProperties=$additionalProperties}" + "Submission{administrativeReturnsExpectedBy=$administrativeReturnsExpectedBy, effectiveDate=$effectiveDate, expectedFundsSettlementAt=$expectedFundsSettlementAt, expectedSettlementSchedule=$expectedSettlementSchedule, submittedAt=$submittedAt, traceNumber=$traceNumber, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt index 038621031..730a78065 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt @@ -156,6 +156,7 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") @@ -312,6 +313,7 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -474,6 +476,7 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt index 4916a6b36..08fccdb2a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt @@ -145,6 +145,7 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -293,6 +294,7 @@ internal class AchTransferTest { assertThat(achTransfer.submission()) .contains( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -441,6 +443,7 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() + .administrativeReturnsExpectedBy(null) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( From a14bd3d085793249c465069b89c3260e1b5ccfec Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 15:46:13 +0000 Subject: [PATCH 06/33] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/achtransfers/AchTransfer.kt | 22 +++++-------------- .../AchTransferListPageResponseTest.kt | 12 +++++++--- .../models/achtransfers/AchTransferTest.kt | 10 ++++++--- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.stats.yml b/.stats.yml index cf55854c7..a4cac0a4b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d5e8c32ee2dc3b3f70e43e439b18ad51e73cb830c01f7bb53290a340be7937ea.yml -openapi_spec_hash: dcf97003cd0f0b49bfc2b1213ef83ed9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-071556e7dfc2b2d72c1f9fee711211e0272dab780651b1a49d3e302d3a9f59be.yml +openapi_spec_hash: 01d445dc17f564c99f440a768f170b0d config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt index 0d61283d3..e7e3be514 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/achtransfers/AchTransfer.kt @@ -9480,11 +9480,11 @@ private constructor( * to be made available to the ODFI no later than the opening of business on the second * banking day following the Settlement Date of the original entry.". * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * @throws IncreaseInvalidDataException 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 administrativeReturnsExpectedBy(): Optional = - administrativeReturnsExpectedBy.getOptional("administrative_returns_expected_by") + fun administrativeReturnsExpectedBy(): OffsetDateTime = + administrativeReturnsExpectedBy.getRequired("administrative_returns_expected_by") /** * The ACH transfer's effective date as sent to the Federal Reserve. If a specific date was @@ -9656,18 +9656,8 @@ private constructor( * return entry to be made available to the ODFI no later than the opening of business * on the second banking day following the Settlement Date of the original entry.". */ - fun administrativeReturnsExpectedBy(administrativeReturnsExpectedBy: OffsetDateTime?) = - administrativeReturnsExpectedBy( - JsonField.ofNullable(administrativeReturnsExpectedBy) - ) - - /** - * Alias for calling [Builder.administrativeReturnsExpectedBy] with - * `administrativeReturnsExpectedBy.orElse(null)`. - */ - fun administrativeReturnsExpectedBy( - administrativeReturnsExpectedBy: Optional - ) = administrativeReturnsExpectedBy(administrativeReturnsExpectedBy.getOrNull()) + fun administrativeReturnsExpectedBy(administrativeReturnsExpectedBy: OffsetDateTime) = + administrativeReturnsExpectedBy(JsonField.of(administrativeReturnsExpectedBy)) /** * Sets [Builder.administrativeReturnsExpectedBy] to an arbitrary JSON value. diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt index 730a78065..e755df7b5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferListPageResponseTest.kt @@ -156,7 +156,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") @@ -313,7 +315,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -476,7 +480,9 @@ internal class AchTransferListPageResponseTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt( OffsetDateTime.parse("2020-02-03T13:30:00Z") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt index 08fccdb2a..ab1d04600 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/achtransfers/AchTransferTest.kt @@ -145,7 +145,9 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -294,7 +296,7 @@ internal class AchTransferTest { assertThat(achTransfer.submission()) .contains( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy(OffsetDateTime.parse("2020-02-05T11:00:00Z")) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( @@ -443,7 +445,9 @@ internal class AchTransferTest { .status(AchTransfer.Status.RETURNED) .submission( AchTransfer.Submission.builder() - .administrativeReturnsExpectedBy(null) + .administrativeReturnsExpectedBy( + OffsetDateTime.parse("2020-02-05T11:00:00Z") + ) .effectiveDate(LocalDate.parse("2020-01-31")) .expectedFundsSettlementAt(OffsetDateTime.parse("2020-02-03T13:30:00Z")) .expectedSettlementSchedule( From dbb50b0f1b0225cda41b3cb3a2c3e0394be13f09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 19:07:49 +0000 Subject: [PATCH 07/33] feat(api): api update --- .stats.yml | 4 ++-- .../models/simulations/programs/ProgramCreateParams.kt | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a4cac0a4b..cc5e6cfd0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-071556e7dfc2b2d72c1f9fee711211e0272dab780651b1a49d3e302d3a9f59be.yml -openapi_spec_hash: 01d445dc17f564c99f440a768f170b0d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-20e8d84deba6f3f35ffb7e8ad746f470aa7acbfa55d98bc7dcb931a768193243.yml +openapi_spec_hash: 7a807bc7bc882d53dc1df541c1ee0495 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt index 2103c1de6..9d7cbc51f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/programs/ProgramCreateParams.kt @@ -580,6 +580,9 @@ private constructor( /** Grasshopper Bank */ @JvmField val GRASSHOPPER_BANK = of("grasshopper_bank") + /** Twin City Bank */ + @JvmField val TWIN_CITY_BANK = of("twin_city_bank") + @JvmStatic fun of(value: String) = Bank(JsonField.of(value)) } @@ -595,6 +598,8 @@ private constructor( GLOBAL_INNOVATIONS_BANK, /** Grasshopper Bank */ GRASSHOPPER_BANK, + /** Twin City Bank */ + TWIN_CITY_BANK, } /** @@ -617,6 +622,8 @@ private constructor( GLOBAL_INNOVATIONS_BANK, /** Grasshopper Bank */ GRASSHOPPER_BANK, + /** Twin City Bank */ + TWIN_CITY_BANK, /** An enum member indicating that [Bank] was instantiated with an unknown value. */ _UNKNOWN, } @@ -635,6 +642,7 @@ private constructor( FIRST_INTERNET_BANK -> Value.FIRST_INTERNET_BANK GLOBAL_INNOVATIONS_BANK -> Value.GLOBAL_INNOVATIONS_BANK GRASSHOPPER_BANK -> Value.GRASSHOPPER_BANK + TWIN_CITY_BANK -> Value.TWIN_CITY_BANK else -> Value._UNKNOWN } @@ -654,6 +662,7 @@ private constructor( FIRST_INTERNET_BANK -> Known.FIRST_INTERNET_BANK GLOBAL_INNOVATIONS_BANK -> Known.GLOBAL_INNOVATIONS_BANK GRASSHOPPER_BANK -> Known.GRASSHOPPER_BANK + TWIN_CITY_BANK -> Known.TWIN_CITY_BANK else -> throw IncreaseInvalidDataException("Unknown Bank: $value") } From 4e3ec15caa8c049362a17bd5d29c0f1857d6c711 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 21:31:09 +0000 Subject: [PATCH 08/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/carddisputes/CardDispute.kt | 11 +- .../api/models/cardpayments/CardPayment.kt | 148 ++++++++++++++++-- .../DeclinedTransaction.kt | 31 +++- .../pendingtransactions/PendingTransaction.kt | 31 +++- .../realtimedecisions/RealTimeDecision.kt | 33 +++- .../api/models/transactions/Transaction.kt | 53 ++++++- .../CardPaymentListPageResponseTest.kt | 36 +++++ .../models/cardpayments/CardPaymentTest.kt | 36 +++++ ...DeclinedTransactionListPageResponseTest.kt | 3 + .../DeclinedTransactionTest.kt | 3 + .../PendingTransactionListPageResponseTest.kt | 3 + .../PendingTransactionTest.kt | 3 + .../realtimedecisions/RealTimeDecisionTest.kt | 3 + .../CardAuthorizationCreateResponseTest.kt | 6 + .../TransactionListPageResponseTest.kt | 3 + .../models/transactions/TransactionTest.kt | 3 + 17 files changed, 372 insertions(+), 38 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc5e6cfd0..cce29e424 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-20e8d84deba6f3f35ffb7e8ad746f470aa7acbfa55d98bc7dcb931a768193243.yml -openapi_spec_hash: 7a807bc7bc882d53dc1df541c1ee0495 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-35cc701c6ebaf8655f27698ffe4994ae7fa9dd843a66ea241f5d16e6c821dd66.yml +openapi_spec_hash: 456373dd9bda8b3aee816045915f22a0 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index 46bde6b2e..82eaf4cfd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -1040,13 +1040,18 @@ private constructor( /** Visa: details will be under the `visa` object. */ @JvmField val VISA = of("visa") + /** Pulse: details will be under the `pulse` object. */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa: details will be under the `visa` object. */ - VISA + VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, } /** @@ -1061,6 +1066,8 @@ private constructor( enum class Value { /** Visa: details will be under the `visa` object. */ VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, /** An enum member indicating that [Network] was instantiated with an unknown value. */ _UNKNOWN, } @@ -1075,6 +1082,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -1090,6 +1098,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 691012030..ea732048a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -8633,6 +8633,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -8642,8 +8643,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -8654,6 +8656,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -8700,6 +8705,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -8710,12 +8716,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -8732,6 +8740,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -8777,6 +8788,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -8785,6 +8797,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -8842,13 +8855,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -8864,6 +8882,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -8881,6 +8901,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -8896,6 +8917,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -10115,18 +10137,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ @@ -12667,13 +12690,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -12688,6 +12716,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -12705,6 +12735,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -12720,6 +12751,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -17627,6 +17659,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -17636,8 +17669,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -17648,6 +17682,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -17694,6 +17731,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -17704,12 +17742,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -17726,6 +17766,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -17771,6 +17814,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -17779,6 +17823,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -17836,13 +17881,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -17858,6 +17908,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -17875,6 +17927,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -17890,6 +17943,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -19109,18 +19163,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ @@ -22217,13 +22272,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -22238,6 +22298,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -22255,6 +22317,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -22270,6 +22333,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -26631,13 +26695,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -26652,6 +26721,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -26669,6 +26740,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -26684,6 +26756,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -38101,13 +38174,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -38122,6 +38200,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -38139,6 +38219,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -38154,6 +38235,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -41133,13 +41215,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -41154,6 +41241,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -41171,6 +41260,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -41186,6 +41276,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -53089,6 +53180,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -53098,8 +53190,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -53110,6 +53203,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -53156,6 +53252,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -53166,12 +53263,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -53188,6 +53287,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -53233,6 +53335,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -53241,6 +53344,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -53298,13 +53402,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -53320,6 +53429,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -53337,6 +53448,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -53352,6 +53464,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -54571,18 +54684,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index 6ff0f1512..abcaa434d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -7311,6 +7311,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7320,8 +7321,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -7332,6 +7334,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -7378,6 +7383,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -7388,12 +7394,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -7410,6 +7418,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7455,6 +7466,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -7463,6 +7475,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -7520,13 +7533,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -7542,6 +7560,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -7559,6 +7579,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7574,6 +7595,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -8793,18 +8815,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 97ce41b6a..4d5d2fb6e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -7365,6 +7365,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7374,8 +7375,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -7386,6 +7388,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -7432,6 +7437,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -7442,12 +7448,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -7464,6 +7472,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7509,6 +7520,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -7517,6 +7529,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -7574,13 +7587,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -7596,6 +7614,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -7613,6 +7633,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7628,6 +7649,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -8847,18 +8869,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index f7afda169..810a3c731 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -6002,6 +6002,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -6011,8 +6012,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -6023,6 +6025,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -6068,6 +6073,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -6078,12 +6084,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -6100,6 +6108,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -6145,6 +6156,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -6153,6 +6165,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -6208,13 +6221,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -6229,6 +6247,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an unknown * value. @@ -6246,6 +6266,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -6261,6 +6282,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -7455,16 +7477,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(category, visa, additionalProperties) } + private val hashCode: Int by lazy { + Objects.hash(category, pulse, visa, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 4384a9d8b..dd9082041 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -6953,13 +6953,18 @@ private constructor( /** Visa: details will be under the `visa` object. */ @JvmField val VISA = of("visa") + /** Pulse: details will be under the `pulse` object. */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa: details will be under the `visa` object. */ - VISA + VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, } /** @@ -6974,6 +6979,8 @@ private constructor( enum class Value { /** Visa: details will be under the `visa` object. */ VISA, + /** Pulse: details will be under the `pulse` object. */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -6991,6 +6998,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -7006,6 +7014,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } @@ -12306,6 +12315,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val pulse: JsonValue, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -12315,8 +12325,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), - ) : this(category, visa, mutableMapOf()) + ) : this(category, pulse, visa, mutableMapOf()) /** * The payment network used to process this card authorization. @@ -12327,6 +12338,9 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** * Fields specific to the `visa` network. * @@ -12373,6 +12387,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` */ @@ -12383,12 +12398,14 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var pulse: JsonValue? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(networkDetails: NetworkDetails) = apply { category = networkDetails.category + pulse = networkDetails.pulse visa = networkDetails.visa additionalProperties = networkDetails.additionalProperties.toMutableMap() } @@ -12405,6 +12422,9 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -12450,6 +12470,7 @@ private constructor( * The following fields are required: * ```java * .category() + * .pulse() * .visa() * ``` * @@ -12458,6 +12479,7 @@ private constructor( fun build(): NetworkDetails = NetworkDetails( checkRequired("category", category), + checkRequired("pulse", pulse), checkRequired("visa", visa), additionalProperties.toMutableMap(), ) @@ -12515,13 +12537,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } /** An enum containing [Category]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -12537,6 +12564,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Category] was instantiated with an * unknown value. @@ -12554,6 +12583,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -12569,6 +12599,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -13788,18 +13819,19 @@ private constructor( return other is NetworkDetails && category == other.category && + pulse == other.pulse && visa == other.visa && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, visa, additionalProperties) + Objects.hash(category, pulse, visa, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}" + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" } /** Network-specific identifiers for a specific request or transaction. */ @@ -28324,13 +28356,18 @@ private constructor( /** Visa */ @JvmField val VISA = of("visa") + /** Pulse */ + @JvmField val PULSE = of("pulse") + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } /** An enum containing [Network]'s known values. */ enum class Known { /** Visa */ - VISA + VISA, + /** Pulse */ + PULSE, } /** @@ -28345,6 +28382,8 @@ private constructor( enum class Value { /** Visa */ VISA, + /** Pulse */ + PULSE, /** * An enum member indicating that [Network] was instantiated with an unknown * value. @@ -28362,6 +28401,7 @@ private constructor( fun value(): Value = when (this) { VISA -> Value.VISA + PULSE -> Value.PULSE else -> Value._UNKNOWN } @@ -28377,6 +28417,7 @@ private constructor( fun known(): Known = when (this) { VISA -> Known.VISA + PULSE -> Known.PULSE else -> throw IncreaseInvalidDataException("Unknown Network: $value") } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 87e857cc4..3de6ae255 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -215,6 +215,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -451,6 +452,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -1399,6 +1401,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -1673,6 +1676,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -1909,6 +1913,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -2857,6 +2862,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -3131,6 +3137,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -3367,6 +3374,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -4315,6 +4323,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -4589,6 +4598,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -4825,6 +4835,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -5773,6 +5784,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -6071,6 +6083,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -6293,6 +6306,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -7189,6 +7203,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -7455,6 +7470,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -7677,6 +7693,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -8573,6 +8590,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -8839,6 +8857,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -9061,6 +9080,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -9957,6 +9977,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -10223,6 +10244,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -10445,6 +10467,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -11341,6 +11364,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -11645,6 +11669,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -11881,6 +11906,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -12829,6 +12855,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -13103,6 +13130,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -13339,6 +13367,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -14287,6 +14316,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -14561,6 +14591,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -14797,6 +14828,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -15745,6 +15777,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -16019,6 +16052,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -16255,6 +16289,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -17203,6 +17238,7 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation .NetworkDetails diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index e2bf426bb..7d92d9c44 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -198,6 +198,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -400,6 +401,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -1233,6 +1235,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -1487,6 +1490,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -1689,6 +1693,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -2522,6 +2527,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -2776,6 +2782,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -2978,6 +2985,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -3811,6 +3819,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -4065,6 +4074,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -4267,6 +4277,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -5100,6 +5111,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -5354,6 +5366,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -5532,6 +5545,7 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -6287,6 +6301,7 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -6509,6 +6524,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -6687,6 +6703,7 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -7442,6 +7459,7 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -7664,6 +7682,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -7842,6 +7861,7 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -8597,6 +8617,7 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -8819,6 +8840,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -8997,6 +9019,7 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -9752,6 +9775,7 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -10025,6 +10049,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -10227,6 +10252,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -11060,6 +11086,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -11314,6 +11341,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -11516,6 +11544,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -12349,6 +12378,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -12603,6 +12633,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -12805,6 +12836,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -13638,6 +13670,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -13892,6 +13925,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -14094,6 +14128,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -14927,6 +14962,7 @@ internal class CardPaymentTest { .Category .VISA ) + .pulse(null) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index 30e256d1d..0d1568596 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -172,6 +172,7 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -510,6 +511,7 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -850,6 +852,7 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index b146dba6a..50a747b63 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -147,6 +147,7 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa @@ -439,6 +440,7 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails.Visa .builder() @@ -726,6 +728,7 @@ internal class DeclinedTransactionTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 9458071fe..732acb7ee 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -168,6 +168,7 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -518,6 +519,7 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -859,6 +861,7 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 57c2fed97..0025afa64 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -159,6 +159,7 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -468,6 +469,7 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization.NetworkDetails .Visa @@ -778,6 +780,7 @@ internal class PendingTransactionTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 6d59aa739..cdb0bf28c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -127,6 +127,7 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse(null) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -360,6 +361,7 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse(null) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -599,6 +601,7 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) + .pulse(null) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index 895289406..c2df7b849 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -174,6 +174,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -509,6 +510,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -860,6 +862,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1188,6 +1191,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -1536,6 +1540,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1871,6 +1876,7 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) + .pulse(null) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index 7a13e0014..628708d80 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -223,6 +223,7 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa @@ -1308,6 +1309,7 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -2367,6 +2369,7 @@ internal class TransactionListPageResponseTest { .Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 12f7f8f7e..1dbc06828 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -196,6 +196,7 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -1174,6 +1175,7 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -2119,6 +2121,7 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) + .pulse(null) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() From 2049ebb7ae2a221317c692c6b5e66860937e88f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 14 Oct 2025 22:24:30 +0000 Subject: [PATCH 09/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 716 +++++++++++++++++- .../DeclinedTransaction.kt | 90 ++- .../pendingtransactions/PendingTransaction.kt | 90 ++- .../realtimedecisions/RealTimeDecision.kt | 88 ++- .../api/models/transactions/Transaction.kt | 266 ++++++- .../CardPaymentListPageResponseTest.kt | 96 +++ .../models/cardpayments/CardPaymentTest.kt | 96 +++ ...DeclinedTransactionListPageResponseTest.kt | 3 + .../DeclinedTransactionTest.kt | 3 + .../PendingTransactionListPageResponseTest.kt | 3 + .../PendingTransactionTest.kt | 3 + .../realtimedecisions/RealTimeDecisionTest.kt | 3 + .../CardAuthorizationCreateResponseTest.kt | 6 + .../TransactionListPageResponseTest.kt | 9 + .../models/transactions/TransactionTest.kt | 9 + 16 files changed, 1445 insertions(+), 40 deletions(-) diff --git a/.stats.yml b/.stats.yml index cce29e424..7201a22ab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-35cc701c6ebaf8655f27698ffe4994ae7fa9dd843a66ea241f5d16e6c821dd66.yml -openapi_spec_hash: 456373dd9bda8b3aee816045915f22a0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-33f2c95401f5925e452440863f26a701b345a2da75b2b3f9b3eb33936adef476.yml +openapi_spec_hash: 3a0f2ac488d1d8e875bd118940c81152 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index ea732048a..25140084c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -10156,6 +10156,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -10164,6 +10165,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -10173,7 +10177,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -10204,6 +10226,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -10254,6 +10287,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -10265,6 +10299,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -10272,6 +10307,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -10279,6 +10316,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -10381,6 +10455,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -10390,6 +10465,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -10404,6 +10483,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -10426,7 +10506,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -10436,6 +10517,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -10444,6 +10527,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -10454,7 +10538,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -19182,6 +19266,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -19190,6 +19275,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -19199,7 +19287,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -19230,6 +19336,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -19280,6 +19397,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -19291,6 +19409,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -19298,6 +19417,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -19305,6 +19426,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -19407,6 +19565,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -19416,6 +19575,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -19430,6 +19593,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -19452,7 +19616,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -19462,6 +19627,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -19470,6 +19637,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -19480,7 +19648,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -22395,6 +22563,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -22403,6 +22572,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -22412,7 +22584,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -22443,6 +22633,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -22493,6 +22694,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -22504,6 +22706,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -22511,6 +22714,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -22518,6 +22723,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -22620,6 +22862,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -22629,6 +22872,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -22643,6 +22890,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -22665,7 +22913,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -22675,6 +22924,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -22683,6 +22934,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -22693,7 +22945,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -26818,6 +27070,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -26826,6 +27079,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -26835,7 +27091,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -26866,6 +27140,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -26916,6 +27201,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -26927,6 +27213,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -26934,6 +27221,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -26941,6 +27230,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -27043,6 +27369,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -27052,6 +27379,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -27066,6 +27397,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -27088,7 +27420,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -27098,6 +27431,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -27106,6 +27441,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -27116,7 +27452,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -29348,6 +29684,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -29360,10 +29697,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -29386,6 +29732,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -29415,6 +29773,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [transactionId]. * @@ -29447,6 +29816,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -29458,6 +29828,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -29465,6 +29836,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -29504,6 +29877,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -29559,6 +29969,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -29568,6 +29979,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -29582,6 +29997,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -29604,6 +30020,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -29614,6 +30031,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -29622,6 +30041,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -29630,7 +30050,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -38297,6 +38717,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -38305,6 +38726,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -38314,7 +38738,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -38345,6 +38787,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -38395,6 +38848,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -38406,6 +38860,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -38413,6 +38868,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -38420,6 +38877,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -38522,6 +39016,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -38531,6 +39026,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -38545,6 +39044,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -38567,7 +39067,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -38577,6 +39078,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -38585,6 +39088,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -38595,7 +39099,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** Why this reversal was initiated. */ @@ -41340,6 +41844,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -41352,10 +41857,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -41378,6 +41892,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -41407,6 +41933,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [transactionId]. * @@ -41439,6 +41976,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -41450,6 +41988,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -41457,6 +41996,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -41496,6 +42037,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -41551,6 +42129,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -41560,6 +42139,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -41574,6 +42157,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -41596,6 +42180,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -41606,6 +42191,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -41614,6 +42201,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -41622,7 +42210,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -54703,6 +55291,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -54711,6 +55300,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -54720,7 +55312,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -54751,6 +55361,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -54801,6 +55422,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -54812,6 +55434,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -54819,6 +55442,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -54826,6 +55451,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -54928,6 +55590,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -54937,6 +55600,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -54951,6 +55618,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -54973,7 +55641,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -54983,6 +55652,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -54991,6 +55662,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -55001,7 +55673,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index abcaa434d..b3a94e0d4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -8834,6 +8834,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -8842,6 +8843,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -8851,7 +8855,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -8882,6 +8904,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -8932,6 +8965,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -8943,6 +8977,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -8950,6 +8985,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -8957,6 +8994,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -9059,6 +9133,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -9068,6 +9143,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -9082,6 +9161,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -9104,7 +9184,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -9114,6 +9195,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -9122,6 +9205,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -9132,7 +9216,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 4d5d2fb6e..1cede24de 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -8888,6 +8888,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -8896,6 +8897,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -8905,7 +8909,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -8936,6 +8958,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -8986,6 +9019,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -8997,6 +9031,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -9004,6 +9039,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -9011,6 +9048,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -9113,6 +9187,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -9122,6 +9197,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -9136,6 +9215,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -9158,7 +9238,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -9168,6 +9249,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -9176,6 +9259,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -9186,7 +9270,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index 810a3c731..d0bff6cec 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -7496,6 +7496,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -7504,6 +7505,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -7513,7 +7517,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code sent + * back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. Expected @@ -7544,6 +7566,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -7593,6 +7626,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -7604,6 +7638,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -7611,12 +7646,49 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -7716,6 +7788,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -7725,6 +7798,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -7739,6 +7816,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -7761,7 +7839,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -7771,6 +7850,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -7779,6 +7860,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -7789,7 +7871,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index dd9082041..4e0fb0740 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -13838,6 +13838,7 @@ private constructor( class NetworkIdentifiers @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val authorizationIdentificationResponse: JsonField, private val retrievalReferenceNumber: JsonField, private val traceNumber: JsonField, private val transactionId: JsonField, @@ -13846,6 +13847,9 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("retrieval_reference_number") @ExcludeMissing retrievalReferenceNumber: JsonField = JsonMissing.of(), @@ -13855,7 +13859,25 @@ private constructor( @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf()) + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) /** * A life-cycle identifier used across e.g., an authorization and a reversal. @@ -13886,6 +13908,17 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [retrievalReferenceNumber]. * @@ -13936,6 +13969,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -13947,6 +13981,7 @@ private constructor( /** A builder for [NetworkIdentifiers]. */ class Builder internal constructor() { + private var authorizationIdentificationResponse: JsonField? = null private var retrievalReferenceNumber: JsonField? = null private var traceNumber: JsonField? = null private var transactionId: JsonField? = null @@ -13954,6 +13989,8 @@ private constructor( @JvmSynthetic internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber traceNumber = networkIdentifiers.traceNumber transactionId = networkIdentifiers.transactionId @@ -13961,6 +13998,43 @@ private constructor( networkIdentifiers.additionalProperties.toMutableMap() } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A life-cycle identifier used across e.g., an authorization and a reversal. * Expected to be unique per acquirer within a window of time. For some card @@ -14063,6 +14137,7 @@ private constructor( * * The following fields are required: * ```java + * .authorizationIdentificationResponse() * .retrievalReferenceNumber() * .traceNumber() * .transactionId() @@ -14072,6 +14147,10 @@ private constructor( */ fun build(): NetworkIdentifiers = NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), checkRequired("traceNumber", traceNumber), checkRequired("transactionId", transactionId), @@ -14086,6 +14165,7 @@ private constructor( return@apply } + authorizationIdentificationResponse() retrievalReferenceNumber() traceNumber() transactionId() @@ -14108,7 +14188,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + (if (traceNumber.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) @@ -14118,6 +14199,8 @@ private constructor( } return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && retrievalReferenceNumber == other.retrievalReferenceNumber && traceNumber == other.traceNumber && transactionId == other.transactionId && @@ -14126,6 +14209,7 @@ private constructor( private val hashCode: Int by lazy { Objects.hash( + authorizationIdentificationResponse, retrievalReferenceNumber, traceNumber, transactionId, @@ -14136,7 +14220,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -18061,6 +18145,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -18073,10 +18158,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -18099,6 +18193,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -18128,6 +18234,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [transactionId]. * @@ -18160,6 +18277,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -18171,6 +18289,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -18178,6 +18297,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -18217,6 +18338,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -18272,6 +18430,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -18281,6 +18440,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -18295,6 +18458,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -18317,6 +18481,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -18327,6 +18492,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -18335,6 +18502,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -18343,7 +18511,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** @@ -28481,6 +28649,7 @@ private constructor( private constructor( private val acquirerBusinessId: JsonField, private val acquirerReferenceNumber: JsonField, + private val authorizationIdentificationResponse: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, ) { @@ -28493,10 +28662,19 @@ private constructor( @JsonProperty("acquirer_reference_number") @ExcludeMissing acquirerReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(acquirerBusinessId, acquirerReferenceNumber, transactionId, mutableMapOf()) + ) : this( + acquirerBusinessId, + acquirerReferenceNumber, + authorizationIdentificationResponse, + transactionId, + mutableMapOf(), + ) /** * A network assigned business ID that identifies the acquirer that processed this @@ -28519,6 +28697,18 @@ private constructor( fun acquirerReferenceNumber(): String = acquirerReferenceNumber.getRequired("acquirer_reference_number") + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -28548,6 +28738,17 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + /** * Returns the raw JSON value of [transactionId]. * @@ -28580,6 +28781,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` */ @@ -28591,6 +28793,7 @@ private constructor( private var acquirerBusinessId: JsonField? = null private var acquirerReferenceNumber: JsonField? = null + private var authorizationIdentificationResponse: JsonField? = null private var transactionId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -28598,6 +28801,8 @@ private constructor( internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { acquirerBusinessId = networkIdentifiers.acquirerBusinessId acquirerReferenceNumber = networkIdentifiers.acquirerReferenceNumber + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse transactionId = networkIdentifiers.transactionId additionalProperties = networkIdentifiers.additionalProperties.toMutableMap() @@ -28637,6 +28842,43 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + /** * A globally unique transaction identifier provided by the card network, used * across multiple life-cycle requests. @@ -28692,6 +28934,7 @@ private constructor( * ```java * .acquirerBusinessId() * .acquirerReferenceNumber() + * .authorizationIdentificationResponse() * .transactionId() * ``` * @@ -28701,6 +28944,10 @@ private constructor( NetworkIdentifiers( checkRequired("acquirerBusinessId", acquirerBusinessId), checkRequired("acquirerReferenceNumber", acquirerReferenceNumber), + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), checkRequired("transactionId", transactionId), additionalProperties.toMutableMap(), ) @@ -28715,6 +28962,7 @@ private constructor( acquirerBusinessId() acquirerReferenceNumber() + authorizationIdentificationResponse() transactionId() validated = true } @@ -28737,6 +28985,7 @@ private constructor( internal fun validity(): Int = (if (acquirerBusinessId.asKnown().isPresent) 1 else 0) + (if (acquirerReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -28747,6 +28996,8 @@ private constructor( return other is NetworkIdentifiers && acquirerBusinessId == other.acquirerBusinessId && acquirerReferenceNumber == other.acquirerReferenceNumber && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && transactionId == other.transactionId && additionalProperties == other.additionalProperties } @@ -28755,6 +29006,7 @@ private constructor( Objects.hash( acquirerBusinessId, acquirerReferenceNumber, + authorizationIdentificationResponse, transactionId, additionalProperties, ) @@ -28763,7 +29015,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "NetworkIdentifiers{acquirerBusinessId=$acquirerBusinessId, acquirerReferenceNumber=$acquirerReferenceNumber, authorizationIdentificationResponse=$authorizationIdentificationResponse, transactionId=$transactionId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 3de6ae255..aec1b0f4f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -246,6 +246,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -480,6 +481,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -555,6 +557,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -673,6 +676,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -733,6 +737,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -977,6 +982,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1051,6 +1057,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1430,6 +1437,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1707,6 +1715,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1941,6 +1950,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2016,6 +2026,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2134,6 +2145,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2194,6 +2206,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2438,6 +2451,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2512,6 +2526,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2891,6 +2906,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3168,6 +3184,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3402,6 +3419,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3477,6 +3495,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3595,6 +3614,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3655,6 +3675,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3899,6 +3920,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3973,6 +3995,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -4352,6 +4375,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4629,6 +4653,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4863,6 +4888,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4938,6 +4964,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5056,6 +5083,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5116,6 +5144,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5360,6 +5389,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5434,6 +5464,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5813,6 +5844,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6111,6 +6143,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6333,6 +6366,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6405,6 +6439,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6521,6 +6556,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6575,6 +6611,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -6803,6 +6840,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6865,6 +6903,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7231,6 +7270,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7498,6 +7538,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7720,6 +7761,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7792,6 +7834,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7908,6 +7951,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7962,6 +8006,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8190,6 +8235,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8252,6 +8298,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8618,6 +8665,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8885,6 +8933,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9107,6 +9156,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9179,6 +9229,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9295,6 +9346,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9349,6 +9401,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9577,6 +9630,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9639,6 +9693,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10005,6 +10060,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10272,6 +10328,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10494,6 +10551,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10566,6 +10624,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10682,6 +10741,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10736,6 +10796,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10964,6 +11025,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11026,6 +11088,7 @@ internal class CardPaymentListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -11392,6 +11455,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11700,6 +11764,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11934,6 +11999,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12009,6 +12075,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12127,6 +12194,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12187,6 +12255,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12431,6 +12500,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12505,6 +12575,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12884,6 +12955,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13161,6 +13233,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13395,6 +13468,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13470,6 +13544,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13588,6 +13663,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13648,6 +13724,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13892,6 +13969,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13966,6 +14044,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14345,6 +14424,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14622,6 +14702,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14856,6 +14937,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14931,6 +15013,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15049,6 +15132,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15109,6 +15193,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -15353,6 +15438,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -15427,6 +15513,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -15806,6 +15893,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16083,6 +16171,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16317,6 +16406,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16392,6 +16482,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardFuelConfirmation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16510,6 +16601,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16570,6 +16662,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -16814,6 +16907,7 @@ internal class CardPaymentListPageResponseTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -16888,6 +16982,7 @@ internal class CardPaymentListPageResponseTest { .acquirerReferenceNumber( "83163715445437604865089" ) + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -17267,6 +17362,7 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardValidation .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index 7d92d9c44..c717d0e9a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -225,6 +225,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -426,6 +427,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -487,6 +489,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -590,6 +593,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -641,6 +645,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -863,6 +868,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -924,6 +930,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1262,6 +1269,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1517,6 +1525,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1718,6 +1727,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1779,6 +1789,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1882,6 +1893,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1933,6 +1945,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2155,6 +2168,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2216,6 +2230,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2554,6 +2569,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2809,6 +2825,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3010,6 +3027,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3071,6 +3089,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3174,6 +3193,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3225,6 +3245,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3447,6 +3468,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -3508,6 +3530,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -3846,6 +3869,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4101,6 +4125,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4302,6 +4327,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4363,6 +4389,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4466,6 +4493,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4517,6 +4545,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -4739,6 +4768,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -4800,6 +4830,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5138,6 +5169,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5389,6 +5421,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5566,6 +5599,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5625,6 +5659,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5718,6 +5753,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -5764,6 +5800,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -5964,6 +6001,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6018,6 +6056,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -6324,6 +6363,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6547,6 +6587,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6724,6 +6765,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6783,6 +6825,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6876,6 +6919,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -6922,6 +6966,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7122,6 +7167,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7176,6 +7222,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -7482,6 +7529,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7705,6 +7753,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7882,6 +7931,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -7941,6 +7991,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8034,6 +8085,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8080,6 +8132,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8280,6 +8333,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8334,6 +8388,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -8640,6 +8695,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -8863,6 +8919,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9040,6 +9097,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9099,6 +9157,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9192,6 +9251,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardIncrement.Network.VISA) .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9238,6 +9298,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9438,6 +9499,7 @@ internal class CardPaymentTest { .network(CardPayment.Element.CardReversal.Network.VISA) .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -9492,6 +9554,7 @@ internal class CardPaymentTest { CardPayment.Element.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -9798,6 +9861,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10076,6 +10140,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10277,6 +10342,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10338,6 +10404,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10441,6 +10508,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10492,6 +10560,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -10714,6 +10783,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -10775,6 +10845,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -11113,6 +11184,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11368,6 +11440,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11569,6 +11642,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11630,6 +11704,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11733,6 +11808,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -11784,6 +11860,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12006,6 +12083,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12067,6 +12145,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -12405,6 +12484,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12660,6 +12740,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12861,6 +12942,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -12922,6 +13004,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13025,6 +13108,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13076,6 +13160,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13298,6 +13383,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13359,6 +13445,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -13697,6 +13784,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -13952,6 +14040,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14153,6 +14242,7 @@ internal class CardPaymentTest { ) .networkIdentifiers( CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14214,6 +14304,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14317,6 +14408,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardIncrement.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14368,6 +14460,7 @@ internal class CardPaymentTest { CardPayment.Element.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14590,6 +14683,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardReversal.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -14651,6 +14745,7 @@ internal class CardPaymentTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -14989,6 +15084,7 @@ internal class CardPaymentTest { .networkIdentifiers( CardPayment.Element.CardValidation.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index 0d1568596..5eb7ecb15 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -201,6 +201,7 @@ internal class DeclinedTransactionListPageResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -539,6 +540,7 @@ internal class DeclinedTransactionListPageResponseTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -881,6 +883,7 @@ internal class DeclinedTransactionListPageResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index 50a747b63..4c9354eea 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -174,6 +174,7 @@ internal class DeclinedTransactionTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -465,6 +466,7 @@ internal class DeclinedTransactionTest { ) .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -755,6 +757,7 @@ internal class DeclinedTransactionTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 732acb7ee..03846423a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -199,6 +199,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -548,6 +549,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -892,6 +894,7 @@ internal class PendingTransactionListPageResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 0025afa64..1f984b55e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -187,6 +187,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -496,6 +497,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -808,6 +810,7 @@ internal class PendingTransactionTest { .networkIdentifiers( PendingTransaction.Source.CardAuthorization.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index cdb0bf28c..3ff8fbba6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -147,6 +147,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -381,6 +382,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -621,6 +623,7 @@ internal class RealTimeDecisionTest { ) .networkIdentifiers( RealTimeDecision.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index c2df7b849..45386a532 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -203,6 +203,7 @@ internal class CardAuthorizationCreateResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -541,6 +542,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -890,6 +892,7 @@ internal class CardAuthorizationCreateResponseTest { .networkIdentifiers( DeclinedTransaction.Source.CardDecline.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1220,6 +1223,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1569,6 +1573,7 @@ internal class CardAuthorizationCreateResponseTest { DeclinedTransaction.Source.CardDecline .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1907,6 +1912,7 @@ internal class CardAuthorizationCreateResponseTest { PendingTransaction.Source.CardAuthorization .NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index 628708d80..c1f909726 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -250,6 +250,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -349,6 +350,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -615,6 +617,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1335,6 +1338,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1428,6 +1432,7 @@ internal class TransactionListPageResponseTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1682,6 +1687,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2396,6 +2402,7 @@ internal class TransactionListPageResponseTest { .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers .builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2495,6 +2502,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2761,6 +2769,7 @@ internal class TransactionListPageResponseTest { .builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 1dbc06828..4500bf1d7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -219,6 +219,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -309,6 +310,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -548,6 +550,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1196,6 +1199,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -1284,6 +1288,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -1509,6 +1514,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2144,6 +2150,7 @@ internal class TransactionTest { ) .networkIdentifiers( Transaction.Source.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") .transactionId("627199945183184") @@ -2234,6 +2241,7 @@ internal class TransactionTest { Transaction.Source.CardRefund.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) @@ -2473,6 +2481,7 @@ internal class TransactionTest { Transaction.Source.CardSettlement.NetworkIdentifiers.builder() .acquirerBusinessId("69650702") .acquirerReferenceNumber("83163715445437604865089") + .authorizationIdentificationResponse("ABC123") .transactionId("627199945183184") .build() ) From 5bf05d830f2ce0adeb347c992ae637d2256e2523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:24:41 +0000 Subject: [PATCH 10/33] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/cards/CardCreateParamsTest.kt | 6 +++--- .../api/models/cards/CardUpdateParamsTest.kt | 6 +++--- .../DigitalCardProfileCloneParamsTest.kt | 6 +++--- .../RealTimeDecisionActionParamsTest.kt | 12 ++++++------ .../api/services/async/CardServiceAsyncTest.kt | 4 ++-- .../async/DigitalCardProfileServiceAsyncTest.kt | 2 +- .../async/RealTimeDecisionServiceAsyncTest.kt | 4 ++-- .../api/services/blocking/CardServiceTest.kt | 4 ++-- .../blocking/DigitalCardProfileServiceTest.kt | 2 +- .../services/blocking/RealTimeDecisionServiceTest.kt | 4 ++-- 11 files changed, 27 insertions(+), 27 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7201a22ab..7d2d5b8d9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-33f2c95401f5925e452440863f26a701b345a2da75b2b3f9b3eb33936adef476.yml -openapi_spec_hash: 3a0f2ac488d1d8e875bd118940c81152 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-bee1322960faf189518a3ac4b28f52fab559d991b86edfebe33795ed60f4af0f.yml +openapi_spec_hash: c3f12839150ef30de08776d0ea693f59 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt index 4766b7c02..ff594e04b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardCreateParamsTest.kt @@ -24,7 +24,7 @@ internal class CardCreateParamsTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -50,7 +50,7 @@ internal class CardCreateParamsTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -75,7 +75,7 @@ internal class CardCreateParamsTest { .contains( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt index 8c85822f4..37d1feb05 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cards/CardUpdateParamsTest.kt @@ -24,7 +24,7 @@ internal class CardUpdateParamsTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -60,7 +60,7 @@ internal class CardUpdateParamsTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -85,7 +85,7 @@ internal class CardUpdateParamsTest { .contains( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt index 5b609eaeb..84c2eeaf1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/digitalcardprofiles/DigitalCardProfileCloneParamsTest.kt @@ -14,7 +14,7 @@ internal class DigitalCardProfileCloneParamsTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") @@ -45,7 +45,7 @@ internal class DigitalCardProfileCloneParamsTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") @@ -64,7 +64,7 @@ internal class DigitalCardProfileCloneParamsTest { assertThat(body.appIconFileId()).contains("app_icon_file_id") assertThat(body.backgroundImageFileId()).contains("file_1ai913suu1zfn1pdetru") assertThat(body.cardDescription()).contains("x") - assertThat(body.contactEmail()).contains("x") + assertThat(body.contactEmail()).contains("dev@stainless.com") assertThat(body.contactPhone()).contains("x") assertThat(body.contactWebsite()).contains("contact_website") assertThat(body.description()).contains("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt index a2b8183a0..30dbe82e2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt @@ -61,7 +61,7 @@ internal class RealTimeDecisionActionParamsTest { .result(RealTimeDecisionActionParams.DigitalWalletAuthentication.Result.SUCCESS) .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -71,7 +71,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -157,7 +157,7 @@ internal class RealTimeDecisionActionParamsTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -167,7 +167,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -236,7 +236,7 @@ internal class RealTimeDecisionActionParamsTest { .result(RealTimeDecisionActionParams.DigitalWalletAuthentication.Result.SUCCESS) .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -247,7 +247,7 @@ internal class RealTimeDecisionActionParamsTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt index b2de39ef1..e781b600b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardServiceAsyncTest.kt @@ -40,7 +40,7 @@ internal class CardServiceAsyncTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -93,7 +93,7 @@ internal class CardServiceAsyncTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt index 6c4a7363c..d3c0b122b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/DigitalCardProfileServiceAsyncTest.kt @@ -109,7 +109,7 @@ internal class DigitalCardProfileServiceAsyncTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt index f4d577458..f3faeee2d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt @@ -104,7 +104,7 @@ internal class RealTimeDecisionServiceAsyncTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -114,7 +114,7 @@ internal class RealTimeDecisionServiceAsyncTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt index 5a011ed22..ecab06e8f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardServiceTest.kt @@ -40,7 +40,7 @@ internal class CardServiceTest { .digitalWallet( CardCreateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -91,7 +91,7 @@ internal class CardServiceTest { .digitalWallet( CardUpdateParams.DigitalWallet.builder() .digitalCardProfileId("digital_card_profile_id") - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt index 7694911c7..ac93dd20c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/DigitalCardProfileServiceTest.kt @@ -105,7 +105,7 @@ internal class DigitalCardProfileServiceTest { .appIconFileId("app_icon_file_id") .backgroundImageFileId("file_1ai913suu1zfn1pdetru") .cardDescription("x") - .contactEmail("x") + .contactEmail("dev@stainless.com") .contactPhone("x") .contactWebsite("contact_website") .description("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt index 5b841468e..ee03e2fe0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt @@ -103,7 +103,7 @@ internal class RealTimeDecisionServiceTest { .success( RealTimeDecisionActionParams.DigitalWalletAuthentication.Success .builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) @@ -113,7 +113,7 @@ internal class RealTimeDecisionServiceTest { RealTimeDecisionActionParams.DigitalWalletToken.builder() .approval( RealTimeDecisionActionParams.DigitalWalletToken.Approval.builder() - .email("x") + .email("dev@stainless.com") .phone("x") .build() ) From c2aa9ee013d28d1f078de229881f1feb3dfc32b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 21:07:29 +0000 Subject: [PATCH 11/33] feat(api): api update --- .stats.yml | 4 +- .../realtimedecisions/RealTimeDecision.kt | 68 +------------------ .../realtimedecisions/RealTimeDecisionTest.kt | 3 - 3 files changed, 5 insertions(+), 70 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7d2d5b8d9..ffbf262f2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-bee1322960faf189518a3ac4b28f52fab559d991b86edfebe33795ed60f4af0f.yml -openapi_spec_hash: c3f12839150ef30de08776d0ea693f59 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d7cf5ee0996fbe47611e26c72b8bd36151ce065c410488583977102f1812b84d.yml +openapi_spec_hash: 8c0f2a172afc0eb0f9fae50250c89216 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index d0bff6cec..38405ebc7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -11057,7 +11057,6 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val cardId: JsonField, - private val cardProfileId: JsonField, private val decision: JsonField, private val device: JsonField, private val digitalWallet: JsonField, @@ -11067,9 +11066,6 @@ private constructor( @JsonCreator private constructor( @JsonProperty("card_id") @ExcludeMissing cardId: JsonField = JsonMissing.of(), - @JsonProperty("card_profile_id") - @ExcludeMissing - cardProfileId: JsonField = JsonMissing.of(), @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), @@ -11077,7 +11073,7 @@ private constructor( @JsonProperty("digital_wallet") @ExcludeMissing digitalWallet: JsonField = JsonMissing.of(), - ) : this(cardId, cardProfileId, decision, device, digitalWallet, mutableMapOf()) + ) : this(cardId, decision, device, digitalWallet, mutableMapOf()) /** * The identifier of the Card that is being tokenized. @@ -11087,16 +11083,6 @@ private constructor( */ fun cardId(): String = cardId.getRequired("card_id") - /** - * The identifier of the Card Profile that was set via the real time decision. This will be - * null until the real time decision is responded to or if the real time decision did not - * set a card profile. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun cardProfileId(): Optional = cardProfileId.getOptional("card_profile_id") - /** * Whether or not the provisioning request was approved. This will be null until the real * time decision is responded to. @@ -11129,16 +11115,6 @@ private constructor( */ @JsonProperty("card_id") @ExcludeMissing fun _cardId(): JsonField = cardId - /** - * Returns the raw JSON value of [cardProfileId]. - * - * Unlike [cardProfileId], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("card_profile_id") - @ExcludeMissing - fun _cardProfileId(): JsonField = cardProfileId - /** * Returns the raw JSON value of [decision]. * @@ -11183,7 +11159,6 @@ private constructor( * The following fields are required: * ```java * .cardId() - * .cardProfileId() * .decision() * .device() * .digitalWallet() @@ -11196,7 +11171,6 @@ private constructor( class Builder internal constructor() { private var cardId: JsonField? = null - private var cardProfileId: JsonField? = null private var decision: JsonField? = null private var device: JsonField? = null private var digitalWallet: JsonField? = null @@ -11205,7 +11179,6 @@ private constructor( @JvmSynthetic internal fun from(digitalWalletToken: DigitalWalletToken) = apply { cardId = digitalWalletToken.cardId - cardProfileId = digitalWalletToken.cardProfileId decision = digitalWalletToken.decision device = digitalWalletToken.device digitalWallet = digitalWalletToken.digitalWallet @@ -11224,29 +11197,6 @@ private constructor( */ fun cardId(cardId: JsonField) = apply { this.cardId = cardId } - /** - * The identifier of the Card Profile that was set via the real time decision. This will - * be null until the real time decision is responded to or if the real time decision did - * not set a card profile. - */ - fun cardProfileId(cardProfileId: String?) = - cardProfileId(JsonField.ofNullable(cardProfileId)) - - /** Alias for calling [Builder.cardProfileId] with `cardProfileId.orElse(null)`. */ - fun cardProfileId(cardProfileId: Optional) = - cardProfileId(cardProfileId.getOrNull()) - - /** - * Sets [Builder.cardProfileId] to an arbitrary JSON value. - * - * You should usually call [Builder.cardProfileId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun cardProfileId(cardProfileId: JsonField) = apply { - this.cardProfileId = cardProfileId - } - /** * Whether or not the provisioning request was approved. This will be null until the * real time decision is responded to. @@ -11319,7 +11269,6 @@ private constructor( * The following fields are required: * ```java * .cardId() - * .cardProfileId() * .decision() * .device() * .digitalWallet() @@ -11330,7 +11279,6 @@ private constructor( fun build(): DigitalWalletToken = DigitalWalletToken( checkRequired("cardId", cardId), - checkRequired("cardProfileId", cardProfileId), checkRequired("decision", decision), checkRequired("device", device), checkRequired("digitalWallet", digitalWallet), @@ -11346,7 +11294,6 @@ private constructor( } cardId() - cardProfileId() decision().ifPresent { it.validate() } device().validate() digitalWallet().validate() @@ -11370,7 +11317,6 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (cardId.asKnown().isPresent) 1 else 0) + - (if (cardProfileId.asKnown().isPresent) 1 else 0) + (decision.asKnown().getOrNull()?.validity() ?: 0) + (device.asKnown().getOrNull()?.validity() ?: 0) + (digitalWallet.asKnown().getOrNull()?.validity() ?: 0) @@ -11852,7 +11798,6 @@ private constructor( return other is DigitalWalletToken && cardId == other.cardId && - cardProfileId == other.cardProfileId && decision == other.decision && device == other.device && digitalWallet == other.digitalWallet && @@ -11860,20 +11805,13 @@ private constructor( } private val hashCode: Int by lazy { - Objects.hash( - cardId, - cardProfileId, - decision, - device, - digitalWallet, - additionalProperties, - ) + Objects.hash(cardId, decision, device, digitalWallet, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "DigitalWalletToken{cardId=$cardId, cardProfileId=$cardProfileId, decision=$decision, device=$device, digitalWallet=$digitalWallet, additionalProperties=$additionalProperties}" + "DigitalWalletToken{cardId=$cardId, decision=$decision, device=$device, digitalWallet=$digitalWallet, additionalProperties=$additionalProperties}" } /** The status of the Real-Time Decision. */ diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 3ff8fbba6..6cfc60746 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -235,7 +235,6 @@ internal class RealTimeDecisionTest { .digitalWalletToken( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() @@ -470,7 +469,6 @@ internal class RealTimeDecisionTest { .contains( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() @@ -711,7 +709,6 @@ internal class RealTimeDecisionTest { .digitalWalletToken( RealTimeDecision.DigitalWalletToken.builder() .cardId("card_id") - .cardProfileId("card_profile_id") .decision(RealTimeDecision.DigitalWalletToken.Decision.APPROVE) .device( RealTimeDecision.DigitalWalletToken.Device.builder() From 627c5290ea4b54edabb8ac80c45c5c4309ece8a1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 00:07:11 +0000 Subject: [PATCH 12/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 54 ++++++++++++++++++- .../CardPaymentListPageResponseTest.kt | 3 ++ .../models/cardpayments/CardPaymentTest.kt | 3 ++ 4 files changed, 61 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ffbf262f2..f6d731d7e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d7cf5ee0996fbe47611e26c72b8bd36151ce065c410488583977102f1812b84d.yml -openapi_spec_hash: 8c0f2a172afc0eb0f9fae50250c89216 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b4cda5505a0662dcbad16dabc86715b5353a90685fa9047384e60156f898f3b8.yml +openapi_spec_hash: 0c831296b6f59e535c73162e0e18c175 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 25140084c..90d1bc36d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -57353,6 +57353,7 @@ private constructor( private val authorizedAmount: JsonField, private val fuelConfirmedAmount: JsonField, private val incrementedAmount: JsonField, + private val refundAuthorizedAmount: JsonField, private val refundedAmount: JsonField, private val reversedAmount: JsonField, private val settledAmount: JsonField, @@ -57370,6 +57371,9 @@ private constructor( @JsonProperty("incremented_amount") @ExcludeMissing incrementedAmount: JsonField = JsonMissing.of(), + @JsonProperty("refund_authorized_amount") + @ExcludeMissing + refundAuthorizedAmount: JsonField = JsonMissing.of(), @JsonProperty("refunded_amount") @ExcludeMissing refundedAmount: JsonField = JsonMissing.of(), @@ -57383,6 +57387,7 @@ private constructor( authorizedAmount, fuelConfirmedAmount, incrementedAmount, + refundAuthorizedAmount, refundedAmount, reversedAmount, settledAmount, @@ -57416,6 +57421,16 @@ private constructor( */ fun incrementedAmount(): Long = incrementedAmount.getRequired("incremented_amount") + /** + * The total refund authorized amount in the minor unit of the transaction's currency. For + * dollars, for example, this is cents. + * + * @throws IncreaseInvalidDataException 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 refundAuthorizedAmount(): Long = + refundAuthorizedAmount.getRequired("refund_authorized_amount") + /** * The total refunded amount in the minor unit of the transaction's currency. For dollars, * for example, this is cents. @@ -57473,6 +57488,16 @@ private constructor( @ExcludeMissing fun _incrementedAmount(): JsonField = incrementedAmount + /** + * Returns the raw JSON value of [refundAuthorizedAmount]. + * + * Unlike [refundAuthorizedAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("refund_authorized_amount") + @ExcludeMissing + fun _refundAuthorizedAmount(): JsonField = refundAuthorizedAmount + /** * Returns the raw JSON value of [refundedAmount]. * @@ -57525,6 +57550,7 @@ private constructor( * .authorizedAmount() * .fuelConfirmedAmount() * .incrementedAmount() + * .refundAuthorizedAmount() * .refundedAmount() * .reversedAmount() * .settledAmount() @@ -57539,6 +57565,7 @@ private constructor( private var authorizedAmount: JsonField? = null private var fuelConfirmedAmount: JsonField? = null private var incrementedAmount: JsonField? = null + private var refundAuthorizedAmount: JsonField? = null private var refundedAmount: JsonField? = null private var reversedAmount: JsonField? = null private var settledAmount: JsonField? = null @@ -57549,6 +57576,7 @@ private constructor( authorizedAmount = state.authorizedAmount fuelConfirmedAmount = state.fuelConfirmedAmount incrementedAmount = state.incrementedAmount + refundAuthorizedAmount = state.refundAuthorizedAmount refundedAmount = state.refundedAmount reversedAmount = state.reversedAmount settledAmount = state.settledAmount @@ -57609,6 +57637,24 @@ private constructor( this.incrementedAmount = incrementedAmount } + /** + * The total refund authorized amount in the minor unit of the transaction's currency. + * For dollars, for example, this is cents. + */ + fun refundAuthorizedAmount(refundAuthorizedAmount: Long) = + refundAuthorizedAmount(JsonField.of(refundAuthorizedAmount)) + + /** + * Sets [Builder.refundAuthorizedAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.refundAuthorizedAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun refundAuthorizedAmount(refundAuthorizedAmount: JsonField) = apply { + this.refundAuthorizedAmount = refundAuthorizedAmount + } + /** * The total refunded amount in the minor unit of the transaction's currency. For * dollars, for example, this is cents. @@ -57689,6 +57735,7 @@ private constructor( * .authorizedAmount() * .fuelConfirmedAmount() * .incrementedAmount() + * .refundAuthorizedAmount() * .refundedAmount() * .reversedAmount() * .settledAmount() @@ -57701,6 +57748,7 @@ private constructor( checkRequired("authorizedAmount", authorizedAmount), checkRequired("fuelConfirmedAmount", fuelConfirmedAmount), checkRequired("incrementedAmount", incrementedAmount), + checkRequired("refundAuthorizedAmount", refundAuthorizedAmount), checkRequired("refundedAmount", refundedAmount), checkRequired("reversedAmount", reversedAmount), checkRequired("settledAmount", settledAmount), @@ -57718,6 +57766,7 @@ private constructor( authorizedAmount() fuelConfirmedAmount() incrementedAmount() + refundAuthorizedAmount() refundedAmount() reversedAmount() settledAmount() @@ -57743,6 +57792,7 @@ private constructor( (if (authorizedAmount.asKnown().isPresent) 1 else 0) + (if (fuelConfirmedAmount.asKnown().isPresent) 1 else 0) + (if (incrementedAmount.asKnown().isPresent) 1 else 0) + + (if (refundAuthorizedAmount.asKnown().isPresent) 1 else 0) + (if (refundedAmount.asKnown().isPresent) 1 else 0) + (if (reversedAmount.asKnown().isPresent) 1 else 0) + (if (settledAmount.asKnown().isPresent) 1 else 0) @@ -57756,6 +57806,7 @@ private constructor( authorizedAmount == other.authorizedAmount && fuelConfirmedAmount == other.fuelConfirmedAmount && incrementedAmount == other.incrementedAmount && + refundAuthorizedAmount == other.refundAuthorizedAmount && refundedAmount == other.refundedAmount && reversedAmount == other.reversedAmount && settledAmount == other.settledAmount && @@ -57767,6 +57818,7 @@ private constructor( authorizedAmount, fuelConfirmedAmount, incrementedAmount, + refundAuthorizedAmount, refundedAmount, reversedAmount, settledAmount, @@ -57777,7 +57829,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "State{authorizedAmount=$authorizedAmount, fuelConfirmedAmount=$fuelConfirmedAmount, incrementedAmount=$incrementedAmount, refundedAmount=$refundedAmount, reversedAmount=$reversedAmount, settledAmount=$settledAmount, additionalProperties=$additionalProperties}" + "State{authorizedAmount=$authorizedAmount, fuelConfirmedAmount=$fuelConfirmedAmount, incrementedAmount=$incrementedAmount, refundAuthorizedAmount=$refundAuthorizedAmount, refundedAmount=$refundedAmount, reversedAmount=$reversedAmount, settledAmount=$settledAmount, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index aec1b0f4f..77fd6f9ad 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -5909,6 +5909,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -11518,6 +11519,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -17427,6 +17429,7 @@ internal class CardPaymentListPageResponseTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index c717d0e9a..7b93f1c15 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -5231,6 +5231,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -9918,6 +9919,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) @@ -15146,6 +15148,7 @@ internal class CardPaymentTest { .authorizedAmount(100L) .fuelConfirmedAmount(0L) .incrementedAmount(20L) + .refundAuthorizedAmount(0L) .refundedAmount(0L) .reversedAmount(20L) .settledAmount(100L) From 4cc243c53315482c3f0c4e66b83e1a97002075ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 18:23:28 +0000 Subject: [PATCH 13/33] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/cardpayments/CardPayment.kt | 18 ++++++++++++------ .../DeclinedTransaction.kt | 6 ++++-- .../pendingtransactions/PendingTransaction.kt | 6 ++++-- .../realtimedecisions/RealTimeDecision.kt | 6 ++++-- .../api/models/transactions/Transaction.kt | 6 ++++-- 6 files changed, 30 insertions(+), 16 deletions(-) diff --git a/.stats.yml b/.stats.yml index f6d731d7e..c0b1861c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b4cda5505a0662dcbad16dabc86715b5353a90685fa9047384e60156f898f3b8.yml -openapi_spec_hash: 0c831296b6f59e535c73162e0e18c175 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-77bf980f154392e3f2070aa38e38d8927ba8cff23d81bb6e5733fdd52a4e67b5.yml +openapi_spec_hash: 18a92821c3e77f158295ca50b4aa33b0 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 90d1bc36d..811e051b8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -4336,7 +4336,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -5130,7 +5131,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -13399,7 +13401,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -14233,7 +14236,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) @@ -49901,7 +49905,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -50518,7 +50523,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index b3a94e0d4..9fbe968a1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -2967,7 +2967,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3801,7 +3802,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 1cede24de..1639b5ab7 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -3068,7 +3068,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -3862,7 +3863,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index 38405ebc7..087cba03d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -1840,7 +1840,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score is + * from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -2585,7 +2586,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 4e0fb0740..73c41994a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -8059,7 +8059,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). @@ -8823,7 +8824,8 @@ private constructor( /** * The risk score generated by the card network. For Visa this is the Visa Advanced - * Authorization risk score, from 0 to 99, where 99 is the riskiest. + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. */ fun networkRiskScore(networkRiskScore: Long?) = networkRiskScore(JsonField.ofNullable(networkRiskScore)) From 2111373ba896c63c028db86bc55b4f4cc15ab84c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:24:40 +0000 Subject: [PATCH 14/33] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/checktransfers/CheckTransfer.kt | 12 +++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index c0b1861c7..381812862 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-77bf980f154392e3f2070aa38e38d8927ba8cff23d81bb6e5733fdd52a4e67b5.yml -openapi_spec_hash: 18a92821c3e77f158295ca50b4aa33b0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-569770c31254c7f2a732392f0a960ab529ea93d792991d0ad4b77ddb03cef90b.yml +openapi_spec_hash: ad8426915b3eb92c26351e2d87a6d891 config_hash: f0b80170c2ea09811aeae3f1e94bc422 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt index 2640eef1d..f0b144f87 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt @@ -1468,7 +1468,9 @@ private constructor( @JvmField val FULL = of("full") /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ @JvmField val NONE = of("none") @@ -1483,7 +1485,9 @@ private constructor( */ FULL, /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ NONE, } @@ -1504,7 +1508,9 @@ private constructor( */ FULL, /** - * No balance check will performed; a zero-dollar Pending Transaction will be created. + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. */ NONE, /** From 5abe99834b4bd1161fc588f88bf0ead3fea939e7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 18:44:29 +0000 Subject: [PATCH 15/33] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 381812862..0cfe0b4d6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-569770c31254c7f2a732392f0a960ab529ea93d792991d0ad4b77ddb03cef90b.yml -openapi_spec_hash: ad8426915b3eb92c26351e2d87a6d891 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f0373fbc3f512db9d7119c8fbda09e7b37b8937d8152a621ccac4a61cb26e645.yml +openapi_spec_hash: 775cf47e50fc4ca4afcb125134c393f9 config_hash: f0b80170c2ea09811aeae3f1e94bc422 From 6e19da06337f68df4830a9a29da088767382b8a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:55:14 +0000 Subject: [PATCH 16/33] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0cfe0b4d6..7ca00a23c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f0373fbc3f512db9d7119c8fbda09e7b37b8937d8152a621ccac4a61cb26e645.yml -openapi_spec_hash: 775cf47e50fc4ca4afcb125134c393f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c13eb8e2ccdb5028451b2a92338fccda6d83d1f3397c9f8f13afc276f61abbe2.yml +openapi_spec_hash: dcd90f19e2ac1931b2fa6c402a7a0082 config_hash: f0b80170c2ea09811aeae3f1e94bc422 From ee7968ddfed0a889d9c6cb4a0033d041ed07f751 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Oct 2025 22:06:24 +0000 Subject: [PATCH 17/33] feat(api): api update --- .stats.yml | 8 +- .../com/increase/api/client/IncreaseClient.kt | 10 + .../api/client/IncreaseClientAsync.kt | 10 + .../api/client/IncreaseClientAsyncImpl.kt | 31 + .../increase/api/client/IncreaseClientImpl.kt | 29 + .../models/fednowtransfers/FednowTransfer.kt | 3714 +++++++++++++++++ .../FednowTransferApproveParams.kt | 242 ++ .../FednowTransferCancelParams.kt | 242 ++ .../FednowTransferCreateParams.kt | 1838 ++++++++ .../fednowtransfers/FednowTransferListPage.kt | 133 + .../FednowTransferListPageAsync.kt | 148 + .../FednowTransferListPageResponse.kt | 241 ++ .../FednowTransferListParams.kt | 850 ++++ .../FednowTransferRetrieveParams.kt | 201 + .../InboundFednowTransfer.kt | 1863 +++++++++ .../InboundFednowTransferListPage.kt | 136 + .../InboundFednowTransferListPageAsync.kt | 152 + .../InboundFednowTransferListPageResponse.kt | 243 ++ .../InboundFednowTransferListParams.kt | 483 +++ .../InboundFednowTransferRetrieveParams.kt | 208 + .../InboundFednowTransferCreateParams.kt | 822 ++++ .../async/FednowTransferServiceAsync.kt | 344 ++ .../async/FednowTransferServiceAsyncImpl.kt | 263 ++ .../InboundFednowTransferServiceAsync.kt | 186 + .../InboundFednowTransferServiceAsyncImpl.kt | 142 + .../services/async/SimulationServiceAsync.kt | 5 + .../async/SimulationServiceAsyncImpl.kt | 17 + .../InboundFednowTransferServiceAsync.kt | 68 + .../InboundFednowTransferServiceAsyncImpl.kt | 91 + .../blocking/FednowTransferService.kt | 344 ++ .../blocking/FednowTransferServiceImpl.kt | 244 ++ .../blocking/InboundFednowTransferService.kt | 185 + .../InboundFednowTransferServiceImpl.kt | 131 + .../services/blocking/SimulationService.kt | 5 + .../blocking/SimulationServiceImpl.kt | 15 + .../InboundFednowTransferService.kt | 68 + .../InboundFednowTransferServiceImpl.kt | 84 + .../FednowTransferApproveParamsTest.kt | 28 + .../FednowTransferCancelParamsTest.kt | 28 + .../FednowTransferCreateParamsTest.kt | 127 + .../FednowTransferListPageResponseTest.kt | 221 + .../FednowTransferListParamsTest.kt | 87 + .../FednowTransferRetrieveParamsTest.kt | 28 + .../fednowtransfers/FednowTransferTest.kt | 200 + ...boundFednowTransferListPageResponseTest.kt | 132 + .../InboundFednowTransferListParamsTest.kt | 73 + ...InboundFednowTransferRetrieveParamsTest.kt | 28 + .../InboundFednowTransferTest.kt | 119 + .../InboundFednowTransferCreateParamsTest.kt | 57 + .../async/FednowTransferServiceAsyncTest.kt | 121 + .../InboundFednowTransferServiceAsyncTest.kt | 45 + .../InboundFednowTransferServiceAsyncTest.kt | 38 + .../blocking/FednowTransferServiceTest.kt | 113 + .../InboundFednowTransferServiceTest.kt | 41 + .../InboundFednowTransferServiceTest.kt | 37 + .../api/proguard/ProGuardCompatibilityTest.kt | 2 + 56 files changed, 15317 insertions(+), 4 deletions(-) create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt create mode 100644 increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt create mode 100644 increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt diff --git a/.stats.yml b/.stats.yml index 7ca00a23c..2363e1cfc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 220 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c13eb8e2ccdb5028451b2a92338fccda6d83d1f3397c9f8f13afc276f61abbe2.yml -openapi_spec_hash: dcd90f19e2ac1931b2fa6c402a7a0082 -config_hash: f0b80170c2ea09811aeae3f1e94bc422 +configured_endpoints: 228 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e809e9e4e5bc9c602a2ecebfbdb4a77d6c88c6f70f0b47a7a4d1dd1df4aaa66d.yml +openapi_spec_hash: cb6cb9fa09a8e52f6eb89271b559823d +config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt index 4de8c0ea2..dc57ab706 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClient.kt @@ -30,11 +30,13 @@ import com.increase.api.services.blocking.EventService import com.increase.api.services.blocking.EventSubscriptionService import com.increase.api.services.blocking.ExportService import com.increase.api.services.blocking.ExternalAccountService +import com.increase.api.services.blocking.FednowTransferService import com.increase.api.services.blocking.FileLinkService import com.increase.api.services.blocking.FileService import com.increase.api.services.blocking.GroupService import com.increase.api.services.blocking.InboundAchTransferService import com.increase.api.services.blocking.InboundCheckDepositService +import com.increase.api.services.blocking.InboundFednowTransferService import com.increase.api.services.blocking.InboundMailItemService import com.increase.api.services.blocking.InboundRealTimePaymentsTransferService import com.increase.api.services.blocking.InboundWireDrawdownRequestService @@ -147,6 +149,10 @@ interface IncreaseClient { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService + fun fednowTransfers(): FednowTransferService + + fun inboundFednowTransfers(): InboundFednowTransferService + fun checkDeposits(): CheckDepositService fun lockboxes(): LockboxService @@ -283,6 +289,10 @@ interface IncreaseClient { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService.WithRawResponse + fun fednowTransfers(): FednowTransferService.WithRawResponse + + fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse + fun checkDeposits(): CheckDepositService.WithRawResponse fun lockboxes(): LockboxService.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt index ac800b994..be4579776 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsync.kt @@ -30,11 +30,13 @@ import com.increase.api.services.async.EventServiceAsync import com.increase.api.services.async.EventSubscriptionServiceAsync import com.increase.api.services.async.ExportServiceAsync import com.increase.api.services.async.ExternalAccountServiceAsync +import com.increase.api.services.async.FednowTransferServiceAsync import com.increase.api.services.async.FileLinkServiceAsync import com.increase.api.services.async.FileServiceAsync import com.increase.api.services.async.GroupServiceAsync import com.increase.api.services.async.InboundAchTransferServiceAsync import com.increase.api.services.async.InboundCheckDepositServiceAsync +import com.increase.api.services.async.InboundFednowTransferServiceAsync import com.increase.api.services.async.InboundMailItemServiceAsync import com.increase.api.services.async.InboundRealTimePaymentsTransferServiceAsync import com.increase.api.services.async.InboundWireDrawdownRequestServiceAsync @@ -147,6 +149,10 @@ interface IncreaseClientAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync + fun fednowTransfers(): FednowTransferServiceAsync + + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync + fun checkDeposits(): CheckDepositServiceAsync fun lockboxes(): LockboxServiceAsync @@ -287,6 +293,10 @@ interface IncreaseClientAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync.WithRawResponse + fun fednowTransfers(): FednowTransferServiceAsync.WithRawResponse + + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse + fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse fun lockboxes(): LockboxServiceAsync.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt index 1adb82f42..ddb03d381 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientAsyncImpl.kt @@ -58,6 +58,8 @@ import com.increase.api.services.async.ExportServiceAsync import com.increase.api.services.async.ExportServiceAsyncImpl import com.increase.api.services.async.ExternalAccountServiceAsync import com.increase.api.services.async.ExternalAccountServiceAsyncImpl +import com.increase.api.services.async.FednowTransferServiceAsync +import com.increase.api.services.async.FednowTransferServiceAsyncImpl import com.increase.api.services.async.FileLinkServiceAsync import com.increase.api.services.async.FileLinkServiceAsyncImpl import com.increase.api.services.async.FileServiceAsync @@ -68,6 +70,8 @@ import com.increase.api.services.async.InboundAchTransferServiceAsync import com.increase.api.services.async.InboundAchTransferServiceAsyncImpl import com.increase.api.services.async.InboundCheckDepositServiceAsync import com.increase.api.services.async.InboundCheckDepositServiceAsyncImpl +import com.increase.api.services.async.InboundFednowTransferServiceAsync +import com.increase.api.services.async.InboundFednowTransferServiceAsyncImpl import com.increase.api.services.async.InboundMailItemServiceAsync import com.increase.api.services.async.InboundMailItemServiceAsyncImpl import com.increase.api.services.async.InboundRealTimePaymentsTransferServiceAsync @@ -234,6 +238,14 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsyncImpl(clientOptionsWithUserAgent) } + private val fednowTransfers: FednowTransferServiceAsync by lazy { + FednowTransferServiceAsyncImpl(clientOptionsWithUserAgent) + } + + private val inboundFednowTransfers: InboundFednowTransferServiceAsync by lazy { + InboundFednowTransferServiceAsyncImpl(clientOptionsWithUserAgent) + } + private val checkDeposits: CheckDepositServiceAsync by lazy { CheckDepositServiceAsyncImpl(clientOptionsWithUserAgent) } @@ -415,6 +427,11 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferServiceAsync = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync = checkDeposits override fun lockboxes(): LockboxServiceAsync = lockboxes @@ -587,6 +604,15 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val fednowTransfers: FednowTransferServiceAsync.WithRawResponse by lazy { + FednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + + private val inboundFednowTransfers: + InboundFednowTransferServiceAsync.WithRawResponse by lazy { + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync.WithRawResponse by lazy { CheckDepositServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -782,6 +808,11 @@ class IncreaseClientAsyncImpl(private val clientOptions: ClientOptions) : Increa InboundRealTimePaymentsTransferServiceAsync.WithRawResponse = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferServiceAsync.WithRawResponse = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse = checkDeposits override fun lockboxes(): LockboxServiceAsync.WithRawResponse = lockboxes diff --git a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt index 0f57c4411..021a9434d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/client/IncreaseClientImpl.kt @@ -58,6 +58,8 @@ import com.increase.api.services.blocking.ExportService import com.increase.api.services.blocking.ExportServiceImpl import com.increase.api.services.blocking.ExternalAccountService import com.increase.api.services.blocking.ExternalAccountServiceImpl +import com.increase.api.services.blocking.FednowTransferService +import com.increase.api.services.blocking.FednowTransferServiceImpl import com.increase.api.services.blocking.FileLinkService import com.increase.api.services.blocking.FileLinkServiceImpl import com.increase.api.services.blocking.FileService @@ -68,6 +70,8 @@ import com.increase.api.services.blocking.InboundAchTransferService import com.increase.api.services.blocking.InboundAchTransferServiceImpl import com.increase.api.services.blocking.InboundCheckDepositService import com.increase.api.services.blocking.InboundCheckDepositServiceImpl +import com.increase.api.services.blocking.InboundFednowTransferService +import com.increase.api.services.blocking.InboundFednowTransferServiceImpl import com.increase.api.services.blocking.InboundMailItemService import com.increase.api.services.blocking.InboundMailItemServiceImpl import com.increase.api.services.blocking.InboundRealTimePaymentsTransferService @@ -231,6 +235,14 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferServiceImpl(clientOptionsWithUserAgent) } + private val fednowTransfers: FednowTransferService by lazy { + FednowTransferServiceImpl(clientOptionsWithUserAgent) + } + + private val inboundFednowTransfers: InboundFednowTransferService by lazy { + InboundFednowTransferServiceImpl(clientOptionsWithUserAgent) + } + private val checkDeposits: CheckDepositService by lazy { CheckDepositServiceImpl(clientOptionsWithUserAgent) } @@ -399,6 +411,10 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferService = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferService = inboundFednowTransfers + override fun checkDeposits(): CheckDepositService = checkDeposits override fun lockboxes(): LockboxService = lockboxes @@ -570,6 +586,14 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferServiceImpl.WithRawResponseImpl(clientOptions) } + private val fednowTransfers: FednowTransferService.WithRawResponse by lazy { + FednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + + private val inboundFednowTransfers: InboundFednowTransferService.WithRawResponse by lazy { + InboundFednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositService.WithRawResponse by lazy { CheckDepositServiceImpl.WithRawResponseImpl(clientOptions) } @@ -763,6 +787,11 @@ class IncreaseClientImpl(private val clientOptions: ClientOptions) : IncreaseCli InboundRealTimePaymentsTransferService.WithRawResponse = inboundRealTimePaymentsTransfers + override fun fednowTransfers(): FednowTransferService.WithRawResponse = fednowTransfers + + override fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositService.WithRawResponse = checkDeposits override fun lockboxes(): LockboxService.WithRawResponse = lockboxes diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt new file mode 100644 index 000000000..2a3cc27fc --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransfer.kt @@ -0,0 +1,3714 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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.increase.api.core.Enum +import com.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkRequired +import com.increase.api.errors.IncreaseInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * FedNow transfers move funds, within seconds, between your Increase account and any other account + * supporting FedNow. + */ +class FednowTransfer +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val accountId: JsonField, + private val accountNumber: JsonField, + private val acknowledgement: JsonField, + private val amount: JsonField, + private val createdAt: JsonField, + private val createdBy: JsonField, + private val creditorName: JsonField, + private val currency: JsonField, + private val debtorName: JsonField, + private val externalAccountId: JsonField, + private val idempotencyKey: JsonField, + private val pendingTransactionId: JsonField, + private val rejection: JsonField, + private val routingNumber: JsonField, + private val sourceAccountNumberId: JsonField, + private val status: JsonField, + private val submission: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val uniqueEndToEndTransactionReference: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("acknowledgement") + @ExcludeMissing + acknowledgement: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("created_by") + @ExcludeMissing + createdBy: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("external_account_id") + @ExcludeMissing + externalAccountId: JsonField = JsonMissing.of(), + @JsonProperty("idempotency_key") + @ExcludeMissing + idempotencyKey: JsonField = JsonMissing.of(), + @JsonProperty("pending_transaction_id") + @ExcludeMissing + pendingTransactionId: JsonField = JsonMissing.of(), + @JsonProperty("rejection") + @ExcludeMissing + rejection: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + routingNumber: JsonField = JsonMissing.of(), + @JsonProperty("source_account_number_id") + @ExcludeMissing + sourceAccountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("submission") + @ExcludeMissing + submission: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("unique_end_to_end_transaction_reference") + @ExcludeMissing + uniqueEndToEndTransactionReference: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + id, + accountId, + accountNumber, + acknowledgement, + amount, + createdAt, + createdBy, + creditorName, + currency, + debtorName, + externalAccountId, + idempotencyKey, + pendingTransactionId, + rejection, + routingNumber, + sourceAccountNumberId, + status, + submission, + transactionId, + type, + uniqueEndToEndTransactionReference, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The FedNow Transfer's identifier. + * + * @throws IncreaseInvalidDataException 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 id(): String = id.getRequired("id") + + /** + * The Account from which the transfer was sent. + * + * @throws IncreaseInvalidDataException 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 accountId(): String = accountId.getRequired("account_id") + + /** + * The destination account number. + * + * @throws IncreaseInvalidDataException 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 accountNumber(): String = accountNumber.getRequired("account_number") + + /** + * If the transfer is acknowledged by the recipient bank, this will contain supplemental + * details. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun acknowledgement(): Optional = + acknowledgement.getOptional("acknowledgement") + + /** + * The transfer amount in USD cents. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the transfer + * was created. + * + * @throws IncreaseInvalidDataException 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 createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * What object created the transfer, either via the API or the dashboard. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun createdBy(): Optional = createdBy.getOptional("created_by") + + /** + * The name of the transfer's recipient. This is set by the sender when creating the transfer. + * + * @throws IncreaseInvalidDataException 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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * FedNow transfers this is always equal to `USD`. + * + * @throws IncreaseInvalidDataException 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 currency(): Currency = currency.getRequired("currency") + + /** + * The name of the transfer's sender. If not provided, defaults to the name of the account's + * entity. + * + * @throws IncreaseInvalidDataException 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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The identifier of the External Account the transfer was made to, if any. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalAccountId(): Optional = externalAccountId.getOptional("external_account_id") + + /** + * The idempotency key you chose for this object. This value is unique across Increase and is + * used to ensure that a request is only processed once. Learn more about + * [idempotency](https://increase.com/documentation/idempotency-keys). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun idempotencyKey(): Optional = idempotencyKey.getOptional("idempotency_key") + + /** + * The ID for the pending transaction representing the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun pendingTransactionId(): Optional = + pendingTransactionId.getOptional("pending_transaction_id") + + /** + * If the transfer is rejected by FedNow or the destination financial institution, this will + * contain supplemental details. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun rejection(): Optional = rejection.getOptional("rejection") + + /** + * The destination American Bankers' Association (ABA) Routing Transit Number (RTN). + * + * @throws IncreaseInvalidDataException 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 routingNumber(): String = routingNumber.getRequired("routing_number") + + /** + * The Account Number the recipient will see as having sent the transfer. + * + * @throws IncreaseInvalidDataException 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 sourceAccountNumberId(): String = + sourceAccountNumberId.getRequired("source_account_number_id") + + /** + * The lifecycle status of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * After the transfer is submitted to FedNow, this will contain supplemental details. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun submission(): Optional = submission.getOptional("submission") + + /** + * The Transaction funding the transfer once it is complete. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_transfer`. + * + * @throws IncreaseInvalidDataException 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") + + /** + * The Unique End-to-end Transaction Reference + * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) of + * the transfer. + * + * @throws IncreaseInvalidDataException 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 uniqueEndToEndTransactionReference(): String = + uniqueEndToEndTransactionReference.getRequired("unique_end_to_end_transaction_reference") + + /** + * Unstructured information that will show on the recipient's bank statement. + * + * @throws IncreaseInvalidDataException 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 unstructuredRemittanceInformation(): String = + unstructuredRemittanceInformation.getRequired("unstructured_remittance_information") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [accountId]. + * + * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_number") + @ExcludeMissing + fun _accountNumber(): JsonField = accountNumber + + /** + * Returns the raw JSON value of [acknowledgement]. + * + * Unlike [acknowledgement], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("acknowledgement") + @ExcludeMissing + fun _acknowledgement(): JsonField = acknowledgement + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [createdBy]. + * + * Unlike [createdBy], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_by") @ExcludeMissing fun _createdBy(): JsonField = createdBy + + /** + * Returns the raw JSON value of [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") @ExcludeMissing fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_account_id") + @ExcludeMissing + fun _externalAccountId(): JsonField = externalAccountId + + /** + * Returns the raw JSON value of [idempotencyKey]. + * + * Unlike [idempotencyKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("idempotency_key") + @ExcludeMissing + fun _idempotencyKey(): JsonField = idempotencyKey + + /** + * Returns the raw JSON value of [pendingTransactionId]. + * + * Unlike [pendingTransactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pending_transaction_id") + @ExcludeMissing + fun _pendingTransactionId(): JsonField = pendingTransactionId + + /** + * Returns the raw JSON value of [rejection]. + * + * Unlike [rejection], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rejection") @ExcludeMissing fun _rejection(): JsonField = rejection + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber(): JsonField = routingNumber + + /** + * Returns the raw JSON value of [sourceAccountNumberId]. + * + * Unlike [sourceAccountNumberId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("source_account_number_id") + @ExcludeMissing + fun _sourceAccountNumberId(): JsonField = sourceAccountNumberId + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [submission]. + * + * Unlike [submission], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("submission") + @ExcludeMissing + fun _submission(): JsonField = submission + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * 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 [uniqueEndToEndTransactionReference]. + * + * Unlike [uniqueEndToEndTransactionReference], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unique_end_to_end_transaction_reference") + @ExcludeMissing + fun _uniqueEndToEndTransactionReference(): JsonField = + uniqueEndToEndTransactionReference + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = unstructuredRemittanceInformation + + @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 [FednowTransfer]. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumber() + * .acknowledgement() + * .amount() + * .createdAt() + * .createdBy() + * .creditorName() + * .currency() + * .debtorName() + * .externalAccountId() + * .idempotencyKey() + * .pendingTransactionId() + * .rejection() + * .routingNumber() + * .sourceAccountNumberId() + * .status() + * .submission() + * .transactionId() + * .type() + * .uniqueEndToEndTransactionReference() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransfer]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var accountId: JsonField? = null + private var accountNumber: JsonField? = null + private var acknowledgement: JsonField? = null + private var amount: JsonField? = null + private var createdAt: JsonField? = null + private var createdBy: JsonField? = null + private var creditorName: JsonField? = null + private var currency: JsonField? = null + private var debtorName: JsonField? = null + private var externalAccountId: JsonField? = null + private var idempotencyKey: JsonField? = null + private var pendingTransactionId: JsonField? = null + private var rejection: JsonField? = null + private var routingNumber: JsonField? = null + private var sourceAccountNumberId: JsonField? = null + private var status: JsonField? = null + private var submission: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null + private var uniqueEndToEndTransactionReference: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransfer: FednowTransfer) = apply { + id = fednowTransfer.id + accountId = fednowTransfer.accountId + accountNumber = fednowTransfer.accountNumber + acknowledgement = fednowTransfer.acknowledgement + amount = fednowTransfer.amount + createdAt = fednowTransfer.createdAt + createdBy = fednowTransfer.createdBy + creditorName = fednowTransfer.creditorName + currency = fednowTransfer.currency + debtorName = fednowTransfer.debtorName + externalAccountId = fednowTransfer.externalAccountId + idempotencyKey = fednowTransfer.idempotencyKey + pendingTransactionId = fednowTransfer.pendingTransactionId + rejection = fednowTransfer.rejection + routingNumber = fednowTransfer.routingNumber + sourceAccountNumberId = fednowTransfer.sourceAccountNumberId + status = fednowTransfer.status + submission = fednowTransfer.submission + transactionId = fednowTransfer.transactionId + type = fednowTransfer.type + uniqueEndToEndTransactionReference = fednowTransfer.uniqueEndToEndTransactionReference + unstructuredRemittanceInformation = fednowTransfer.unstructuredRemittanceInformation + additionalProperties = fednowTransfer.additionalProperties.toMutableMap() + } + + /** The FedNow Transfer's identifier. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** The Account from which the transfer was sent. */ + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) + + /** + * Sets [Builder.accountId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } + + /** The destination account number. */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber + } + + /** + * If the transfer is acknowledged by the recipient bank, this will contain supplemental + * details. + */ + fun acknowledgement(acknowledgement: Acknowledgement?) = + acknowledgement(JsonField.ofNullable(acknowledgement)) + + /** Alias for calling [Builder.acknowledgement] with `acknowledgement.orElse(null)`. */ + fun acknowledgement(acknowledgement: Optional) = + acknowledgement(acknowledgement.getOrNull()) + + /** + * Sets [Builder.acknowledgement] to an arbitrary JSON value. + * + * You should usually call [Builder.acknowledgement] with a well-typed [Acknowledgement] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun acknowledgement(acknowledgement: JsonField) = apply { + this.acknowledgement = acknowledgement + } + + /** The transfer amount in USD cents. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was created. + */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + /** What object created the transfer, either via the API or the dashboard. */ + fun createdBy(createdBy: CreatedBy?) = createdBy(JsonField.ofNullable(createdBy)) + + /** Alias for calling [Builder.createdBy] with `createdBy.orElse(null)`. */ + fun createdBy(createdBy: Optional) = createdBy(createdBy.getOrNull()) + + /** + * Sets [Builder.createdBy] to an arbitrary JSON value. + * + * You should usually call [Builder.createdBy] with a well-typed [CreatedBy] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy } + + /** + * The name of the transfer's recipient. This is set by the sender when creating the + * transfer. + */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. + * For FedNow transfers this is always equal to `USD`. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The name of the transfer's sender. If not provided, defaults to the name of the account's + * entity. + */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The identifier of the External Account the transfer was made to, if any. */ + fun externalAccountId(externalAccountId: String?) = + externalAccountId(JsonField.ofNullable(externalAccountId)) + + /** Alias for calling [Builder.externalAccountId] with `externalAccountId.orElse(null)`. */ + fun externalAccountId(externalAccountId: Optional) = + externalAccountId(externalAccountId.getOrNull()) + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + this.externalAccountId = externalAccountId + } + + /** + * The idempotency key you chose for this object. This value is unique across Increase and + * is used to ensure that a request is only processed once. Learn more about + * [idempotency](https://increase.com/documentation/idempotency-keys). + */ + fun idempotencyKey(idempotencyKey: String?) = + idempotencyKey(JsonField.ofNullable(idempotencyKey)) + + /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */ + fun idempotencyKey(idempotencyKey: Optional) = + idempotencyKey(idempotencyKey.getOrNull()) + + /** + * Sets [Builder.idempotencyKey] to an arbitrary JSON value. + * + * You should usually call [Builder.idempotencyKey] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun idempotencyKey(idempotencyKey: JsonField) = apply { + this.idempotencyKey = idempotencyKey + } + + /** The ID for the pending transaction representing the transfer. */ + fun pendingTransactionId(pendingTransactionId: String?) = + pendingTransactionId(JsonField.ofNullable(pendingTransactionId)) + + /** + * Alias for calling [Builder.pendingTransactionId] with + * `pendingTransactionId.orElse(null)`. + */ + fun pendingTransactionId(pendingTransactionId: Optional) = + pendingTransactionId(pendingTransactionId.getOrNull()) + + /** + * Sets [Builder.pendingTransactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.pendingTransactionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pendingTransactionId(pendingTransactionId: JsonField) = apply { + this.pendingTransactionId = pendingTransactionId + } + + /** + * If the transfer is rejected by FedNow or the destination financial institution, this will + * contain supplemental details. + */ + fun rejection(rejection: Rejection?) = rejection(JsonField.ofNullable(rejection)) + + /** Alias for calling [Builder.rejection] with `rejection.orElse(null)`. */ + fun rejection(rejection: Optional) = rejection(rejection.getOrNull()) + + /** + * Sets [Builder.rejection] to an arbitrary JSON value. + * + * You should usually call [Builder.rejection] with a well-typed [Rejection] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun rejection(rejection: JsonField) = apply { this.rejection = rejection } + + /** The destination American Bankers' Association (ABA) Routing Transit Number (RTN). */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } + + /** The Account Number the recipient will see as having sent the transfer. */ + fun sourceAccountNumberId(sourceAccountNumberId: String) = + sourceAccountNumberId(JsonField.of(sourceAccountNumberId)) + + /** + * Sets [Builder.sourceAccountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.sourceAccountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sourceAccountNumberId(sourceAccountNumberId: JsonField) = apply { + this.sourceAccountNumberId = sourceAccountNumberId + } + + /** The lifecycle status of the transfer. */ + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + /** After the transfer is submitted to FedNow, this will contain supplemental details. */ + fun submission(submission: Submission?) = submission(JsonField.ofNullable(submission)) + + /** Alias for calling [Builder.submission] with `submission.orElse(null)`. */ + fun submission(submission: Optional) = submission(submission.getOrNull()) + + /** + * Sets [Builder.submission] to an arbitrary JSON value. + * + * You should usually call [Builder.submission] with a well-typed [Submission] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun submission(submission: JsonField) = apply { this.submission = submission } + + /** The Transaction funding the transfer once it is complete. */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_transfer`. + */ + 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 } + + /** + * The Unique End-to-end Transaction Reference + * ([UETR](https://www.swift.com/payments/what-unique-end-end-transaction-reference-uetr)) + * of the transfer. + */ + fun uniqueEndToEndTransactionReference(uniqueEndToEndTransactionReference: String) = + uniqueEndToEndTransactionReference(JsonField.of(uniqueEndToEndTransactionReference)) + + /** + * Sets [Builder.uniqueEndToEndTransactionReference] to an arbitrary JSON value. + * + * You should usually call [Builder.uniqueEndToEndTransactionReference] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun uniqueEndToEndTransactionReference( + uniqueEndToEndTransactionReference: JsonField + ) = apply { this.uniqueEndToEndTransactionReference = uniqueEndToEndTransactionReference } + + /** Unstructured information that will show on the recipient's bank statement. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [FednowTransfer]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumber() + * .acknowledgement() + * .amount() + * .createdAt() + * .createdBy() + * .creditorName() + * .currency() + * .debtorName() + * .externalAccountId() + * .idempotencyKey() + * .pendingTransactionId() + * .rejection() + * .routingNumber() + * .sourceAccountNumberId() + * .status() + * .submission() + * .transactionId() + * .type() + * .uniqueEndToEndTransactionReference() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransfer = + FednowTransfer( + checkRequired("id", id), + checkRequired("accountId", accountId), + checkRequired("accountNumber", accountNumber), + checkRequired("acknowledgement", acknowledgement), + checkRequired("amount", amount), + checkRequired("createdAt", createdAt), + checkRequired("createdBy", createdBy), + checkRequired("creditorName", creditorName), + checkRequired("currency", currency), + checkRequired("debtorName", debtorName), + checkRequired("externalAccountId", externalAccountId), + checkRequired("idempotencyKey", idempotencyKey), + checkRequired("pendingTransactionId", pendingTransactionId), + checkRequired("rejection", rejection), + checkRequired("routingNumber", routingNumber), + checkRequired("sourceAccountNumberId", sourceAccountNumberId), + checkRequired("status", status), + checkRequired("submission", submission), + checkRequired("transactionId", transactionId), + checkRequired("type", type), + checkRequired( + "uniqueEndToEndTransactionReference", + uniqueEndToEndTransactionReference, + ), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): FednowTransfer = apply { + if (validated) { + return@apply + } + + id() + accountId() + accountNumber() + acknowledgement().ifPresent { it.validate() } + amount() + createdAt() + createdBy().ifPresent { it.validate() } + creditorName() + currency().validate() + debtorName() + externalAccountId() + idempotencyKey() + pendingTransactionId() + rejection().ifPresent { it.validate() } + routingNumber() + sourceAccountNumberId() + status().validate() + submission().ifPresent { it.validate() } + transactionId() + type().validate() + uniqueEndToEndTransactionReference() + unstructuredRemittanceInformation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (id.asKnown().isPresent) 1 else 0) + + (if (accountId.asKnown().isPresent) 1 else 0) + + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (acknowledgement.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (createdBy.asKnown().getOrNull()?.validity() ?: 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (externalAccountId.asKnown().isPresent) 1 else 0) + + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + + (rejection.asKnown().getOrNull()?.validity() ?: 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (submission.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (uniqueEndToEndTransactionReference.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + /** + * If the transfer is acknowledged by the recipient bank, this will contain supplemental + * details. + */ + class Acknowledgement + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val acknowledgedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("acknowledged_at") + @ExcludeMissing + acknowledgedAt: JsonField = JsonMissing.of() + ) : this(acknowledgedAt, mutableMapOf()) + + /** + * When the transfer was acknowledged. + * + * @throws IncreaseInvalidDataException 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 acknowledgedAt(): OffsetDateTime = acknowledgedAt.getRequired("acknowledged_at") + + /** + * Returns the raw JSON value of [acknowledgedAt]. + * + * Unlike [acknowledgedAt], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("acknowledged_at") + @ExcludeMissing + fun _acknowledgedAt(): JsonField = acknowledgedAt + + @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 [Acknowledgement]. + * + * The following fields are required: + * ```java + * .acknowledgedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Acknowledgement]. */ + class Builder internal constructor() { + + private var acknowledgedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(acknowledgement: Acknowledgement) = apply { + acknowledgedAt = acknowledgement.acknowledgedAt + additionalProperties = acknowledgement.additionalProperties.toMutableMap() + } + + /** When the transfer was acknowledged. */ + fun acknowledgedAt(acknowledgedAt: OffsetDateTime) = + acknowledgedAt(JsonField.of(acknowledgedAt)) + + /** + * Sets [Builder.acknowledgedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.acknowledgedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun acknowledgedAt(acknowledgedAt: JsonField) = apply { + this.acknowledgedAt = acknowledgedAt + } + + 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 [Acknowledgement]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .acknowledgedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Acknowledgement = + Acknowledgement( + checkRequired("acknowledgedAt", acknowledgedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Acknowledgement = apply { + if (validated) { + return@apply + } + + acknowledgedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (acknowledgedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Acknowledgement && + acknowledgedAt == other.acknowledgedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(acknowledgedAt, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Acknowledgement{acknowledgedAt=$acknowledgedAt, additionalProperties=$additionalProperties}" + } + + /** What object created the transfer, either via the API or the dashboard. */ + class CreatedBy + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val apiKey: JsonField, + private val category: JsonField, + private val oauthApplication: JsonField, + private val user: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("api_key") @ExcludeMissing apiKey: JsonField = JsonMissing.of(), + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("oauth_application") + @ExcludeMissing + oauthApplication: JsonField = JsonMissing.of(), + @JsonProperty("user") @ExcludeMissing user: JsonField = JsonMissing.of(), + ) : this(apiKey, category, oauthApplication, user, mutableMapOf()) + + /** + * If present, details about the API key that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun apiKey(): Optional = apiKey.getOptional("api_key") + + /** + * The type of object that created this transfer. + * + * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") + + /** + * If present, details about the OAuth Application that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun oauthApplication(): Optional = + oauthApplication.getOptional("oauth_application") + + /** + * If present, details about the User that created the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun user(): Optional = user.getOptional("user") + + /** + * Returns the raw JSON value of [apiKey]. + * + * Unlike [apiKey], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("api_key") @ExcludeMissing fun _apiKey(): JsonField = apiKey + + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + + /** + * Returns the raw JSON value of [oauthApplication]. + * + * Unlike [oauthApplication], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("oauth_application") + @ExcludeMissing + fun _oauthApplication(): JsonField = oauthApplication + + /** + * Returns the raw JSON value of [user]. + * + * Unlike [user], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("user") @ExcludeMissing fun _user(): JsonField = user + + @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 [CreatedBy]. + * + * The following fields are required: + * ```java + * .apiKey() + * .category() + * .oauthApplication() + * .user() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreatedBy]. */ + class Builder internal constructor() { + + private var apiKey: JsonField? = null + private var category: JsonField? = null + private var oauthApplication: JsonField? = null + private var user: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(createdBy: CreatedBy) = apply { + apiKey = createdBy.apiKey + category = createdBy.category + oauthApplication = createdBy.oauthApplication + user = createdBy.user + additionalProperties = createdBy.additionalProperties.toMutableMap() + } + + /** If present, details about the API key that created the transfer. */ + fun apiKey(apiKey: ApiKey?) = apiKey(JsonField.ofNullable(apiKey)) + + /** Alias for calling [Builder.apiKey] with `apiKey.orElse(null)`. */ + fun apiKey(apiKey: Optional) = apiKey(apiKey.getOrNull()) + + /** + * Sets [Builder.apiKey] to an arbitrary JSON value. + * + * You should usually call [Builder.apiKey] with a well-typed [ApiKey] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey } + + /** The type of object that created this transfer. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** If present, details about the OAuth Application that created the transfer. */ + fun oauthApplication(oauthApplication: OAuthApplication?) = + oauthApplication(JsonField.ofNullable(oauthApplication)) + + /** + * Alias for calling [Builder.oauthApplication] with `oauthApplication.orElse(null)`. + */ + fun oauthApplication(oauthApplication: Optional) = + oauthApplication(oauthApplication.getOrNull()) + + /** + * Sets [Builder.oauthApplication] to an arbitrary JSON value. + * + * You should usually call [Builder.oauthApplication] with a well-typed + * [OAuthApplication] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun oauthApplication(oauthApplication: JsonField) = apply { + this.oauthApplication = oauthApplication + } + + /** If present, details about the User that created the transfer. */ + fun user(user: User?) = user(JsonField.ofNullable(user)) + + /** Alias for calling [Builder.user] with `user.orElse(null)`. */ + fun user(user: Optional) = user(user.getOrNull()) + + /** + * Sets [Builder.user] to an arbitrary JSON value. + * + * You should usually call [Builder.user] with a well-typed [User] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun user(user: JsonField) = apply { this.user = user } + + 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 [CreatedBy]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .apiKey() + * .category() + * .oauthApplication() + * .user() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreatedBy = + CreatedBy( + checkRequired("apiKey", apiKey), + checkRequired("category", category), + checkRequired("oauthApplication", oauthApplication), + checkRequired("user", user), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreatedBy = apply { + if (validated) { + return@apply + } + + apiKey().ifPresent { it.validate() } + category().validate() + oauthApplication().ifPresent { it.validate() } + user().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (apiKey.asKnown().getOrNull()?.validity() ?: 0) + + (category.asKnown().getOrNull()?.validity() ?: 0) + + (oauthApplication.asKnown().getOrNull()?.validity() ?: 0) + + (user.asKnown().getOrNull()?.validity() ?: 0) + + /** If present, details about the API key that created the transfer. */ + class ApiKey + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val description: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of() + ) : this(description, mutableMapOf()) + + /** + * The description set for the API key when it was created. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun description(): Optional = description.getOptional("description") + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + @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 [ApiKey]. + * + * The following fields are required: + * ```java + * .description() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ApiKey]. */ + class Builder internal constructor() { + + private var description: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(apiKey: ApiKey) = apply { + description = apiKey.description + additionalProperties = apiKey.additionalProperties.toMutableMap() + } + + /** The description set for the API key when it was created. */ + fun description(description: String?) = + description(JsonField.ofNullable(description)) + + /** Alias for calling [Builder.description] with `description.orElse(null)`. */ + fun description(description: Optional) = + description(description.getOrNull()) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + 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 [ApiKey]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .description() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): ApiKey = + ApiKey( + checkRequired("description", description), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): ApiKey = apply { + if (validated) { + return@apply + } + + description() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (description.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ApiKey && + description == other.description && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(description, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ApiKey{description=$description, additionalProperties=$additionalProperties}" + } + + /** The type of object that created this transfer. */ + class Category @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 { + + /** An API key. Details will be under the `api_key` object. */ + @JvmField val API_KEY = of("api_key") + + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + @JvmField val OAUTH_APPLICATION = of("oauth_application") + + /** A User in the Increase dashboard. Details will be under the `user` object. */ + @JvmField val USER = of("user") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] 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 { + /** An API key. Details will be under the `api_key` object. */ + API_KEY, + /** + * An OAuth application you connected to Increase. Details will be under the + * `oauth_application` object. + */ + OAUTH_APPLICATION, + /** A User in the Increase dashboard. Details will be under the `user` object. */ + USER, + /** + * An enum member indicating that [Category] 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) { + API_KEY -> Value.API_KEY + OAUTH_APPLICATION -> Value.OAUTH_APPLICATION + USER -> Value.USER + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + API_KEY -> Known.API_KEY + OAUTH_APPLICATION -> Known.OAUTH_APPLICATION + USER -> Known.USER + else -> throw IncreaseInvalidDataException("Unknown Category: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** If present, details about the OAuth Application that created the transfer. */ + class OAuthApplication + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of() + ) : this(name, mutableMapOf()) + + /** + * The name of the OAuth Application. + * + * @throws IncreaseInvalidDataException 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 name(): String = name.getRequired("name") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @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 [OAuthApplication]. + * + * The following fields are required: + * ```java + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [OAuthApplication]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(oauthApplication: OAuthApplication) = apply { + name = oauthApplication.name + additionalProperties = oauthApplication.additionalProperties.toMutableMap() + } + + /** The name of the OAuth Application. */ + fun name(name: String) = name(JsonField.of(name)) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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 [OAuthApplication]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): OAuthApplication = + OAuthApplication( + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): OAuthApplication = apply { + if (validated) { + return@apply + } + + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (name.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is OAuthApplication && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "OAuthApplication{name=$name, additionalProperties=$additionalProperties}" + } + + /** If present, details about the User that created the transfer. */ + class User + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val email: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("email") @ExcludeMissing email: JsonField = JsonMissing.of() + ) : this(email, mutableMapOf()) + + /** + * The email address of the User. + * + * @throws IncreaseInvalidDataException 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 email(): String = email.getRequired("email") + + /** + * Returns the raw JSON value of [email]. + * + * Unlike [email], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("email") @ExcludeMissing fun _email(): JsonField = email + + @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 [User]. + * + * The following fields are required: + * ```java + * .email() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [User]. */ + class Builder internal constructor() { + + private var email: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(user: User) = apply { + email = user.email + additionalProperties = user.additionalProperties.toMutableMap() + } + + /** The email address of the User. */ + fun email(email: String) = email(JsonField.of(email)) + + /** + * Sets [Builder.email] to an arbitrary JSON value. + * + * You should usually call [Builder.email] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun email(email: JsonField) = apply { this.email = email } + + 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 [User]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .email() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): User = + User(checkRequired("email", email), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): User = apply { + if (validated) { + return@apply + } + + email() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (email.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is User && + email == other.email && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(email, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "User{email=$email, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedBy && + apiKey == other.apiKey && + category == other.category && + oauthApplication == other.oauthApplication && + user == other.user && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(apiKey, category, oauthApplication, user, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * FedNow transfers this is always equal to `USD`. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * If the transfer is rejected by FedNow or the destination financial institution, this will + * contain supplemental details. + */ + class Rejection + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val rejectReasonAdditionalInformation: JsonField, + private val rejectReasonCode: JsonField, + private val rejectedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reject_reason_additional_information") + @ExcludeMissing + rejectReasonAdditionalInformation: JsonField = JsonMissing.of(), + @JsonProperty("reject_reason_code") + @ExcludeMissing + rejectReasonCode: JsonField = JsonMissing.of(), + @JsonProperty("rejected_at") + @ExcludeMissing + rejectedAt: JsonField = JsonMissing.of(), + ) : this(rejectReasonAdditionalInformation, rejectReasonCode, rejectedAt, mutableMapOf()) + + /** + * Additional information about the rejection provided by the recipient bank. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun rejectReasonAdditionalInformation(): Optional = + rejectReasonAdditionalInformation.getOptional("reject_reason_additional_information") + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + * + * @throws IncreaseInvalidDataException 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 rejectReasonCode(): RejectReasonCode = + rejectReasonCode.getRequired("reject_reason_code") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was rejected. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun rejectedAt(): Optional = rejectedAt.getOptional("rejected_at") + + /** + * Returns the raw JSON value of [rejectReasonAdditionalInformation]. + * + * Unlike [rejectReasonAdditionalInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("reject_reason_additional_information") + @ExcludeMissing + fun _rejectReasonAdditionalInformation(): JsonField = + rejectReasonAdditionalInformation + + /** + * Returns the raw JSON value of [rejectReasonCode]. + * + * Unlike [rejectReasonCode], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("reject_reason_code") + @ExcludeMissing + fun _rejectReasonCode(): JsonField = rejectReasonCode + + /** + * Returns the raw JSON value of [rejectedAt]. + * + * Unlike [rejectedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("rejected_at") + @ExcludeMissing + fun _rejectedAt(): JsonField = rejectedAt + + @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 [Rejection]. + * + * The following fields are required: + * ```java + * .rejectReasonAdditionalInformation() + * .rejectReasonCode() + * .rejectedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Rejection]. */ + class Builder internal constructor() { + + private var rejectReasonAdditionalInformation: JsonField? = null + private var rejectReasonCode: JsonField? = null + private var rejectedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(rejection: Rejection) = apply { + rejectReasonAdditionalInformation = rejection.rejectReasonAdditionalInformation + rejectReasonCode = rejection.rejectReasonCode + rejectedAt = rejection.rejectedAt + additionalProperties = rejection.additionalProperties.toMutableMap() + } + + /** Additional information about the rejection provided by the recipient bank. */ + fun rejectReasonAdditionalInformation(rejectReasonAdditionalInformation: String?) = + rejectReasonAdditionalInformation( + JsonField.ofNullable(rejectReasonAdditionalInformation) + ) + + /** + * Alias for calling [Builder.rejectReasonAdditionalInformation] with + * `rejectReasonAdditionalInformation.orElse(null)`. + */ + fun rejectReasonAdditionalInformation( + rejectReasonAdditionalInformation: Optional + ) = rejectReasonAdditionalInformation(rejectReasonAdditionalInformation.getOrNull()) + + /** + * Sets [Builder.rejectReasonAdditionalInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectReasonAdditionalInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun rejectReasonAdditionalInformation( + rejectReasonAdditionalInformation: JsonField + ) = apply { this.rejectReasonAdditionalInformation = rejectReasonAdditionalInformation } + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + */ + fun rejectReasonCode(rejectReasonCode: RejectReasonCode) = + rejectReasonCode(JsonField.of(rejectReasonCode)) + + /** + * Sets [Builder.rejectReasonCode] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectReasonCode] with a well-typed + * [RejectReasonCode] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun rejectReasonCode(rejectReasonCode: JsonField) = apply { + this.rejectReasonCode = rejectReasonCode + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was rejected. + */ + fun rejectedAt(rejectedAt: OffsetDateTime?) = + rejectedAt(JsonField.ofNullable(rejectedAt)) + + /** Alias for calling [Builder.rejectedAt] with `rejectedAt.orElse(null)`. */ + fun rejectedAt(rejectedAt: Optional) = + rejectedAt(rejectedAt.getOrNull()) + + /** + * Sets [Builder.rejectedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.rejectedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun rejectedAt(rejectedAt: JsonField) = apply { + this.rejectedAt = rejectedAt + } + + 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 [Rejection]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .rejectReasonAdditionalInformation() + * .rejectReasonCode() + * .rejectedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Rejection = + Rejection( + checkRequired( + "rejectReasonAdditionalInformation", + rejectReasonAdditionalInformation, + ), + checkRequired("rejectReasonCode", rejectReasonCode), + checkRequired("rejectedAt", rejectedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Rejection = apply { + if (validated) { + return@apply + } + + rejectReasonAdditionalInformation() + rejectReasonCode().validate() + rejectedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (rejectReasonAdditionalInformation.asKnown().isPresent) 1 else 0) + + (rejectReasonCode.asKnown().getOrNull()?.validity() ?: 0) + + (if (rejectedAt.asKnown().isPresent) 1 else 0) + + /** + * The reason the transfer was rejected as provided by the recipient bank or the FedNow + * network. + */ + class RejectReasonCode + @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 { + + /** + * The destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + @JvmField val ACCOUNT_CLOSED = of("account_closed") + + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + @JvmField val ACCOUNT_BLOCKED = of("account_blocked") + + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + @JvmField val INVALID_CREDITOR_ACCOUNT_TYPE = of("invalid_creditor_account_type") + + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + @JvmField + val INVALID_CREDITOR_ACCOUNT_NUMBER = of("invalid_creditor_account_number") + + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + @JvmField + val INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER = + of("invalid_creditor_financial_institution_identifier") + + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + @JvmField val END_CUSTOMER_DECEASED = of("end_customer_deceased") + + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + @JvmField val NARRATIVE = of("narrative") + + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + @JvmField val TRANSACTION_FORBIDDEN = of("transaction_forbidden") + + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + @JvmField val TRANSACTION_TYPE_NOT_SUPPORTED = of("transaction_type_not_supported") + + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + @JvmField val AMOUNT_EXCEEDS_BANK_LIMITS = of("amount_exceeds_bank_limits") + + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + @JvmField val INVALID_CREDITOR_ADDRESS = of("invalid_creditor_address") + + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + @JvmField val INVALID_DEBTOR_ADDRESS = of("invalid_debtor_address") + + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + @JvmField val TIMEOUT = of("timeout") + + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + @JvmField val PROCESSING_ERROR = of("processing_error") + + /** Some other error or issue has occurred. */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = RejectReasonCode(JsonField.of(value)) + } + + /** An enum containing [RejectReasonCode]'s known values. */ + enum class Known { + /** + * The destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + ACCOUNT_CLOSED, + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + ACCOUNT_BLOCKED, + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + INVALID_CREDITOR_ACCOUNT_TYPE, + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + INVALID_CREDITOR_ACCOUNT_NUMBER, + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER, + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + END_CUSTOMER_DECEASED, + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + NARRATIVE, + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + TRANSACTION_FORBIDDEN, + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + TRANSACTION_TYPE_NOT_SUPPORTED, + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + AMOUNT_EXCEEDS_BANK_LIMITS, + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + INVALID_CREDITOR_ADDRESS, + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + INVALID_DEBTOR_ADDRESS, + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + TIMEOUT, + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + PROCESSING_ERROR, + /** Some other error or issue has occurred. */ + OTHER, + } + + /** + * An enum containing [RejectReasonCode]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [RejectReasonCode] 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 { + /** + * The destination account is closed. Corresponds to the FedNow reason code `AC04`. + */ + ACCOUNT_CLOSED, + /** + * The destination account is currently blocked from receiving transactions. + * Corresponds to the FedNow reason code `AC06`. + */ + ACCOUNT_BLOCKED, + /** + * The destination account is ineligible to receive FedNow transfers. Corresponds to + * the FedNow reason code `AC14`. + */ + INVALID_CREDITOR_ACCOUNT_TYPE, + /** + * The destination account does not exist. Corresponds to the FedNow reason code + * `AC03`. + */ + INVALID_CREDITOR_ACCOUNT_NUMBER, + /** + * The destination routing number is invalid. Corresponds to the FedNow reason code + * `RC04`. + */ + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER, + /** + * The destination account holder is deceased. Corresponds to the FedNow reason code + * `MD07`. + */ + END_CUSTOMER_DECEASED, + /** + * The reason is provided as narrative information in the additional information + * field. Corresponds to the FedNow reason code `NARR`. + */ + NARRATIVE, + /** + * FedNow transfers are not allowed to the destination account. Corresponds to the + * FedNow reason code `AG01`. + */ + TRANSACTION_FORBIDDEN, + /** + * FedNow transfers are not enabled for the destination account. Corresponds to the + * FedNow reason code `AG03`. + */ + TRANSACTION_TYPE_NOT_SUPPORTED, + /** + * The amount is higher than the recipient is authorized to send or receive. + * Corresponds to the FedNow reason code `E990`. + */ + AMOUNT_EXCEEDS_BANK_LIMITS, + /** + * The creditor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE04`. + */ + INVALID_CREDITOR_ADDRESS, + /** + * The debtor's address is required, but missing or invalid. Corresponds to the + * FedNow reason code `BE07`. + */ + INVALID_DEBTOR_ADDRESS, + /** + * There was a timeout processing the transfer. Corresponds to the FedNow reason + * code `E997`. + */ + TIMEOUT, + /** + * The transfer was rejected due to an internal Increase issue. We have been + * notified. + */ + PROCESSING_ERROR, + /** Some other error or issue has occurred. */ + OTHER, + /** + * An enum member indicating that [RejectReasonCode] 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_CLOSED -> Value.ACCOUNT_CLOSED + ACCOUNT_BLOCKED -> Value.ACCOUNT_BLOCKED + INVALID_CREDITOR_ACCOUNT_TYPE -> Value.INVALID_CREDITOR_ACCOUNT_TYPE + INVALID_CREDITOR_ACCOUNT_NUMBER -> Value.INVALID_CREDITOR_ACCOUNT_NUMBER + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER -> + Value.INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER + END_CUSTOMER_DECEASED -> Value.END_CUSTOMER_DECEASED + NARRATIVE -> Value.NARRATIVE + TRANSACTION_FORBIDDEN -> Value.TRANSACTION_FORBIDDEN + TRANSACTION_TYPE_NOT_SUPPORTED -> Value.TRANSACTION_TYPE_NOT_SUPPORTED + AMOUNT_EXCEEDS_BANK_LIMITS -> Value.AMOUNT_EXCEEDS_BANK_LIMITS + INVALID_CREDITOR_ADDRESS -> Value.INVALID_CREDITOR_ADDRESS + INVALID_DEBTOR_ADDRESS -> Value.INVALID_DEBTOR_ADDRESS + TIMEOUT -> Value.TIMEOUT + PROCESSING_ERROR -> Value.PROCESSING_ERROR + OTHER -> Value.OTHER + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ACCOUNT_CLOSED -> Known.ACCOUNT_CLOSED + ACCOUNT_BLOCKED -> Known.ACCOUNT_BLOCKED + INVALID_CREDITOR_ACCOUNT_TYPE -> Known.INVALID_CREDITOR_ACCOUNT_TYPE + INVALID_CREDITOR_ACCOUNT_NUMBER -> Known.INVALID_CREDITOR_ACCOUNT_NUMBER + INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER -> + Known.INVALID_CREDITOR_FINANCIAL_INSTITUTION_IDENTIFIER + END_CUSTOMER_DECEASED -> Known.END_CUSTOMER_DECEASED + NARRATIVE -> Known.NARRATIVE + TRANSACTION_FORBIDDEN -> Known.TRANSACTION_FORBIDDEN + TRANSACTION_TYPE_NOT_SUPPORTED -> Known.TRANSACTION_TYPE_NOT_SUPPORTED + AMOUNT_EXCEEDS_BANK_LIMITS -> Known.AMOUNT_EXCEEDS_BANK_LIMITS + INVALID_CREDITOR_ADDRESS -> Known.INVALID_CREDITOR_ADDRESS + INVALID_DEBTOR_ADDRESS -> Known.INVALID_DEBTOR_ADDRESS + TIMEOUT -> Known.TIMEOUT + PROCESSING_ERROR -> Known.PROCESSING_ERROR + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown RejectReasonCode: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RejectReasonCode = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 RejectReasonCode && 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 Rejection && + rejectReasonAdditionalInformation == other.rejectReasonAdditionalInformation && + rejectReasonCode == other.rejectReasonCode && + rejectedAt == other.rejectedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + rejectReasonAdditionalInformation, + rejectReasonCode, + rejectedAt, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Rejection{rejectReasonAdditionalInformation=$rejectReasonAdditionalInformation, rejectReasonCode=$rejectReasonCode, rejectedAt=$rejectedAt, additionalProperties=$additionalProperties}" + } + + /** The lifecycle status of the transfer. */ + class Status @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 { + + /** The transfer is pending review by Increase. */ + @JvmField val PENDING_REVIEWING = of("pending_reviewing") + + /** The transfer has been canceled. */ + @JvmField val CANCELED = of("canceled") + + /** The transfer has been rejected by Increase. */ + @JvmField val REVIEWING_REJECTED = of("reviewing_rejected") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + /** The transfer is pending approval. */ + @JvmField val PENDING_APPROVAL = of("pending_approval") + + /** The transfer is queued to be submitted to FedNow. */ + @JvmField val PENDING_SUBMITTING = of("pending_submitting") + + /** The transfer has been submitted and is pending a response from FedNow. */ + @JvmField val PENDING_RESPONSE = of("pending_response") + + /** The transfer has been sent successfully and is complete. */ + @JvmField val COMPLETE = of("complete") + + /** The transfer was rejected by the network or the recipient's bank. */ + @JvmField val REJECTED = of("rejected") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] 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 { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + /** An enum member indicating that [Status] 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) { + PENDING_REVIEWING -> Value.PENDING_REVIEWING + CANCELED -> Value.CANCELED + REVIEWING_REJECTED -> Value.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + PENDING_APPROVAL -> Value.PENDING_APPROVAL + PENDING_SUBMITTING -> Value.PENDING_SUBMITTING + PENDING_RESPONSE -> Value.PENDING_RESPONSE + COMPLETE -> Value.COMPLETE + REJECTED -> Value.REJECTED + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + PENDING_REVIEWING -> Known.PENDING_REVIEWING + CANCELED -> Known.CANCELED + REVIEWING_REJECTED -> Known.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + PENDING_APPROVAL -> Known.PENDING_APPROVAL + PENDING_SUBMITTING -> Known.PENDING_SUBMITTING + PENDING_RESPONSE -> Known.PENDING_RESPONSE + COMPLETE -> Known.COMPLETE + REJECTED -> Known.REJECTED + else -> throw IncreaseInvalidDataException("Unknown Status: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** After the transfer is submitted to FedNow, this will contain supplemental details. */ + class Submission + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val messageIdentification: JsonField, + private val submittedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("message_identification") + @ExcludeMissing + messageIdentification: JsonField = JsonMissing.of(), + @JsonProperty("submitted_at") + @ExcludeMissing + submittedAt: JsonField = JsonMissing.of(), + ) : this(messageIdentification, submittedAt, mutableMapOf()) + + /** + * The FedNow network identification of the message submitted. + * + * @throws IncreaseInvalidDataException 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 messageIdentification(): String = + messageIdentification.getRequired("message_identification") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was submitted to FedNow. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun submittedAt(): Optional = submittedAt.getOptional("submitted_at") + + /** + * Returns the raw JSON value of [messageIdentification]. + * + * Unlike [messageIdentification], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("message_identification") + @ExcludeMissing + fun _messageIdentification(): JsonField = messageIdentification + + /** + * Returns the raw JSON value of [submittedAt]. + * + * Unlike [submittedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("submitted_at") + @ExcludeMissing + fun _submittedAt(): JsonField = submittedAt + + @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 [Submission]. + * + * The following fields are required: + * ```java + * .messageIdentification() + * .submittedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Submission]. */ + class Builder internal constructor() { + + private var messageIdentification: JsonField? = null + private var submittedAt: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(submission: Submission) = apply { + messageIdentification = submission.messageIdentification + submittedAt = submission.submittedAt + additionalProperties = submission.additionalProperties.toMutableMap() + } + + /** The FedNow network identification of the message submitted. */ + fun messageIdentification(messageIdentification: String) = + messageIdentification(JsonField.of(messageIdentification)) + + /** + * Sets [Builder.messageIdentification] to an arbitrary JSON value. + * + * You should usually call [Builder.messageIdentification] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun messageIdentification(messageIdentification: JsonField) = apply { + this.messageIdentification = messageIdentification + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was submitted to FedNow. + */ + fun submittedAt(submittedAt: OffsetDateTime?) = + submittedAt(JsonField.ofNullable(submittedAt)) + + /** Alias for calling [Builder.submittedAt] with `submittedAt.orElse(null)`. */ + fun submittedAt(submittedAt: Optional) = + submittedAt(submittedAt.getOrNull()) + + /** + * Sets [Builder.submittedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.submittedAt] with a well-typed [OffsetDateTime] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun submittedAt(submittedAt: JsonField) = apply { + this.submittedAt = submittedAt + } + + 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 [Submission]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .messageIdentification() + * .submittedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Submission = + Submission( + checkRequired("messageIdentification", messageIdentification), + checkRequired("submittedAt", submittedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Submission = apply { + if (validated) { + return@apply + } + + messageIdentification() + submittedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (messageIdentification.asKnown().isPresent) 1 else 0) + + (if (submittedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Submission && + messageIdentification == other.messageIdentification && + submittedAt == other.submittedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(messageIdentification, submittedAt, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Submission{messageIdentification=$messageIdentification, submittedAt=$submittedAt, additionalProperties=$additionalProperties}" + } + + /** + * A constant representing the object's type. For this resource it will always be + * `fednow_transfer`. + */ + 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 FEDNOW_TRANSFER = of("fednow_transfer") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + FEDNOW_TRANSFER + } + + /** + * 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 { + FEDNOW_TRANSFER, + /** 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) { + FEDNOW_TRANSFER -> Value.FEDNOW_TRANSFER + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + FEDNOW_TRANSFER -> Known.FEDNOW_TRANSFER + else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("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: IncreaseInvalidDataException) { + 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 FednowTransfer && + id == other.id && + accountId == other.accountId && + accountNumber == other.accountNumber && + acknowledgement == other.acknowledgement && + amount == other.amount && + createdAt == other.createdAt && + createdBy == other.createdBy && + creditorName == other.creditorName && + currency == other.currency && + debtorName == other.debtorName && + externalAccountId == other.externalAccountId && + idempotencyKey == other.idempotencyKey && + pendingTransactionId == other.pendingTransactionId && + rejection == other.rejection && + routingNumber == other.routingNumber && + sourceAccountNumberId == other.sourceAccountNumberId && + status == other.status && + submission == other.submission && + transactionId == other.transactionId && + type == other.type && + uniqueEndToEndTransactionReference == other.uniqueEndToEndTransactionReference && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + accountId, + accountNumber, + acknowledgement, + amount, + createdAt, + createdBy, + creditorName, + currency, + debtorName, + externalAccountId, + idempotencyKey, + pendingTransactionId, + rejection, + routingNumber, + sourceAccountNumberId, + status, + submission, + transactionId, + type, + uniqueEndToEndTransactionReference, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FednowTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, acknowledgement=$acknowledgement, amount=$amount, createdAt=$createdAt, createdBy=$createdBy, creditorName=$creditorName, currency=$currency, debtorName=$debtorName, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, pendingTransactionId=$pendingTransactionId, rejection=$rejection, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, uniqueEndToEndTransactionReference=$uniqueEndToEndTransactionReference, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt new file mode 100644 index 000000000..f1fbb4299 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParams.kt @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Approve a FedNow Transfer */ +class FednowTransferApproveParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + /** The identifier of the FedNow Transfer to approve. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferApproveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferApproveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferApproveParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferApproveParams: FednowTransferApproveParams) = apply { + fednowTransferId = fednowTransferApproveParams.fednowTransferId + additionalHeaders = fednowTransferApproveParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferApproveParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + fednowTransferApproveParams.additionalBodyProperties.toMutableMap() + } + + /** The identifier of the FedNow Transfer to approve. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [FednowTransferApproveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferApproveParams = + FednowTransferApproveParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferApproveParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash( + fednowTransferId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) + + override fun toString() = + "FednowTransferApproveParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt new file mode 100644 index 000000000..bbcbb6f04 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParams.kt @@ -0,0 +1,242 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Cancel a pending FedNow Transfer */ +class FednowTransferCancelParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, + private val additionalBodyProperties: Map, +) : Params { + + /** The identifier of the pending FedNow Transfer to cancel. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional body properties to send with the request. */ + fun _additionalBodyProperties(): Map = additionalBodyProperties + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferCancelParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferCancelParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferCancelParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferCancelParams: FednowTransferCancelParams) = apply { + fednowTransferId = fednowTransferCancelParams.fednowTransferId + additionalHeaders = fednowTransferCancelParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferCancelParams.additionalQueryParams.toBuilder() + additionalBodyProperties = + fednowTransferCancelParams.additionalBodyProperties.toMutableMap() + } + + /** The identifier of the pending FedNow Transfer to cancel. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + putAllAdditionalBodyProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { + additionalBodyProperties.remove(key) + } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalBodyProperty) + } + + /** + * Returns an immutable instance of [FednowTransferCancelParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferCancelParams = + FednowTransferCancelParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + additionalBodyProperties.toImmutable(), + ) + } + + fun _body(): Optional> = + Optional.ofNullable(additionalBodyProperties.ifEmpty { null }) + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferCancelParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams && + additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int = + Objects.hash( + fednowTransferId, + additionalHeaders, + additionalQueryParams, + additionalBodyProperties, + ) + + override fun toString() = + "FednowTransferCancelParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt new file mode 100644 index 000000000..5448ef511 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParams.kt @@ -0,0 +1,1838 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.checkRequired +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Create a FedNow Transfer */ +class FednowTransferCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The identifier for the account that will send the transfer. + * + * @throws IncreaseInvalidDataException 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 accountId(): String = body.accountId() + + /** + * The amount, in minor units, to send to the creditor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = body.amount() + + /** + * The creditor's name. + * + * @throws IncreaseInvalidDataException 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 creditorName(): String = body.creditorName() + + /** + * The debtor's name. + * + * @throws IncreaseInvalidDataException 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 debtorName(): String = body.debtorName() + + /** + * The Account Number to include in the transfer as the debtor's account number. + * + * @throws IncreaseInvalidDataException 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 sourceAccountNumberId(): String = body.sourceAccountNumberId() + + /** + * Unstructured remittance information to include in the transfer. + * + * @throws IncreaseInvalidDataException 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 unstructuredRemittanceInformation(): String = body.unstructuredRemittanceInformation() + + /** + * The creditor's account number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun accountNumber(): Optional = body.accountNumber() + + /** + * The creditor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditorAddress(): Optional = body.creditorAddress() + + /** + * The debtor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorAddress(): Optional = body.debtorAddress() + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun externalAccountId(): Optional = body.externalAccountId() + + /** + * Whether the transfer requires explicit approval via the dashboard or API. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun requireApproval(): Optional = body.requireApproval() + + /** + * The creditor's bank account routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun routingNumber(): Optional = body.routingNumber() + + /** + * Returns the raw JSON value of [accountId]. + * + * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountId(): JsonField = body._accountId() + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + + /** + * Returns the raw JSON value of [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _creditorName(): JsonField = body._creditorName() + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorName(): JsonField = body._debtorName() + + /** + * Returns the raw JSON value of [sourceAccountNumberId]. + * + * Unlike [sourceAccountNumberId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _sourceAccountNumberId(): JsonField = body._sourceAccountNumberId() + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + fun _unstructuredRemittanceInformation(): JsonField = + body._unstructuredRemittanceInformation() + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountNumber(): JsonField = body._accountNumber() + + /** + * Returns the raw JSON value of [creditorAddress]. + * + * Unlike [creditorAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _creditorAddress(): JsonField = body._creditorAddress() + + /** + * Returns the raw JSON value of [debtorAddress]. + * + * Unlike [debtorAddress], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorAddress(): JsonField = body._debtorAddress() + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _externalAccountId(): JsonField = body._externalAccountId() + + /** + * Returns the raw JSON value of [requireApproval]. + * + * Unlike [requireApproval], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _requireApproval(): JsonField = body._requireApproval() + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _routingNumber(): JsonField = body._routingNumber() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferCreateParams]. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferCreateParams: FednowTransferCreateParams) = apply { + body = fednowTransferCreateParams.body.toBuilder() + additionalHeaders = fednowTransferCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [accountId] + * - [amount] + * - [creditorName] + * - [debtorName] + * - [sourceAccountNumberId] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The identifier for the account that will send the transfer. */ + fun accountId(accountId: String) = apply { body.accountId(accountId) } + + /** + * Sets [Builder.accountId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountId(accountId: JsonField) = apply { body.accountId(accountId) } + + /** The amount, in minor units, to send to the creditor. */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + + /** The creditor's name. */ + fun creditorName(creditorName: String) = apply { body.creditorName(creditorName) } + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + body.creditorName(creditorName) + } + + /** The debtor's name. */ + fun debtorName(debtorName: String) = apply { body.debtorName(debtorName) } + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { body.debtorName(debtorName) } + + /** The Account Number to include in the transfer as the debtor's account number. */ + fun sourceAccountNumberId(sourceAccountNumberId: String) = apply { + body.sourceAccountNumberId(sourceAccountNumberId) + } + + /** + * Sets [Builder.sourceAccountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.sourceAccountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun sourceAccountNumberId(sourceAccountNumberId: JsonField) = apply { + body.sourceAccountNumberId(sourceAccountNumberId) + } + + /** Unstructured remittance information to include in the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = apply { + body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) + } + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) } + + /** The creditor's account number. */ + fun accountNumber(accountNumber: String) = apply { body.accountNumber(accountNumber) } + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + body.accountNumber(accountNumber) + } + + /** The creditor's address. */ + fun creditorAddress(creditorAddress: CreditorAddress) = apply { + body.creditorAddress(creditorAddress) + } + + /** + * Sets [Builder.creditorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorAddress] with a well-typed [CreditorAddress] + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun creditorAddress(creditorAddress: JsonField) = apply { + body.creditorAddress(creditorAddress) + } + + /** The debtor's address. */ + fun debtorAddress(debtorAddress: DebtorAddress) = apply { + body.debtorAddress(debtorAddress) + } + + /** + * Sets [Builder.debtorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAddress] with a well-typed [DebtorAddress] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAddress(debtorAddress: JsonField) = apply { + body.debtorAddress(debtorAddress) + } + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + */ + fun externalAccountId(externalAccountId: String) = apply { + body.externalAccountId(externalAccountId) + } + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + body.externalAccountId(externalAccountId) + } + + /** Whether the transfer requires explicit approval via the dashboard or API. */ + fun requireApproval(requireApproval: Boolean) = apply { + body.requireApproval(requireApproval) + } + + /** + * Sets [Builder.requireApproval] to an arbitrary JSON value. + * + * You should usually call [Builder.requireApproval] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun requireApproval(requireApproval: JsonField) = apply { + body.requireApproval(requireApproval) + } + + /** The creditor's bank account routing number. */ + fun routingNumber(routingNumber: String) = apply { body.routingNumber(routingNumber) } + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + body.routingNumber(routingNumber) + } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferCreateParams = + FednowTransferCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val accountId: JsonField, + private val amount: JsonField, + private val creditorName: JsonField, + private val debtorName: JsonField, + private val sourceAccountNumberId: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val accountNumber: JsonField, + private val creditorAddress: JsonField, + private val debtorAddress: JsonField, + private val externalAccountId: JsonField, + private val requireApproval: JsonField, + private val routingNumber: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("account_id") + @ExcludeMissing + accountId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("source_account_number_id") + @ExcludeMissing + sourceAccountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + @JsonProperty("account_number") + @ExcludeMissing + accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("creditor_address") + @ExcludeMissing + creditorAddress: JsonField = JsonMissing.of(), + @JsonProperty("debtor_address") + @ExcludeMissing + debtorAddress: JsonField = JsonMissing.of(), + @JsonProperty("external_account_id") + @ExcludeMissing + externalAccountId: JsonField = JsonMissing.of(), + @JsonProperty("require_approval") + @ExcludeMissing + requireApproval: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") + @ExcludeMissing + routingNumber: JsonField = JsonMissing.of(), + ) : this( + accountId, + amount, + creditorName, + debtorName, + sourceAccountNumberId, + unstructuredRemittanceInformation, + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + mutableMapOf(), + ) + + /** + * The identifier for the account that will send the transfer. + * + * @throws IncreaseInvalidDataException 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 accountId(): String = accountId.getRequired("account_id") + + /** + * The amount, in minor units, to send to the creditor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The creditor's name. + * + * @throws IncreaseInvalidDataException 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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The debtor's name. + * + * @throws IncreaseInvalidDataException 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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The Account Number to include in the transfer as the debtor's account number. + * + * @throws IncreaseInvalidDataException 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 sourceAccountNumberId(): String = + sourceAccountNumberId.getRequired("source_account_number_id") + + /** + * Unstructured remittance information to include in the transfer. + * + * @throws IncreaseInvalidDataException 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 unstructuredRemittanceInformation(): String = + unstructuredRemittanceInformation.getRequired("unstructured_remittance_information") + + /** + * The creditor's account number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun accountNumber(): Optional = accountNumber.getOptional("account_number") + + /** + * The creditor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun creditorAddress(): Optional = + creditorAddress.getOptional("creditor_address") + + /** + * The debtor's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorAddress(): Optional = debtorAddress.getOptional("debtor_address") + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is provided, + * `account_number` and `routing_number` must be absent. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun externalAccountId(): Optional = + externalAccountId.getOptional("external_account_id") + + /** + * Whether the transfer requires explicit approval via the dashboard or API. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun requireApproval(): Optional = requireApproval.getOptional("require_approval") + + /** + * The creditor's bank account routing number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun routingNumber(): Optional = routingNumber.getOptional("routing_number") + + /** + * Returns the raw JSON value of [accountId]. + * + * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") + @ExcludeMissing + fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [sourceAccountNumberId]. + * + * Unlike [sourceAccountNumberId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("source_account_number_id") + @ExcludeMissing + fun _sourceAccountNumberId(): JsonField = sourceAccountNumberId + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = + unstructuredRemittanceInformation + + /** + * Returns the raw JSON value of [accountNumber]. + * + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("account_number") + @ExcludeMissing + fun _accountNumber(): JsonField = accountNumber + + /** + * Returns the raw JSON value of [creditorAddress]. + * + * Unlike [creditorAddress], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("creditor_address") + @ExcludeMissing + fun _creditorAddress(): JsonField = creditorAddress + + /** + * Returns the raw JSON value of [debtorAddress]. + * + * Unlike [debtorAddress], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_address") + @ExcludeMissing + fun _debtorAddress(): JsonField = debtorAddress + + /** + * Returns the raw JSON value of [externalAccountId]. + * + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("external_account_id") + @ExcludeMissing + fun _externalAccountId(): JsonField = externalAccountId + + /** + * Returns the raw JSON value of [requireApproval]. + * + * Unlike [requireApproval], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("require_approval") + @ExcludeMissing + fun _requireApproval(): JsonField = requireApproval + + /** + * Returns the raw JSON value of [routingNumber]. + * + * Unlike [routingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("routing_number") + @ExcludeMissing + fun _routingNumber(): JsonField = routingNumber + + @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 [Body]. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var accountId: JsonField? = null + private var amount: JsonField? = null + private var creditorName: JsonField? = null + private var debtorName: JsonField? = null + private var sourceAccountNumberId: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var accountNumber: JsonField = JsonMissing.of() + private var creditorAddress: JsonField = JsonMissing.of() + private var debtorAddress: JsonField = JsonMissing.of() + private var externalAccountId: JsonField = JsonMissing.of() + private var requireApproval: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + accountId = body.accountId + amount = body.amount + creditorName = body.creditorName + debtorName = body.debtorName + sourceAccountNumberId = body.sourceAccountNumberId + unstructuredRemittanceInformation = body.unstructuredRemittanceInformation + accountNumber = body.accountNumber + creditorAddress = body.creditorAddress + debtorAddress = body.debtorAddress + externalAccountId = body.externalAccountId + requireApproval = body.requireApproval + routingNumber = body.routingNumber + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The identifier for the account that will send the transfer. */ + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) + + /** + * Sets [Builder.accountId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } + + /** The amount, in minor units, to send to the creditor. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The creditor's name. */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** The debtor's name. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The Account Number to include in the transfer as the debtor's account number. */ + fun sourceAccountNumberId(sourceAccountNumberId: String) = + sourceAccountNumberId(JsonField.of(sourceAccountNumberId)) + + /** + * Sets [Builder.sourceAccountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.sourceAccountNumberId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun sourceAccountNumberId(sourceAccountNumberId: JsonField) = apply { + this.sourceAccountNumberId = sourceAccountNumberId + } + + /** Unstructured remittance information to include in the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + /** The creditor's account number. */ + fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) + + /** + * Sets [Builder.accountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumber(accountNumber: JsonField) = apply { + this.accountNumber = accountNumber + } + + /** The creditor's address. */ + fun creditorAddress(creditorAddress: CreditorAddress) = + creditorAddress(JsonField.of(creditorAddress)) + + /** + * Sets [Builder.creditorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorAddress] with a well-typed [CreditorAddress] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun creditorAddress(creditorAddress: JsonField) = apply { + this.creditorAddress = creditorAddress + } + + /** The debtor's address. */ + fun debtorAddress(debtorAddress: DebtorAddress) = + debtorAddress(JsonField.of(debtorAddress)) + + /** + * Sets [Builder.debtorAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAddress] with a well-typed [DebtorAddress] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorAddress(debtorAddress: JsonField) = apply { + this.debtorAddress = debtorAddress + } + + /** + * The ID of an External Account to initiate a transfer to. If this parameter is + * provided, `account_number` and `routing_number` must be absent. + */ + fun externalAccountId(externalAccountId: String) = + externalAccountId(JsonField.of(externalAccountId)) + + /** + * Sets [Builder.externalAccountId] to an arbitrary JSON value. + * + * You should usually call [Builder.externalAccountId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun externalAccountId(externalAccountId: JsonField) = apply { + this.externalAccountId = externalAccountId + } + + /** Whether the transfer requires explicit approval via the dashboard or API. */ + fun requireApproval(requireApproval: Boolean) = + requireApproval(JsonField.of(requireApproval)) + + /** + * Sets [Builder.requireApproval] to an arbitrary JSON value. + * + * You should usually call [Builder.requireApproval] with a well-typed [Boolean] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun requireApproval(requireApproval: JsonField) = apply { + this.requireApproval = requireApproval + } + + /** The creditor's bank account routing number. */ + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + + /** + * Sets [Builder.routingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.routingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountId() + * .amount() + * .creditorName() + * .debtorName() + * .sourceAccountNumberId() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("accountId", accountId), + checkRequired("amount", amount), + checkRequired("creditorName", creditorName), + checkRequired("debtorName", debtorName), + checkRequired("sourceAccountNumberId", sourceAccountNumberId), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + accountId() + amount() + creditorName() + debtorName() + sourceAccountNumberId() + unstructuredRemittanceInformation() + accountNumber() + creditorAddress().ifPresent { it.validate() } + debtorAddress().ifPresent { it.validate() } + externalAccountId() + requireApproval() + routingNumber() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (accountId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + (if (accountNumber.asKnown().isPresent) 1 else 0) + + (creditorAddress.asKnown().getOrNull()?.validity() ?: 0) + + (debtorAddress.asKnown().getOrNull()?.validity() ?: 0) + + (if (externalAccountId.asKnown().isPresent) 1 else 0) + + (if (requireApproval.asKnown().isPresent) 1 else 0) + + (if (routingNumber.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + accountId == other.accountId && + amount == other.amount && + creditorName == other.creditorName && + debtorName == other.debtorName && + sourceAccountNumberId == other.sourceAccountNumberId && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + accountNumber == other.accountNumber && + creditorAddress == other.creditorAddress && + debtorAddress == other.debtorAddress && + externalAccountId == other.externalAccountId && + requireApproval == other.requireApproval && + routingNumber == other.routingNumber && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountId, + amount, + creditorName, + debtorName, + sourceAccountNumberId, + unstructuredRemittanceInformation, + accountNumber, + creditorAddress, + debtorAddress, + externalAccountId, + requireApproval, + routingNumber, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{accountId=$accountId, amount=$amount, creditorName=$creditorName, debtorName=$debtorName, sourceAccountNumberId=$sourceAccountNumberId, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, accountNumber=$accountNumber, creditorAddress=$creditorAddress, debtorAddress=$debtorAddress, externalAccountId=$externalAccountId, requireApproval=$requireApproval, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" + } + + /** The creditor's address. */ + class CreditorAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val postalCode: JsonField, + private val state: JsonField, + private val line1: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + ) : this(city, postalCode, state, line1, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @throws IncreaseInvalidDataException 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 city(): String = city.getRequired("city") + + /** + * The postal code component of the address. + * + * @throws IncreaseInvalidDataException 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 postalCode(): String = postalCode.getRequired("postal_code") + + /** + * The US state component of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun state(): String = state.getRequired("state") + + /** + * The first line of the address. This is usually the street number and street. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + /** + * 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 [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + @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 [CreditorAddress]. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditorAddress]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var postalCode: JsonField? = null + private var state: JsonField? = null + private var line1: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(creditorAddress: CreditorAddress) = apply { + city = creditorAddress.city + postalCode = creditorAddress.postalCode + state = creditorAddress.state + line1 = creditorAddress.line1 + additionalProperties = creditorAddress.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String) = city(JsonField.of(city)) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The postal code component of the address. */ + fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } + + /** The US state component of the address. */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The first line of the address. This is usually the street number and street. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + 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 [CreditorAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditorAddress = + CreditorAddress( + checkRequired("city", city), + checkRequired("postalCode", postalCode), + checkRequired("state", state), + line1, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditorAddress = apply { + if (validated) { + return@apply + } + + city() + postalCode() + state() + line1() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (city.asKnown().isPresent) 1 else 0) + + (if (postalCode.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditorAddress && + city == other.city && + postalCode == other.postalCode && + state == other.state && + line1 == other.line1 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, postalCode, state, line1, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditorAddress{city=$city, postalCode=$postalCode, state=$state, line1=$line1, additionalProperties=$additionalProperties}" + } + + /** The debtor's address. */ + class DebtorAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val city: JsonField, + private val postalCode: JsonField, + private val state: JsonField, + private val line1: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("city") @ExcludeMissing city: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(), + @JsonProperty("line1") @ExcludeMissing line1: JsonField = JsonMissing.of(), + ) : this(city, postalCode, state, line1, mutableMapOf()) + + /** + * The city, district, town, or village of the address. + * + * @throws IncreaseInvalidDataException 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 city(): String = city.getRequired("city") + + /** + * The postal code component of the address. + * + * @throws IncreaseInvalidDataException 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 postalCode(): String = postalCode.getRequired("postal_code") + + /** + * The US state component of the address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun state(): String = state.getRequired("state") + + /** + * The first line of the address. This is usually the street number and street. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * Returns the raw JSON value of [city]. + * + * Unlike [city], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("city") @ExcludeMissing fun _city(): JsonField = city + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + /** + * 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 [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + @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 [DebtorAddress]. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DebtorAddress]. */ + class Builder internal constructor() { + + private var city: JsonField? = null + private var postalCode: JsonField? = null + private var state: JsonField? = null + private var line1: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtorAddress: DebtorAddress) = apply { + city = debtorAddress.city + postalCode = debtorAddress.postalCode + state = debtorAddress.state + line1 = debtorAddress.line1 + additionalProperties = debtorAddress.additionalProperties.toMutableMap() + } + + /** The city, district, town, or village of the address. */ + fun city(city: String) = city(JsonField.of(city)) + + /** + * Sets [Builder.city] to an arbitrary JSON value. + * + * You should usually call [Builder.city] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun city(city: JsonField) = apply { this.city = city } + + /** The postal code component of the address. */ + fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } + + /** The US state component of the address. */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The first line of the address. This is usually the street number and street. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + 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 [DebtorAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .city() + * .postalCode() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DebtorAddress = + DebtorAddress( + checkRequired("city", city), + checkRequired("postalCode", postalCode), + checkRequired("state", state), + line1, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DebtorAddress = apply { + if (validated) { + return@apply + } + + city() + postalCode() + state() + line1() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (city.asKnown().isPresent) 1 else 0) + + (if (postalCode.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (line1.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DebtorAddress && + city == other.city && + postalCode == other.postalCode && + state == other.state && + line1 == other.line1 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(city, postalCode, state, line1, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DebtorAddress{city=$city, postalCode=$postalCode, state=$state, line1=$line1, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "FednowTransferCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt new file mode 100644 index 000000000..d0e10bbdb --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPage.kt @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.FednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferService.list */ +class FednowTransferListPage +private constructor( + private val service: FednowTransferService, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): FednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: FednowTransferService? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPage: FednowTransferListPage) = apply { + service = fednowTransferListPage.service + params = fednowTransferListPage.params + response = fednowTransferListPage.response + } + + fun service(service: FednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPage = + FednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "FednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt new file mode 100644 index 000000000..c8812f290 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageAsync.kt @@ -0,0 +1,148 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.FednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see FednowTransferServiceAsync.list */ +class FednowTransferListPageAsync +private constructor( + private val service: FednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: FednowTransferListParams, + private val response: FednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [FednowTransferListPageResponse], but gracefully handles missing data. + * + * @see FednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): FednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): FednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): FednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: FednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: FednowTransferListParams? = null + private var response: FednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(fednowTransferListPageAsync: FednowTransferListPageAsync) = apply { + service = fednowTransferListPageAsync.service + streamHandlerExecutor = fednowTransferListPageAsync.streamHandlerExecutor + params = fednowTransferListPageAsync.params + response = fednowTransferListPageAsync.response + } + + fun service(service: FednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: FednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: FednowTransferListPageResponse) = apply { this.response = response } + + /** + * Returns an immutable instance of [FednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPageAsync = + FednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "FednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt new file mode 100644 index 000000000..42b40ec21 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponse.kt @@ -0,0 +1,241 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +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.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown +import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A list of FedNow Transfer objects. */ +class FednowTransferListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val nextCursor: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("next_cursor") + @ExcludeMissing + nextCursor: JsonField = JsonMissing.of(), + ) : this(data, nextCursor, mutableMapOf()) + + /** + * The contents of the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * A pointer to a place in the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [nextCursor]. + * + * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + + @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 + * [FednowTransferListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(fednowTransferListPageResponse: FednowTransferListPageResponse) = apply { + data = fednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = fednowTransferListPageResponse.nextCursor + additionalProperties = + fednowTransferListPageResponse.additionalProperties.toMutableMap() + } + + /** The contents of the list. */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [FednowTransfer] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: FednowTransfer) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** A pointer to a place in the list. */ + fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + + /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + + /** + * Sets [Builder.nextCursor] to an arbitrary JSON value. + * + * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + + 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 [FednowTransferListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): FednowTransferListPageResponse = + FednowTransferListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): FednowTransferListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + nextCursor() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (nextCursor.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListPageResponse && + data == other.data && + nextCursor == other.nextCursor && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "FednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt new file mode 100644 index 000000000..f912be17c --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParams.kt @@ -0,0 +1,850 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.annotation.JsonCreator +import com.increase.api.core.Enum +import com.increase.api.core.JsonField +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** List FedNow Transfers */ +class FednowTransferListParams +private constructor( + private val accountId: String?, + private val createdAt: CreatedAt?, + private val cursor: String?, + private val externalAccountId: String?, + private val idempotencyKey: String?, + private val limit: Long?, + private val status: Status?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Filter FedNow Transfers to those that originated from the specified Account. */ + fun accountId(): Optional = Optional.ofNullable(accountId) + + fun createdAt(): Optional = Optional.ofNullable(createdAt) + + /** Return the page of entries after this one. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** Filter FedNow Transfers to those made to the specified External Account. */ + fun externalAccountId(): Optional = Optional.ofNullable(externalAccountId) + + /** + * Filter records to the one with the specified `idempotency_key` you chose for that object. + * This value is unique across Increase and is used to ensure that a request is only processed + * once. Learn more about [idempotency](https://increase.com/documentation/idempotency-keys). + */ + fun idempotencyKey(): Optional = Optional.ofNullable(idempotencyKey) + + /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */ + fun limit(): Optional = Optional.ofNullable(limit) + + fun status(): Optional = Optional.ofNullable(status) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferListParams = builder().build() + + /** Returns a mutable builder for constructing an instance of [FednowTransferListParams]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferListParams]. */ + class Builder internal constructor() { + + private var accountId: String? = null + private var createdAt: CreatedAt? = null + private var cursor: String? = null + private var externalAccountId: String? = null + private var idempotencyKey: String? = null + private var limit: Long? = null + private var status: Status? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferListParams: FednowTransferListParams) = apply { + accountId = fednowTransferListParams.accountId + createdAt = fednowTransferListParams.createdAt + cursor = fednowTransferListParams.cursor + externalAccountId = fednowTransferListParams.externalAccountId + idempotencyKey = fednowTransferListParams.idempotencyKey + limit = fednowTransferListParams.limit + status = fednowTransferListParams.status + additionalHeaders = fednowTransferListParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferListParams.additionalQueryParams.toBuilder() + } + + /** Filter FedNow Transfers to those that originated from the specified Account. */ + fun accountId(accountId: String?) = apply { this.accountId = accountId } + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt } + + /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ + fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull()) + + /** Return the page of entries after this one. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** Filter FedNow Transfers to those made to the specified External Account. */ + fun externalAccountId(externalAccountId: String?) = apply { + this.externalAccountId = externalAccountId + } + + /** Alias for calling [Builder.externalAccountId] with `externalAccountId.orElse(null)`. */ + fun externalAccountId(externalAccountId: Optional) = + externalAccountId(externalAccountId.getOrNull()) + + /** + * Filter records to the one with the specified `idempotency_key` you chose for that object. + * This value is unique across Increase and is used to ensure that a request is only + * processed once. Learn more about + * [idempotency](https://increase.com/documentation/idempotency-keys). + */ + fun idempotencyKey(idempotencyKey: String?) = apply { this.idempotencyKey = idempotencyKey } + + /** Alias for calling [Builder.idempotencyKey] with `idempotencyKey.orElse(null)`. */ + fun idempotencyKey(idempotencyKey: Optional) = + idempotencyKey(idempotencyKey.getOrNull()) + + /** + * Limit the size of the list that is returned. The default (and maximum) is 100 objects. + */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun status(status: Status?) = apply { this.status = status } + + /** Alias for calling [Builder.status] with `status.orElse(null)`. */ + fun status(status: Optional) = status(status.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferListParams = + FednowTransferListParams( + accountId, + createdAt, + cursor, + externalAccountId, + idempotencyKey, + limit, + status, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + accountId?.let { put("account_id", it) } + createdAt?.let { + it.after().ifPresent { + put("created_at.after", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.before().ifPresent { + put("created_at.before", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.onOrAfter().ifPresent { + put( + "created_at.on_or_after", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it.onOrBefore().ifPresent { + put( + "created_at.on_or_before", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("created_at.$key", value) + } + } + } + cursor?.let { put("cursor", it) } + externalAccountId?.let { put("external_account_id", it) } + idempotencyKey?.let { put("idempotency_key", it) } + limit?.let { put("limit", it.toString()) } + status?.let { + it.in_().ifPresent { put("status.in", it.joinToString(",") { it.toString() }) } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("status.$key", value) + } + } + } + putAll(additionalQueryParams) + } + .build() + + class CreatedAt + private constructor( + private val after: OffsetDateTime?, + private val before: OffsetDateTime?, + private val onOrAfter: OffsetDateTime?, + private val onOrBefore: OffsetDateTime?, + private val additionalProperties: QueryParams, + ) { + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun after(): Optional = Optional.ofNullable(after) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun before(): Optional = Optional.ofNullable(before) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(): Optional = Optional.ofNullable(onOrAfter) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(): Optional = Optional.ofNullable(onOrBefore) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [CreatedAt]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreatedAt]. */ + class Builder internal constructor() { + + private var after: OffsetDateTime? = null + private var before: OffsetDateTime? = null + private var onOrAfter: OffsetDateTime? = null + private var onOrBefore: OffsetDateTime? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(createdAt: CreatedAt) = apply { + after = createdAt.after + before = createdAt.before + onOrAfter = createdAt.onOrAfter + onOrBefore = createdAt.onOrBefore + additionalProperties = createdAt.additionalProperties.toBuilder() + } + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun after(after: OffsetDateTime?) = apply { this.after = after } + + /** Alias for calling [Builder.after] with `after.orElse(null)`. */ + fun after(after: Optional) = after(after.getOrNull()) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun before(before: OffsetDateTime?) = apply { this.before = before } + + /** Alias for calling [Builder.before] with `before.orElse(null)`. */ + fun before(before: Optional) = before(before.getOrNull()) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(onOrAfter: OffsetDateTime?) = apply { this.onOrAfter = onOrAfter } + + /** Alias for calling [Builder.onOrAfter] with `onOrAfter.orElse(null)`. */ + fun onOrAfter(onOrAfter: Optional) = onOrAfter(onOrAfter.getOrNull()) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(onOrBefore: OffsetDateTime?) = apply { this.onOrBefore = onOrBefore } + + /** Alias for calling [Builder.onOrBefore] with `onOrBefore.orElse(null)`. */ + fun onOrBefore(onOrBefore: Optional) = + onOrBefore(onOrBefore.getOrNull()) + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [CreatedAt]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): CreatedAt = + CreatedAt(after, before, onOrAfter, onOrBefore, additionalProperties.build()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedAt && + after == other.after && + before == other.before && + onOrAfter == other.onOrAfter && + onOrBefore == other.onOrBefore && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(after, before, onOrAfter, onOrBefore, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedAt{after=$after, before=$before, onOrAfter=$onOrAfter, onOrBefore=$onOrBefore, additionalProperties=$additionalProperties}" + } + + class Status + private constructor(private val in_: List?, private val additionalProperties: QueryParams) { + + /** + * Return results whose value is in the provided list. For GET requests, this should be + * encoded as a comma-delimited string, such as `?in=one,two,three`. + */ + fun in_(): Optional> = Optional.ofNullable(in_) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Status]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Status]. */ + class Builder internal constructor() { + + private var in_: MutableList? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(status: Status) = apply { + in_ = status.in_?.toMutableList() + additionalProperties = status.additionalProperties.toBuilder() + } + + /** + * Return results whose value is in the provided list. For GET requests, this should be + * encoded as a comma-delimited string, such as `?in=one,two,three`. + */ + fun in_(in_: List?) = apply { this.in_ = in_?.toMutableList() } + + /** Alias for calling [Builder.in_] with `in_.orElse(null)`. */ + fun in_(in_: Optional>) = in_(in_.getOrNull()) + + /** + * Adds a single [In] to [Builder.in_]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addIn(in_: In) = apply { + this.in_ = (this.in_ ?: mutableListOf()).apply { add(in_) } + } + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [Status]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Status = Status(in_?.toImmutable(), additionalProperties.build()) + } + + class In @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 { + + /** The transfer is pending review by Increase. */ + @JvmField val PENDING_REVIEWING = of("pending_reviewing") + + /** The transfer has been canceled. */ + @JvmField val CANCELED = of("canceled") + + /** The transfer has been rejected by Increase. */ + @JvmField val REVIEWING_REJECTED = of("reviewing_rejected") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + /** The transfer is pending approval. */ + @JvmField val PENDING_APPROVAL = of("pending_approval") + + /** The transfer is queued to be submitted to FedNow. */ + @JvmField val PENDING_SUBMITTING = of("pending_submitting") + + /** The transfer has been submitted and is pending a response from FedNow. */ + @JvmField val PENDING_RESPONSE = of("pending_response") + + /** The transfer has been sent successfully and is complete. */ + @JvmField val COMPLETE = of("complete") + + /** The transfer was rejected by the network or the recipient's bank. */ + @JvmField val REJECTED = of("rejected") + + @JvmStatic fun of(value: String) = In(JsonField.of(value)) + } + + /** An enum containing [In]'s known values. */ + enum class Known { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + } + + /** + * An enum containing [In]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [In] 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 { + /** The transfer is pending review by Increase. */ + PENDING_REVIEWING, + /** The transfer has been canceled. */ + CANCELED, + /** The transfer has been rejected by Increase. */ + REVIEWING_REJECTED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** The transfer is pending approval. */ + PENDING_APPROVAL, + /** The transfer is queued to be submitted to FedNow. */ + PENDING_SUBMITTING, + /** The transfer has been submitted and is pending a response from FedNow. */ + PENDING_RESPONSE, + /** The transfer has been sent successfully and is complete. */ + COMPLETE, + /** The transfer was rejected by the network or the recipient's bank. */ + REJECTED, + /** An enum member indicating that [In] 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) { + PENDING_REVIEWING -> Value.PENDING_REVIEWING + CANCELED -> Value.CANCELED + REVIEWING_REJECTED -> Value.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + PENDING_APPROVAL -> Value.PENDING_APPROVAL + PENDING_SUBMITTING -> Value.PENDING_SUBMITTING + PENDING_RESPONSE -> Value.PENDING_RESPONSE + COMPLETE -> Value.COMPLETE + REJECTED -> Value.REJECTED + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + PENDING_REVIEWING -> Known.PENDING_REVIEWING + CANCELED -> Known.CANCELED + REVIEWING_REJECTED -> Known.REVIEWING_REJECTED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + PENDING_APPROVAL -> Known.PENDING_APPROVAL + PENDING_SUBMITTING -> Known.PENDING_SUBMITTING + PENDING_RESPONSE -> Known.PENDING_RESPONSE + COMPLETE -> Known.COMPLETE + REJECTED -> Known.REJECTED + else -> throw IncreaseInvalidDataException("Unknown In: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): In = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 In && 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 Status && + in_ == other.in_ && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(in_, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Status{in_=$in_, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferListParams && + accountId == other.accountId && + createdAt == other.createdAt && + cursor == other.cursor && + externalAccountId == other.externalAccountId && + idempotencyKey == other.idempotencyKey && + limit == other.limit && + status == other.status && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + createdAt, + cursor, + externalAccountId, + idempotencyKey, + limit, + status, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "FednowTransferListParams{accountId=$accountId, createdAt=$createdAt, cursor=$cursor, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, limit=$limit, status=$status, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt new file mode 100644 index 000000000..a297b1156 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParams.kt @@ -0,0 +1,201 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Retrieve a FedNow Transfer */ +class FednowTransferRetrieveParams +private constructor( + private val fednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the FedNow Transfer. */ + fun fednowTransferId(): Optional = Optional.ofNullable(fednowTransferId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): FednowTransferRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of [FednowTransferRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [FednowTransferRetrieveParams]. */ + class Builder internal constructor() { + + private var fednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(fednowTransferRetrieveParams: FednowTransferRetrieveParams) = apply { + fednowTransferId = fednowTransferRetrieveParams.fednowTransferId + additionalHeaders = fednowTransferRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = fednowTransferRetrieveParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the FedNow Transfer. */ + fun fednowTransferId(fednowTransferId: String?) = apply { + this.fednowTransferId = fednowTransferId + } + + /** Alias for calling [Builder.fednowTransferId] with `fednowTransferId.orElse(null)`. */ + fun fednowTransferId(fednowTransferId: Optional) = + fednowTransferId(fednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [FednowTransferRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): FednowTransferRetrieveParams = + FednowTransferRetrieveParams( + fednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> fednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is FednowTransferRetrieveParams && + fednowTransferId == other.fednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(fednowTransferId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "FednowTransferRetrieveParams{fednowTransferId=$fednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt new file mode 100644 index 000000000..e1e64d3aa --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransfer.kt @@ -0,0 +1,1863 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +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.increase.api.core.Enum +import com.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkRequired +import com.increase.api.errors.IncreaseInvalidDataException +import java.time.OffsetDateTime +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** + * An Inbound FedNow Transfer is a FedNow transfer initiated outside of Increase to your account. + */ +class InboundFednowTransfer +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val id: JsonField, + private val accountId: JsonField, + private val accountNumberId: JsonField, + private val amount: JsonField, + private val confirmation: JsonField, + private val createdAt: JsonField, + private val creditorName: JsonField, + private val currency: JsonField, + private val debtorAccountNumber: JsonField, + private val debtorName: JsonField, + private val debtorRoutingNumber: JsonField, + private val decline: JsonField, + private val status: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), + @JsonProperty("account_number_id") + @ExcludeMissing + accountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("confirmation") + @ExcludeMissing + confirmation: JsonField = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("creditor_name") + @ExcludeMissing + creditorName: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor_account_number") + @ExcludeMissing + debtorAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_routing_number") + @ExcludeMissing + debtorRoutingNumber: JsonField = JsonMissing.of(), + @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), + @JsonProperty("status") @ExcludeMissing status: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + id, + accountId, + accountNumberId, + amount, + confirmation, + createdAt, + creditorName, + currency, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + decline, + status, + transactionId, + type, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The inbound FedNow transfer's identifier. + * + * @throws IncreaseInvalidDataException 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 id(): String = id.getRequired("id") + + /** + * The Account to which the transfer was sent. + * + * @throws IncreaseInvalidDataException 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 accountId(): String = accountId.getRequired("account_id") + + /** + * The identifier of the Account Number to which this transfer was sent. + * + * @throws IncreaseInvalidDataException 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 accountNumberId(): String = accountNumberId.getRequired("account_number_id") + + /** + * The amount in USD cents. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * If your transfer is confirmed, this will contain details of the confirmation. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun confirmation(): Optional = confirmation.getOptional("confirmation") + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the transfer + * was created. + * + * @throws IncreaseInvalidDataException 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 createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** + * The name the sender of the transfer specified as the recipient of the transfer. + * + * @throws IncreaseInvalidDataException 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 creditorName(): String = creditorName.getRequired("creditor_name") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. This + * will always be "USD" for a FedNow transfer. + * + * @throws IncreaseInvalidDataException 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 currency(): Currency = currency.getRequired("currency") + + /** + * The account number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException 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 debtorAccountNumber(): String = debtorAccountNumber.getRequired("debtor_account_number") + + /** + * The name provided by the sender of the transfer. + * + * @throws IncreaseInvalidDataException 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 debtorName(): String = debtorName.getRequired("debtor_name") + + /** + * The routing number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException 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 debtorRoutingNumber(): String = debtorRoutingNumber.getRequired("debtor_routing_number") + + /** + * If your transfer is declined, this will contain details of the decline. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun decline(): Optional = decline.getOptional("decline") + + /** + * The lifecycle status of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun status(): Status = status.getRequired("status") + + /** + * The identifier of the Transaction object created when the transfer was confirmed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_transfer`. + * + * @throws IncreaseInvalidDataException 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") + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + unstructuredRemittanceInformation.getOptional("unstructured_remittance_information") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [accountId]. + * + * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId + + /** + * Returns the raw JSON value of [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("account_number_id") + @ExcludeMissing + fun _accountNumberId(): JsonField = accountNumberId + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [confirmation]. + * + * Unlike [confirmation], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("confirmation") + @ExcludeMissing + fun _confirmation(): JsonField = confirmation + + /** + * Returns the raw JSON value of [createdAt]. + * + * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("created_at") + @ExcludeMissing + fun _createdAt(): JsonField = createdAt + + /** + * Returns the raw JSON value of [creditorName]. + * + * Unlike [creditorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor_name") + @ExcludeMissing + fun _creditorName(): JsonField = creditorName + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_account_number") + @ExcludeMissing + fun _debtorAccountNumber(): JsonField = debtorAccountNumber + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") @ExcludeMissing fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("debtor_routing_number") + @ExcludeMissing + fun _debtorRoutingNumber(): JsonField = debtorRoutingNumber + + /** + * Returns the raw JSON value of [decline]. + * + * Unlike [decline], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline + + /** + * Returns the raw JSON value of [status]. + * + * Unlike [status], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + /** + * 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 [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = unstructuredRemittanceInformation + + @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 [InboundFednowTransfer]. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumberId() + * .amount() + * .confirmation() + * .createdAt() + * .creditorName() + * .currency() + * .debtorAccountNumber() + * .debtorName() + * .debtorRoutingNumber() + * .decline() + * .status() + * .transactionId() + * .type() + * .unstructuredRemittanceInformation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransfer]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var accountId: JsonField? = null + private var accountNumberId: JsonField? = null + private var amount: JsonField? = null + private var confirmation: JsonField? = null + private var createdAt: JsonField? = null + private var creditorName: JsonField? = null + private var currency: JsonField? = null + private var debtorAccountNumber: JsonField? = null + private var debtorName: JsonField? = null + private var debtorRoutingNumber: JsonField? = null + private var decline: JsonField? = null + private var status: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null + private var unstructuredRemittanceInformation: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(inboundFednowTransfer: InboundFednowTransfer) = apply { + id = inboundFednowTransfer.id + accountId = inboundFednowTransfer.accountId + accountNumberId = inboundFednowTransfer.accountNumberId + amount = inboundFednowTransfer.amount + confirmation = inboundFednowTransfer.confirmation + createdAt = inboundFednowTransfer.createdAt + creditorName = inboundFednowTransfer.creditorName + currency = inboundFednowTransfer.currency + debtorAccountNumber = inboundFednowTransfer.debtorAccountNumber + debtorName = inboundFednowTransfer.debtorName + debtorRoutingNumber = inboundFednowTransfer.debtorRoutingNumber + decline = inboundFednowTransfer.decline + status = inboundFednowTransfer.status + transactionId = inboundFednowTransfer.transactionId + type = inboundFednowTransfer.type + unstructuredRemittanceInformation = + inboundFednowTransfer.unstructuredRemittanceInformation + additionalProperties = inboundFednowTransfer.additionalProperties.toMutableMap() + } + + /** The inbound FedNow transfer's identifier. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** The Account to which the transfer was sent. */ + fun accountId(accountId: String) = accountId(JsonField.of(accountId)) + + /** + * Sets [Builder.accountId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun accountId(accountId: JsonField) = apply { this.accountId = accountId } + + /** The identifier of the Account Number to which this transfer was sent. */ + fun accountNumberId(accountNumberId: String) = + accountNumberId(JsonField.of(accountNumberId)) + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + this.accountNumberId = accountNumberId + } + + /** The amount in USD cents. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** If your transfer is confirmed, this will contain details of the confirmation. */ + fun confirmation(confirmation: Confirmation?) = + confirmation(JsonField.ofNullable(confirmation)) + + /** Alias for calling [Builder.confirmation] with `confirmation.orElse(null)`. */ + fun confirmation(confirmation: Optional) = + confirmation(confirmation.getOrNull()) + + /** + * Sets [Builder.confirmation] to an arbitrary JSON value. + * + * You should usually call [Builder.confirmation] with a well-typed [Confirmation] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun confirmation(confirmation: JsonField) = apply { + this.confirmation = confirmation + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the + * transfer was created. + */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** + * Sets [Builder.createdAt] to an arbitrary JSON value. + * + * You should usually call [Builder.createdAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + /** The name the sender of the transfer specified as the recipient of the transfer. */ + fun creditorName(creditorName: String) = creditorName(JsonField.of(creditorName)) + + /** + * Sets [Builder.creditorName] to an arbitrary JSON value. + * + * You should usually call [Builder.creditorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditorName(creditorName: JsonField) = apply { + this.creditorName = creditorName + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. + * This will always be "USD" for a FedNow transfer. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = + debtorAccountNumber(JsonField.of(debtorAccountNumber)) + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + this.debtorAccountNumber = debtorAccountNumber + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = + debtorRoutingNumber(JsonField.of(debtorRoutingNumber)) + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + this.debtorRoutingNumber = debtorRoutingNumber + } + + /** If your transfer is declined, this will contain details of the decline. */ + fun decline(decline: Decline?) = decline(JsonField.ofNullable(decline)) + + /** Alias for calling [Builder.decline] with `decline.orElse(null)`. */ + fun decline(decline: Optional) = decline(decline.getOrNull()) + + /** + * Sets [Builder.decline] to an arbitrary JSON value. + * + * You should usually call [Builder.decline] with a well-typed [Decline] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun decline(decline: JsonField) = apply { this.decline = decline } + + /** The lifecycle status of the transfer. */ + fun status(status: Status) = status(JsonField.of(status)) + + /** + * Sets [Builder.status] to an arbitrary JSON value. + * + * You should usually call [Builder.status] with a well-typed [Status] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun status(status: JsonField) = apply { this.status = status } + + /** The identifier of the Transaction object created when the transfer was confirmed. */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_transfer`. + */ + 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 } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String?) = + unstructuredRemittanceInformation( + JsonField.ofNullable(unstructuredRemittanceInformation) + ) + + /** + * Alias for calling [Builder.unstructuredRemittanceInformation] with + * `unstructuredRemittanceInformation.orElse(null)`. + */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: Optional) = + unstructuredRemittanceInformation(unstructuredRemittanceInformation.getOrNull()) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [InboundFednowTransfer]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .accountId() + * .accountNumberId() + * .amount() + * .confirmation() + * .createdAt() + * .creditorName() + * .currency() + * .debtorAccountNumber() + * .debtorName() + * .debtorRoutingNumber() + * .decline() + * .status() + * .transactionId() + * .type() + * .unstructuredRemittanceInformation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransfer = + InboundFednowTransfer( + checkRequired("id", id), + checkRequired("accountId", accountId), + checkRequired("accountNumberId", accountNumberId), + checkRequired("amount", amount), + checkRequired("confirmation", confirmation), + checkRequired("createdAt", createdAt), + checkRequired("creditorName", creditorName), + checkRequired("currency", currency), + checkRequired("debtorAccountNumber", debtorAccountNumber), + checkRequired("debtorName", debtorName), + checkRequired("debtorRoutingNumber", debtorRoutingNumber), + checkRequired("decline", decline), + checkRequired("status", status), + checkRequired("transactionId", transactionId), + checkRequired("type", type), + checkRequired( + "unstructuredRemittanceInformation", + unstructuredRemittanceInformation, + ), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InboundFednowTransfer = apply { + if (validated) { + return@apply + } + + id() + accountId() + accountNumberId() + amount() + confirmation().ifPresent { it.validate() } + createdAt() + creditorName() + currency().validate() + debtorAccountNumber() + debtorName() + debtorRoutingNumber() + decline().ifPresent { it.validate() } + status().validate() + transactionId() + type().validate() + unstructuredRemittanceInformation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (id.asKnown().isPresent) 1 else 0) + + (if (accountId.asKnown().isPresent) 1 else 0) + + (if (accountNumberId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (confirmation.asKnown().getOrNull()?.validity() ?: 0) + + (if (createdAt.asKnown().isPresent) 1 else 0) + + (if (creditorName.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (debtorAccountNumber.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (debtorRoutingNumber.asKnown().isPresent) 1 else 0) + + (decline.asKnown().getOrNull()?.validity() ?: 0) + + (status.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + /** If your transfer is confirmed, this will contain details of the confirmation. */ + class Confirmation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of() + ) : this(transferId, mutableMapOf()) + + /** + * The identifier of the FedNow Transfer that led to this Transaction. + * + * @throws IncreaseInvalidDataException 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 transferId(): String = transferId.getRequired("transfer_id") + + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @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 [Confirmation]. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Confirmation]. */ + class Builder internal constructor() { + + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(confirmation: Confirmation) = apply { + transferId = confirmation.transferId + additionalProperties = confirmation.additionalProperties.toMutableMap() + } + + /** The identifier of the FedNow Transfer that led to this Transaction. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transferId(transferId: JsonField) = apply { this.transferId = transferId } + + 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 [Confirmation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Confirmation = + Confirmation( + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Confirmation = apply { + if (validated) { + return@apply + } + + transferId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (transferId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Confirmation && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(transferId, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Confirmation{transferId=$transferId, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code of the transfer's currency. This + * will always be "USD" for a FedNow transfer. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** If your transfer is declined, this will contain details of the decline. */ + class Decline + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val reason: JsonField, + private val transferId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), + @JsonProperty("transfer_id") + @ExcludeMissing + transferId: JsonField = JsonMissing.of(), + ) : this(reason, transferId, mutableMapOf()) + + /** + * Why the transfer was declined. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * The identifier of the FedNow Transfer that led to this declined transaction. + * + * @throws IncreaseInvalidDataException 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 transferId(): String = transferId.getRequired("transfer_id") + + /** + * 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 + + /** + * Returns the raw JSON value of [transferId]. + * + * Unlike [transferId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("transfer_id") + @ExcludeMissing + fun _transferId(): JsonField = transferId + + @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 [Decline]. + * + * The following fields are required: + * ```java + * .reason() + * .transferId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Decline]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var transferId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(decline: Decline) = apply { + reason = decline.reason + transferId = decline.transferId + additionalProperties = decline.additionalProperties.toMutableMap() + } + + /** Why the transfer was declined. */ + 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 } + + /** The identifier of the FedNow Transfer that led to this declined transaction. */ + fun transferId(transferId: String) = transferId(JsonField.of(transferId)) + + /** + * Sets [Builder.transferId] to an arbitrary JSON value. + * + * You should usually call [Builder.transferId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transferId(transferId: JsonField) = apply { this.transferId = transferId } + + 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 [Decline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * .transferId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Decline = + Decline( + checkRequired("reason", reason), + checkRequired("transferId", transferId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Decline = apply { + if (validated) { + return@apply + } + + reason().validate() + transferId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (if (transferId.asKnown().isPresent) 1 else 0) + + /** Why the transfer was declined. */ + 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 { + + /** The account number is canceled. */ + @JvmField val ACCOUNT_NUMBER_CANCELED = of("account_number_canceled") + + /** The account number is disabled. */ + @JvmField val ACCOUNT_NUMBER_DISABLED = of("account_number_disabled") + + /** Your account is restricted. */ + @JvmField val ACCOUNT_RESTRICTED = of("account_restricted") + + /** Your account is inactive. */ + @JvmField val GROUP_LOCKED = of("group_locked") + + /** The account's entity is not active. */ + @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") + + /** Your account is not enabled to receive FedNow transfers. */ + @JvmField val FEDNOW_NOT_ENABLED = of("fednow_not_enabled") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** The account number is canceled. */ + ACCOUNT_NUMBER_CANCELED, + /** The account number is disabled. */ + ACCOUNT_NUMBER_DISABLED, + /** Your account is restricted. */ + ACCOUNT_RESTRICTED, + /** Your account is inactive. */ + GROUP_LOCKED, + /** The account's entity is not active. */ + ENTITY_NOT_ACTIVE, + /** Your account is not enabled to receive FedNow transfers. */ + FEDNOW_NOT_ENABLED, + } + + /** + * 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 { + /** The account number is canceled. */ + ACCOUNT_NUMBER_CANCELED, + /** The account number is disabled. */ + ACCOUNT_NUMBER_DISABLED, + /** Your account is restricted. */ + ACCOUNT_RESTRICTED, + /** Your account is inactive. */ + GROUP_LOCKED, + /** The account's entity is not active. */ + ENTITY_NOT_ACTIVE, + /** Your account is not enabled to receive FedNow transfers. */ + FEDNOW_NOT_ENABLED, + /** + * 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_NUMBER_CANCELED -> Value.ACCOUNT_NUMBER_CANCELED + ACCOUNT_NUMBER_DISABLED -> Value.ACCOUNT_NUMBER_DISABLED + ACCOUNT_RESTRICTED -> Value.ACCOUNT_RESTRICTED + GROUP_LOCKED -> Value.GROUP_LOCKED + ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE + FEDNOW_NOT_ENABLED -> Value.FEDNOW_NOT_ENABLED + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + ACCOUNT_NUMBER_CANCELED -> Known.ACCOUNT_NUMBER_CANCELED + ACCOUNT_NUMBER_DISABLED -> Known.ACCOUNT_NUMBER_DISABLED + ACCOUNT_RESTRICTED -> Known.ACCOUNT_RESTRICTED + GROUP_LOCKED -> Known.GROUP_LOCKED + ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE + FEDNOW_NOT_ENABLED -> Known.FEDNOW_NOT_ENABLED + else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("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: IncreaseInvalidDataException) { + 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 Decline && + reason == other.reason && + transferId == other.transferId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, transferId, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Decline{reason=$reason, transferId=$transferId, additionalProperties=$additionalProperties}" + } + + /** The lifecycle status of the transfer. */ + class Status @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 { + + /** The transfer is pending confirmation. */ + @JvmField val PENDING_CONFIRMING = of("pending_confirming") + + /** The transfer was not responded to in time. */ + @JvmField val TIMED_OUT = of("timed_out") + + /** The transfer has been received successfully and is confirmed. */ + @JvmField val CONFIRMED = of("confirmed") + + /** The transfer has been declined. */ + @JvmField val DECLINED = of("declined") + + /** The transfer requires attention from an Increase operator. */ + @JvmField val REQUIRES_ATTENTION = of("requires_attention") + + @JvmStatic fun of(value: String) = Status(JsonField.of(value)) + } + + /** An enum containing [Status]'s known values. */ + enum class Known { + /** The transfer is pending confirmation. */ + PENDING_CONFIRMING, + /** The transfer was not responded to in time. */ + TIMED_OUT, + /** The transfer has been received successfully and is confirmed. */ + CONFIRMED, + /** The transfer has been declined. */ + DECLINED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + } + + /** + * An enum containing [Status]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Status] 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 { + /** The transfer is pending confirmation. */ + PENDING_CONFIRMING, + /** The transfer was not responded to in time. */ + TIMED_OUT, + /** The transfer has been received successfully and is confirmed. */ + CONFIRMED, + /** The transfer has been declined. */ + DECLINED, + /** The transfer requires attention from an Increase operator. */ + REQUIRES_ATTENTION, + /** An enum member indicating that [Status] 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) { + PENDING_CONFIRMING -> Value.PENDING_CONFIRMING + TIMED_OUT -> Value.TIMED_OUT + CONFIRMED -> Value.CONFIRMED + DECLINED -> Value.DECLINED + REQUIRES_ATTENTION -> Value.REQUIRES_ATTENTION + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + PENDING_CONFIRMING -> Known.PENDING_CONFIRMING + TIMED_OUT -> Known.TIMED_OUT + CONFIRMED -> Known.CONFIRMED + DECLINED -> Known.DECLINED + REQUIRES_ATTENTION -> Known.REQUIRES_ATTENTION + else -> throw IncreaseInvalidDataException("Unknown Status: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Status = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Status && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * A constant representing the object's type. For this resource it will always be + * `inbound_fednow_transfer`. + */ + 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 INBOUND_FEDNOW_TRANSFER = of("inbound_fednow_transfer") + + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) + } + + /** An enum containing [Type]'s known values. */ + enum class Known { + INBOUND_FEDNOW_TRANSFER + } + + /** + * 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 { + INBOUND_FEDNOW_TRANSFER, + /** 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) { + INBOUND_FEDNOW_TRANSFER -> Value.INBOUND_FEDNOW_TRANSFER + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + INBOUND_FEDNOW_TRANSFER -> Known.INBOUND_FEDNOW_TRANSFER + else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("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: IncreaseInvalidDataException) { + 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 InboundFednowTransfer && + id == other.id && + accountId == other.accountId && + accountNumberId == other.accountNumberId && + amount == other.amount && + confirmation == other.confirmation && + createdAt == other.createdAt && + creditorName == other.creditorName && + currency == other.currency && + debtorAccountNumber == other.debtorAccountNumber && + debtorName == other.debtorName && + debtorRoutingNumber == other.debtorRoutingNumber && + decline == other.decline && + status == other.status && + transactionId == other.transactionId && + type == other.type && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + accountId, + accountNumberId, + amount, + confirmation, + createdAt, + creditorName, + currency, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + decline, + status, + transactionId, + type, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InboundFednowTransfer{id=$id, accountId=$accountId, accountNumberId=$accountNumberId, amount=$amount, confirmation=$confirmation, createdAt=$createdAt, creditorName=$creditorName, currency=$currency, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, decline=$decline, status=$status, transactionId=$transactionId, type=$type, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt new file mode 100644 index 000000000..88d87e5d4 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPage.kt @@ -0,0 +1,136 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPager +import com.increase.api.core.Page +import com.increase.api.core.checkRequired +import com.increase.api.services.blocking.InboundFednowTransferService +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferService.list */ +class InboundFednowTransferListPage +private constructor( + private val service: InboundFednowTransferService, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : Page { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): InboundFednowTransferListPage = service.list(nextPageParams()) + + fun autoPager(): AutoPager = AutoPager.from(this) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPage]. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPage]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferService? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPage: InboundFednowTransferListPage) = apply { + service = inboundFednowTransferListPage.service + params = inboundFednowTransferListPage.params + response = inboundFednowTransferListPage.response + } + + fun service(service: InboundFednowTransferService) = apply { this.service = service } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPage]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPage = + InboundFednowTransferListPage( + checkRequired("service", service), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPage && + service == other.service && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, params, response) + + override fun toString() = + "InboundFednowTransferListPage{service=$service, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt new file mode 100644 index 000000000..95c6b183e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageAsync.kt @@ -0,0 +1,152 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.AutoPagerAsync +import com.increase.api.core.PageAsync +import com.increase.api.core.checkRequired +import com.increase.api.services.async.InboundFednowTransferServiceAsync +import java.util.Objects +import java.util.Optional +import java.util.concurrent.CompletableFuture +import java.util.concurrent.Executor +import kotlin.jvm.optionals.getOrNull + +/** @see InboundFednowTransferServiceAsync.list */ +class InboundFednowTransferListPageAsync +private constructor( + private val service: InboundFednowTransferServiceAsync, + private val streamHandlerExecutor: Executor, + private val params: InboundFednowTransferListParams, + private val response: InboundFednowTransferListPageResponse, +) : PageAsync { + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.data + */ + fun data(): List = + response._data().getOptional("data").getOrNull() ?: emptyList() + + /** + * Delegates to [InboundFednowTransferListPageResponse], but gracefully handles missing data. + * + * @see InboundFednowTransferListPageResponse.nextCursor + */ + fun nextCursor(): Optional = response._nextCursor().getOptional("next_cursor") + + override fun items(): List = data() + + override fun hasNextPage(): Boolean = items().isNotEmpty() && nextCursor().isPresent + + fun nextPageParams(): InboundFednowTransferListParams { + val nextCursor = + nextCursor().getOrNull() + ?: throw IllegalStateException("Cannot construct next page params") + return params.toBuilder().cursor(nextCursor).build() + } + + override fun nextPage(): CompletableFuture = + service.list(nextPageParams()) + + fun autoPager(): AutoPagerAsync = + AutoPagerAsync.from(this, streamHandlerExecutor) + + /** The parameters that were used to request this page. */ + fun params(): InboundFednowTransferListParams = params + + /** The response that this page was parsed from. */ + fun response(): InboundFednowTransferListPageResponse = response + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListPageAsync]. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPageAsync]. */ + class Builder internal constructor() { + + private var service: InboundFednowTransferServiceAsync? = null + private var streamHandlerExecutor: Executor? = null + private var params: InboundFednowTransferListParams? = null + private var response: InboundFednowTransferListPageResponse? = null + + @JvmSynthetic + internal fun from(inboundFednowTransferListPageAsync: InboundFednowTransferListPageAsync) = + apply { + service = inboundFednowTransferListPageAsync.service + streamHandlerExecutor = inboundFednowTransferListPageAsync.streamHandlerExecutor + params = inboundFednowTransferListPageAsync.params + response = inboundFednowTransferListPageAsync.response + } + + fun service(service: InboundFednowTransferServiceAsync) = apply { this.service = service } + + fun streamHandlerExecutor(streamHandlerExecutor: Executor) = apply { + this.streamHandlerExecutor = streamHandlerExecutor + } + + /** The parameters that were used to request this page. */ + fun params(params: InboundFednowTransferListParams) = apply { this.params = params } + + /** The response that this page was parsed from. */ + fun response(response: InboundFednowTransferListPageResponse) = apply { + this.response = response + } + + /** + * Returns an immutable instance of [InboundFednowTransferListPageAsync]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .service() + * .streamHandlerExecutor() + * .params() + * .response() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPageAsync = + InboundFednowTransferListPageAsync( + checkRequired("service", service), + checkRequired("streamHandlerExecutor", streamHandlerExecutor), + checkRequired("params", params), + checkRequired("response", response), + ) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPageAsync && + service == other.service && + streamHandlerExecutor == other.streamHandlerExecutor && + params == other.params && + response == other.response + } + + override fun hashCode(): Int = Objects.hash(service, streamHandlerExecutor, params, response) + + override fun toString() = + "InboundFednowTransferListPageAsync{service=$service, streamHandlerExecutor=$streamHandlerExecutor, params=$params, response=$response}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt new file mode 100644 index 000000000..7ba304261 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponse.kt @@ -0,0 +1,243 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +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.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown +import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** A list of Inbound FedNow Transfer objects. */ +class InboundFednowTransferListPageResponse +@JsonCreator(mode = JsonCreator.Mode.DISABLED) +private constructor( + private val data: JsonField>, + private val nextCursor: JsonField, + private val additionalProperties: MutableMap, +) { + + @JsonCreator + private constructor( + @JsonProperty("data") + @ExcludeMissing + data: JsonField> = JsonMissing.of(), + @JsonProperty("next_cursor") + @ExcludeMissing + nextCursor: JsonField = JsonMissing.of(), + ) : this(data, nextCursor, mutableMapOf()) + + /** + * The contents of the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun data(): List = data.getRequired("data") + + /** + * A pointer to a place in the list. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun nextCursor(): Optional = nextCursor.getOptional("next_cursor") + + /** + * Returns the raw JSON value of [data]. + * + * Unlike [data], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("data") @ExcludeMissing fun _data(): JsonField> = data + + /** + * Returns the raw JSON value of [nextCursor]. + * + * Unlike [nextCursor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("next_cursor") @ExcludeMissing fun _nextCursor(): JsonField = nextCursor + + @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 + * [InboundFednowTransferListPageResponse]. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListPageResponse]. */ + class Builder internal constructor() { + + private var data: JsonField>? = null + private var nextCursor: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + inboundFednowTransferListPageResponse: InboundFednowTransferListPageResponse + ) = apply { + data = inboundFednowTransferListPageResponse.data.map { it.toMutableList() } + nextCursor = inboundFednowTransferListPageResponse.nextCursor + additionalProperties = + inboundFednowTransferListPageResponse.additionalProperties.toMutableMap() + } + + /** The contents of the list. */ + fun data(data: List) = data(JsonField.of(data)) + + /** + * Sets [Builder.data] to an arbitrary JSON value. + * + * You should usually call [Builder.data] with a well-typed `List` + * value instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun data(data: JsonField>) = apply { + this.data = data.map { it.toMutableList() } + } + + /** + * Adds a single [InboundFednowTransfer] to [Builder.data]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addData(data: InboundFednowTransfer) = apply { + this.data = + (this.data ?: JsonField.of(mutableListOf())).also { + checkKnown("data", it).add(data) + } + } + + /** A pointer to a place in the list. */ + fun nextCursor(nextCursor: String?) = nextCursor(JsonField.ofNullable(nextCursor)) + + /** Alias for calling [Builder.nextCursor] with `nextCursor.orElse(null)`. */ + fun nextCursor(nextCursor: Optional) = nextCursor(nextCursor.getOrNull()) + + /** + * Sets [Builder.nextCursor] to an arbitrary JSON value. + * + * You should usually call [Builder.nextCursor] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nextCursor(nextCursor: JsonField) = apply { this.nextCursor = nextCursor } + + 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 [InboundFednowTransferListPageResponse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .data() + * .nextCursor() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse( + checkRequired("data", data).map { it.toImmutable() }, + checkRequired("nextCursor", nextCursor), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InboundFednowTransferListPageResponse = apply { + if (validated) { + return@apply + } + + data().forEach { it.validate() } + nextCursor() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (data.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + + (if (nextCursor.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListPageResponse && + data == other.data && + nextCursor == other.nextCursor && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(data, nextCursor, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InboundFednowTransferListPageResponse{data=$data, nextCursor=$nextCursor, additionalProperties=$additionalProperties}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt new file mode 100644 index 000000000..021f85294 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParams.kt @@ -0,0 +1,483 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import java.time.format.DateTimeFormatter +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** List Inbound FedNow Transfers */ +class InboundFednowTransferListParams +private constructor( + private val accountId: String?, + private val accountNumberId: String?, + private val createdAt: CreatedAt?, + private val cursor: String?, + private val limit: Long?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** Filter Inbound FedNow Transfers to those belonging to the specified Account. */ + fun accountId(): Optional = Optional.ofNullable(accountId) + + /** Filter Inbound FedNow Transfers to ones belonging to the specified Account Number. */ + fun accountNumberId(): Optional = Optional.ofNullable(accountNumberId) + + fun createdAt(): Optional = Optional.ofNullable(createdAt) + + /** Return the page of entries after this one. */ + fun cursor(): Optional = Optional.ofNullable(cursor) + + /** Limit the size of the list that is returned. The default (and maximum) is 100 objects. */ + fun limit(): Optional = Optional.ofNullable(limit) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): InboundFednowTransferListParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferListParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferListParams]. */ + class Builder internal constructor() { + + private var accountId: String? = null + private var accountNumberId: String? = null + private var createdAt: CreatedAt? = null + private var cursor: String? = null + private var limit: Long? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(inboundFednowTransferListParams: InboundFednowTransferListParams) = + apply { + accountId = inboundFednowTransferListParams.accountId + accountNumberId = inboundFednowTransferListParams.accountNumberId + createdAt = inboundFednowTransferListParams.createdAt + cursor = inboundFednowTransferListParams.cursor + limit = inboundFednowTransferListParams.limit + additionalHeaders = inboundFednowTransferListParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferListParams.additionalQueryParams.toBuilder() + } + + /** Filter Inbound FedNow Transfers to those belonging to the specified Account. */ + fun accountId(accountId: String?) = apply { this.accountId = accountId } + + /** Alias for calling [Builder.accountId] with `accountId.orElse(null)`. */ + fun accountId(accountId: Optional) = accountId(accountId.getOrNull()) + + /** Filter Inbound FedNow Transfers to ones belonging to the specified Account Number. */ + fun accountNumberId(accountNumberId: String?) = apply { + this.accountNumberId = accountNumberId + } + + /** Alias for calling [Builder.accountNumberId] with `accountNumberId.orElse(null)`. */ + fun accountNumberId(accountNumberId: Optional) = + accountNumberId(accountNumberId.getOrNull()) + + fun createdAt(createdAt: CreatedAt?) = apply { this.createdAt = createdAt } + + /** Alias for calling [Builder.createdAt] with `createdAt.orElse(null)`. */ + fun createdAt(createdAt: Optional) = createdAt(createdAt.getOrNull()) + + /** Return the page of entries after this one. */ + fun cursor(cursor: String?) = apply { this.cursor = cursor } + + /** Alias for calling [Builder.cursor] with `cursor.orElse(null)`. */ + fun cursor(cursor: Optional) = cursor(cursor.getOrNull()) + + /** + * Limit the size of the list that is returned. The default (and maximum) is 100 objects. + */ + fun limit(limit: Long?) = apply { this.limit = limit } + + /** + * Alias for [Builder.limit]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun limit(limit: Long) = limit(limit as Long?) + + /** Alias for calling [Builder.limit] with `limit.orElse(null)`. */ + fun limit(limit: Optional) = limit(limit.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferListParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InboundFednowTransferListParams = + InboundFednowTransferListParams( + accountId, + accountNumberId, + createdAt, + cursor, + limit, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = + QueryParams.builder() + .apply { + accountId?.let { put("account_id", it) } + accountNumberId?.let { put("account_number_id", it) } + createdAt?.let { + it.after().ifPresent { + put("created_at.after", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.before().ifPresent { + put("created_at.before", DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it)) + } + it.onOrAfter().ifPresent { + put( + "created_at.on_or_after", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it.onOrBefore().ifPresent { + put( + "created_at.on_or_before", + DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(it), + ) + } + it._additionalProperties().keys().forEach { key -> + it._additionalProperties().values(key).forEach { value -> + put("created_at.$key", value) + } + } + } + cursor?.let { put("cursor", it) } + limit?.let { put("limit", it.toString()) } + putAll(additionalQueryParams) + } + .build() + + class CreatedAt + private constructor( + private val after: OffsetDateTime?, + private val before: OffsetDateTime?, + private val onOrAfter: OffsetDateTime?, + private val onOrBefore: OffsetDateTime?, + private val additionalProperties: QueryParams, + ) { + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun after(): Optional = Optional.ofNullable(after) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. + */ + fun before(): Optional = Optional.ofNullable(before) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(): Optional = Optional.ofNullable(onOrAfter) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(): Optional = Optional.ofNullable(onOrBefore) + + /** Query params to send with the request. */ + fun _additionalProperties(): QueryParams = additionalProperties + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [CreatedAt]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreatedAt]. */ + class Builder internal constructor() { + + private var after: OffsetDateTime? = null + private var before: OffsetDateTime? = null + private var onOrAfter: OffsetDateTime? = null + private var onOrBefore: OffsetDateTime? = null + private var additionalProperties: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(createdAt: CreatedAt) = apply { + after = createdAt.after + before = createdAt.before + onOrAfter = createdAt.onOrAfter + onOrBefore = createdAt.onOrBefore + additionalProperties = createdAt.additionalProperties.toBuilder() + } + + /** + * Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun after(after: OffsetDateTime?) = apply { this.after = after } + + /** Alias for calling [Builder.after] with `after.orElse(null)`. */ + fun after(after: Optional) = after(after.getOrNull()) + + /** + * Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun before(before: OffsetDateTime?) = apply { this.before = before } + + /** Alias for calling [Builder.before] with `before.orElse(null)`. */ + fun before(before: Optional) = before(before.getOrNull()) + + /** + * Return results on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrAfter(onOrAfter: OffsetDateTime?) = apply { this.onOrAfter = onOrAfter } + + /** Alias for calling [Builder.onOrAfter] with `onOrAfter.orElse(null)`. */ + fun onOrAfter(onOrAfter: Optional) = onOrAfter(onOrAfter.getOrNull()) + + /** + * Return results on or before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) + * timestamp. + */ + fun onOrBefore(onOrBefore: OffsetDateTime?) = apply { this.onOrBefore = onOrBefore } + + /** Alias for calling [Builder.onOrBefore] with `onOrBefore.orElse(null)`. */ + fun onOrBefore(onOrBefore: Optional) = + onOrBefore(onOrBefore.getOrNull()) + + fun additionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun additionalProperties(additionalProperties: Map>) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: String) = apply { + additionalProperties.put(key, value) + } + + fun putAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.put(key, values) + } + + fun putAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun putAllAdditionalProperties(additionalProperties: Map>) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun replaceAdditionalProperties(key: String, value: String) = apply { + additionalProperties.replace(key, value) + } + + fun replaceAdditionalProperties(key: String, values: Iterable) = apply { + additionalProperties.replace(key, values) + } + + fun replaceAllAdditionalProperties(additionalProperties: QueryParams) = apply { + this.additionalProperties.replaceAll(additionalProperties) + } + + fun replaceAllAdditionalProperties( + additionalProperties: Map> + ) = apply { this.additionalProperties.replaceAll(additionalProperties) } + + fun removeAdditionalProperties(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + additionalProperties.removeAll(keys) + } + + /** + * Returns an immutable instance of [CreatedAt]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): CreatedAt = + CreatedAt(after, before, onOrAfter, onOrBefore, additionalProperties.build()) + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreatedAt && + after == other.after && + before == other.before && + onOrAfter == other.onOrAfter && + onOrBefore == other.onOrBefore && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(after, before, onOrAfter, onOrBefore, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreatedAt{after=$after, before=$before, onOrAfter=$onOrAfter, onOrBefore=$onOrBefore, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferListParams && + accountId == other.accountId && + accountNumberId == other.accountNumberId && + createdAt == other.createdAt && + cursor == other.cursor && + limit == other.limit && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash( + accountId, + accountNumberId, + createdAt, + cursor, + limit, + additionalHeaders, + additionalQueryParams, + ) + + override fun toString() = + "InboundFednowTransferListParams{accountId=$accountId, accountNumberId=$accountNumberId, createdAt=$createdAt, cursor=$cursor, limit=$limit, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt new file mode 100644 index 000000000..d5162d99a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParams.kt @@ -0,0 +1,208 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.Params +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import java.util.Objects +import java.util.Optional +import kotlin.jvm.optionals.getOrNull + +/** Retrieve an Inbound FedNow Transfer */ +class InboundFednowTransferRetrieveParams +private constructor( + private val inboundFednowTransferId: String?, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** The identifier of the Inbound FedNow Transfer to get details for. */ + fun inboundFednowTransferId(): Optional = Optional.ofNullable(inboundFednowTransferId) + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun none(): InboundFednowTransferRetrieveParams = builder().build() + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferRetrieveParams]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferRetrieveParams]. */ + class Builder internal constructor() { + + private var inboundFednowTransferId: String? = null + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from( + inboundFednowTransferRetrieveParams: InboundFednowTransferRetrieveParams + ) = apply { + inboundFednowTransferId = inboundFednowTransferRetrieveParams.inboundFednowTransferId + additionalHeaders = inboundFednowTransferRetrieveParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferRetrieveParams.additionalQueryParams.toBuilder() + } + + /** The identifier of the Inbound FedNow Transfer to get details for. */ + fun inboundFednowTransferId(inboundFednowTransferId: String?) = apply { + this.inboundFednowTransferId = inboundFednowTransferId + } + + /** + * Alias for calling [Builder.inboundFednowTransferId] with + * `inboundFednowTransferId.orElse(null)`. + */ + fun inboundFednowTransferId(inboundFednowTransferId: Optional) = + inboundFednowTransferId(inboundFednowTransferId.getOrNull()) + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferRetrieveParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams( + inboundFednowTransferId, + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _pathParam(index: Int): String = + when (index) { + 0 -> inboundFednowTransferId ?: "" + else -> "" + } + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferRetrieveParams && + inboundFednowTransferId == other.inboundFednowTransferId && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = + Objects.hash(inboundFednowTransferId, additionalHeaders, additionalQueryParams) + + override fun toString() = + "InboundFednowTransferRetrieveParams{inboundFednowTransferId=$inboundFednowTransferId, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt new file mode 100644 index 000000000..1dfcd1dc0 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParams.kt @@ -0,0 +1,822 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.simulations.inboundfednowtransfers + +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.increase.api.core.ExcludeMissing +import com.increase.api.core.JsonField +import com.increase.api.core.JsonMissing +import com.increase.api.core.JsonValue +import com.increase.api.core.Params +import com.increase.api.core.checkRequired +import com.increase.api.core.http.Headers +import com.increase.api.core.http.QueryParams +import com.increase.api.errors.IncreaseInvalidDataException +import java.util.Collections +import java.util.Objects +import java.util.Optional + +/** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ +class InboundFednowTransferCreateParams +private constructor( + private val body: Body, + private val additionalHeaders: Headers, + private val additionalQueryParams: QueryParams, +) : Params { + + /** + * The identifier of the Account Number the inbound FedNow Transfer is for. + * + * @throws IncreaseInvalidDataException 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 accountNumberId(): String = body.accountNumberId() + + /** + * The transfer amount in USD cents. Must be positive. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = body.amount() + + /** + * The account number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorAccountNumber(): Optional = body.debtorAccountNumber() + + /** + * The name provided by the sender of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorName(): Optional = body.debtorName() + + /** + * The routing number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtorRoutingNumber(): Optional = body.debtorRoutingNumber() + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + body.unstructuredRemittanceInformation() + + /** + * Returns the raw JSON value of [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _accountNumberId(): JsonField = body._accountNumberId() + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + + /** + * Returns the raw JSON value of [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _debtorAccountNumber(): JsonField = body._debtorAccountNumber() + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _debtorName(): JsonField = body._debtorName() + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an unexpected + * type. + */ + fun _debtorRoutingNumber(): JsonField = body._debtorRoutingNumber() + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field has + * an unexpected type. + */ + fun _unstructuredRemittanceInformation(): JsonField = + body._unstructuredRemittanceInformation() + + fun _additionalBodyProperties(): Map = body._additionalProperties() + + /** Additional headers to send with the request. */ + fun _additionalHeaders(): Headers = additionalHeaders + + /** Additional query param to send with the request. */ + fun _additionalQueryParams(): QueryParams = additionalQueryParams + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [InboundFednowTransferCreateParams]. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InboundFednowTransferCreateParams]. */ + class Builder internal constructor() { + + private var body: Body.Builder = Body.builder() + private var additionalHeaders: Headers.Builder = Headers.builder() + private var additionalQueryParams: QueryParams.Builder = QueryParams.builder() + + @JvmSynthetic + internal fun from(inboundFednowTransferCreateParams: InboundFednowTransferCreateParams) = + apply { + body = inboundFednowTransferCreateParams.body.toBuilder() + additionalHeaders = inboundFednowTransferCreateParams.additionalHeaders.toBuilder() + additionalQueryParams = + inboundFednowTransferCreateParams.additionalQueryParams.toBuilder() + } + + /** + * Sets the entire request body. + * + * This is generally only useful if you are already constructing the body separately. + * Otherwise, it's more convenient to use the top-level setters instead: + * - [accountNumberId] + * - [amount] + * - [debtorAccountNumber] + * - [debtorName] + * - [debtorRoutingNumber] + * - etc. + */ + fun body(body: Body) = apply { this.body = body.toBuilder() } + + /** The identifier of the Account Number the inbound FedNow Transfer is for. */ + fun accountNumberId(accountNumberId: String) = apply { + body.accountNumberId(accountNumberId) + } + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + body.accountNumberId(accountNumberId) + } + + /** The transfer amount in USD cents. Must be positive. */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = apply { + body.debtorAccountNumber(debtorAccountNumber) + } + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + body.debtorAccountNumber(debtorAccountNumber) + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = apply { body.debtorName(debtorName) } + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun debtorName(debtorName: JsonField) = apply { body.debtorName(debtorName) } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = apply { + body.debtorRoutingNumber(debtorRoutingNumber) + } + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + body.debtorRoutingNumber(debtorRoutingNumber) + } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = apply { + body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) + } + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { body.unstructuredRemittanceInformation(unstructuredRemittanceInformation) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + body.additionalProperties(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + body.putAdditionalProperty(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + body.putAllAdditionalProperties(additionalBodyProperties) + } + + fun removeAdditionalBodyProperty(key: String) = apply { body.removeAdditionalProperty(key) } + + fun removeAllAdditionalBodyProperties(keys: Set) = apply { + body.removeAllAdditionalProperties(keys) + } + + fun additionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllAdditionalHeaders(additionalHeaders) + } + + fun putAdditionalHeader(name: String, value: String) = apply { + additionalHeaders.put(name, value) + } + + fun putAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.put(name, values) + } + + fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.putAll(additionalHeaders) + } + + fun replaceAdditionalHeaders(name: String, value: String) = apply { + additionalHeaders.replace(name, value) + } + + fun replaceAdditionalHeaders(name: String, values: Iterable) = apply { + additionalHeaders.replace(name, values) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.replaceAll(additionalHeaders) + } + + fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) } + + fun removeAllAdditionalHeaders(names: Set) = apply { + additionalHeaders.removeAll(names) + } + + fun additionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllAdditionalQueryParams(additionalQueryParams) + } + + fun putAdditionalQueryParam(key: String, value: String) = apply { + additionalQueryParams.put(key, value) + } + + fun putAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.put(key, values) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun putAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.putAll(additionalQueryParams) + } + + fun replaceAdditionalQueryParams(key: String, value: String) = apply { + additionalQueryParams.replace(key, value) + } + + fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply { + additionalQueryParams.replace(key, values) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) = + apply { + this.additionalQueryParams.replaceAll(additionalQueryParams) + } + + fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) } + + fun removeAllAdditionalQueryParams(keys: Set) = apply { + additionalQueryParams.removeAll(keys) + } + + /** + * Returns an immutable instance of [InboundFednowTransferCreateParams]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InboundFednowTransferCreateParams = + InboundFednowTransferCreateParams( + body.build(), + additionalHeaders.build(), + additionalQueryParams.build(), + ) + } + + fun _body(): Body = body + + override fun _headers(): Headers = additionalHeaders + + override fun _queryParams(): QueryParams = additionalQueryParams + + class Body + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val accountNumberId: JsonField, + private val amount: JsonField, + private val debtorAccountNumber: JsonField, + private val debtorName: JsonField, + private val debtorRoutingNumber: JsonField, + private val unstructuredRemittanceInformation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("account_number_id") + @ExcludeMissing + accountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("debtor_account_number") + @ExcludeMissing + debtorAccountNumber: JsonField = JsonMissing.of(), + @JsonProperty("debtor_name") + @ExcludeMissing + debtorName: JsonField = JsonMissing.of(), + @JsonProperty("debtor_routing_number") + @ExcludeMissing + debtorRoutingNumber: JsonField = JsonMissing.of(), + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + unstructuredRemittanceInformation: JsonField = JsonMissing.of(), + ) : this( + accountNumberId, + amount, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + mutableMapOf(), + ) + + /** + * The identifier of the Account Number the inbound FedNow Transfer is for. + * + * @throws IncreaseInvalidDataException 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 accountNumberId(): String = accountNumberId.getRequired("account_number_id") + + /** + * The transfer amount in USD cents. Must be positive. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The account number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorAccountNumber(): Optional = + debtorAccountNumber.getOptional("debtor_account_number") + + /** + * The name provided by the sender of the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorName(): Optional = debtorName.getOptional("debtor_name") + + /** + * The routing number of the account that sent the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun debtorRoutingNumber(): Optional = + debtorRoutingNumber.getOptional("debtor_routing_number") + + /** + * Additional information included with the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun unstructuredRemittanceInformation(): Optional = + unstructuredRemittanceInformation.getOptional("unstructured_remittance_information") + + /** + * Returns the raw JSON value of [accountNumberId]. + * + * Unlike [accountNumberId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("account_number_id") + @ExcludeMissing + fun _accountNumberId(): JsonField = accountNumberId + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [debtorAccountNumber]. + * + * Unlike [debtorAccountNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("debtor_account_number") + @ExcludeMissing + fun _debtorAccountNumber(): JsonField = debtorAccountNumber + + /** + * Returns the raw JSON value of [debtorName]. + * + * Unlike [debtorName], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor_name") + @ExcludeMissing + fun _debtorName(): JsonField = debtorName + + /** + * Returns the raw JSON value of [debtorRoutingNumber]. + * + * Unlike [debtorRoutingNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("debtor_routing_number") + @ExcludeMissing + fun _debtorRoutingNumber(): JsonField = debtorRoutingNumber + + /** + * Returns the raw JSON value of [unstructuredRemittanceInformation]. + * + * Unlike [unstructuredRemittanceInformation], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("unstructured_remittance_information") + @ExcludeMissing + fun _unstructuredRemittanceInformation(): JsonField = + unstructuredRemittanceInformation + + @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 [Body]. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Body]. */ + class Builder internal constructor() { + + private var accountNumberId: JsonField? = null + private var amount: JsonField? = null + private var debtorAccountNumber: JsonField = JsonMissing.of() + private var debtorName: JsonField = JsonMissing.of() + private var debtorRoutingNumber: JsonField = JsonMissing.of() + private var unstructuredRemittanceInformation: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(body: Body) = apply { + accountNumberId = body.accountNumberId + amount = body.amount + debtorAccountNumber = body.debtorAccountNumber + debtorName = body.debtorName + debtorRoutingNumber = body.debtorRoutingNumber + unstructuredRemittanceInformation = body.unstructuredRemittanceInformation + additionalProperties = body.additionalProperties.toMutableMap() + } + + /** The identifier of the Account Number the inbound FedNow Transfer is for. */ + fun accountNumberId(accountNumberId: String) = + accountNumberId(JsonField.of(accountNumberId)) + + /** + * Sets [Builder.accountNumberId] to an arbitrary JSON value. + * + * You should usually call [Builder.accountNumberId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun accountNumberId(accountNumberId: JsonField) = apply { + this.accountNumberId = accountNumberId + } + + /** The transfer amount in USD cents. Must be positive. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The account number of the account that sent the transfer. */ + fun debtorAccountNumber(debtorAccountNumber: String) = + debtorAccountNumber(JsonField.of(debtorAccountNumber)) + + /** + * Sets [Builder.debtorAccountNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorAccountNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorAccountNumber(debtorAccountNumber: JsonField) = apply { + this.debtorAccountNumber = debtorAccountNumber + } + + /** The name provided by the sender of the transfer. */ + fun debtorName(debtorName: String) = debtorName(JsonField.of(debtorName)) + + /** + * Sets [Builder.debtorName] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorName] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun debtorName(debtorName: JsonField) = apply { this.debtorName = debtorName } + + /** The routing number of the account that sent the transfer. */ + fun debtorRoutingNumber(debtorRoutingNumber: String) = + debtorRoutingNumber(JsonField.of(debtorRoutingNumber)) + + /** + * Sets [Builder.debtorRoutingNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.debtorRoutingNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun debtorRoutingNumber(debtorRoutingNumber: JsonField) = apply { + this.debtorRoutingNumber = debtorRoutingNumber + } + + /** Additional information included with the transfer. */ + fun unstructuredRemittanceInformation(unstructuredRemittanceInformation: String) = + unstructuredRemittanceInformation(JsonField.of(unstructuredRemittanceInformation)) + + /** + * Sets [Builder.unstructuredRemittanceInformation] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructuredRemittanceInformation] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun unstructuredRemittanceInformation( + unstructuredRemittanceInformation: JsonField + ) = apply { this.unstructuredRemittanceInformation = unstructuredRemittanceInformation } + + 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 [Body]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .accountNumberId() + * .amount() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Body = + Body( + checkRequired("accountNumberId", accountNumberId), + checkRequired("amount", amount), + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Body = apply { + if (validated) { + return@apply + } + + accountNumberId() + amount() + debtorAccountNumber() + debtorName() + debtorRoutingNumber() + unstructuredRemittanceInformation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (accountNumberId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (debtorAccountNumber.asKnown().isPresent) 1 else 0) + + (if (debtorName.asKnown().isPresent) 1 else 0) + + (if (debtorRoutingNumber.asKnown().isPresent) 1 else 0) + + (if (unstructuredRemittanceInformation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Body && + accountNumberId == other.accountNumberId && + amount == other.amount && + debtorAccountNumber == other.debtorAccountNumber && + debtorName == other.debtorName && + debtorRoutingNumber == other.debtorRoutingNumber && + unstructuredRemittanceInformation == other.unstructuredRemittanceInformation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + accountNumberId, + amount, + debtorAccountNumber, + debtorName, + debtorRoutingNumber, + unstructuredRemittanceInformation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Body{accountNumberId=$accountNumberId, amount=$amount, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, unstructuredRemittanceInformation=$unstructuredRemittanceInformation, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InboundFednowTransferCreateParams && + body == other.body && + additionalHeaders == other.additionalHeaders && + additionalQueryParams == other.additionalQueryParams + } + + override fun hashCode(): Int = Objects.hash(body, additionalHeaders, additionalQueryParams) + + override fun toString() = + "InboundFednowTransferCreateParams{body=$body, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams}" +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt new file mode 100644 index 000000000..1debb37e7 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsync.kt @@ -0,0 +1,344 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface FednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): FednowTransferServiceAsync + + /** Create a FedNow Transfer */ + fun create(params: FednowTransferCreateParams): CompletableFuture = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** Retrieve a FedNow Transfer */ + fun retrieve(fednowTransferId: String): CompletableFuture = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): CompletableFuture = retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve(params: FednowTransferRetrieveParams): CompletableFuture = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** List FedNow Transfers */ + fun list(): CompletableFuture = + list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): CompletableFuture = + list(FednowTransferListParams.none(), requestOptions) + + /** Approve a FedNow Transfer */ + fun approve(fednowTransferId: String): CompletableFuture = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): CompletableFuture = approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see approve */ + fun approve(params: FednowTransferApproveParams): CompletableFuture = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** Cancel a pending FedNow Transfer */ + fun cancel(fednowTransferId: String): CompletableFuture = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): CompletableFuture = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see cancel */ + fun cancel(params: FednowTransferCancelParams): CompletableFuture = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + + /** + * A view of [FednowTransferServiceAsync] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /fednow_transfers`, but is otherwise the same as + * [FednowTransferServiceAsync.create]. + */ + fun create( + params: FednowTransferCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** + * Returns a raw HTTP response for `get /fednow_transfers/{fednow_transfer_id}`, but is + * otherwise the same as [FednowTransferServiceAsync.retrieve]. + */ + fun retrieve(fednowTransferId: String): CompletableFuture> = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): CompletableFuture> = + retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /fednow_transfers`, but is otherwise the same as + * [FednowTransferServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(FednowTransferListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/approve`, + * but is otherwise the same as [FednowTransferServiceAsync.approve]. + */ + fun approve(fednowTransferId: String): CompletableFuture> = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): CompletableFuture> = + approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams + ): CompletableFuture> = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/cancel`, but + * is otherwise the same as [FednowTransferServiceAsync.cancel]. + */ + fun cancel(fednowTransferId: String): CompletableFuture> = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): CompletableFuture> = + cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams + ): CompletableFuture> = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..ea4c3f72e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncImpl.kt @@ -0,0 +1,263 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPageAsync +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class FednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : FednowTransferServiceAsync { + + private val withRawResponse: FednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): FednowTransferServiceAsync.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync = + FednowTransferServiceAsyncImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /fednow_transfers/{fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /fednow_transfers + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers/{fednow_transfer_id}/approve + withRawResponse().approve(params, requestOptions).thenApply { it.parse() } + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /fednow_transfers/{fednow_transfer_id}/cancel + withRawResponse().cancel(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): FednowTransferServiceAsync.WithRawResponse = + FednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + FednowTransferListPageAsync.builder() + .service(FednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + + private val approveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "approve") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { approveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val cancelHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "cancel") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { cancelHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt new file mode 100644 index 000000000..ca737e1bf --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsync.kt @@ -0,0 +1,186 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface InboundFednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferServiceAsync + + /** Retrieve an Inbound FedNow Transfer */ + fun retrieve(inboundFednowTransferId: String): CompletableFuture = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): CompletableFuture = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): CompletableFuture = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** List Inbound FedNow Transfers */ + fun list(): CompletableFuture = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): CompletableFuture = list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture = + list(InboundFednowTransferListParams.none(), requestOptions) + + /** + * A view of [InboundFednowTransferServiceAsync] that provides access to raw HTTP responses for + * each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /inbound_fednow_transfers/{inbound_fednow_transfer_id}`, but is otherwise the same as + * [InboundFednowTransferServiceAsync.retrieve]. + */ + fun retrieve( + inboundFednowTransferId: String + ): CompletableFuture> = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): CompletableFuture> = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): CompletableFuture> = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): CompletableFuture> = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /inbound_fednow_transfers`, but is otherwise the + * same as [InboundFednowTransferServiceAsync.list]. + */ + fun list(): CompletableFuture> = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): CompletableFuture> = + list(params, RequestOptions.none()) + + /** @see list */ + fun list( + requestOptions: RequestOptions + ): CompletableFuture> = + list(InboundFednowTransferListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..992a3cf7e --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncImpl.kt @@ -0,0 +1,142 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class InboundFednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferServiceAsync { + + private val withRawResponse: InboundFednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferServiceAsync.WithRawResponse = + withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync = + InboundFednowTransferServiceAsyncImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /inbound_fednow_transfers/{inbound_fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).thenApply { it.parse() } + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // get /inbound_fednow_transfers + withRawResponse().list(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse = + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inboundFednowTransferId", params.inboundFednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers", params._pathParam(0)) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers") + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + InboundFednowTransferListPageAsync.builder() + .service(InboundFednowTransferServiceAsyncImpl(clientOptions)) + .streamHandlerExecutor(clientOptions.streamHandlerExecutor) + .params(params) + .response(it) + .build() + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt index 1ea163761..ea0418bd8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsync.kt @@ -21,6 +21,7 @@ import com.increase.api.services.async.simulations.DigitalWalletTokenRequestServ import com.increase.api.services.async.simulations.DocumentServiceAsync import com.increase.api.services.async.simulations.InboundAchTransferServiceAsync import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsync +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsync import com.increase.api.services.async.simulations.InboundMailItemServiceAsync import com.increase.api.services.async.simulations.InboundRealTimePaymentsTransferServiceAsync import com.increase.api.services.async.simulations.InboundWireDrawdownRequestServiceAsync @@ -94,6 +95,8 @@ interface SimulationServiceAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync + fun checkDeposits(): CheckDepositServiceAsync fun inboundMailItems(): InboundMailItemServiceAsync @@ -168,6 +171,8 @@ interface SimulationServiceAsync { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync.WithRawResponse + fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse + fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse fun inboundMailItems(): InboundMailItemServiceAsync.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt index 8aa019ed2..1bb414948 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/SimulationServiceAsyncImpl.kt @@ -39,6 +39,8 @@ import com.increase.api.services.async.simulations.InboundAchTransferServiceAsyn import com.increase.api.services.async.simulations.InboundAchTransferServiceAsyncImpl import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsync import com.increase.api.services.async.simulations.InboundCheckDepositServiceAsyncImpl +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsync +import com.increase.api.services.async.simulations.InboundFednowTransferServiceAsyncImpl import com.increase.api.services.async.simulations.InboundMailItemServiceAsync import com.increase.api.services.async.simulations.InboundMailItemServiceAsyncImpl import com.increase.api.services.async.simulations.InboundRealTimePaymentsTransferServiceAsync @@ -163,6 +165,10 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsyncImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferServiceAsync by lazy { + InboundFednowTransferServiceAsyncImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync by lazy { CheckDepositServiceAsyncImpl(clientOptions) } @@ -239,6 +245,9 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferServiceAsync = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync = checkDeposits override fun inboundMailItems(): InboundMailItemServiceAsync = inboundMailItems @@ -352,6 +361,11 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) } + private val inboundFednowTransfers: + InboundFednowTransferServiceAsync.WithRawResponse by lazy { + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositServiceAsync.WithRawResponse by lazy { CheckDepositServiceAsyncImpl.WithRawResponseImpl(clientOptions) } @@ -444,6 +458,9 @@ class SimulationServiceAsyncImpl internal constructor(private val clientOptions: InboundRealTimePaymentsTransferServiceAsync.WithRawResponse = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferServiceAsync.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositServiceAsync.WithRawResponse = checkDeposits override fun inboundMailItems(): InboundMailItemServiceAsync.WithRawResponse = diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt new file mode 100644 index 000000000..0a0b3fc68 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsync.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +interface InboundFednowTransferServiceAsync { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferServiceAsync + + /** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ + fun create( + params: InboundFednowTransferCreateParams + ): CompletableFuture = create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture + + /** + * A view of [InboundFednowTransferServiceAsync] that provides access to raw HTTP responses for + * each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse + + /** + * Returns a raw HTTP response for `post /simulations/inbound_fednow_transfers`, but is + * otherwise the same as [InboundFednowTransferServiceAsync.create]. + */ + fun create( + params: InboundFednowTransferCreateParams + ): CompletableFuture> = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): CompletableFuture> + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt new file mode 100644 index 000000000..3282a705a --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncImpl.kt @@ -0,0 +1,91 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepareAsync +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +class InboundFednowTransferServiceAsyncImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferServiceAsync { + + private val withRawResponse: InboundFednowTransferServiceAsync.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferServiceAsync.WithRawResponse = + withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync = + InboundFednowTransferServiceAsyncImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture = + // post /simulations/inbound_fednow_transfers + withRawResponse().create(params, requestOptions).thenApply { it.parse() } + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferServiceAsync.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferServiceAsync.WithRawResponse = + InboundFednowTransferServiceAsyncImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): CompletableFuture> { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("simulations", "inbound_fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepareAsync(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + return request + .thenComposeAsync { clientOptions.httpClient.executeAsync(it, requestOptions) } + .thenApply { response -> + errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt new file mode 100644 index 000000000..f0447c0dd --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferService.kt @@ -0,0 +1,344 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.function.Consumer + +interface FednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): FednowTransferService + + /** Create a FedNow Transfer */ + fun create(params: FednowTransferCreateParams): FednowTransfer = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** Retrieve a FedNow Transfer */ + fun retrieve(fednowTransferId: String): FednowTransfer = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): FednowTransfer = retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see retrieve */ + fun retrieve(params: FednowTransferRetrieveParams): FednowTransfer = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** List FedNow Transfers */ + fun list(): FednowTransferListPage = list(FednowTransferListParams.none()) + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransferListPage + + /** @see list */ + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): FednowTransferListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): FednowTransferListPage = + list(FednowTransferListParams.none(), requestOptions) + + /** Approve a FedNow Transfer */ + fun approve(fednowTransferId: String): FednowTransfer = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): FednowTransfer = approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see approve */ + fun approve(params: FednowTransferApproveParams): FednowTransfer = + approve(params, RequestOptions.none()) + + /** @see approve */ + fun approve(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** Cancel a pending FedNow Transfer */ + fun cancel(fednowTransferId: String): FednowTransfer = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): FednowTransfer = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): FednowTransfer + + /** @see cancel */ + fun cancel(params: FednowTransferCancelParams): FednowTransfer = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + fun cancel(fednowTransferId: String, requestOptions: RequestOptions): FednowTransfer = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + + /** + * A view of [FednowTransferService] that provides access to raw HTTP responses for each method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): FednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /fednow_transfers`, but is otherwise the same as + * [FednowTransferService.create]. + */ + @MustBeClosed + fun create(params: FednowTransferCreateParams): HttpResponseFor = + create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** + * Returns a raw HTTP response for `get /fednow_transfers/{fednow_transfer_id}`, but is + * otherwise the same as [FednowTransferService.retrieve]. + */ + @MustBeClosed + fun retrieve(fednowTransferId: String): HttpResponseFor = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + params: FednowTransferRetrieveParams = FednowTransferRetrieveParams.none(), + ): HttpResponseFor = + retrieve(fednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve(params: FednowTransferRetrieveParams): HttpResponseFor = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve(fednowTransferId, FednowTransferRetrieveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `get /fednow_transfers`, but is otherwise the same as + * [FednowTransferService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = list(FednowTransferListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: FednowTransferListParams = FednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: FednowTransferListParams = FednowTransferListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(FednowTransferListParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/approve`, + * but is otherwise the same as [FednowTransferService.approve]. + */ + @MustBeClosed + fun approve(fednowTransferId: String): HttpResponseFor = + approve(fednowTransferId, FednowTransferApproveParams.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + approve(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + params: FednowTransferApproveParams = FednowTransferApproveParams.none(), + ): HttpResponseFor = + approve(fednowTransferId, params, RequestOptions.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see approve */ + @MustBeClosed + fun approve(params: FednowTransferApproveParams): HttpResponseFor = + approve(params, RequestOptions.none()) + + /** @see approve */ + @MustBeClosed + fun approve( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + approve(fednowTransferId, FednowTransferApproveParams.none(), requestOptions) + + /** + * Returns a raw HTTP response for `post /fednow_transfers/{fednow_transfer_id}/cancel`, but + * is otherwise the same as [FednowTransferService.cancel]. + */ + @MustBeClosed + fun cancel(fednowTransferId: String): HttpResponseFor = + cancel(fednowTransferId, FednowTransferCancelParams.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + cancel(params.toBuilder().fednowTransferId(fednowTransferId).build(), requestOptions) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + params: FednowTransferCancelParams = FednowTransferCancelParams.none(), + ): HttpResponseFor = cancel(fednowTransferId, params, RequestOptions.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see cancel */ + @MustBeClosed + fun cancel(params: FednowTransferCancelParams): HttpResponseFor = + cancel(params, RequestOptions.none()) + + /** @see cancel */ + @MustBeClosed + fun cancel( + fednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + cancel(fednowTransferId, FednowTransferCancelParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt new file mode 100644 index 000000000..4f4632985 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/FednowTransferServiceImpl.kt @@ -0,0 +1,244 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.fednowtransfers.FednowTransfer +import com.increase.api.models.fednowtransfers.FednowTransferApproveParams +import com.increase.api.models.fednowtransfers.FednowTransferCancelParams +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import com.increase.api.models.fednowtransfers.FednowTransferListPage +import com.increase.api.models.fednowtransfers.FednowTransferListPageResponse +import com.increase.api.models.fednowtransfers.FednowTransferListParams +import com.increase.api.models.fednowtransfers.FednowTransferRetrieveParams +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class FednowTransferServiceImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferService { + + private val withRawResponse: FednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): FednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions(modifier: Consumer): FednowTransferService = + FednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers + withRawResponse().create(params, requestOptions).parse() + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // get /fednow_transfers/{fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): FednowTransferListPage = + // get /fednow_transfers + withRawResponse().list(params, requestOptions).parse() + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers/{fednow_transfer_id}/approve + withRawResponse().approve(params, requestOptions).parse() + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): FednowTransfer = + // post /fednow_transfers/{fednow_transfer_id}/cancel + withRawResponse().cancel(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + FednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): FednowTransferService.WithRawResponse = + FednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: FednowTransferCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: FednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: FednowTransferListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + FednowTransferListPage.builder() + .service(FednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + + private val approveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun approve( + params: FednowTransferApproveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "approve") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { approveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val cancelHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun cancel( + params: FednowTransferCancelParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("fednowTransferId", params.fednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("fednow_transfers", params._pathParam(0), "cancel") + .apply { params._body().ifPresent { body(json(clientOptions.jsonMapper, it)) } } + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { cancelHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt new file mode 100644 index 000000000..c62b7542f --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferService.kt @@ -0,0 +1,185 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.function.Consumer + +interface InboundFednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferService + + /** Retrieve an Inbound FedNow Transfer */ + fun retrieve(inboundFednowTransferId: String): InboundFednowTransfer = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): InboundFednowTransfer = retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer + + /** @see retrieve */ + fun retrieve(params: InboundFednowTransferRetrieveParams): InboundFednowTransfer = + retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** List Inbound FedNow Transfers */ + fun list(): InboundFednowTransferListPage = list(InboundFednowTransferListParams.none()) + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransferListPage + + /** @see list */ + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): InboundFednowTransferListPage = list(params, RequestOptions.none()) + + /** @see list */ + fun list(requestOptions: RequestOptions): InboundFednowTransferListPage = + list(InboundFednowTransferListParams.none(), requestOptions) + + /** + * A view of [InboundFednowTransferService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `get + * /inbound_fednow_transfers/{inbound_fednow_transfer_id}`, but is otherwise the same as + * [InboundFednowTransferService.retrieve]. + */ + @MustBeClosed + fun retrieve(inboundFednowTransferId: String): HttpResponseFor = + retrieve(inboundFednowTransferId, InboundFednowTransferRetrieveParams.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = + InboundFednowTransferRetrieveParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor = + retrieve( + params.toBuilder().inboundFednowTransferId(inboundFednowTransferId).build(), + requestOptions, + ) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + params: InboundFednowTransferRetrieveParams = InboundFednowTransferRetrieveParams.none(), + ): HttpResponseFor = + retrieve(inboundFednowTransferId, params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + params: InboundFednowTransferRetrieveParams + ): HttpResponseFor = retrieve(params, RequestOptions.none()) + + /** @see retrieve */ + @MustBeClosed + fun retrieve( + inboundFednowTransferId: String, + requestOptions: RequestOptions, + ): HttpResponseFor = + retrieve( + inboundFednowTransferId, + InboundFednowTransferRetrieveParams.none(), + requestOptions, + ) + + /** + * Returns a raw HTTP response for `get /inbound_fednow_transfers`, but is otherwise the + * same as [InboundFednowTransferService.list]. + */ + @MustBeClosed + fun list(): HttpResponseFor = + list(InboundFednowTransferListParams.none()) + + /** @see list */ + @MustBeClosed + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none(), + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + + /** @see list */ + @MustBeClosed + fun list( + params: InboundFednowTransferListParams = InboundFednowTransferListParams.none() + ): HttpResponseFor = list(params, RequestOptions.none()) + + /** @see list */ + @MustBeClosed + fun list(requestOptions: RequestOptions): HttpResponseFor = + list(InboundFednowTransferListParams.none(), requestOptions) + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt new file mode 100644 index 000000000..6df0ed717 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceImpl.kt @@ -0,0 +1,131 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.checkRequired +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPage +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListPageResponse +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferListParams +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransferRetrieveParams +import java.util.function.Consumer +import kotlin.jvm.optionals.getOrNull + +class InboundFednowTransferServiceImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferService { + + private val withRawResponse: InboundFednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService = + InboundFednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + // get /inbound_fednow_transfers/{inbound_fednow_transfer_id} + withRawResponse().retrieve(params, requestOptions).parse() + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): InboundFednowTransferListPage = + // get /inbound_fednow_transfers + withRawResponse().list(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse = + InboundFednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val retrieveHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun retrieve( + params: InboundFednowTransferRetrieveParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + // We check here instead of in the params builder because this can be specified + // positionally or in the params class. + checkRequired("inboundFednowTransferId", params.inboundFednowTransferId().getOrNull()) + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers", params._pathParam(0)) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { retrieveHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + + private val listHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun list( + params: InboundFednowTransferListParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.GET) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("inbound_fednow_transfers") + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { listHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + .let { + InboundFednowTransferListPage.builder() + .service(InboundFednowTransferServiceImpl(clientOptions)) + .params(params) + .response(it) + .build() + } + } + } + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt index f124c5978..69da7fc59 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationService.kt @@ -21,6 +21,7 @@ import com.increase.api.services.blocking.simulations.DigitalWalletTokenRequestS import com.increase.api.services.blocking.simulations.DocumentService import com.increase.api.services.blocking.simulations.InboundAchTransferService import com.increase.api.services.blocking.simulations.InboundCheckDepositService +import com.increase.api.services.blocking.simulations.InboundFednowTransferService import com.increase.api.services.blocking.simulations.InboundMailItemService import com.increase.api.services.blocking.simulations.InboundRealTimePaymentsTransferService import com.increase.api.services.blocking.simulations.InboundWireDrawdownRequestService @@ -94,6 +95,8 @@ interface SimulationService { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService + fun inboundFednowTransfers(): InboundFednowTransferService + fun checkDeposits(): CheckDepositService fun inboundMailItems(): InboundMailItemService @@ -165,6 +168,8 @@ interface SimulationService { fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService.WithRawResponse + fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse + fun checkDeposits(): CheckDepositService.WithRawResponse fun inboundMailItems(): InboundMailItemService.WithRawResponse diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt index e0b712f98..c49b8a384 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/SimulationServiceImpl.kt @@ -39,6 +39,8 @@ import com.increase.api.services.blocking.simulations.InboundAchTransferService import com.increase.api.services.blocking.simulations.InboundAchTransferServiceImpl import com.increase.api.services.blocking.simulations.InboundCheckDepositService import com.increase.api.services.blocking.simulations.InboundCheckDepositServiceImpl +import com.increase.api.services.blocking.simulations.InboundFednowTransferService +import com.increase.api.services.blocking.simulations.InboundFednowTransferServiceImpl import com.increase.api.services.blocking.simulations.InboundMailItemService import com.increase.api.services.blocking.simulations.InboundMailItemServiceImpl import com.increase.api.services.blocking.simulations.InboundRealTimePaymentsTransferService @@ -156,6 +158,10 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferServiceImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferService by lazy { + InboundFednowTransferServiceImpl(clientOptions) + } + private val checkDeposits: CheckDepositService by lazy { CheckDepositServiceImpl(clientOptions) } @@ -230,6 +236,8 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie override fun inboundRealTimePaymentsTransfers(): InboundRealTimePaymentsTransferService = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferService = inboundFednowTransfers + override fun checkDeposits(): CheckDepositService = checkDeposits override fun inboundMailItems(): InboundMailItemService = inboundMailItems @@ -342,6 +350,10 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferServiceImpl.WithRawResponseImpl(clientOptions) } + private val inboundFednowTransfers: InboundFednowTransferService.WithRawResponse by lazy { + InboundFednowTransferServiceImpl.WithRawResponseImpl(clientOptions) + } + private val checkDeposits: CheckDepositService.WithRawResponse by lazy { CheckDepositServiceImpl.WithRawResponseImpl(clientOptions) } @@ -432,6 +444,9 @@ class SimulationServiceImpl internal constructor(private val clientOptions: Clie InboundRealTimePaymentsTransferService.WithRawResponse = inboundRealTimePaymentsTransfers + override fun inboundFednowTransfers(): InboundFednowTransferService.WithRawResponse = + inboundFednowTransfers + override fun checkDeposits(): CheckDepositService.WithRawResponse = checkDeposits override fun inboundMailItems(): InboundMailItemService.WithRawResponse = inboundMailItems diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt new file mode 100644 index 000000000..bdda1f5ad --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferService.kt @@ -0,0 +1,68 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.google.errorprone.annotations.MustBeClosed +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.function.Consumer + +interface InboundFednowTransferService { + + /** + * Returns a view of this service that provides access to raw HTTP responses for each method. + */ + fun withRawResponse(): WithRawResponse + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions(modifier: Consumer): InboundFednowTransferService + + /** Simulates an [Inbound FedNow Transfer](#inbound-fednow-transfers) to your account. */ + fun create(params: InboundFednowTransferCreateParams): InboundFednowTransfer = + create(params, RequestOptions.none()) + + /** @see create */ + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): InboundFednowTransfer + + /** + * A view of [InboundFednowTransferService] that provides access to raw HTTP responses for each + * method. + */ + interface WithRawResponse { + + /** + * Returns a view of this service with the given option modifications applied. + * + * The original service is not modified. + */ + fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse + + /** + * Returns a raw HTTP response for `post /simulations/inbound_fednow_transfers`, but is + * otherwise the same as [InboundFednowTransferService.create]. + */ + @MustBeClosed + fun create( + params: InboundFednowTransferCreateParams + ): HttpResponseFor = create(params, RequestOptions.none()) + + /** @see create */ + @MustBeClosed + fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions = RequestOptions.none(), + ): HttpResponseFor + } +} diff --git a/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt new file mode 100644 index 000000000..e15d91289 --- /dev/null +++ b/increase-java-core/src/main/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceImpl.kt @@ -0,0 +1,84 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.increase.api.core.ClientOptions +import com.increase.api.core.RequestOptions +import com.increase.api.core.handlers.errorBodyHandler +import com.increase.api.core.handlers.errorHandler +import com.increase.api.core.handlers.jsonHandler +import com.increase.api.core.http.HttpMethod +import com.increase.api.core.http.HttpRequest +import com.increase.api.core.http.HttpResponse +import com.increase.api.core.http.HttpResponse.Handler +import com.increase.api.core.http.HttpResponseFor +import com.increase.api.core.http.json +import com.increase.api.core.http.parseable +import com.increase.api.core.prepare +import com.increase.api.models.inboundfednowtransfers.InboundFednowTransfer +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import java.util.function.Consumer + +class InboundFednowTransferServiceImpl +internal constructor(private val clientOptions: ClientOptions) : InboundFednowTransferService { + + private val withRawResponse: InboundFednowTransferService.WithRawResponse by lazy { + WithRawResponseImpl(clientOptions) + } + + override fun withRawResponse(): InboundFednowTransferService.WithRawResponse = withRawResponse + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService = + InboundFednowTransferServiceImpl(clientOptions.toBuilder().apply(modifier::accept).build()) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): InboundFednowTransfer = + // post /simulations/inbound_fednow_transfers + withRawResponse().create(params, requestOptions).parse() + + class WithRawResponseImpl internal constructor(private val clientOptions: ClientOptions) : + InboundFednowTransferService.WithRawResponse { + + private val errorHandler: Handler = + errorHandler(errorBodyHandler(clientOptions.jsonMapper)) + + override fun withOptions( + modifier: Consumer + ): InboundFednowTransferService.WithRawResponse = + InboundFednowTransferServiceImpl.WithRawResponseImpl( + clientOptions.toBuilder().apply(modifier::accept).build() + ) + + private val createHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + + override fun create( + params: InboundFednowTransferCreateParams, + requestOptions: RequestOptions, + ): HttpResponseFor { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .baseUrl(clientOptions.baseUrl()) + .addPathSegments("simulations", "inbound_fednow_transfers") + .body(json(clientOptions.jsonMapper, params._body())) + .build() + .prepare(clientOptions, params) + val requestOptions = requestOptions.applyDefaults(RequestOptions.from(clientOptions)) + val response = clientOptions.httpClient.execute(request, requestOptions) + return errorHandler.handle(response).parseable { + response + .use { createHandler.handle(it) } + .also { + if (requestOptions.responseValidation!!) { + it.validate() + } + } + } + } + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt new file mode 100644 index 000000000..d9904bdf1 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferApproveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferApproveParamsTest { + + @Test + fun create() { + FednowTransferApproveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferApproveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt new file mode 100644 index 000000000..a6cd3d84a --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCancelParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferCancelParamsTest { + + @Test + fun create() { + FednowTransferCancelParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferCancelParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt new file mode 100644 index 000000000..543bf2c30 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferCreateParamsTest.kt @@ -0,0 +1,127 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferCreateParamsTest { + + @Test + fun create() { + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + } + + @Test + fun body() { + val params = + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.amount()).isEqualTo(100L) + assertThat(body.creditorName()).isEqualTo("Ian Crease") + assertThat(body.debtorName()).isEqualTo("National Phonograph Company") + assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + assertThat(body.accountNumber()).contains("987654321") + assertThat(body.creditorAddress()) + .contains( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + assertThat(body.debtorAddress()) + .contains( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + assertThat(body.externalAccountId()).contains("external_account_id") + assertThat(body.requireApproval()).contains(true) + assertThat(body.routingNumber()).contains("101050001") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val body = params._body() + + assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(body.amount()).isEqualTo(100L) + assertThat(body.creditorName()).isEqualTo("Ian Crease") + assertThat(body.debtorName()).isEqualTo("National Phonograph Company") + assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt new file mode 100644 index 000000000..555be5ebb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListPageResponseTest.kt @@ -0,0 +1,221 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferListPageResponseTest { + + @Test + fun create() { + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() + .addData( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(fednowTransferListPageResponse.data()) + .containsExactly( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + assertThat(fednowTransferListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fednowTransferListPageResponse = + FednowTransferListPageResponse.builder() + .addData( + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder() + .name("name") + .build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedFednowTransferListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fednowTransferListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFednowTransferListPageResponse) + .isEqualTo(fednowTransferListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt new file mode 100644 index 000000000..3f0ce6b0e --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferListParamsTest.kt @@ -0,0 +1,87 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferListParamsTest { + + @Test + fun create() { + FednowTransferListParams.builder() + .accountId("account_id") + .createdAt( + FednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .externalAccountId("external_account_id") + .idempotencyKey("x") + .limit(1L) + .status( + FednowTransferListParams.Status.builder() + .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) + .build() + ) + .build() + } + + @Test + fun queryParams() { + val params = + FednowTransferListParams.builder() + .accountId("account_id") + .createdAt( + FednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .externalAccountId("external_account_id") + .idempotencyKey("x") + .limit(1L) + .status( + FednowTransferListParams.Status.builder() + .addIn(FednowTransferListParams.Status.In.PENDING_REVIEWING) + .build() + ) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("account_id", "account_id") + .put("created_at.after", "2019-12-27T18:11:19.117Z") + .put("created_at.before", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_after", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_before", "2019-12-27T18:11:19.117Z") + .put("cursor", "cursor") + .put("external_account_id", "external_account_id") + .put("idempotency_key", "x") + .put("limit", "1") + .put("status.in", listOf("pending_reviewing").joinToString(",")) + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = FednowTransferListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt new file mode 100644 index 000000000..d7fb418cb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferRetrieveParamsTest { + + @Test + fun create() { + FednowTransferRetrieveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + } + + @Test + fun pathParams() { + val params = + FednowTransferRetrieveParams.builder() + .fednowTransferId("fednow_transfer_4i0mptrdu1mueg1196bg") + .build() + + assertThat(params._pathParam(0)).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt new file mode 100644 index 000000000..25cb67962 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/fednowtransfers/FednowTransferTest.kt @@ -0,0 +1,200 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.fednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class FednowTransferTest { + + @Test + fun create() { + val fednowTransfer = + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + assertThat(fednowTransfer.id()).isEqualTo("fednow_transfer_4i0mptrdu1mueg1196bg") + assertThat(fednowTransfer.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(fednowTransfer.accountNumber()).isEqualTo("987654321") + assertThat(fednowTransfer.acknowledgement()) + .contains( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.amount()).isEqualTo(100L) + assertThat(fednowTransfer.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(fednowTransfer.createdBy()) + .contains( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder().description("description").build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user(FednowTransfer.CreatedBy.User.builder().email("user@example.com").build()) + .build() + ) + assertThat(fednowTransfer.creditorName()).isEqualTo("Ian Crease") + assertThat(fednowTransfer.currency()).isEqualTo(FednowTransfer.Currency.USD) + assertThat(fednowTransfer.debtorName()).isEqualTo("National Phonograph Company") + assertThat(fednowTransfer.externalAccountId()).isEmpty + assertThat(fednowTransfer.idempotencyKey()).isEmpty + assertThat(fednowTransfer.pendingTransactionId()) + .contains("pending_transaction_k1sfetcau2qbvjbzgju4") + assertThat(fednowTransfer.rejection()) + .contains( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.routingNumber()).isEqualTo("101050001") + assertThat(fednowTransfer.sourceAccountNumberId()) + .isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(fednowTransfer.status()).isEqualTo(FednowTransfer.Status.COMPLETE) + assertThat(fednowTransfer.submission()) + .contains( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + assertThat(fednowTransfer.transactionId()).contains("transaction_uyrp7fld2ium70oa7oi") + assertThat(fednowTransfer.type()).isEqualTo(FednowTransfer.Type.FEDNOW_TRANSFER) + assertThat(fednowTransfer.uniqueEndToEndTransactionReference()) + .isEqualTo("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + assertThat(fednowTransfer.unstructuredRemittanceInformation()).isEqualTo("Invoice 29582") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val fednowTransfer = + FednowTransfer.builder() + .id("fednow_transfer_4i0mptrdu1mueg1196bg") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumber("987654321") + .acknowledgement( + FednowTransfer.Acknowledgement.builder() + .acknowledgedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .amount(100L) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .createdBy( + FednowTransfer.CreatedBy.builder() + .apiKey( + FednowTransfer.CreatedBy.ApiKey.builder() + .description("description") + .build() + ) + .category(FednowTransfer.CreatedBy.Category.USER) + .oauthApplication( + FednowTransfer.CreatedBy.OAuthApplication.builder().name("name").build() + ) + .user( + FednowTransfer.CreatedBy.User.builder() + .email("user@example.com") + .build() + ) + .build() + ) + .creditorName("Ian Crease") + .currency(FednowTransfer.Currency.USD) + .debtorName("National Phonograph Company") + .externalAccountId(null) + .idempotencyKey(null) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .rejection( + FednowTransfer.Rejection.builder() + .rejectReasonAdditionalInformation(null) + .rejectReasonCode(FednowTransfer.Rejection.RejectReasonCode.OTHER) + .rejectedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .routingNumber("101050001") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .status(FednowTransfer.Status.COMPLETE) + .submission( + FednowTransfer.Submission.builder() + .messageIdentification("20250308723260130GT4LAKENDXBHQCZDWS") + .submittedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .build() + ) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(FednowTransfer.Type.FEDNOW_TRANSFER) + .uniqueEndToEndTransactionReference("9a21e10a-7600-4a24-8ff3-2cbc5943c27a") + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val roundtrippedFednowTransfer = + jsonMapper.readValue( + jsonMapper.writeValueAsString(fednowTransfer), + jacksonTypeRef(), + ) + + assertThat(roundtrippedFednowTransfer).isEqualTo(fednowTransfer) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt new file mode 100644 index 000000000..9ad0c3f5d --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListPageResponseTest.kt @@ -0,0 +1,132 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferListPageResponseTest { + + @Test + fun create() { + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() + .addData( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason( + InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED + ) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + assertThat(inboundFednowTransferListPageResponse.data()) + .containsExactly( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + assertThat(inboundFednowTransferListPageResponse.nextCursor()).contains("v57w5d") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val inboundFednowTransferListPageResponse = + InboundFednowTransferListPageResponse.builder() + .addData( + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason( + InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED + ) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + ) + .nextCursor("v57w5d") + .build() + + val roundtrippedInboundFednowTransferListPageResponse = + jsonMapper.readValue( + jsonMapper.writeValueAsString(inboundFednowTransferListPageResponse), + jacksonTypeRef(), + ) + + assertThat(roundtrippedInboundFednowTransferListPageResponse) + .isEqualTo(inboundFednowTransferListPageResponse) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt new file mode 100644 index 000000000..4e51b0b73 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferListParamsTest.kt @@ -0,0 +1,73 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.increase.api.core.http.QueryParams +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferListParamsTest { + + @Test + fun create() { + InboundFednowTransferListParams.builder() + .accountId("account_id") + .accountNumberId("account_number_id") + .createdAt( + InboundFednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .limit(1L) + .build() + } + + @Test + fun queryParams() { + val params = + InboundFednowTransferListParams.builder() + .accountId("account_id") + .accountNumberId("account_number_id") + .createdAt( + InboundFednowTransferListParams.CreatedAt.builder() + .after(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .before(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrAfter(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .onOrBefore(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .build() + ) + .cursor("cursor") + .limit(1L) + .build() + + val queryParams = params._queryParams() + + assertThat(queryParams) + .isEqualTo( + QueryParams.builder() + .put("account_id", "account_id") + .put("account_number_id", "account_number_id") + .put("created_at.after", "2019-12-27T18:11:19.117Z") + .put("created_at.before", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_after", "2019-12-27T18:11:19.117Z") + .put("created_at.on_or_before", "2019-12-27T18:11:19.117Z") + .put("cursor", "cursor") + .put("limit", "1") + .build() + ) + } + + @Test + fun queryParamsWithoutOptionalFields() { + val params = InboundFednowTransferListParams.builder().build() + + val queryParams = params._queryParams() + + assertThat(queryParams).isEqualTo(QueryParams.builder().build()) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt new file mode 100644 index 000000000..e5917296e --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferRetrieveParamsTest.kt @@ -0,0 +1,28 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferRetrieveParamsTest { + + @Test + fun create() { + InboundFednowTransferRetrieveParams.builder() + .inboundFednowTransferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + } + + @Test + fun pathParams() { + val params = + InboundFednowTransferRetrieveParams.builder() + .inboundFednowTransferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + + assertThat(params._pathParam(0)).isEqualTo("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + // out-of-bound path param + assertThat(params._pathParam(1)).isEqualTo("") + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt new file mode 100644 index 000000000..6bc042bc7 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/inboundfednowtransfers/InboundFednowTransferTest.kt @@ -0,0 +1,119 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.inboundfednowtransfers + +import com.fasterxml.jackson.module.kotlin.jacksonTypeRef +import com.increase.api.core.jsonMapper +import java.time.OffsetDateTime +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferTest { + + @Test + fun create() { + val inboundFednowTransfer = + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + assertThat(inboundFednowTransfer.id()) + .isEqualTo("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + assertThat(inboundFednowTransfer.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") + assertThat(inboundFednowTransfer.accountNumberId()) + .isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(inboundFednowTransfer.amount()).isEqualTo(100L) + assertThat(inboundFednowTransfer.confirmation()) + .contains( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + assertThat(inboundFednowTransfer.createdAt()) + .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + assertThat(inboundFednowTransfer.creditorName()).isEqualTo("Ian Crease") + assertThat(inboundFednowTransfer.currency()).isEqualTo(InboundFednowTransfer.Currency.USD) + assertThat(inboundFednowTransfer.debtorAccountNumber()).isEqualTo("987654321") + assertThat(inboundFednowTransfer.debtorName()).isEqualTo("National Phonograph Company") + assertThat(inboundFednowTransfer.debtorRoutingNumber()).isEqualTo("101050001") + assertThat(inboundFednowTransfer.decline()) + .contains( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + assertThat(inboundFednowTransfer.status()).isEqualTo(InboundFednowTransfer.Status.CONFIRMED) + assertThat(inboundFednowTransfer.transactionId()) + .contains("transaction_uyrp7fld2ium70oa7oi") + assertThat(inboundFednowTransfer.type()) + .isEqualTo(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + assertThat(inboundFednowTransfer.unstructuredRemittanceInformation()) + .contains("Invoice 29582") + } + + @Test + fun roundtrip() { + val jsonMapper = jsonMapper() + val inboundFednowTransfer = + InboundFednowTransfer.builder() + .id("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .accountId("account_in71c4amph0vgo2qllky") + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(100L) + .confirmation( + InboundFednowTransfer.Confirmation.builder() + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .creditorName("Ian Crease") + .currency(InboundFednowTransfer.Currency.USD) + .debtorAccountNumber("987654321") + .debtorName("National Phonograph Company") + .debtorRoutingNumber("101050001") + .decline( + InboundFednowTransfer.Decline.builder() + .reason(InboundFednowTransfer.Decline.Reason.ACCOUNT_NUMBER_DISABLED) + .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + .build() + ) + .status(InboundFednowTransfer.Status.CONFIRMED) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(InboundFednowTransfer.Type.INBOUND_FEDNOW_TRANSFER) + .unstructuredRemittanceInformation("Invoice 29582") + .build() + + val roundtrippedInboundFednowTransfer = + jsonMapper.readValue( + jsonMapper.writeValueAsString(inboundFednowTransfer), + jacksonTypeRef(), + ) + + assertThat(roundtrippedInboundFednowTransfer).isEqualTo(inboundFednowTransfer) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt new file mode 100644 index 000000000..45a6784e0 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/inboundfednowtransfers/InboundFednowTransferCreateParamsTest.kt @@ -0,0 +1,57 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.models.simulations.inboundfednowtransfers + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +internal class InboundFednowTransferCreateParamsTest { + + @Test + fun create() { + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + } + + @Test + fun body() { + val params = + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + + val body = params._body() + + assertThat(body.accountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.amount()).isEqualTo(1000L) + assertThat(body.debtorAccountNumber()).contains("x") + assertThat(body.debtorName()).contains("x") + assertThat(body.debtorRoutingNumber()).contains("xxxxxxxxx") + assertThat(body.unstructuredRemittanceInformation()).contains("x") + } + + @Test + fun bodyWithoutOptionalFields() { + val params = + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .build() + + val body = params._body() + + assertThat(body.accountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.amount()).isEqualTo(1000L) + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..129774f41 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/FednowTransferServiceAsyncTest.kt @@ -0,0 +1,121 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class FednowTransferServiceAsyncTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.create( + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + ) + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.retrieve("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val pageFuture = fednowTransferServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } + + @Test + fun approve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.approve("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } + + @Test + fun cancel() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferServiceAsync = client.fednowTransfers() + + val fednowTransferFuture = + fednowTransferServiceAsync.cancel("fednow_transfer_4i0mptrdu1mueg1196bg") + + val fednowTransfer = fednowTransferFuture.get() + fednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..71b6d422b --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/InboundFednowTransferServiceAsyncTest.kt @@ -0,0 +1,45 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceAsyncTest { + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.inboundFednowTransfers() + + val inboundFednowTransferFuture = + inboundFednowTransferServiceAsync.retrieve( + "inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20" + ) + + val inboundFednowTransfer = inboundFednowTransferFuture.get() + inboundFednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.inboundFednowTransfers() + + val pageFuture = inboundFednowTransferServiceAsync.list() + + val page = pageFuture.get() + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt new file mode 100644 index 000000000..a1e3ed3c5 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/InboundFednowTransferServiceAsyncTest.kt @@ -0,0 +1,38 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.async.simulations + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceAsyncTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClientAsync.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferServiceAsync = client.simulations().inboundFednowTransfers() + + val inboundFednowTransferFuture = + inboundFednowTransferServiceAsync.create( + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + ) + + val inboundFednowTransfer = inboundFednowTransferFuture.get() + inboundFednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt new file mode 100644 index 000000000..7dcad0dc8 --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/FednowTransferServiceTest.kt @@ -0,0 +1,113 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import com.increase.api.models.fednowtransfers.FednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class FednowTransferServiceTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = + fednowTransferService.create( + FednowTransferCreateParams.builder() + .accountId("account_in71c4amph0vgo2qllky") + .amount(100L) + .creditorName("Ian Crease") + .debtorName("National Phonograph Company") + .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .unstructuredRemittanceInformation("Invoice 29582") + .accountNumber("987654321") + .creditorAddress( + FednowTransferCreateParams.CreditorAddress.builder() + .city("New York") + .postalCode("10045") + .state("NY") + .line1("33 Liberty Street") + .build() + ) + .debtorAddress( + FednowTransferCreateParams.DebtorAddress.builder() + .city("x") + .postalCode("x") + .state("x") + .line1("x") + .build() + ) + .externalAccountId("external_account_id") + .requireApproval(true) + .routingNumber("101050001") + .build() + ) + + fednowTransfer.validate() + } + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.retrieve("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val page = fednowTransferService.list() + + page.response().validate() + } + + @Test + fun approve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.approve("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } + + @Test + fun cancel() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val fednowTransferService = client.fednowTransfers() + + val fednowTransfer = fednowTransferService.cancel("fednow_transfer_4i0mptrdu1mueg1196bg") + + fednowTransfer.validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt new file mode 100644 index 000000000..52147b35f --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/InboundFednowTransferServiceTest.kt @@ -0,0 +1,41 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceTest { + + @Test + fun retrieve() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.inboundFednowTransfers() + + val inboundFednowTransfer = + inboundFednowTransferService.retrieve("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20") + + inboundFednowTransfer.validate() + } + + @Test + fun list() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.inboundFednowTransfers() + + val page = inboundFednowTransferService.list() + + page.response().validate() + } +} diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt new file mode 100644 index 000000000..d17e0e5fb --- /dev/null +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/InboundFednowTransferServiceTest.kt @@ -0,0 +1,37 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.increase.api.services.blocking.simulations + +import com.increase.api.TestServerExtension +import com.increase.api.client.okhttp.IncreaseOkHttpClient +import com.increase.api.models.simulations.inboundfednowtransfers.InboundFednowTransferCreateParams +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.extension.ExtendWith + +@ExtendWith(TestServerExtension::class) +internal class InboundFednowTransferServiceTest { + + @Test + fun create() { + val client = + IncreaseOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My API Key") + .build() + val inboundFednowTransferService = client.simulations().inboundFednowTransfers() + + val inboundFednowTransfer = + inboundFednowTransferService.create( + InboundFednowTransferCreateParams.builder() + .accountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .amount(1000L) + .debtorAccountNumber("x") + .debtorName("x") + .debtorRoutingNumber("xxxxxxxxx") + .unstructuredRemittanceInformation("x") + .build() + ) + + inboundFednowTransfer.validate() + } +} diff --git a/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt b/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt index 5ac6a9ae2..4b3d3ef42 100644 --- a/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt +++ b/increase-java-proguard-test/src/test/kotlin/com/increase/api/proguard/ProGuardCompatibilityTest.kt @@ -74,6 +74,8 @@ internal class ProGuardCompatibilityTest { assertThat(client.inboundCheckDeposits()).isNotNull() assertThat(client.realTimePaymentsTransfers()).isNotNull() assertThat(client.inboundRealTimePaymentsTransfers()).isNotNull() + assertThat(client.fednowTransfers()).isNotNull() + assertThat(client.inboundFednowTransfers()).isNotNull() assertThat(client.checkDeposits()).isNotNull() assertThat(client.lockboxes()).isNotNull() assertThat(client.inboundMailItems()).isNotNull() From a7c29d9eb1fcd85020ae654163f7a08aa6d606dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 26 Oct 2025 13:50:25 +0000 Subject: [PATCH 18/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 1148 ++++++++++++++++- .../DeclinedTransaction.kt | 276 +++- .../pendingtransactions/PendingTransaction.kt | 276 +++- .../realtimedecisions/RealTimeDecision.kt | 273 +++- .../api/models/transactions/Transaction.kt | 276 +++- .../CardPaymentListPageResponseTest.kt | 432 +++++++ .../models/cardpayments/CardPaymentTest.kt | 384 ++++++ ...DeclinedTransactionListPageResponseTest.kt | 27 + .../DeclinedTransactionTest.kt | 24 + .../PendingTransactionListPageResponseTest.kt | 27 + .../PendingTransactionTest.kt | 27 + .../realtimedecisions/RealTimeDecisionTest.kt | 21 + .../CardAuthorizationCreateResponseTest.kt | 54 + .../TransactionListPageResponseTest.kt | 26 + .../models/transactions/TransactionTest.kt | 23 + 16 files changed, 3266 insertions(+), 32 deletions(-) diff --git a/.stats.yml b/.stats.yml index 2363e1cfc..23a163cf1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e809e9e4e5bc9c602a2ecebfbdb4a77d6c88c6f70f0b47a7a4d1dd1df4aaa66d.yml -openapi_spec_hash: cb6cb9fa09a8e52f6eb89271b559823d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9848b3b7725425c712a5fba932c836f3210adf21b9b7a232370f13960790158c.yml +openapi_spec_hash: 49090a79a8225d8ad36fe249aac2a12a config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 811e051b8..a546aecc8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -5675,6 +5675,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -5693,6 +5694,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -5717,6 +5721,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -5743,6 +5748,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -5818,6 +5831,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -5908,6 +5931,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -5925,6 +5949,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -5938,6 +5963,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -5978,6 +6004,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -6144,6 +6185,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -6159,6 +6201,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -6179,6 +6222,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -6207,6 +6251,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -6669,6 +6714,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8272,6 +8544,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -8286,6 +8559,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -8300,7 +8574,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -14787,6 +15061,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -14805,6 +15080,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -14829,6 +15107,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -14855,6 +15134,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -14930,6 +15217,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -15020,6 +15317,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -15037,6 +15335,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -15050,6 +15349,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -15090,6 +15390,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -15256,6 +15571,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -15271,6 +15587,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -15291,6 +15608,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -15319,6 +15637,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -15781,8 +16100,235 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The part of this transaction amount that was for healthcare prescriptions. */ - class Prescription + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -17384,6 +17930,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -17398,6 +17945,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -17412,7 +17960,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -24127,6 +24675,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -24145,6 +24694,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -24169,6 +24721,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -24195,6 +24748,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -24270,6 +24831,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -24360,6 +24931,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -24377,6 +24949,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -24390,6 +24963,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -24430,6 +25004,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -24596,6 +25185,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -24611,6 +25201,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -24631,6 +25222,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -24659,6 +25251,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -24822,7 +25415,234 @@ private constructor( } /** - * Returns an immutable instance of [Clinic]. + * Returns an immutable instance of [Clinic]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Clinic = + Clinic( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Clinic = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Clinic && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for dental-related services. */ + class Dental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Dental]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Dental]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(dental: Dental) = apply { + amount = dental.amount + currency = dental.currency + additionalProperties = dental.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Dental]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -24834,8 +25654,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Clinic = - Clinic( + fun build(): Dental = + Dental( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -24844,7 +25664,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Clinic = apply { + fun validate(): Dental = apply { if (validated) { return@apply } @@ -24878,7 +25698,7 @@ private constructor( return true } - return other is Clinic && + return other is Dental && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -24891,11 +25711,11 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } - /** The part of this transaction amount that was for dental-related services. */ - class Dental + /** The original pre-authorized amount. */ + class Original @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val amount: JsonField, @@ -24967,7 +25787,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Dental]. + * Returns a mutable builder for constructing an instance of [Original]. * * The following fields are required: * ```java @@ -24978,7 +25798,7 @@ private constructor( @JvmStatic fun builder() = Builder() } - /** A builder for [Dental]. */ + /** A builder for [Original]. */ class Builder internal constructor() { private var amount: JsonField? = null @@ -24987,10 +25807,10 @@ private constructor( mutableMapOf() @JvmSynthetic - internal fun from(dental: Dental) = apply { - amount = dental.amount - currency = dental.currency - additionalProperties = dental.additionalProperties.toMutableMap() + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() } /** @@ -25049,7 +25869,7 @@ private constructor( } /** - * Returns an immutable instance of [Dental]. + * Returns an immutable instance of [Original]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -25061,8 +25881,8 @@ private constructor( * * @throws IllegalStateException if any required field is unset. */ - fun build(): Dental = - Dental( + fun build(): Original = + Original( checkRequired("amount", amount), checkRequired("currency", currency), additionalProperties.toMutableMap(), @@ -25071,7 +25891,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Dental = apply { + fun validate(): Original = apply { if (validated) { return@apply } @@ -25105,7 +25925,7 @@ private constructor( return true } - return other is Dental && + return other is Original && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties @@ -25118,7 +25938,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } /** The part of this transaction amount that was for healthcare prescriptions. */ @@ -26724,6 +27544,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -26738,6 +27559,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -26752,7 +27574,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** @@ -50964,6 +51786,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -50982,6 +51805,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -51006,6 +51832,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -51032,6 +51859,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -51107,6 +51942,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -51197,6 +52042,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -51214,6 +52060,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -51227,6 +52074,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -51267,6 +52115,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -51433,6 +52296,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -51448,6 +52312,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -51468,6 +52333,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -51496,6 +52362,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -51958,6 +52825,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -53561,6 +54655,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -53575,6 +54670,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -53589,7 +54685,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index 9fbe968a1..b8f1ca77c 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -4353,6 +4353,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -4371,6 +4372,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -4395,6 +4399,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -4421,6 +4426,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -4496,6 +4509,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -4586,6 +4609,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4603,6 +4627,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -4616,6 +4641,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -4656,6 +4682,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -4822,6 +4863,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4837,6 +4879,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -4857,6 +4900,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -4885,6 +4929,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -5347,6 +5392,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6950,6 +7222,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -6964,6 +7237,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -6978,7 +7252,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 1639b5ab7..a35be6e13 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -4407,6 +4407,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -4425,6 +4426,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -4449,6 +4453,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -4475,6 +4480,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -4550,6 +4563,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -4640,6 +4663,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4657,6 +4681,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -4670,6 +4695,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -4710,6 +4736,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -4876,6 +4917,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -4891,6 +4933,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -4911,6 +4954,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -4939,6 +4983,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -5401,6 +5446,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -7004,6 +7276,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -7018,6 +7291,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -7032,7 +7306,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index 087cba03d..c33b61b1e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -2976,6 +2976,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -2994,6 +2995,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -3016,6 +3020,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -3042,6 +3047,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -3114,6 +3127,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -3196,6 +3219,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -3213,6 +3237,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -3226,6 +3251,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -3266,6 +3292,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** The part of this transaction amount that was for healthcare prescriptions. */ fun prescription(prescription: Prescription?) = prescription(JsonField.ofNullable(prescription)) @@ -3422,6 +3463,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -3437,6 +3479,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -3457,6 +3500,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -3485,6 +3529,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -3941,6 +3986,230 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if it + * is added to the amount (such as an ATM surcharge fee) and negative if it is + * subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + * amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -5517,6 +5786,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -5531,6 +5801,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -5545,7 +5816,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** Whether or not the authorization was approved. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 73c41994a..5be99a9d5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -9357,6 +9357,7 @@ private constructor( private constructor( private val clinic: JsonField, private val dental: JsonField, + private val original: JsonField, private val prescription: JsonField, private val surcharge: JsonField, private val totalCumulative: JsonField, @@ -9375,6 +9376,9 @@ private constructor( @JsonProperty("dental") @ExcludeMissing dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), @JsonProperty("prescription") @ExcludeMissing prescription: JsonField = JsonMissing.of(), @@ -9399,6 +9403,7 @@ private constructor( ) : this( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -9425,6 +9430,14 @@ private constructor( */ fun dental(): Optional = dental.getOptional("dental") + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + /** * The part of this transaction amount that was for healthcare prescriptions. * @@ -9500,6 +9513,16 @@ private constructor( */ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + /** * Returns the raw JSON value of [prescription]. * @@ -9590,6 +9613,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -9607,6 +9631,7 @@ private constructor( private var clinic: JsonField? = null private var dental: JsonField? = null + private var original: JsonField? = null private var prescription: JsonField? = null private var surcharge: JsonField? = null private var totalCumulative: JsonField? = null @@ -9620,6 +9645,7 @@ private constructor( internal fun from(additionalAmounts: AdditionalAmounts) = apply { clinic = additionalAmounts.clinic dental = additionalAmounts.dental + original = additionalAmounts.original prescription = additionalAmounts.prescription surcharge = additionalAmounts.surcharge totalCumulative = additionalAmounts.totalCumulative @@ -9660,6 +9686,21 @@ private constructor( */ fun dental(dental: JsonField) = apply { this.dental = dental } + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + /** * The part of this transaction amount that was for healthcare prescriptions. */ @@ -9826,6 +9867,7 @@ private constructor( * ```java * .clinic() * .dental() + * .original() * .prescription() * .surcharge() * .totalCumulative() @@ -9841,6 +9883,7 @@ private constructor( AdditionalAmounts( checkRequired("clinic", clinic), checkRequired("dental", dental), + checkRequired("original", original), checkRequired("prescription", prescription), checkRequired("surcharge", surcharge), checkRequired("totalCumulative", totalCumulative), @@ -9861,6 +9904,7 @@ private constructor( clinic().ifPresent { it.validate() } dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } prescription().ifPresent { it.validate() } surcharge().ifPresent { it.validate() } totalCumulative().ifPresent { it.validate() } @@ -9889,6 +9933,7 @@ private constructor( internal fun validity(): Int = (clinic.asKnown().getOrNull()?.validity() ?: 0) + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + (prescription.asKnown().getOrNull()?.validity() ?: 0) + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + @@ -10351,6 +10396,233 @@ private constructor( "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" } + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + /** The part of this transaction amount that was for healthcare prescriptions. */ class Prescription @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -11954,6 +12226,7 @@ private constructor( return other is AdditionalAmounts && clinic == other.clinic && dental == other.dental && + original == other.original && prescription == other.prescription && surcharge == other.surcharge && totalCumulative == other.totalCumulative && @@ -11968,6 +12241,7 @@ private constructor( Objects.hash( clinic, dental, + original, prescription, surcharge, totalCumulative, @@ -11982,7 +12256,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "AdditionalAmounts{clinic=$clinic, dental=$dental, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 77fd6f9ad..2313cabd1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -123,6 +123,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -361,6 +370,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -600,6 +618,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -1322,6 +1349,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -1592,6 +1628,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -1830,6 +1875,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -2069,6 +2123,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -2791,6 +2854,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -3061,6 +3133,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -3299,6 +3380,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -3538,6 +3628,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -4260,6 +4359,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -4530,6 +4638,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -4768,6 +4885,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -5007,6 +5133,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -5729,6 +5864,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -6024,6 +6168,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -6250,6 +6403,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -6483,6 +6645,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -7159,6 +7330,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -7419,6 +7599,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -7645,6 +7834,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -7878,6 +8076,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -8554,6 +8761,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -8814,6 +9030,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -9040,6 +9265,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -9273,6 +9507,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -9949,6 +10192,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -10209,6 +10461,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -10435,6 +10696,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -10668,6 +10938,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -11344,6 +11623,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -11643,6 +11931,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -11881,6 +12178,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -12120,6 +12426,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -12842,6 +13157,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -13112,6 +13436,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -13350,6 +13683,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -13589,6 +13931,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -14311,6 +14662,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -14581,6 +14941,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -14819,6 +15188,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -15058,6 +15436,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -15780,6 +16167,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts @@ -16050,6 +16446,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -16288,6 +16693,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline .AdditionalAmounts @@ -16527,6 +16941,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement .AdditionalAmounts @@ -17249,6 +17672,15 @@ internal class CardPaymentListPageResponseTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index 7b93f1c15..4fa207fe4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -110,6 +110,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -321,6 +330,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -528,6 +545,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -1167,6 +1192,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -1410,6 +1443,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -1621,6 +1663,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -1828,6 +1878,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -2467,6 +2525,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -2710,6 +2776,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -2921,6 +2996,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -3128,6 +3211,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -3767,6 +3858,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -4010,6 +4109,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -4221,6 +4329,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -4428,6 +4544,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -5067,6 +5191,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -5321,6 +5453,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -5506,6 +5646,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -5693,6 +5840,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -6270,6 +6424,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -6487,6 +6649,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -6672,6 +6842,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -6859,6 +7036,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -7436,6 +7620,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -7653,6 +7845,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -7838,6 +8038,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -8025,6 +8232,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -8602,6 +8816,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -8819,6 +9041,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization.AdditionalAmounts .Prescription @@ -9004,6 +9234,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -9191,6 +9428,13 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -9768,6 +10012,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -10027,6 +10279,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -10238,6 +10499,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -10445,6 +10714,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -11084,6 +11361,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -11327,6 +11612,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -11538,6 +11832,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -11745,6 +12047,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -12384,6 +12694,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -12627,6 +12945,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -12838,6 +13165,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -13045,6 +13380,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -13684,6 +14027,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription @@ -13927,6 +14278,15 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardAuthorization .AdditionalAmounts @@ -14138,6 +14498,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardDecline.AdditionalAmounts .Prescription @@ -14345,6 +14713,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardIncrement.AdditionalAmounts .Prescription @@ -14984,6 +15360,14 @@ internal class CardPaymentTest { .currency("currency") .build() ) + .original( + CardPayment.Element.CardValidation.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( CardPayment.Element.CardValidation.AdditionalAmounts .Prescription diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index 5eb7ecb15..8636c8089 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -77,6 +77,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -420,6 +429,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -759,6 +777,15 @@ internal class DeclinedTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index 4c9354eea..f0ece0416 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -66,6 +66,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription @@ -362,6 +370,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription @@ -649,6 +665,14 @@ internal class DeclinedTransactionTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline.AdditionalAmounts .Prescription diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 03846423a..c18006a5d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -75,6 +75,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -428,6 +437,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -770,6 +788,15 @@ internal class PendingTransactionListPageResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 1f984b55e..b9d11dde6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -70,6 +70,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -383,6 +392,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -693,6 +711,15 @@ internal class PendingTransactionTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 6cfc60746..979293de1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -52,6 +52,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts .Prescription @@ -289,6 +296,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts.Prescription .builder() @@ -526,6 +540,13 @@ internal class RealTimeDecisionTest { .currency("currency") .build() ) + .original( + RealTimeDecision.CardAuthorization.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( RealTimeDecision.CardAuthorization.AdditionalAmounts .Prescription diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index 45386a532..c328653b0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -79,6 +79,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -418,6 +427,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -772,6 +790,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -1102,6 +1129,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts @@ -1449,6 +1485,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + DeclinedTransaction.Source.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( DeclinedTransaction.Source.CardDecline .AdditionalAmounts @@ -1788,6 +1833,15 @@ internal class CardAuthorizationCreateResponseTest { .currency("currency") .build() ) + .original( + PendingTransaction.Source.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( PendingTransaction.Source.CardAuthorization .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index c1f909726..2a11ab0ad 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -136,6 +136,15 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial .AdditionalAmounts @@ -1233,6 +1242,14 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -2288,6 +2305,15 @@ internal class TransactionListPageResponseTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial .AdditionalAmounts diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index 4500bf1d7..a92d8f924 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -120,6 +120,14 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -1106,6 +1114,13 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription @@ -2051,6 +2066,14 @@ internal class TransactionTest { .currency("currency") .build() ) + .original( + Transaction.Source.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) .prescription( Transaction.Source.CardFinancial.AdditionalAmounts .Prescription From a57da1835b758b295c18930ead890ab1469997f5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:39:45 +0000 Subject: [PATCH 19/33] feat(api): api update --- .stats.yml | 4 +- .../cardrefunds/CardRefundCreateParams.kt | 84 +++++++++++++++++-- .../cardrefunds/CardRefundCreateParamsTest.kt | 3 + .../simulations/CardRefundServiceAsyncTest.kt | 1 + .../simulations/CardRefundServiceTest.kt | 1 + 5 files changed, 86 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 23a163cf1..3af61a35c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-9848b3b7725425c712a5fba932c836f3210adf21b9b7a232370f13960790158c.yml -openapi_spec_hash: 49090a79a8225d8ad36fe249aac2a12a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-6fc6504fd01ec9082a1f98aedf474846382b0196143751c1cae21fb7651c7fd1.yml +openapi_spec_hash: 7b2f1e569444dec8f4e02a26adf6eae0 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt index 42b6ac667..23318d0ca 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParams.kt @@ -29,6 +29,15 @@ private constructor( private val additionalQueryParams: QueryParams, ) : Params { + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if not + * provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun amount(): Optional = body.amount() + /** * The identifier of the Pending Transaction for the refund authorization. If this is provided, * `transaction` must not be provided as a refund with a refund authorized can not be linked to @@ -48,6 +57,13 @@ private constructor( */ fun transactionId(): Optional = body.transactionId() + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _amount(): JsonField = body._amount() + /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -100,11 +116,26 @@ private constructor( * * This is generally only useful if you are already constructing the body separately. * Otherwise, it's more convenient to use the top-level setters instead: + * - [amount] * - [pendingTransactionId] * - [transactionId] */ fun body(body: Body) = apply { this.body = body.toBuilder() } + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if + * not provided. + */ + fun amount(amount: Long) = apply { body.amount(amount) } + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { body.amount(amount) } + /** * The identifier of the Pending Transaction for the refund authorization. If this is * provided, `transaction` must not be provided as a refund with a refund authorized can not @@ -281,6 +312,7 @@ private constructor( class Body @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( + private val amount: JsonField, private val pendingTransactionId: JsonField, private val transactionId: JsonField, private val additionalProperties: MutableMap, @@ -288,13 +320,23 @@ private constructor( @JsonCreator private constructor( + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), @JsonProperty("pending_transaction_id") @ExcludeMissing pendingTransactionId: JsonField = JsonMissing.of(), @JsonProperty("transaction_id") @ExcludeMissing transactionId: JsonField = JsonMissing.of(), - ) : this(pendingTransactionId, transactionId, mutableMapOf()) + ) : this(amount, pendingTransactionId, transactionId, mutableMapOf()) + + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` if + * not provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun amount(): Optional = amount.getOptional("amount") /** * The identifier of the Pending Transaction for the refund authorization. If this is @@ -316,6 +358,13 @@ private constructor( */ fun transactionId(): Optional = transactionId.getOptional("transaction_id") + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -357,17 +406,34 @@ private constructor( /** A builder for [Body]. */ class Builder internal constructor() { + private var amount: JsonField = JsonMissing.of() private var pendingTransactionId: JsonField = JsonMissing.of() private var transactionId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(body: Body) = apply { + amount = body.amount pendingTransactionId = body.pendingTransactionId transactionId = body.transactionId additionalProperties = body.additionalProperties.toMutableMap() } + /** + * The refund amount in cents. Pulled off the `pending_transaction` or the `transaction` + * if not provided. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + /** * The identifier of the Pending Transaction for the refund authorization. If this is * provided, `transaction` must not be provided as a refund with a refund authorized can @@ -429,7 +495,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): Body = - Body(pendingTransactionId, transactionId, additionalProperties.toMutableMap()) + Body( + amount, + pendingTransactionId, + transactionId, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -439,6 +510,7 @@ private constructor( return@apply } + amount() pendingTransactionId() transactionId() validated = true @@ -460,7 +532,8 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + (if (transactionId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { @@ -469,19 +542,20 @@ private constructor( } return other is Body && + amount == other.amount && pendingTransactionId == other.pendingTransactionId && transactionId == other.transactionId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(pendingTransactionId, transactionId, additionalProperties) + Objects.hash(amount, pendingTransactionId, transactionId, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Body{pendingTransactionId=$pendingTransactionId, transactionId=$transactionId, additionalProperties=$additionalProperties}" + "Body{amount=$amount, pendingTransactionId=$pendingTransactionId, transactionId=$transactionId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt index baece6da6..caeb63f1f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardrefunds/CardRefundCreateParamsTest.kt @@ -10,6 +10,7 @@ internal class CardRefundCreateParamsTest { @Test fun create() { CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() @@ -19,12 +20,14 @@ internal class CardRefundCreateParamsTest { fun body() { val params = CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() val body = params._body() + assertThat(body.amount()).contains(1L) assertThat(body.pendingTransactionId()).contains("pending_transaction_id") assertThat(body.transactionId()).contains("transaction_uyrp7fld2ium70oa7oi") } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt index 7799c78f4..6bfa4f80e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardRefundServiceAsyncTest.kt @@ -23,6 +23,7 @@ internal class CardRefundServiceAsyncTest { val transactionFuture = cardRefundServiceAsync.create( CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt index cf3c0fbaf..9a53b8d23 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardRefundServiceTest.kt @@ -23,6 +23,7 @@ internal class CardRefundServiceTest { val transaction = cardRefundService.create( CardRefundCreateParams.builder() + .amount(1L) .pendingTransactionId("pending_transaction_id") .transactionId("transaction_uyrp7fld2ium70oa7oi") .build() From f7b88d8b6148ab0f33f8c4f937346b2ef0c670d8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Oct 2025 17:43:55 +0000 Subject: [PATCH 20/33] feat(api): api update --- .stats.yml | 4 +- .../CardAuthorizationCreateParams.kt | 204 +++++++++++++++++- .../CardAuthorizationCreateParamsTest.kt | 15 ++ .../CardAuthorizationServiceAsyncTest.kt | 5 + .../CardAuthorizationServiceTest.kt | 5 + 5 files changed, 226 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3af61a35c..09fe707d7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-6fc6504fd01ec9082a1f98aedf474846382b0196143751c1cae21fb7651c7fd1.yml -openapi_spec_hash: 7b2f1e569444dec8f4e02a26adf6eae0 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4ecdf6d7ab918ac6bedd10130962aa92a2b10e59ca7a98849bcbb72878bffc92.yml +openapi_spec_hash: cefa36c80b576364e72406d7da8c4610 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt index 76e5009a7..cd9678ff3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParams.kt @@ -2595,6 +2595,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, + private val refund: JsonField, private val additionalProperties: MutableMap, ) { @@ -2602,8 +2603,9 @@ private constructor( private constructor( @JsonProperty("category") @ExcludeMissing - category: JsonField = JsonMissing.of() - ) : this(category, mutableMapOf()) + category: JsonField = JsonMissing.of(), + @JsonProperty("refund") @ExcludeMissing refund: JsonField = JsonMissing.of(), + ) : this(category, refund, mutableMapOf()) /** * The processing category describes the intent behind the authorization, such as whether it @@ -2614,6 +2616,14 @@ private constructor( */ fun category(): Category = category.getRequired("category") + /** + * Details related to refund authorizations. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun refund(): Optional = refund.getOptional("refund") + /** * Returns the raw JSON value of [category]. * @@ -2621,6 +2631,13 @@ private constructor( */ @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [refund]. + * + * Unlike [refund], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("refund") @ExcludeMissing fun _refund(): JsonField = refund + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -2650,11 +2667,13 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null + private var refund: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(processingCategory: ProcessingCategory) = apply { category = processingCategory.category + refund = processingCategory.refund additionalProperties = processingCategory.additionalProperties.toMutableMap() } @@ -2673,6 +2692,18 @@ private constructor( */ fun category(category: JsonField) = apply { this.category = category } + /** Details related to refund authorizations. */ + fun refund(refund: Refund) = refund(JsonField.of(refund)) + + /** + * Sets [Builder.refund] to an arbitrary JSON value. + * + * You should usually call [Builder.refund] with a well-typed [Refund] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun refund(refund: JsonField) = apply { this.refund = refund } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2707,6 +2738,7 @@ private constructor( fun build(): ProcessingCategory = ProcessingCategory( checkRequired("category", category), + refund, additionalProperties.toMutableMap(), ) } @@ -2719,6 +2751,7 @@ private constructor( } category().validate() + refund().ifPresent { it.validate() } validated = true } @@ -2737,7 +2770,9 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + internal fun validity(): Int = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (refund.asKnown().getOrNull()?.validity() ?: 0) /** * The processing category describes the intent behind the authorization, such as whether it @@ -2981,6 +3016,164 @@ private constructor( override fun toString() = value.toString() } + /** Details related to refund authorizations. */ + class Refund + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val originalCardPaymentId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("original_card_payment_id") + @ExcludeMissing + originalCardPaymentId: JsonField = JsonMissing.of() + ) : this(originalCardPaymentId, mutableMapOf()) + + /** + * The card payment to link this refund to. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun originalCardPaymentId(): Optional = + originalCardPaymentId.getOptional("original_card_payment_id") + + /** + * Returns the raw JSON value of [originalCardPaymentId]. + * + * Unlike [originalCardPaymentId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("original_card_payment_id") + @ExcludeMissing + fun _originalCardPaymentId(): JsonField = originalCardPaymentId + + @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 [Refund]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Refund]. */ + class Builder internal constructor() { + + private var originalCardPaymentId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(refund: Refund) = apply { + originalCardPaymentId = refund.originalCardPaymentId + additionalProperties = refund.additionalProperties.toMutableMap() + } + + /** The card payment to link this refund to. */ + fun originalCardPaymentId(originalCardPaymentId: String) = + originalCardPaymentId(JsonField.of(originalCardPaymentId)) + + /** + * Sets [Builder.originalCardPaymentId] to an arbitrary JSON value. + * + * You should usually call [Builder.originalCardPaymentId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun originalCardPaymentId(originalCardPaymentId: JsonField) = apply { + this.originalCardPaymentId = originalCardPaymentId + } + + 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 [Refund]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Refund = + Refund(originalCardPaymentId, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Refund = apply { + if (validated) { + return@apply + } + + originalCardPaymentId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (originalCardPaymentId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Refund && + originalCardPaymentId == other.originalCardPaymentId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(originalCardPaymentId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Refund{originalCardPaymentId=$originalCardPaymentId, additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -2988,15 +3181,16 @@ private constructor( return other is ProcessingCategory && category == other.category && + refund == other.refund && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(category, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(category, refund, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ProcessingCategory{category=$category, additionalProperties=$additionalProperties}" + "ProcessingCategory{category=$category, refund=$refund, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt index 5eed574cc..649446ba2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateParamsTest.kt @@ -42,6 +42,11 @@ internal class CardAuthorizationCreateParamsTest { .category( CardAuthorizationCreateParams.ProcessingCategory.Category.ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") @@ -85,6 +90,11 @@ internal class CardAuthorizationCreateParamsTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") @@ -128,6 +138,11 @@ internal class CardAuthorizationCreateParamsTest { .category( CardAuthorizationCreateParams.ProcessingCategory.Category.ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) assertThat(body.terminalId()).contains("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt index 3a53ebd69..75746804e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardAuthorizationServiceAsyncTest.kt @@ -56,6 +56,11 @@ internal class CardAuthorizationServiceAsyncTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt index 1eeb96686..ecf86f1ce 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardAuthorizationServiceTest.kt @@ -56,6 +56,11 @@ internal class CardAuthorizationServiceTest { CardAuthorizationCreateParams.ProcessingCategory.Category .ACCOUNT_FUNDING ) + .refund( + CardAuthorizationCreateParams.ProcessingCategory.Refund.builder() + .originalCardPaymentId("original_card_payment_id") + .build() + ) .build() ) .terminalId("x") From 26c0a6f5543f3c6b5800b774c37b49c3efdecad7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 17:43:25 +0000 Subject: [PATCH 21/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 9919 +++++++++++++++-- .../CardPaymentListPageResponseTest.kt | 3380 +++++- .../models/cardpayments/CardPaymentTest.kt | 3150 +++++- 4 files changed, 14842 insertions(+), 1611 deletions(-) diff --git a/.stats.yml b/.stats.yml index 09fe707d7..b52e298fa 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4ecdf6d7ab918ac6bedd10130962aa92a2b10e59ca7a98849bcbb72878bffc92.yml -openapi_spec_hash: cefa36c80b576364e72406d7da8c4610 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4aa2f4a453e4fc5f0876f09919d76289bc530dcdd693e6d69db07980803aab6d.yml +openapi_spec_hash: 32bfd518611484cb0777810dd934f1fa config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index a546aecc8..a71010fae 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -525,6 +525,7 @@ private constructor( private val cardAuthorization: JsonField, private val cardAuthorizationExpiration: JsonField, private val cardDecline: JsonField, + private val cardFinancial: JsonField, private val cardFuelConfirmation: JsonField, private val cardIncrement: JsonField, private val cardRefund: JsonField, @@ -551,6 +552,9 @@ private constructor( @JsonProperty("card_decline") @ExcludeMissing cardDecline: JsonField = JsonMissing.of(), + @JsonProperty("card_financial") + @ExcludeMissing + cardFinancial: JsonField = JsonMissing.of(), @JsonProperty("card_fuel_confirmation") @ExcludeMissing cardFuelConfirmation: JsonField = JsonMissing.of(), @@ -581,6 +585,7 @@ private constructor( cardAuthorization, cardAuthorizationExpiration, cardDecline, + cardFinancial, cardFuelConfirmation, cardIncrement, cardRefund, @@ -635,6 +640,16 @@ private constructor( */ fun cardDecline(): Optional = cardDecline.getOptional("card_decline") + /** + * A Card Financial object. This field will be present in the JSON response if and only if + * `category` is equal to `card_financial`. Card Financials are temporary holds placed on a + * customers funds with the intent to later clear a transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cardFinancial(): Optional = cardFinancial.getOptional("card_financial") + /** * A Card Fuel Confirmation object. This field will be present in the JSON response if and * only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations update @@ -765,6 +780,16 @@ private constructor( @ExcludeMissing fun _cardDecline(): JsonField = cardDecline + /** + * Returns the raw JSON value of [cardFinancial]. + * + * Unlike [cardFinancial], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("card_financial") + @ExcludeMissing + fun _cardFinancial(): JsonField = cardFinancial + /** * Returns the raw JSON value of [cardFuelConfirmation]. * @@ -863,6 +888,7 @@ private constructor( * .cardAuthorization() * .cardAuthorizationExpiration() * .cardDecline() + * .cardFinancial() * .cardFuelConfirmation() * .cardIncrement() * .cardRefund() @@ -884,6 +910,7 @@ private constructor( private var cardAuthorization: JsonField? = null private var cardAuthorizationExpiration: JsonField? = null private var cardDecline: JsonField? = null + private var cardFinancial: JsonField? = null private var cardFuelConfirmation: JsonField? = null private var cardIncrement: JsonField? = null private var cardRefund: JsonField? = null @@ -901,6 +928,7 @@ private constructor( cardAuthorization = element.cardAuthorization cardAuthorizationExpiration = element.cardAuthorizationExpiration cardDecline = element.cardDecline + cardFinancial = element.cardFinancial cardFuelConfirmation = element.cardFuelConfirmation cardIncrement = element.cardIncrement cardRefund = element.cardRefund @@ -1016,6 +1044,29 @@ private constructor( this.cardDecline = cardDecline } + /** + * A Card Financial object. This field will be present in the JSON response if and only + * if `category` is equal to `card_financial`. Card Financials are temporary holds + * placed on a customers funds with the intent to later clear a transaction. + */ + fun cardFinancial(cardFinancial: CardFinancial?) = + cardFinancial(JsonField.ofNullable(cardFinancial)) + + /** Alias for calling [Builder.cardFinancial] with `cardFinancial.orElse(null)`. */ + fun cardFinancial(cardFinancial: Optional) = + cardFinancial(cardFinancial.getOrNull()) + + /** + * Sets [Builder.cardFinancial] to an arbitrary JSON value. + * + * You should usually call [Builder.cardFinancial] with a well-typed [CardFinancial] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun cardFinancial(cardFinancial: JsonField) = apply { + this.cardFinancial = cardFinancial + } + /** * A Card Fuel Confirmation object. This field will be present in the JSON response if * and only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations @@ -1228,6 +1279,7 @@ private constructor( * .cardAuthorization() * .cardAuthorizationExpiration() * .cardDecline() + * .cardFinancial() * .cardFuelConfirmation() * .cardIncrement() * .cardRefund() @@ -1247,6 +1299,7 @@ private constructor( checkRequired("cardAuthorization", cardAuthorization), checkRequired("cardAuthorizationExpiration", cardAuthorizationExpiration), checkRequired("cardDecline", cardDecline), + checkRequired("cardFinancial", cardFinancial), checkRequired("cardFuelConfirmation", cardFuelConfirmation), checkRequired("cardIncrement", cardIncrement), checkRequired("cardRefund", cardRefund), @@ -1271,6 +1324,7 @@ private constructor( cardAuthorization().ifPresent { it.validate() } cardAuthorizationExpiration().ifPresent { it.validate() } cardDecline().ifPresent { it.validate() } + cardFinancial().ifPresent { it.validate() } cardFuelConfirmation().ifPresent { it.validate() } cardIncrement().ifPresent { it.validate() } cardRefund().ifPresent { it.validate() } @@ -1302,6 +1356,7 @@ private constructor( (cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorizationExpiration.asKnown().getOrNull()?.validity() ?: 0) + (cardDecline.asKnown().getOrNull()?.validity() ?: 0) + + (cardFinancial.asKnown().getOrNull()?.validity() ?: 0) + (cardFuelConfirmation.asKnown().getOrNull()?.validity() ?: 0) + (cardIncrement.asKnown().getOrNull()?.validity() ?: 0) + (cardRefund.asKnown().getOrNull()?.validity() ?: 0) + @@ -13443,15 +13498,8984 @@ private constructor( @JsonProperty("real_time_decision_id") @ExcludeMissing realTimeDecisionId: JsonField = JsonMissing.of(), - @JsonProperty("real_time_decision_reason") - @ExcludeMissing - realTimeDecisionReason: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), + @JsonProperty("real_time_decision_reason") + @ExcludeMissing + realTimeDecisionReason: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + @JsonProperty("terminal_id") + @ExcludeMissing + terminalId: JsonField = JsonMissing.of(), + @JsonProperty("verification") + @ExcludeMissing + verification: JsonField = JsonMissing.of(), + ) : this( + id, + actioner, + additionalAmounts, + amount, + cardPaymentId, + currency, + declinedTransactionId, + digitalWalletTokenId, + direction, + incrementedCardAuthorizationId, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + presentmentAmount, + presentmentCurrency, + processingCategory, + realTimeDecisionId, + realTimeDecisionReason, + reason, + terminalId, + verification, + mutableMapOf(), + ) + + /** + * The Card Decline identifier. + * + * @throws IncreaseInvalidDataException 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 id(): String = id.getRequired("id") + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + * + * @throws IncreaseInvalidDataException 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 actioner(): Actioner = actioner.getRequired("actioner") + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + * + * @throws IncreaseInvalidDataException 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 additionalAmounts(): AdditionalAmounts = + additionalAmounts.getRequired("additional_amounts") + + /** + * The declined amount in the minor unit of the destination account currency. For + * dollars, for example, this is cents. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The ID of the Card Payment this transaction belongs to. + * + * @throws IncreaseInvalidDataException 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 cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + * + * @throws IncreaseInvalidDataException 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 currency(): Currency = currency.getRequired("currency") + + /** + * The identifier of the declined transaction created for this Card Decline. + * + * @throws IncreaseInvalidDataException 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 declinedTransactionId(): String = + declinedTransactionId.getRequired("declined_transaction_id") + + /** + * If the authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun digitalWalletTokenId(): Optional = + digitalWalletTokenId.getOptional("digital_wallet_token_id") + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + * + * @throws IncreaseInvalidDataException 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 direction(): Direction = direction.getRequired("direction") + + /** + * The identifier of the card authorization this request attempted to incrementally + * authorize. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun incrementedCardAuthorizationId(): Optional = + incrementedCardAuthorizationId.getOptional("incremented_card_authorization_id") + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + * + * @throws IncreaseInvalidDataException 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 merchantAcceptorId(): String = + merchantAcceptorId.getRequired("merchant_acceptor_id") + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is + * transacting with. + * + * @throws IncreaseInvalidDataException 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 merchantCategoryCode(): String = + merchantCategoryCode.getRequired("merchant_category_code") + + /** + * The city the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantCity(): Optional = merchantCity.getOptional("merchant_city") + + /** + * The country the merchant resides in. + * + * @throws IncreaseInvalidDataException 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 merchantCountry(): String = merchantCountry.getRequired("merchant_country") + + /** + * The merchant descriptor of the merchant the card is transacting with. + * + * @throws IncreaseInvalidDataException 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 merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor") + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP + * code, where the first 5 and last 4 are separated by a dash. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantPostalCode(): Optional = + merchantPostalCode.getOptional("merchant_postal_code") + + /** + * The state the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantState(): Optional = merchantState.getOptional("merchant_state") + + /** + * Fields specific to the `network`. + * + * @throws IncreaseInvalidDataException 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 networkDetails(): NetworkDetails = networkDetails.getRequired("network_details") + + /** + * Network-specific identifiers for a specific request or transaction. + * + * @throws IncreaseInvalidDataException 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 networkIdentifiers(): NetworkIdentifiers = + networkIdentifiers.getRequired("network_identifiers") + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun networkRiskScore(): Optional = + networkRiskScore.getOptional("network_risk_score") + + /** + * If the authorization was made in-person with a physical card, the Physical Card that + * was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id") + + /** + * The declined amount in the minor unit of the transaction's presentment currency. + * + * @throws IncreaseInvalidDataException 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 presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment currency. + * + * @throws IncreaseInvalidDataException 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 presentmentCurrency(): String = + presentmentCurrency.getRequired("presentment_currency") + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + * + * @throws IncreaseInvalidDataException 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 processingCategory(): ProcessingCategory = + processingCategory.getRequired("processing_category") + + /** + * The identifier of the Real-Time Decision sent to approve or decline this transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun realTimeDecisionId(): Optional = + realTimeDecisionId.getOptional("real_time_decision_id") + + /** + * This is present if a specific decline reason was given in the real-time decision. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun realTimeDecisionReason(): Optional = + realTimeDecisionReason.getOptional("real_time_decision_reason") + + /** + * Why the transaction was declined. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun terminalId(): Optional = terminalId.getOptional("terminal_id") + + /** + * Fields related to verification of cardholder-provided values. + * + * @throws IncreaseInvalidDataException 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 verification(): Verification = verification.getRequired("verification") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [actioner]. + * + * Unlike [actioner], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("actioner") + @ExcludeMissing + fun _actioner(): JsonField = actioner + + /** + * Returns the raw JSON value of [additionalAmounts]. + * + * Unlike [additionalAmounts], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("additional_amounts") + @ExcludeMissing + fun _additionalAmounts(): JsonField = additionalAmounts + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [cardPaymentId]. + * + * Unlike [cardPaymentId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("card_payment_id") + @ExcludeMissing + fun _cardPaymentId(): JsonField = cardPaymentId + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [declinedTransactionId]. + * + * Unlike [declinedTransactionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("declined_transaction_id") + @ExcludeMissing + fun _declinedTransactionId(): JsonField = declinedTransactionId + + /** + * Returns the raw JSON value of [digitalWalletTokenId]. + * + * Unlike [digitalWalletTokenId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + fun _digitalWalletTokenId(): JsonField = digitalWalletTokenId + + /** + * Returns the raw JSON value of [direction]. + * + * Unlike [direction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("direction") + @ExcludeMissing + fun _direction(): JsonField = direction + + /** + * Returns the raw JSON value of [incrementedCardAuthorizationId]. + * + * Unlike [incrementedCardAuthorizationId], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("incremented_card_authorization_id") + @ExcludeMissing + fun _incrementedCardAuthorizationId(): JsonField = + incrementedCardAuthorizationId + + /** + * Returns the raw JSON value of [merchantAcceptorId]. + * + * Unlike [merchantAcceptorId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + fun _merchantAcceptorId(): JsonField = merchantAcceptorId + + /** + * Returns the raw JSON value of [merchantCategoryCode]. + * + * Unlike [merchantCategoryCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_category_code") + @ExcludeMissing + fun _merchantCategoryCode(): JsonField = merchantCategoryCode + + /** + * Returns the raw JSON value of [merchantCity]. + * + * Unlike [merchantCity], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("merchant_city") + @ExcludeMissing + fun _merchantCity(): JsonField = merchantCity + + /** + * Returns the raw JSON value of [merchantCountry]. + * + * Unlike [merchantCountry], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_country") + @ExcludeMissing + fun _merchantCountry(): JsonField = merchantCountry + + /** + * Returns the raw JSON value of [merchantDescriptor]. + * + * Unlike [merchantDescriptor], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_descriptor") + @ExcludeMissing + fun _merchantDescriptor(): JsonField = merchantDescriptor + + /** + * Returns the raw JSON value of [merchantPostalCode]. + * + * Unlike [merchantPostalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_postal_code") + @ExcludeMissing + fun _merchantPostalCode(): JsonField = merchantPostalCode + + /** + * Returns the raw JSON value of [merchantState]. + * + * Unlike [merchantState], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("merchant_state") + @ExcludeMissing + fun _merchantState(): JsonField = merchantState + + /** + * Returns the raw JSON value of [networkDetails]. + * + * Unlike [networkDetails], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_details") + @ExcludeMissing + fun _networkDetails(): JsonField = networkDetails + + /** + * Returns the raw JSON value of [networkIdentifiers]. + * + * Unlike [networkIdentifiers], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_identifiers") + @ExcludeMissing + fun _networkIdentifiers(): JsonField = networkIdentifiers + + /** + * Returns the raw JSON value of [networkRiskScore]. + * + * Unlike [networkRiskScore], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_risk_score") + @ExcludeMissing + fun _networkRiskScore(): JsonField = networkRiskScore + + /** + * Returns the raw JSON value of [physicalCardId]. + * + * Unlike [physicalCardId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("physical_card_id") + @ExcludeMissing + fun _physicalCardId(): JsonField = physicalCardId + + /** + * Returns the raw JSON value of [presentmentAmount]. + * + * Unlike [presentmentAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_amount") + @ExcludeMissing + fun _presentmentAmount(): JsonField = presentmentAmount + + /** + * Returns the raw JSON value of [presentmentCurrency]. + * + * Unlike [presentmentCurrency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_currency") + @ExcludeMissing + fun _presentmentCurrency(): JsonField = presentmentCurrency + + /** + * Returns the raw JSON value of [processingCategory]. + * + * Unlike [processingCategory], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("processing_category") + @ExcludeMissing + fun _processingCategory(): JsonField = processingCategory + + /** + * Returns the raw JSON value of [realTimeDecisionId]. + * + * Unlike [realTimeDecisionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_decision_id") + @ExcludeMissing + fun _realTimeDecisionId(): JsonField = realTimeDecisionId + + /** + * Returns the raw JSON value of [realTimeDecisionReason]. + * + * Unlike [realTimeDecisionReason], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_decision_reason") + @ExcludeMissing + fun _realTimeDecisionReason(): JsonField = + realTimeDecisionReason + + /** + * 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 + + /** + * Returns the raw JSON value of [terminalId]. + * + * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("terminal_id") + @ExcludeMissing + fun _terminalId(): JsonField = terminalId + + /** + * Returns the raw JSON value of [verification]. + * + * Unlike [verification], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("verification") + @ExcludeMissing + fun _verification(): JsonField = verification + + @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 [CardDecline]. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .declinedTransactionId() + * .digitalWalletTokenId() + * .direction() + * .incrementedCardAuthorizationId() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .realTimeDecisionReason() + * .reason() + * .terminalId() + * .verification() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardDecline]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var actioner: JsonField? = null + private var additionalAmounts: JsonField? = null + private var amount: JsonField? = null + private var cardPaymentId: JsonField? = null + private var currency: JsonField? = null + private var declinedTransactionId: JsonField? = null + private var digitalWalletTokenId: JsonField? = null + private var direction: JsonField? = null + private var incrementedCardAuthorizationId: JsonField? = null + private var merchantAcceptorId: JsonField? = null + private var merchantCategoryCode: JsonField? = null + private var merchantCity: JsonField? = null + private var merchantCountry: JsonField? = null + private var merchantDescriptor: JsonField? = null + private var merchantPostalCode: JsonField? = null + private var merchantState: JsonField? = null + private var networkDetails: JsonField? = null + private var networkIdentifiers: JsonField? = null + private var networkRiskScore: JsonField? = null + private var physicalCardId: JsonField? = null + private var presentmentAmount: JsonField? = null + private var presentmentCurrency: JsonField? = null + private var processingCategory: JsonField? = null + private var realTimeDecisionId: JsonField? = null + private var realTimeDecisionReason: JsonField? = null + private var reason: JsonField? = null + private var terminalId: JsonField? = null + private var verification: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardDecline: CardDecline) = apply { + id = cardDecline.id + actioner = cardDecline.actioner + additionalAmounts = cardDecline.additionalAmounts + amount = cardDecline.amount + cardPaymentId = cardDecline.cardPaymentId + currency = cardDecline.currency + declinedTransactionId = cardDecline.declinedTransactionId + digitalWalletTokenId = cardDecline.digitalWalletTokenId + direction = cardDecline.direction + incrementedCardAuthorizationId = cardDecline.incrementedCardAuthorizationId + merchantAcceptorId = cardDecline.merchantAcceptorId + merchantCategoryCode = cardDecline.merchantCategoryCode + merchantCity = cardDecline.merchantCity + merchantCountry = cardDecline.merchantCountry + merchantDescriptor = cardDecline.merchantDescriptor + merchantPostalCode = cardDecline.merchantPostalCode + merchantState = cardDecline.merchantState + networkDetails = cardDecline.networkDetails + networkIdentifiers = cardDecline.networkIdentifiers + networkRiskScore = cardDecline.networkRiskScore + physicalCardId = cardDecline.physicalCardId + presentmentAmount = cardDecline.presentmentAmount + presentmentCurrency = cardDecline.presentmentCurrency + processingCategory = cardDecline.processingCategory + realTimeDecisionId = cardDecline.realTimeDecisionId + realTimeDecisionReason = cardDecline.realTimeDecisionReason + reason = cardDecline.reason + terminalId = cardDecline.terminalId + verification = cardDecline.verification + additionalProperties = cardDecline.additionalProperties.toMutableMap() + } + + /** The Card Decline identifier. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + */ + fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner)) + + /** + * Sets [Builder.actioner] to an arbitrary JSON value. + * + * You should usually call [Builder.actioner] with a well-typed [Actioner] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun actioner(actioner: JsonField) = apply { this.actioner = actioner } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide + * more detailed information about the transaction. + */ + fun additionalAmounts(additionalAmounts: AdditionalAmounts) = + additionalAmounts(JsonField.of(additionalAmounts)) + + /** + * Sets [Builder.additionalAmounts] to an arbitrary JSON value. + * + * You should usually call [Builder.additionalAmounts] with a well-typed + * [AdditionalAmounts] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun additionalAmounts(additionalAmounts: JsonField) = apply { + this.additionalAmounts = additionalAmounts + } + + /** + * The declined amount in the minor unit of the destination account currency. For + * dollars, for example, this is cents. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The ID of the Card Payment this transaction belongs to. */ + fun cardPaymentId(cardPaymentId: String) = + cardPaymentId(JsonField.of(cardPaymentId)) + + /** + * Sets [Builder.cardPaymentId] to an arbitrary JSON value. + * + * You should usually call [Builder.cardPaymentId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun cardPaymentId(cardPaymentId: JsonField) = apply { + this.cardPaymentId = cardPaymentId + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The identifier of the declined transaction created for this Card Decline. */ + fun declinedTransactionId(declinedTransactionId: String) = + declinedTransactionId(JsonField.of(declinedTransactionId)) + + /** + * Sets [Builder.declinedTransactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.declinedTransactionId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun declinedTransactionId(declinedTransactionId: JsonField) = apply { + this.declinedTransactionId = declinedTransactionId + } + + /** + * If the authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + */ + fun digitalWalletTokenId(digitalWalletTokenId: String?) = + digitalWalletTokenId(JsonField.ofNullable(digitalWalletTokenId)) + + /** + * Alias for calling [Builder.digitalWalletTokenId] with + * `digitalWalletTokenId.orElse(null)`. + */ + fun digitalWalletTokenId(digitalWalletTokenId: Optional) = + digitalWalletTokenId(digitalWalletTokenId.getOrNull()) + + /** + * Sets [Builder.digitalWalletTokenId] to an arbitrary JSON value. + * + * You should usually call [Builder.digitalWalletTokenId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply { + this.digitalWalletTokenId = digitalWalletTokenId + } + + /** + * The direction describes the direction the funds will move, either from the + * cardholder to the merchant or from the merchant to the cardholder. + */ + fun direction(direction: Direction) = direction(JsonField.of(direction)) + + /** + * Sets [Builder.direction] to an arbitrary JSON value. + * + * You should usually call [Builder.direction] with a well-typed [Direction] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun direction(direction: JsonField) = apply { + this.direction = direction + } + + /** + * The identifier of the card authorization this request attempted to incrementally + * authorize. + */ + fun incrementedCardAuthorizationId(incrementedCardAuthorizationId: String?) = + incrementedCardAuthorizationId( + JsonField.ofNullable(incrementedCardAuthorizationId) + ) + + /** + * Alias for calling [Builder.incrementedCardAuthorizationId] with + * `incrementedCardAuthorizationId.orElse(null)`. + */ + fun incrementedCardAuthorizationId( + incrementedCardAuthorizationId: Optional + ) = incrementedCardAuthorizationId(incrementedCardAuthorizationId.getOrNull()) + + /** + * Sets [Builder.incrementedCardAuthorizationId] to an arbitrary JSON value. + * + * You should usually call [Builder.incrementedCardAuthorizationId] with a + * well-typed [String] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun incrementedCardAuthorizationId( + incrementedCardAuthorizationId: JsonField + ) = apply { this.incrementedCardAuthorizationId = incrementedCardAuthorizationId } + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + */ + fun merchantAcceptorId(merchantAcceptorId: String) = + merchantAcceptorId(JsonField.of(merchantAcceptorId)) + + /** + * Sets [Builder.merchantAcceptorId] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantAcceptorId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantAcceptorId(merchantAcceptorId: JsonField) = apply { + this.merchantAcceptorId = merchantAcceptorId + } + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card + * is transacting with. + */ + fun merchantCategoryCode(merchantCategoryCode: String) = + merchantCategoryCode(JsonField.of(merchantCategoryCode)) + + /** + * Sets [Builder.merchantCategoryCode] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCategoryCode] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply { + this.merchantCategoryCode = merchantCategoryCode + } + + /** The city the merchant resides in. */ + fun merchantCity(merchantCity: String?) = + merchantCity(JsonField.ofNullable(merchantCity)) + + /** Alias for calling [Builder.merchantCity] with `merchantCity.orElse(null)`. */ + fun merchantCity(merchantCity: Optional) = + merchantCity(merchantCity.getOrNull()) + + /** + * Sets [Builder.merchantCity] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCity] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun merchantCity(merchantCity: JsonField) = apply { + this.merchantCity = merchantCity + } + + /** The country the merchant resides in. */ + fun merchantCountry(merchantCountry: String) = + merchantCountry(JsonField.of(merchantCountry)) + + /** + * Sets [Builder.merchantCountry] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCountry] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantCountry(merchantCountry: JsonField) = apply { + this.merchantCountry = merchantCountry + } + + /** The merchant descriptor of the merchant the card is transacting with. */ + fun merchantDescriptor(merchantDescriptor: String) = + merchantDescriptor(JsonField.of(merchantDescriptor)) + + /** + * Sets [Builder.merchantDescriptor] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantDescriptor] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantDescriptor(merchantDescriptor: JsonField) = apply { + this.merchantDescriptor = merchantDescriptor + } + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + * ZIP code, where the first 5 and last 4 are separated by a dash. + */ + fun merchantPostalCode(merchantPostalCode: String?) = + merchantPostalCode(JsonField.ofNullable(merchantPostalCode)) + + /** + * Alias for calling [Builder.merchantPostalCode] with + * `merchantPostalCode.orElse(null)`. + */ + fun merchantPostalCode(merchantPostalCode: Optional) = + merchantPostalCode(merchantPostalCode.getOrNull()) + + /** + * Sets [Builder.merchantPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPostalCode] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantPostalCode(merchantPostalCode: JsonField) = apply { + this.merchantPostalCode = merchantPostalCode + } + + /** The state the merchant resides in. */ + fun merchantState(merchantState: String?) = + merchantState(JsonField.ofNullable(merchantState)) + + /** Alias for calling [Builder.merchantState] with `merchantState.orElse(null)`. */ + fun merchantState(merchantState: Optional) = + merchantState(merchantState.getOrNull()) + + /** + * Sets [Builder.merchantState] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantState] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun merchantState(merchantState: JsonField) = apply { + this.merchantState = merchantState + } + + /** Fields specific to the `network`. */ + fun networkDetails(networkDetails: NetworkDetails) = + networkDetails(JsonField.of(networkDetails)) + + /** + * Sets [Builder.networkDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.networkDetails] with a well-typed + * [NetworkDetails] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun networkDetails(networkDetails: JsonField) = apply { + this.networkDetails = networkDetails + } + + /** Network-specific identifiers for a specific request or transaction. */ + fun networkIdentifiers(networkIdentifiers: NetworkIdentifiers) = + networkIdentifiers(JsonField.of(networkIdentifiers)) + + /** + * Sets [Builder.networkIdentifiers] to an arbitrary JSON value. + * + * You should usually call [Builder.networkIdentifiers] with a well-typed + * [NetworkIdentifiers] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun networkIdentifiers(networkIdentifiers: JsonField) = apply { + this.networkIdentifiers = networkIdentifiers + } + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. + */ + fun networkRiskScore(networkRiskScore: Long?) = + networkRiskScore(JsonField.ofNullable(networkRiskScore)) + + /** + * Alias for [Builder.networkRiskScore]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun networkRiskScore(networkRiskScore: Long) = + networkRiskScore(networkRiskScore as Long?) + + /** + * Alias for calling [Builder.networkRiskScore] with + * `networkRiskScore.orElse(null)`. + */ + fun networkRiskScore(networkRiskScore: Optional) = + networkRiskScore(networkRiskScore.getOrNull()) + + /** + * Sets [Builder.networkRiskScore] to an arbitrary JSON value. + * + * You should usually call [Builder.networkRiskScore] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun networkRiskScore(networkRiskScore: JsonField) = apply { + this.networkRiskScore = networkRiskScore + } + + /** + * If the authorization was made in-person with a physical card, the Physical Card + * that was used. + */ + fun physicalCardId(physicalCardId: String?) = + physicalCardId(JsonField.ofNullable(physicalCardId)) + + /** + * Alias for calling [Builder.physicalCardId] with `physicalCardId.orElse(null)`. + */ + fun physicalCardId(physicalCardId: Optional) = + physicalCardId(physicalCardId.getOrNull()) + + /** + * Sets [Builder.physicalCardId] to an arbitrary JSON value. + * + * You should usually call [Builder.physicalCardId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun physicalCardId(physicalCardId: JsonField) = apply { + this.physicalCardId = physicalCardId + } + + /** + * The declined amount in the minor unit of the transaction's presentment currency. + */ + fun presentmentAmount(presentmentAmount: Long) = + presentmentAmount(JsonField.of(presentmentAmount)) + + /** + * Sets [Builder.presentmentAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentAmount(presentmentAmount: JsonField) = apply { + this.presentmentAmount = presentmentAmount + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment currency. + */ + fun presentmentCurrency(presentmentCurrency: String) = + presentmentCurrency(JsonField.of(presentmentCurrency)) + + /** + * Sets [Builder.presentmentCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentCurrency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentCurrency(presentmentCurrency: JsonField) = apply { + this.presentmentCurrency = presentmentCurrency + } + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + fun processingCategory(processingCategory: ProcessingCategory) = + processingCategory(JsonField.of(processingCategory)) + + /** + * Sets [Builder.processingCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.processingCategory] with a well-typed + * [ProcessingCategory] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun processingCategory(processingCategory: JsonField) = apply { + this.processingCategory = processingCategory + } + + /** + * The identifier of the Real-Time Decision sent to approve or decline this + * transaction. + */ + fun realTimeDecisionId(realTimeDecisionId: String?) = + realTimeDecisionId(JsonField.ofNullable(realTimeDecisionId)) + + /** + * Alias for calling [Builder.realTimeDecisionId] with + * `realTimeDecisionId.orElse(null)`. + */ + fun realTimeDecisionId(realTimeDecisionId: Optional) = + realTimeDecisionId(realTimeDecisionId.getOrNull()) + + /** + * Sets [Builder.realTimeDecisionId] to an arbitrary JSON value. + * + * You should usually call [Builder.realTimeDecisionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun realTimeDecisionId(realTimeDecisionId: JsonField) = apply { + this.realTimeDecisionId = realTimeDecisionId + } + + /** + * This is present if a specific decline reason was given in the real-time decision. + */ + fun realTimeDecisionReason(realTimeDecisionReason: RealTimeDecisionReason?) = + realTimeDecisionReason(JsonField.ofNullable(realTimeDecisionReason)) + + /** + * Alias for calling [Builder.realTimeDecisionReason] with + * `realTimeDecisionReason.orElse(null)`. + */ + fun realTimeDecisionReason( + realTimeDecisionReason: Optional + ) = realTimeDecisionReason(realTimeDecisionReason.getOrNull()) + + /** + * Sets [Builder.realTimeDecisionReason] to an arbitrary JSON value. + * + * You should usually call [Builder.realTimeDecisionReason] with a well-typed + * [RealTimeDecisionReason] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun realTimeDecisionReason( + realTimeDecisionReason: JsonField + ) = apply { this.realTimeDecisionReason = realTimeDecisionReason } + + /** Why the transaction was declined. */ + 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 } + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + */ + fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId)) + + /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */ + fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull()) + + /** + * Sets [Builder.terminalId] to an arbitrary JSON value. + * + * You should usually call [Builder.terminalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun terminalId(terminalId: JsonField) = apply { + this.terminalId = terminalId + } + + /** Fields related to verification of cardholder-provided values. */ + fun verification(verification: Verification) = + verification(JsonField.of(verification)) + + /** + * Sets [Builder.verification] to an arbitrary JSON value. + * + * You should usually call [Builder.verification] with a well-typed [Verification] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun verification(verification: JsonField) = apply { + this.verification = verification + } + + 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 [CardDecline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .declinedTransactionId() + * .digitalWalletTokenId() + * .direction() + * .incrementedCardAuthorizationId() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .realTimeDecisionReason() + * .reason() + * .terminalId() + * .verification() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardDecline = + CardDecline( + checkRequired("id", id), + checkRequired("actioner", actioner), + checkRequired("additionalAmounts", additionalAmounts), + checkRequired("amount", amount), + checkRequired("cardPaymentId", cardPaymentId), + checkRequired("currency", currency), + checkRequired("declinedTransactionId", declinedTransactionId), + checkRequired("digitalWalletTokenId", digitalWalletTokenId), + checkRequired("direction", direction), + checkRequired( + "incrementedCardAuthorizationId", + incrementedCardAuthorizationId, + ), + checkRequired("merchantAcceptorId", merchantAcceptorId), + checkRequired("merchantCategoryCode", merchantCategoryCode), + checkRequired("merchantCity", merchantCity), + checkRequired("merchantCountry", merchantCountry), + checkRequired("merchantDescriptor", merchantDescriptor), + checkRequired("merchantPostalCode", merchantPostalCode), + checkRequired("merchantState", merchantState), + checkRequired("networkDetails", networkDetails), + checkRequired("networkIdentifiers", networkIdentifiers), + checkRequired("networkRiskScore", networkRiskScore), + checkRequired("physicalCardId", physicalCardId), + checkRequired("presentmentAmount", presentmentAmount), + checkRequired("presentmentCurrency", presentmentCurrency), + checkRequired("processingCategory", processingCategory), + checkRequired("realTimeDecisionId", realTimeDecisionId), + checkRequired("realTimeDecisionReason", realTimeDecisionReason), + checkRequired("reason", reason), + checkRequired("terminalId", terminalId), + checkRequired("verification", verification), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardDecline = apply { + if (validated) { + return@apply + } + + id() + actioner().validate() + additionalAmounts().validate() + amount() + cardPaymentId() + currency().validate() + declinedTransactionId() + digitalWalletTokenId() + direction().validate() + incrementedCardAuthorizationId() + merchantAcceptorId() + merchantCategoryCode() + merchantCity() + merchantCountry() + merchantDescriptor() + merchantPostalCode() + merchantState() + networkDetails().validate() + networkIdentifiers().validate() + networkRiskScore() + physicalCardId() + presentmentAmount() + presentmentCurrency() + processingCategory().validate() + realTimeDecisionId() + realTimeDecisionReason().ifPresent { it.validate() } + reason().validate() + terminalId() + verification().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (id.asKnown().isPresent) 1 else 0) + + (actioner.asKnown().getOrNull()?.validity() ?: 0) + + (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (cardPaymentId.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (declinedTransactionId.asKnown().isPresent) 1 else 0) + + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + + (direction.asKnown().getOrNull()?.validity() ?: 0) + + (if (incrementedCardAuthorizationId.asKnown().isPresent) 1 else 0) + + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + + (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + + (if (merchantCity.asKnown().isPresent) 1 else 0) + + (if (merchantCountry.asKnown().isPresent) 1 else 0) + + (if (merchantDescriptor.asKnown().isPresent) 1 else 0) + + (if (merchantPostalCode.asKnown().isPresent) 1 else 0) + + (if (merchantState.asKnown().isPresent) 1 else 0) + + (networkDetails.asKnown().getOrNull()?.validity() ?: 0) + + (networkIdentifiers.asKnown().getOrNull()?.validity() ?: 0) + + (if (networkRiskScore.asKnown().isPresent) 1 else 0) + + (if (physicalCardId.asKnown().isPresent) 1 else 0) + + (if (presentmentAmount.asKnown().isPresent) 1 else 0) + + (if (presentmentCurrency.asKnown().isPresent) 1 else 0) + + (processingCategory.asKnown().getOrNull()?.validity() ?: 0) + + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + + (realTimeDecisionReason.asKnown().getOrNull()?.validity() ?: 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (if (terminalId.asKnown().isPresent) 1 else 0) + + (verification.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + */ + class Actioner @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 { + + /** This object was actioned by the user through a real-time decision. */ + @JvmField val USER = of("user") + + /** This object was actioned by Increase without user intervention. */ + @JvmField val INCREASE = of("increase") + + /** This object was actioned by the network, through stand-in processing. */ + @JvmField val NETWORK = of("network") + + @JvmStatic fun of(value: String) = Actioner(JsonField.of(value)) + } + + /** An enum containing [Actioner]'s known values. */ + enum class Known { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + } + + /** + * An enum containing [Actioner]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Actioner] 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 { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + /** + * An enum member indicating that [Actioner] 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) { + USER -> Value.USER + INCREASE -> Value.INCREASE + NETWORK -> Value.NETWORK + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + USER -> Known.USER + INCREASE -> Known.INCREASE + NETWORK -> Known.NETWORK + else -> throw IncreaseInvalidDataException("Unknown Actioner: $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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Actioner = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Actioner && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + */ + class AdditionalAmounts + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val clinic: JsonField, + private val dental: JsonField, + private val original: JsonField, + private val prescription: JsonField, + private val surcharge: JsonField, + private val totalCumulative: JsonField, + private val totalHealthcare: JsonField, + private val transit: JsonField, + private val unknown: JsonField, + private val vision: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("clinic") + @ExcludeMissing + clinic: JsonField = JsonMissing.of(), + @JsonProperty("dental") + @ExcludeMissing + dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), + @JsonProperty("prescription") + @ExcludeMissing + prescription: JsonField = JsonMissing.of(), + @JsonProperty("surcharge") + @ExcludeMissing + surcharge: JsonField = JsonMissing.of(), + @JsonProperty("total_cumulative") + @ExcludeMissing + totalCumulative: JsonField = JsonMissing.of(), + @JsonProperty("total_healthcare") + @ExcludeMissing + totalHealthcare: JsonField = JsonMissing.of(), + @JsonProperty("transit") + @ExcludeMissing + transit: JsonField = JsonMissing.of(), + @JsonProperty("unknown") + @ExcludeMissing + unknown: JsonField = JsonMissing.of(), + @JsonProperty("vision") + @ExcludeMissing + vision: JsonField = JsonMissing.of(), + ) : this( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + mutableMapOf(), + ) + + /** + * The part of this transaction amount that was for clinic-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun clinic(): Optional = clinic.getOptional("clinic") + + /** + * The part of this transaction amount that was for dental-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun dental(): Optional = dental.getOptional("dental") + + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + + /** + * The part of this transaction amount that was for healthcare prescriptions. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun prescription(): Optional = + prescription.getOptional("prescription") + + /** + * The surcharge amount charged for this transaction by the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun surcharge(): Optional = surcharge.getOptional("surcharge") + + /** + * The total amount of a series of incremental authorizations, optionally provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalCumulative(): Optional = + totalCumulative.getOptional("total_cumulative") + + /** + * The total amount of healthcare-related additional amounts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalHealthcare(): Optional = + totalHealthcare.getOptional("total_healthcare") + + /** + * The part of this transaction amount that was for transit-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transit(): Optional = transit.getOptional("transit") + + /** + * An unknown additional amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun unknown(): Optional = unknown.getOptional("unknown") + + /** + * The part of this transaction amount that was for vision-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun vision(): Optional = vision.getOptional("vision") + + /** + * Returns the raw JSON value of [clinic]. + * + * Unlike [clinic], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("clinic") @ExcludeMissing fun _clinic(): JsonField = clinic + + /** + * Returns the raw JSON value of [dental]. + * + * Unlike [dental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + + /** + * Returns the raw JSON value of [prescription]. + * + * Unlike [prescription], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("prescription") + @ExcludeMissing + fun _prescription(): JsonField = prescription + + /** + * Returns the raw JSON value of [surcharge]. + * + * Unlike [surcharge], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("surcharge") + @ExcludeMissing + fun _surcharge(): JsonField = surcharge + + /** + * Returns the raw JSON value of [totalCumulative]. + * + * Unlike [totalCumulative], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_cumulative") + @ExcludeMissing + fun _totalCumulative(): JsonField = totalCumulative + + /** + * Returns the raw JSON value of [totalHealthcare]. + * + * Unlike [totalHealthcare], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_healthcare") + @ExcludeMissing + fun _totalHealthcare(): JsonField = totalHealthcare + + /** + * Returns the raw JSON value of [transit]. + * + * Unlike [transit], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transit") + @ExcludeMissing + fun _transit(): JsonField = transit + + /** + * Returns the raw JSON value of [unknown]. + * + * Unlike [unknown], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unknown") + @ExcludeMissing + fun _unknown(): JsonField = unknown + + /** + * Returns the raw JSON value of [vision]. + * + * Unlike [vision], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("vision") @ExcludeMissing fun _vision(): JsonField = vision + + @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 + * [AdditionalAmounts]. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AdditionalAmounts]. */ + class Builder internal constructor() { + + private var clinic: JsonField? = null + private var dental: JsonField? = null + private var original: JsonField? = null + private var prescription: JsonField? = null + private var surcharge: JsonField? = null + private var totalCumulative: JsonField? = null + private var totalHealthcare: JsonField? = null + private var transit: JsonField? = null + private var unknown: JsonField? = null + private var vision: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(additionalAmounts: AdditionalAmounts) = apply { + clinic = additionalAmounts.clinic + dental = additionalAmounts.dental + original = additionalAmounts.original + prescription = additionalAmounts.prescription + surcharge = additionalAmounts.surcharge + totalCumulative = additionalAmounts.totalCumulative + totalHealthcare = additionalAmounts.totalHealthcare + transit = additionalAmounts.transit + unknown = additionalAmounts.unknown + vision = additionalAmounts.vision + additionalProperties = additionalAmounts.additionalProperties.toMutableMap() + } + + /** The part of this transaction amount that was for clinic-related services. */ + fun clinic(clinic: Clinic?) = clinic(JsonField.ofNullable(clinic)) + + /** Alias for calling [Builder.clinic] with `clinic.orElse(null)`. */ + fun clinic(clinic: Optional) = clinic(clinic.getOrNull()) + + /** + * Sets [Builder.clinic] to an arbitrary JSON value. + * + * You should usually call [Builder.clinic] with a well-typed [Clinic] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun clinic(clinic: JsonField) = apply { this.clinic = clinic } + + /** The part of this transaction amount that was for dental-related services. */ + fun dental(dental: Dental?) = dental(JsonField.ofNullable(dental)) + + /** Alias for calling [Builder.dental] with `dental.orElse(null)`. */ + fun dental(dental: Optional) = dental(dental.getOrNull()) + + /** + * Sets [Builder.dental] to an arbitrary JSON value. + * + * You should usually call [Builder.dental] with a well-typed [Dental] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dental(dental: JsonField) = apply { this.dental = dental } + + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + + /** + * The part of this transaction amount that was for healthcare prescriptions. + */ + fun prescription(prescription: Prescription?) = + prescription(JsonField.ofNullable(prescription)) + + /** + * Alias for calling [Builder.prescription] with `prescription.orElse(null)`. + */ + fun prescription(prescription: Optional) = + prescription(prescription.getOrNull()) + + /** + * Sets [Builder.prescription] to an arbitrary JSON value. + * + * You should usually call [Builder.prescription] with a well-typed + * [Prescription] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun prescription(prescription: JsonField) = apply { + this.prescription = prescription + } + + /** The surcharge amount charged for this transaction by the merchant. */ + fun surcharge(surcharge: Surcharge?) = + surcharge(JsonField.ofNullable(surcharge)) + + /** Alias for calling [Builder.surcharge] with `surcharge.orElse(null)`. */ + fun surcharge(surcharge: Optional) = surcharge(surcharge.getOrNull()) + + /** + * Sets [Builder.surcharge] to an arbitrary JSON value. + * + * You should usually call [Builder.surcharge] with a well-typed [Surcharge] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun surcharge(surcharge: JsonField) = apply { + this.surcharge = surcharge + } + + /** + * The total amount of a series of incremental authorizations, optionally + * provided. + */ + fun totalCumulative(totalCumulative: TotalCumulative?) = + totalCumulative(JsonField.ofNullable(totalCumulative)) + + /** + * Alias for calling [Builder.totalCumulative] with + * `totalCumulative.orElse(null)`. + */ + fun totalCumulative(totalCumulative: Optional) = + totalCumulative(totalCumulative.getOrNull()) + + /** + * Sets [Builder.totalCumulative] to an arbitrary JSON value. + * + * You should usually call [Builder.totalCumulative] with a well-typed + * [TotalCumulative] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalCumulative(totalCumulative: JsonField) = apply { + this.totalCumulative = totalCumulative + } + + /** The total amount of healthcare-related additional amounts. */ + fun totalHealthcare(totalHealthcare: TotalHealthcare?) = + totalHealthcare(JsonField.ofNullable(totalHealthcare)) + + /** + * Alias for calling [Builder.totalHealthcare] with + * `totalHealthcare.orElse(null)`. + */ + fun totalHealthcare(totalHealthcare: Optional) = + totalHealthcare(totalHealthcare.getOrNull()) + + /** + * Sets [Builder.totalHealthcare] to an arbitrary JSON value. + * + * You should usually call [Builder.totalHealthcare] with a well-typed + * [TotalHealthcare] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalHealthcare(totalHealthcare: JsonField) = apply { + this.totalHealthcare = totalHealthcare + } + + /** + * The part of this transaction amount that was for transit-related services. + */ + fun transit(transit: Transit?) = transit(JsonField.ofNullable(transit)) + + /** Alias for calling [Builder.transit] with `transit.orElse(null)`. */ + fun transit(transit: Optional) = transit(transit.getOrNull()) + + /** + * Sets [Builder.transit] to an arbitrary JSON value. + * + * You should usually call [Builder.transit] with a well-typed [Transit] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun transit(transit: JsonField) = apply { this.transit = transit } + + /** An unknown additional amount. */ + fun unknown(unknown: Unknown?) = unknown(JsonField.ofNullable(unknown)) + + /** Alias for calling [Builder.unknown] with `unknown.orElse(null)`. */ + fun unknown(unknown: Optional) = unknown(unknown.getOrNull()) + + /** + * Sets [Builder.unknown] to an arbitrary JSON value. + * + * You should usually call [Builder.unknown] with a well-typed [Unknown] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun unknown(unknown: JsonField) = apply { this.unknown = unknown } + + /** The part of this transaction amount that was for vision-related services. */ + fun vision(vision: Vision?) = vision(JsonField.ofNullable(vision)) + + /** Alias for calling [Builder.vision] with `vision.orElse(null)`. */ + fun vision(vision: Optional) = vision(vision.getOrNull()) + + /** + * Sets [Builder.vision] to an arbitrary JSON value. + * + * You should usually call [Builder.vision] with a well-typed [Vision] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vision(vision: JsonField) = apply { this.vision = vision } + + 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 [AdditionalAmounts]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AdditionalAmounts = + AdditionalAmounts( + checkRequired("clinic", clinic), + checkRequired("dental", dental), + checkRequired("original", original), + checkRequired("prescription", prescription), + checkRequired("surcharge", surcharge), + checkRequired("totalCumulative", totalCumulative), + checkRequired("totalHealthcare", totalHealthcare), + checkRequired("transit", transit), + checkRequired("unknown", unknown), + checkRequired("vision", vision), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): AdditionalAmounts = apply { + if (validated) { + return@apply + } + + clinic().ifPresent { it.validate() } + dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } + prescription().ifPresent { it.validate() } + surcharge().ifPresent { it.validate() } + totalCumulative().ifPresent { it.validate() } + totalHealthcare().ifPresent { it.validate() } + transit().ifPresent { it.validate() } + unknown().ifPresent { it.validate() } + vision().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (clinic.asKnown().getOrNull()?.validity() ?: 0) + + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + + (prescription.asKnown().getOrNull()?.validity() ?: 0) + + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + + (totalHealthcare.asKnown().getOrNull()?.validity() ?: 0) + + (transit.asKnown().getOrNull()?.validity() ?: 0) + + (unknown.asKnown().getOrNull()?.validity() ?: 0) + + (vision.asKnown().getOrNull()?.validity() ?: 0) + + /** The part of this transaction amount that was for clinic-related services. */ + class Clinic + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Clinic]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Clinic]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(clinic: Clinic) = apply { + amount = clinic.amount + currency = clinic.currency + additionalProperties = clinic.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Clinic]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Clinic = + Clinic( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Clinic = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Clinic && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for dental-related services. */ + class Dental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Dental]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Dental]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(dental: Dental) = apply { + amount = dental.amount + currency = dental.currency + additionalProperties = dental.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Dental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Dental = + Dental( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Dental = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Dental && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Prescription]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Prescription]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(prescription: Prescription) = apply { + amount = prescription.amount + currency = prescription.currency + additionalProperties = prescription.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Prescription]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Prescription = + Prescription( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Prescription = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Prescription && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The surcharge amount charged for this transaction by the merchant. */ + class Surcharge + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Surcharge]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Surcharge]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(surcharge: Surcharge) = apply { + amount = surcharge.amount + currency = surcharge.currency + additionalProperties = surcharge.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Surcharge]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Surcharge = + Surcharge( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Surcharge = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Surcharge && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** + * The total amount of a series of incremental authorizations, optionally provided. + */ + class TotalCumulative + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalCumulative]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalCumulative]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalCumulative: TotalCumulative) = apply { + amount = totalCumulative.amount + currency = totalCumulative.currency + additionalProperties = + totalCumulative.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [TotalCumulative]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalCumulative = + TotalCumulative( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalCumulative = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalCumulative && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The total amount of healthcare-related additional amounts. */ + class TotalHealthcare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalHealthcare]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalHealthcare]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalHealthcare: TotalHealthcare) = apply { + amount = totalHealthcare.amount + currency = totalHealthcare.currency + additionalProperties = + totalHealthcare.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [TotalHealthcare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalHealthcare = + TotalHealthcare( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalHealthcare = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalHealthcare && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalHealthcare{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for transit-related services. */ + class Transit + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Transit]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Transit]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(transit: Transit) = apply { + amount = transit.amount + currency = transit.currency + additionalProperties = transit.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Transit]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Transit = + Transit( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Transit = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Transit && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Transit{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** An unknown additional amount. */ + class Unknown + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Unknown]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unknown]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(unknown: Unknown) = apply { + amount = unknown.amount + currency = unknown.currency + additionalProperties = unknown.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Unknown]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unknown = + Unknown( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unknown = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unknown && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unknown{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for vision-related services. */ + class Vision + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Vision]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Vision]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(vision: Vision) = apply { + amount = vision.amount + currency = vision.currency + additionalProperties = vision.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Vision]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Vision = + Vision( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Vision = apply { + if (validated) { + return@apply + } + + amount() + currency() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vision && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Vision{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AdditionalAmounts && + clinic == other.clinic && + dental == other.dental && + original == other.original && + prescription == other.prescription && + surcharge == other.surcharge && + totalCumulative == other.totalCumulative && + totalHealthcare == other.totalHealthcare && + transit == other.transit && + unknown == other.unknown && + vision == other.vision && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + */ + class Direction @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 { + + /** A regular card authorization where funds are debited from the cardholder. */ + @JvmField val SETTLEMENT = of("settlement") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + @JvmStatic fun of(value: String) = Direction(JsonField.of(value)) + } + + /** An enum containing [Direction]'s known values. */ + enum class Known { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + } + + /** + * An enum containing [Direction]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Direction] 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 { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * An enum member indicating that [Direction] 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) { + SETTLEMENT -> Value.SETTLEMENT + REFUND -> Value.REFUND + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + SETTLEMENT -> Known.SETTLEMENT + REFUND -> Known.REFUND + else -> throw IncreaseInvalidDataException("Unknown Direction: $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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Direction = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Direction && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `network`. */ + class NetworkDetails + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val pulse: JsonValue, + private val visa: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), + ) : this(category, pulse, visa, mutableMapOf()) + + /** + * The payment network used to process this card authorization. + * + * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") + + /** Fields specific to the `pulse` network. */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + + /** + * Fields specific to the `visa` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun visa(): Optional = visa.getOptional("visa") + + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("category") + @ExcludeMissing + fun _category(): JsonField = category + + /** + * Returns the raw JSON value of [visa]. + * + * Unlike [visa], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa + + @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 [NetworkDetails]. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkDetails]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var pulse: JsonValue? = null + private var visa: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkDetails: NetworkDetails) = apply { + category = networkDetails.category + pulse = networkDetails.pulse + visa = networkDetails.visa + additionalProperties = networkDetails.additionalProperties.toMutableMap() + } + + /** The payment network used to process this card authorization. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** Fields specific to the `pulse` network. */ + fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + + /** Fields specific to the `visa` network. */ + fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) + + /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */ + fun visa(visa: Optional) = visa(visa.getOrNull()) + + /** + * Sets [Builder.visa] to an arbitrary JSON value. + * + * You should usually call [Builder.visa] with a well-typed [Visa] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun visa(visa: JsonField) = apply { this.visa = visa } + + 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 [NetworkDetails]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkDetails = + NetworkDetails( + checkRequired("category", category), + checkRequired("pulse", pulse), + checkRequired("visa", visa), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkDetails = apply { + if (validated) { + return@apply + } + + category().validate() + visa().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (visa.asKnown().getOrNull()?.validity() ?: 0) + + /** The payment network used to process this card authorization. */ + class Category + @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 { + + /** Visa */ + @JvmField val VISA = of("visa") + + /** Pulse */ + @JvmField val PULSE = of("pulse") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Category] 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 { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + /** + * An enum member indicating that [Category] 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) { + VISA -> Value.VISA + PULSE -> Value.PULSE + 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 IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + VISA -> Known.VISA + PULSE -> Known.PULSE + else -> throw IncreaseInvalidDataException("Unknown Category: $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 IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `visa` network. */ + class Visa + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val electronicCommerceIndicator: JsonField, + private val pointOfServiceEntryMode: JsonField, + private val standInProcessingReason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + electronicCommerceIndicator: JsonField = + JsonMissing.of(), + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + pointOfServiceEntryMode: JsonField = + JsonMissing.of(), + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + standInProcessingReason: JsonField = + JsonMissing.of(), + ) : this( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + mutableMapOf(), + ) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun electronicCommerceIndicator(): Optional = + electronicCommerceIndicator.getOptional("electronic_commerce_indicator") + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pointOfServiceEntryMode(): Optional = + pointOfServiceEntryMode.getOptional("point_of_service_entry_mode") + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun standInProcessingReason(): Optional = + standInProcessingReason.getOptional("stand_in_processing_reason") + + /** + * Returns the raw JSON value of [electronicCommerceIndicator]. + * + * Unlike [electronicCommerceIndicator], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + fun _electronicCommerceIndicator(): JsonField = + electronicCommerceIndicator + + /** + * Returns the raw JSON value of [pointOfServiceEntryMode]. + * + * Unlike [pointOfServiceEntryMode], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + fun _pointOfServiceEntryMode(): JsonField = + pointOfServiceEntryMode + + /** + * Returns the raw JSON value of [standInProcessingReason]. + * + * Unlike [standInProcessingReason], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + fun _standInProcessingReason(): JsonField = + standInProcessingReason + + @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 [Visa]. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Visa]. */ + class Builder internal constructor() { + + private var electronicCommerceIndicator: + JsonField? = + null + private var pointOfServiceEntryMode: JsonField? = + null + private var standInProcessingReason: JsonField? = + null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(visa: Visa) = apply { + electronicCommerceIndicator = visa.electronicCommerceIndicator + pointOfServiceEntryMode = visa.pointOfServiceEntryMode + standInProcessingReason = visa.standInProcessingReason + additionalProperties = visa.additionalProperties.toMutableMap() + } + + /** + * For electronic commerce transactions, this identifies the level of + * security used in obtaining the customer's payment credential. For mail or + * telephone order transactions, identifies the type of mail or telephone + * order. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: ElectronicCommerceIndicator? + ) = + electronicCommerceIndicator( + JsonField.ofNullable(electronicCommerceIndicator) + ) + + /** + * Alias for calling [Builder.electronicCommerceIndicator] with + * `electronicCommerceIndicator.orElse(null)`. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: Optional + ) = electronicCommerceIndicator(electronicCommerceIndicator.getOrNull()) + + /** + * Sets [Builder.electronicCommerceIndicator] to an arbitrary JSON value. + * + * You should usually call [Builder.electronicCommerceIndicator] with a + * well-typed [ElectronicCommerceIndicator] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: JsonField + ) = apply { this.electronicCommerceIndicator = electronicCommerceIndicator } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: PointOfServiceEntryMode? + ) = pointOfServiceEntryMode(JsonField.ofNullable(pointOfServiceEntryMode)) + + /** + * Alias for calling [Builder.pointOfServiceEntryMode] with + * `pointOfServiceEntryMode.orElse(null)`. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: Optional + ) = pointOfServiceEntryMode(pointOfServiceEntryMode.getOrNull()) + + /** + * Sets [Builder.pointOfServiceEntryMode] to an arbitrary JSON value. + * + * You should usually call [Builder.pointOfServiceEntryMode] with a + * well-typed [PointOfServiceEntryMode] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: JsonField + ) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode } + + /** + * Only present when `actioner: network`. Describes why a card authorization + * was approved or declined by Visa through stand-in processing. + */ + fun standInProcessingReason( + standInProcessingReason: StandInProcessingReason? + ) = standInProcessingReason(JsonField.ofNullable(standInProcessingReason)) + + /** + * Alias for calling [Builder.standInProcessingReason] with + * `standInProcessingReason.orElse(null)`. + */ + fun standInProcessingReason( + standInProcessingReason: Optional + ) = standInProcessingReason(standInProcessingReason.getOrNull()) + + /** + * Sets [Builder.standInProcessingReason] to an arbitrary JSON value. + * + * You should usually call [Builder.standInProcessingReason] with a + * well-typed [StandInProcessingReason] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun standInProcessingReason( + standInProcessingReason: JsonField + ) = apply { this.standInProcessingReason = standInProcessingReason } + + 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 [Visa]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Visa = + Visa( + checkRequired( + "electronicCommerceIndicator", + electronicCommerceIndicator, + ), + checkRequired("pointOfServiceEntryMode", pointOfServiceEntryMode), + checkRequired("standInProcessingReason", standInProcessingReason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Visa = apply { + if (validated) { + return@apply + } + + electronicCommerceIndicator().ifPresent { it.validate() } + pointOfServiceEntryMode().ifPresent { it.validate() } + standInProcessingReason().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (electronicCommerceIndicator.asKnown().getOrNull()?.validity() ?: 0) + + (pointOfServiceEntryMode.asKnown().getOrNull()?.validity() ?: 0) + + (standInProcessingReason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + */ + class ElectronicCommerceIndicator + @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 { + + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + @JvmField val MAIL_PHONE_ORDER = of("mail_phone_order") + + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + @JvmField val RECURRING = of("recurring") + + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + @JvmField val INSTALLMENT = of("installment") + + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + @JvmField val UNKNOWN_MAIL_PHONE_ORDER = of("unknown_mail_phone_order") + + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + @JvmField + val SECURE_ELECTRONIC_COMMERCE = of("secure_electronic_commerce") + + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT = + of("non_authenticated_security_transaction_at_3ds_capable_merchant") + + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION = + of("non_authenticated_security_transaction") + + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + @JvmField val NON_SECURE_TRANSACTION = of("non_secure_transaction") + + @JvmStatic + fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value)) + } + + /** An enum containing [ElectronicCommerceIndicator]'s known values. */ + enum class Known { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + } + + /** + * An enum containing [ElectronicCommerceIndicator]'s known values, as well + * as an [_UNKNOWN] member. + * + * An instance of [ElectronicCommerceIndicator] 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 { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + /** + * An enum member indicating that [ElectronicCommerceIndicator] 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) { + MAIL_PHONE_ORDER -> Value.MAIL_PHONE_ORDER + RECURRING -> Value.RECURRING + INSTALLMENT -> Value.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Value.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Value.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Value + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Value.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Value.NON_SECURE_TRANSACTION + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + MAIL_PHONE_ORDER -> Known.MAIL_PHONE_ORDER + RECURRING -> Known.RECURRING + INSTALLMENT -> Known.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Known.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Known.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Known + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Known.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Known.NON_SECURE_TRANSACTION + else -> + throw IncreaseInvalidDataException( + "Unknown ElectronicCommerceIndicator: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): ElectronicCommerceIndicator = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 ElectronicCommerceIndicator && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + class PointOfServiceEntryMode + @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 { + + /** Unknown */ + @JvmField val UNKNOWN = of("unknown") + + /** Manual key entry */ + @JvmField val MANUAL = of("manual") + + /** Magnetic stripe read, without card verification value */ + @JvmField val MAGNETIC_STRIPE_NO_CVV = of("magnetic_stripe_no_cvv") + + /** Optical code */ + @JvmField val OPTICAL_CODE = of("optical_code") + + /** Contact chip card */ + @JvmField val INTEGRATED_CIRCUIT_CARD = of("integrated_circuit_card") + + /** Contactless read of chip card */ + @JvmField val CONTACTLESS = of("contactless") + + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + @JvmField val CREDENTIAL_ON_FILE = of("credential_on_file") + + /** Magnetic stripe read */ + @JvmField val MAGNETIC_STRIPE = of("magnetic_stripe") + + /** Contactless read of magnetic stripe data */ + @JvmField + val CONTACTLESS_MAGNETIC_STRIPE = of("contactless_magnetic_stripe") + + /** Contact chip card, without card verification value */ + @JvmField + val INTEGRATED_CIRCUIT_CARD_NO_CVV = + of("integrated_circuit_card_no_cvv") + + @JvmStatic + fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value)) + } + + /** An enum containing [PointOfServiceEntryMode]'s known values. */ + enum class Known { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + } + + /** + * An enum containing [PointOfServiceEntryMode]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [PointOfServiceEntryMode] 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 { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + /** + * An enum member indicating that [PointOfServiceEntryMode] 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) { + UNKNOWN -> Value.UNKNOWN + MANUAL -> Value.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Value.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Value.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Value.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Value.CONTACTLESS + CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Value.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Value.INTEGRATED_CIRCUIT_CARD_NO_CVV + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + UNKNOWN -> Known.UNKNOWN + MANUAL -> Known.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Known.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Known.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Known.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Known.CONTACTLESS + CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Known.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Known.INTEGRATED_CIRCUIT_CARD_NO_CVV + else -> + throw IncreaseInvalidDataException( + "Unknown PointOfServiceEntryMode: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): PointOfServiceEntryMode = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 PointOfServiceEntryMode && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + */ + class StandInProcessingReason + @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 { + + /** Increase failed to process the authorization in a timely manner. */ + @JvmField val ISSUER_ERROR = of("issuer_error") + + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") + + /** The 3DS cardholder authentication verification value was invalid. */ + @JvmField + val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE = + of("invalid_cardholder_authentication_verification_value") + + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + @JvmField val INTERNAL_VISA_ERROR = of("internal_visa_error") + + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + @JvmField + val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED = + of("merchant_transaction_advisory_service_authentication_required") + + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + @JvmField + val PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK = + of("payment_fraud_disruption_acquirer_block") + + /** An unspecific reason for stand-in processing. */ + @JvmField val OTHER = of("other") + + @JvmStatic + fun of(value: String) = StandInProcessingReason(JsonField.of(value)) + } + + /** An enum containing [StandInProcessingReason]'s known values. */ + enum class Known { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + } + + /** + * An enum containing [StandInProcessingReason]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [StandInProcessingReason] 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 { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + /** + * An enum member indicating that [StandInProcessingReason] 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) { + ISSUER_ERROR -> Value.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Value.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Value.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Value + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Value.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Value.OTHER + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + ISSUER_ERROR -> Known.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Known.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Known.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Known + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Known.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Known.OTHER + else -> + throw IncreaseInvalidDataException( + "Unknown StandInProcessingReason: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): StandInProcessingReason = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 StandInProcessingReason && 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 Visa && + electronicCommerceIndicator == other.electronicCommerceIndicator && + pointOfServiceEntryMode == other.pointOfServiceEntryMode && + standInProcessingReason == other.standInProcessingReason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, standInProcessingReason=$standInProcessingReason, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkDetails && + category == other.category && + pulse == other.pulse && + visa == other.visa && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, pulse, visa, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" + } + + /** Network-specific identifiers for a specific request or transaction. */ + class NetworkIdentifiers + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val authorizationIdentificationResponse: JsonField, + private val retrievalReferenceNumber: JsonField, + private val traceNumber: JsonField, + private val transactionId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + retrievalReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("trace_number") + @ExcludeMissing + traceNumber: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun retrievalReferenceNumber(): Optional = + retrievalReferenceNumber.getOptional("retrieval_reference_number") + + /** + * A counter used to verify an individual authorization. Expected to be unique per + * acquirer within a window of time. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun traceNumber(): Optional = traceNumber.getOptional("trace_number") + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + + /** + * Returns the raw JSON value of [retrievalReferenceNumber]. + * + * Unlike [retrievalReferenceNumber], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + fun _retrievalReferenceNumber(): JsonField = retrievalReferenceNumber + + /** + * Returns the raw JSON value of [traceNumber]. + * + * Unlike [traceNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("trace_number") + @ExcludeMissing + fun _traceNumber(): JsonField = traceNumber + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + @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 + * [NetworkIdentifiers]. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkIdentifiers]. */ + class Builder internal constructor() { + + private var authorizationIdentificationResponse: JsonField? = null + private var retrievalReferenceNumber: JsonField? = null + private var traceNumber: JsonField? = null + private var transactionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse + retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber + traceNumber = networkIdentifiers.traceNumber + transactionId = networkIdentifiers.transactionId + additionalProperties = + networkIdentifiers.additionalProperties.toMutableMap() + } + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: String?) = + retrievalReferenceNumber(JsonField.ofNullable(retrievalReferenceNumber)) + + /** + * Alias for calling [Builder.retrievalReferenceNumber] with + * `retrievalReferenceNumber.orElse(null)`. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: Optional) = + retrievalReferenceNumber(retrievalReferenceNumber.getOrNull()) + + /** + * Sets [Builder.retrievalReferenceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.retrievalReferenceNumber] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: JsonField) = + apply { + this.retrievalReferenceNumber = retrievalReferenceNumber + } + + /** + * A counter used to verify an individual authorization. Expected to be unique + * per acquirer within a window of time. + */ + fun traceNumber(traceNumber: String?) = + traceNumber(JsonField.ofNullable(traceNumber)) + + /** Alias for calling [Builder.traceNumber] with `traceNumber.orElse(null)`. */ + fun traceNumber(traceNumber: Optional) = + traceNumber(traceNumber.getOrNull()) + + /** + * Sets [Builder.traceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.traceNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun traceNumber(traceNumber: JsonField) = apply { + this.traceNumber = traceNumber + } + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** + * Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. + */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + 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 [NetworkIdentifiers]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkIdentifiers = + NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), + checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), + checkRequired("traceNumber", traceNumber), + checkRequired("transactionId", transactionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkIdentifiers = apply { + if (validated) { + return@apply + } + + authorizationIdentificationResponse() + retrievalReferenceNumber() + traceNumber() + transactionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (traceNumber.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && + retrievalReferenceNumber == other.retrievalReferenceNumber && + traceNumber == other.traceNumber && + transactionId == other.transactionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + } + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + class ProcessingCategory + @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 { + + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + @JvmField val ACCOUNT_FUNDING = of("account_funding") + + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + @JvmField val AUTOMATIC_FUEL_DISPENSER = of("automatic_fuel_dispenser") + + /** A transaction used to pay a bill. */ + @JvmField val BILL_PAYMENT = of("bill_payment") + + /** Original credit transactions are used to send money to a cardholder. */ + @JvmField val ORIGINAL_CREDIT = of("original_credit") + + /** A regular purchase. */ + @JvmField val PURCHASE = of("purchase") + + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + @JvmField val QUASI_CASH = of("quasi_cash") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + @JvmField val CASH_DISBURSEMENT = of("cash_disbursement") + + /** The processing category is unknown. */ + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic fun of(value: String) = ProcessingCategory(JsonField.of(value)) + } + + /** An enum containing [ProcessingCategory]'s known values. */ + enum class Known { + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** The processing category is unknown. */ + UNKNOWN, + } + + /** + * An enum containing [ProcessingCategory]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ProcessingCategory] 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 funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** The processing category is unknown. */ + UNKNOWN, + /** + * An enum member indicating that [ProcessingCategory] 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_FUNDING -> Value.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Value.BILL_PAYMENT + ORIGINAL_CREDIT -> Value.ORIGINAL_CREDIT + PURCHASE -> Value.PURCHASE + QUASI_CASH -> Value.QUASI_CASH + REFUND -> Value.REFUND + CASH_DISBURSEMENT -> Value.CASH_DISBURSEMENT + UNKNOWN -> Value.UNKNOWN + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Known.BILL_PAYMENT + ORIGINAL_CREDIT -> Known.ORIGINAL_CREDIT + PURCHASE -> Known.PURCHASE + QUASI_CASH -> Known.QUASI_CASH + REFUND -> Known.REFUND + CASH_DISBURSEMENT -> Known.CASH_DISBURSEMENT + UNKNOWN -> Known.UNKNOWN + else -> + throw IncreaseInvalidDataException("Unknown ProcessingCategory: $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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): ProcessingCategory = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 ProcessingCategory && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** This is present if a specific decline reason was given in the real-time decision. */ + class RealTimeDecisionReason + @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 { + + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") + + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") + + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") + + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") + + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = RealTimeDecisionReason(JsonField.of(value)) + } + + /** An enum containing [RealTimeDecisionReason]'s known values. */ + enum class Known { + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + } + + /** + * An enum containing [RealTimeDecisionReason]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [RealTimeDecisionReason] 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 { + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + /** + * An enum member indicating that [RealTimeDecisionReason] 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) { + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + OTHER -> Value.OTHER + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD + OTHER -> Known.OTHER + else -> + throw IncreaseInvalidDataException( + "Unknown RealTimeDecisionReason: $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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): RealTimeDecisionReason = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 RealTimeDecisionReason && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Why the transaction was declined. */ + 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 { + + /** The account has been closed. */ + @JvmField val ACCOUNT_CLOSED = of("account_closed") + + /** The Card was not active. */ + @JvmField val CARD_NOT_ACTIVE = of("card_not_active") + + /** The Card has been canceled. */ + @JvmField val CARD_CANCELED = of("card_canceled") + + /** The Physical Card was not active. */ + @JvmField val PHYSICAL_CARD_NOT_ACTIVE = of("physical_card_not_active") + + /** The account's entity was not active. */ + @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") + + /** The account was inactive. */ + @JvmField val GROUP_LOCKED = of("group_locked") + + /** The Card's Account did not have a sufficient available balance. */ + @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") + + /** The given CVV2 did not match the card's value. */ + @JvmField val CVV2_MISMATCH = of("cvv2_mismatch") + + /** The given PIN did not match the card's value. */ + @JvmField val PIN_MISMATCH = of("pin_mismatch") + + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + @JvmField val CARD_EXPIRATION_MISMATCH = of("card_expiration_mismatch") + + /** The attempted card transaction is not allowed per Increase's terms. */ + @JvmField val TRANSACTION_NOT_ALLOWED = of("transaction_not_allowed") + + /** The transaction was blocked by a Limit. */ + @JvmField val BREACHES_LIMIT = of("breaches_limit") + + /** Your application declined the transaction via webhook. */ + @JvmField val WEBHOOK_DECLINED = of("webhook_declined") + + /** Your application webhook did not respond without the required timeout. */ + @JvmField val WEBHOOK_TIMED_OUT = of("webhook_timed_out") + + /** Declined by stand-in processing. */ + @JvmField + val DECLINED_BY_STAND_IN_PROCESSING = of("declined_by_stand_in_processing") + + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") + + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + @JvmField + val MISSING_ORIGINAL_AUTHORIZATION = of("missing_original_authorization") + + /** The transaction was declined because the 3DS authentication failed. */ + @JvmField val FAILED_3DS_AUTHENTICATION = of("failed_3ds_authentication") + + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + @JvmField val SUSPECTED_CARD_TESTING = of("suspected_card_testing") + + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** The account has been closed. */ + ACCOUNT_CLOSED, + /** The Card was not active. */ + CARD_NOT_ACTIVE, + /** The Card has been canceled. */ + CARD_CANCELED, + /** The Physical Card was not active. */ + PHYSICAL_CARD_NOT_ACTIVE, + /** The account's entity was not active. */ + ENTITY_NOT_ACTIVE, + /** The account was inactive. */ + GROUP_LOCKED, + /** The Card's Account did not have a sufficient available balance. */ + INSUFFICIENT_FUNDS, + /** The given CVV2 did not match the card's value. */ + CVV2_MISMATCH, + /** The given PIN did not match the card's value. */ + PIN_MISMATCH, + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + CARD_EXPIRATION_MISMATCH, + /** The attempted card transaction is not allowed per Increase's terms. */ + TRANSACTION_NOT_ALLOWED, + /** The transaction was blocked by a Limit. */ + BREACHES_LIMIT, + /** Your application declined the transaction via webhook. */ + WEBHOOK_DECLINED, + /** Your application webhook did not respond without the required timeout. */ + WEBHOOK_TIMED_OUT, + /** Declined by stand-in processing. */ + DECLINED_BY_STAND_IN_PROCESSING, + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + MISSING_ORIGINAL_AUTHORIZATION, + /** The transaction was declined because the 3DS authentication failed. */ + FAILED_3DS_AUTHENTICATION, + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + SUSPECTED_CARD_TESTING, + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + SUSPECTED_FRAUD, + } + + /** + * 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 { + /** The account has been closed. */ + ACCOUNT_CLOSED, + /** The Card was not active. */ + CARD_NOT_ACTIVE, + /** The Card has been canceled. */ + CARD_CANCELED, + /** The Physical Card was not active. */ + PHYSICAL_CARD_NOT_ACTIVE, + /** The account's entity was not active. */ + ENTITY_NOT_ACTIVE, + /** The account was inactive. */ + GROUP_LOCKED, + /** The Card's Account did not have a sufficient available balance. */ + INSUFFICIENT_FUNDS, + /** The given CVV2 did not match the card's value. */ + CVV2_MISMATCH, + /** The given PIN did not match the card's value. */ + PIN_MISMATCH, + /** + * The given expiration date did not match the card's value. Only applies when a + * CVV2 is present. + */ + CARD_EXPIRATION_MISMATCH, + /** The attempted card transaction is not allowed per Increase's terms. */ + TRANSACTION_NOT_ALLOWED, + /** The transaction was blocked by a Limit. */ + BREACHES_LIMIT, + /** Your application declined the transaction via webhook. */ + WEBHOOK_DECLINED, + /** Your application webhook did not respond without the required timeout. */ + WEBHOOK_TIMED_OUT, + /** Declined by stand-in processing. */ + DECLINED_BY_STAND_IN_PROCESSING, + /** + * The card read had an invalid CVV, dCVV, or authorization request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** + * The original card authorization for this incremental authorization does not + * exist. + */ + MISSING_ORIGINAL_AUTHORIZATION, + /** The transaction was declined because the 3DS authentication failed. */ + FAILED_3DS_AUTHENTICATION, + /** + * The transaction was suspected to be used by a card tester to test for valid + * card numbers. + */ + SUSPECTED_CARD_TESTING, + /** + * The transaction was suspected to be fraudulent. Please reach out to + * support@increase.com for more information. + */ + SUSPECTED_FRAUD, + /** + * 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_CLOSED -> Value.ACCOUNT_CLOSED + CARD_NOT_ACTIVE -> Value.CARD_NOT_ACTIVE + CARD_CANCELED -> Value.CARD_CANCELED + PHYSICAL_CARD_NOT_ACTIVE -> Value.PHYSICAL_CARD_NOT_ACTIVE + ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE + GROUP_LOCKED -> Value.GROUP_LOCKED + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + CVV2_MISMATCH -> Value.CVV2_MISMATCH + PIN_MISMATCH -> Value.PIN_MISMATCH + CARD_EXPIRATION_MISMATCH -> Value.CARD_EXPIRATION_MISMATCH + TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED + BREACHES_LIMIT -> Value.BREACHES_LIMIT + WEBHOOK_DECLINED -> Value.WEBHOOK_DECLINED + WEBHOOK_TIMED_OUT -> Value.WEBHOOK_TIMED_OUT + DECLINED_BY_STAND_IN_PROCESSING -> Value.DECLINED_BY_STAND_IN_PROCESSING + INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD + MISSING_ORIGINAL_AUTHORIZATION -> Value.MISSING_ORIGINAL_AUTHORIZATION + FAILED_3DS_AUTHENTICATION -> Value.FAILED_3DS_AUTHENTICATION + SUSPECTED_CARD_TESTING -> Value.SUSPECTED_CARD_TESTING + SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + 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 IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + ACCOUNT_CLOSED -> Known.ACCOUNT_CLOSED + CARD_NOT_ACTIVE -> Known.CARD_NOT_ACTIVE + CARD_CANCELED -> Known.CARD_CANCELED + PHYSICAL_CARD_NOT_ACTIVE -> Known.PHYSICAL_CARD_NOT_ACTIVE + ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE + GROUP_LOCKED -> Known.GROUP_LOCKED + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + CVV2_MISMATCH -> Known.CVV2_MISMATCH + PIN_MISMATCH -> Known.PIN_MISMATCH + CARD_EXPIRATION_MISMATCH -> Known.CARD_EXPIRATION_MISMATCH + TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED + BREACHES_LIMIT -> Known.BREACHES_LIMIT + WEBHOOK_DECLINED -> Known.WEBHOOK_DECLINED + WEBHOOK_TIMED_OUT -> Known.WEBHOOK_TIMED_OUT + DECLINED_BY_STAND_IN_PROCESSING -> Known.DECLINED_BY_STAND_IN_PROCESSING + INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD + MISSING_ORIGINAL_AUTHORIZATION -> Known.MISSING_ORIGINAL_AUTHORIZATION + FAILED_3DS_AUTHENTICATION -> Known.FAILED_3DS_AUTHENTICATION + SUSPECTED_CARD_TESTING -> Known.SUSPECTED_CARD_TESTING + SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD + else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("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: IncreaseInvalidDataException) { + 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() + } + + /** Fields related to verification of cardholder-provided values. */ + class Verification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardVerificationCode: JsonField, + private val cardholderAddress: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("card_verification_code") + @ExcludeMissing + cardVerificationCode: JsonField = JsonMissing.of(), + @JsonProperty("cardholder_address") + @ExcludeMissing + cardholderAddress: JsonField = JsonMissing.of(), + ) : this(cardVerificationCode, cardholderAddress, mutableMapOf()) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + * + * @throws IncreaseInvalidDataException 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 cardVerificationCode(): CardVerificationCode = + cardVerificationCode.getRequired("card_verification_code") + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + * + * @throws IncreaseInvalidDataException 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 cardholderAddress(): CardholderAddress = + cardholderAddress.getRequired("cardholder_address") + + /** + * Returns the raw JSON value of [cardVerificationCode]. + * + * Unlike [cardVerificationCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("card_verification_code") + @ExcludeMissing + fun _cardVerificationCode(): JsonField = cardVerificationCode + + /** + * Returns the raw JSON value of [cardholderAddress]. + * + * Unlike [cardholderAddress], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("cardholder_address") + @ExcludeMissing + fun _cardholderAddress(): JsonField = cardholderAddress + + @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 [Verification]. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Verification]. */ + class Builder internal constructor() { + + private var cardVerificationCode: JsonField? = null + private var cardholderAddress: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(verification: Verification) = apply { + cardVerificationCode = verification.cardVerificationCode + cardholderAddress = verification.cardholderAddress + additionalProperties = verification.additionalProperties.toMutableMap() + } + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code + * on the back of the card. + */ + fun cardVerificationCode(cardVerificationCode: CardVerificationCode) = + cardVerificationCode(JsonField.of(cardVerificationCode)) + + /** + * Sets [Builder.cardVerificationCode] to an arbitrary JSON value. + * + * You should usually call [Builder.cardVerificationCode] with a well-typed + * [CardVerificationCode] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun cardVerificationCode( + cardVerificationCode: JsonField + ) = apply { this.cardVerificationCode = cardVerificationCode } + + /** + * Cardholder address provided in the authorization request and the address on + * file we verified it against. + */ + fun cardholderAddress(cardholderAddress: CardholderAddress) = + cardholderAddress(JsonField.of(cardholderAddress)) + + /** + * Sets [Builder.cardholderAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderAddress] with a well-typed + * [CardholderAddress] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun cardholderAddress(cardholderAddress: JsonField) = apply { + this.cardholderAddress = cardholderAddress + } + + 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 [Verification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Verification = + Verification( + checkRequired("cardVerificationCode", cardVerificationCode), + checkRequired("cardholderAddress", cardholderAddress), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Verification = apply { + if (validated) { + return@apply + } + + cardVerificationCode().validate() + cardholderAddress().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (cardVerificationCode.asKnown().getOrNull()?.validity() ?: 0) + + (cardholderAddress.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + */ + class CardVerificationCode + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of() + ) : this(result, mutableMapOf()) + + /** + * The result of verifying the Card Verification Code. + * + * @throws IncreaseInvalidDataException 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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardVerificationCode]. + * + * The following fields are required: + * ```java + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardVerificationCode]. */ + class Builder internal constructor() { + + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardVerificationCode: CardVerificationCode) = apply { + result = cardVerificationCode.result + additionalProperties = + cardVerificationCode.additionalProperties.toMutableMap() + } + + /** The result of verifying the Card Verification Code. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + fun 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 [CardVerificationCode]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardVerificationCode = + CardVerificationCode( + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardVerificationCode = apply { + if (validated) { + return@apply + } + + result().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The result of verifying the Card Verification Code. */ + class Result + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** + * No card verification code was provided in the authorization request. + */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** The card verification code matched the one on file. */ + @JvmField val MATCH = of("match") + + /** The card verification code did not match the one on file. */ + @JvmField val NO_MATCH = of("no_match") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + /** + * An enum member indicating that [Result] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + NOT_CHECKED -> Value.NOT_CHECKED + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + NOT_CHECKED -> Known.NOT_CHECKED + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + else -> throw IncreaseInvalidDataException("Unknown Result: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily + * for debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Result = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this + * object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Result && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardVerificationCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(result, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardVerificationCode{result=$result, additionalProperties=$additionalProperties}" + } + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + */ + class CardholderAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val actualLine1: JsonField, + private val actualPostalCode: JsonField, + private val providedLine1: JsonField, + private val providedPostalCode: JsonField, + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("actual_line1") + @ExcludeMissing + actualLine1: JsonField = JsonMissing.of(), + @JsonProperty("actual_postal_code") + @ExcludeMissing + actualPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("provided_line1") + @ExcludeMissing + providedLine1: JsonField = JsonMissing.of(), + @JsonProperty("provided_postal_code") + @ExcludeMissing + providedPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of(), + ) : this( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + mutableMapOf(), + ) + + /** + * Line 1 of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualLine1(): Optional = actualLine1.getOptional("actual_line1") + + /** + * The postal code of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualPostalCode(): Optional = + actualPostalCode.getOptional("actual_postal_code") + + /** + * The cardholder address line 1 provided for verification in the authorization + * request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedLine1(): Optional = + providedLine1.getOptional("provided_line1") + + /** + * The postal code provided for verification in the authorization request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedPostalCode(): Optional = + providedPostalCode.getOptional("provided_postal_code") + + /** + * The address verification result returned to the card network. + * + * @throws IncreaseInvalidDataException 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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [actualLine1]. + * + * Unlike [actualLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_line1") + @ExcludeMissing + fun _actualLine1(): JsonField = actualLine1 + + /** + * Returns the raw JSON value of [actualPostalCode]. + * + * Unlike [actualPostalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_postal_code") + @ExcludeMissing + fun _actualPostalCode(): JsonField = actualPostalCode + + /** + * Returns the raw JSON value of [providedLine1]. + * + * Unlike [providedLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("provided_line1") + @ExcludeMissing + fun _providedLine1(): JsonField = providedLine1 + + /** + * Returns the raw JSON value of [providedPostalCode]. + * + * Unlike [providedPostalCode], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("provided_postal_code") + @ExcludeMissing + fun _providedPostalCode(): JsonField = providedPostalCode + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardholderAddress]. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderAddress]. */ + class Builder internal constructor() { + + private var actualLine1: JsonField? = null + private var actualPostalCode: JsonField? = null + private var providedLine1: JsonField? = null + private var providedPostalCode: JsonField? = null + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardholderAddress: CardholderAddress) = apply { + actualLine1 = cardholderAddress.actualLine1 + actualPostalCode = cardholderAddress.actualPostalCode + providedLine1 = cardholderAddress.providedLine1 + providedPostalCode = cardholderAddress.providedPostalCode + result = cardholderAddress.result + additionalProperties = + cardholderAddress.additionalProperties.toMutableMap() + } + + /** Line 1 of the address on file for the cardholder. */ + fun actualLine1(actualLine1: String?) = + actualLine1(JsonField.ofNullable(actualLine1)) + + /** + * Alias for calling [Builder.actualLine1] with `actualLine1.orElse(null)`. + */ + fun actualLine1(actualLine1: Optional) = + actualLine1(actualLine1.getOrNull()) + + /** + * Sets [Builder.actualLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.actualLine1] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun actualLine1(actualLine1: JsonField) = apply { + this.actualLine1 = actualLine1 + } + + /** The postal code of the address on file for the cardholder. */ + fun actualPostalCode(actualPostalCode: String?) = + actualPostalCode(JsonField.ofNullable(actualPostalCode)) + + /** + * Alias for calling [Builder.actualPostalCode] with + * `actualPostalCode.orElse(null)`. + */ + fun actualPostalCode(actualPostalCode: Optional) = + actualPostalCode(actualPostalCode.getOrNull()) + + /** + * Sets [Builder.actualPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.actualPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun actualPostalCode(actualPostalCode: JsonField) = apply { + this.actualPostalCode = actualPostalCode + } + + /** + * The cardholder address line 1 provided for verification in the + * authorization request. + */ + fun providedLine1(providedLine1: String?) = + providedLine1(JsonField.ofNullable(providedLine1)) + + /** + * Alias for calling [Builder.providedLine1] with + * `providedLine1.orElse(null)`. + */ + fun providedLine1(providedLine1: Optional) = + providedLine1(providedLine1.getOrNull()) + + /** + * Sets [Builder.providedLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.providedLine1] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedLine1(providedLine1: JsonField) = apply { + this.providedLine1 = providedLine1 + } + + /** + * The postal code provided for verification in the authorization request. + */ + fun providedPostalCode(providedPostalCode: String?) = + providedPostalCode(JsonField.ofNullable(providedPostalCode)) + + /** + * Alias for calling [Builder.providedPostalCode] with + * `providedPostalCode.orElse(null)`. + */ + fun providedPostalCode(providedPostalCode: Optional) = + providedPostalCode(providedPostalCode.getOrNull()) + + /** + * Sets [Builder.providedPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.providedPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedPostalCode(providedPostalCode: JsonField) = apply { + this.providedPostalCode = providedPostalCode + } + + /** The address verification result returned to the card network. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + fun 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 [CardholderAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardholderAddress = + CardholderAddress( + checkRequired("actualLine1", actualLine1), + checkRequired("actualPostalCode", actualPostalCode), + checkRequired("providedLine1", providedLine1), + checkRequired("providedPostalCode", providedPostalCode), + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardholderAddress = apply { + if (validated) { + return@apply + } + + actualLine1() + actualPostalCode() + providedLine1() + providedPostalCode() + result().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (actualLine1.asKnown().isPresent) 1 else 0) + + (if (actualPostalCode.asKnown().isPresent) 1 else 0) + + (if (providedLine1.asKnown().isPresent) 1 else 0) + + (if (providedPostalCode.asKnown().isPresent) 1 else 0) + + (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The address verification result returned to the card network. */ + class Result + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** No address information was provided in the authorization request. */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = + of("postal_code_match_address_no_match") + + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + @JvmField + val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = + of("postal_code_no_match_address_match") + + /** Postal code and street address match. */ + @JvmField val MATCH = of("match") + + /** Postal code and street address do not match. */ + @JvmField val NO_MATCH = of("no_match") + + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + /** + * An enum member indicating that [Result] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + NOT_CHECKED -> Value.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + NOT_CHECKED -> Known.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + else -> throw IncreaseInvalidDataException("Unknown Result: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily + * for debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Result = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this + * object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Result && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardholderAddress && + actualLine1 == other.actualLine1 && + actualPostalCode == other.actualPostalCode && + providedLine1 == other.providedLine1 && + providedPostalCode == other.providedPostalCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardholderAddress{actualLine1=$actualLine1, actualPostalCode=$actualPostalCode, providedLine1=$providedLine1, providedPostalCode=$providedPostalCode, result=$result, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Verification && + cardVerificationCode == other.cardVerificationCode && + cardholderAddress == other.cardholderAddress && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(cardVerificationCode, cardholderAddress, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Verification{cardVerificationCode=$cardVerificationCode, cardholderAddress=$cardholderAddress, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardDecline && + id == other.id && + actioner == other.actioner && + additionalAmounts == other.additionalAmounts && + amount == other.amount && + cardPaymentId == other.cardPaymentId && + currency == other.currency && + declinedTransactionId == other.declinedTransactionId && + digitalWalletTokenId == other.digitalWalletTokenId && + direction == other.direction && + incrementedCardAuthorizationId == other.incrementedCardAuthorizationId && + merchantAcceptorId == other.merchantAcceptorId && + merchantCategoryCode == other.merchantCategoryCode && + merchantCity == other.merchantCity && + merchantCountry == other.merchantCountry && + merchantDescriptor == other.merchantDescriptor && + merchantPostalCode == other.merchantPostalCode && + merchantState == other.merchantState && + networkDetails == other.networkDetails && + networkIdentifiers == other.networkIdentifiers && + networkRiskScore == other.networkRiskScore && + physicalCardId == other.physicalCardId && + presentmentAmount == other.presentmentAmount && + presentmentCurrency == other.presentmentCurrency && + processingCategory == other.processingCategory && + realTimeDecisionId == other.realTimeDecisionId && + realTimeDecisionReason == other.realTimeDecisionReason && + reason == other.reason && + terminalId == other.terminalId && + verification == other.verification && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + actioner, + additionalAmounts, + amount, + cardPaymentId, + currency, + declinedTransactionId, + digitalWalletTokenId, + direction, + incrementedCardAuthorizationId, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + presentmentAmount, + presentmentCurrency, + processingCategory, + realTimeDecisionId, + realTimeDecisionReason, + reason, + terminalId, + verification, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardDecline{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, incrementedCardAuthorizationId=$incrementedCardAuthorizationId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, realTimeDecisionReason=$realTimeDecisionReason, reason=$reason, terminalId=$terminalId, verification=$verification, additionalProperties=$additionalProperties}" + } + + /** + * A Card Financial object. This field will be present in the JSON response if and only if + * `category` is equal to `card_financial`. Card Financials are temporary holds placed on a + * customers funds with the intent to later clear a transaction. + */ + class CardFinancial + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val actioner: JsonField, + private val additionalAmounts: JsonField, + private val amount: JsonField, + private val cardPaymentId: JsonField, + private val currency: JsonField, + private val digitalWalletTokenId: JsonField, + private val direction: JsonField, + private val merchantAcceptorId: JsonField, + private val merchantCategoryCode: JsonField, + private val merchantCity: JsonField, + private val merchantCountry: JsonField, + private val merchantDescriptor: JsonField, + private val merchantPostalCode: JsonField, + private val merchantState: JsonField, + private val networkDetails: JsonField, + private val networkIdentifiers: JsonField, + private val networkRiskScore: JsonField, + private val physicalCardId: JsonField, + private val presentmentAmount: JsonField, + private val presentmentCurrency: JsonField, + private val processingCategory: JsonField, + private val realTimeDecisionId: JsonField, + private val terminalId: JsonField, + private val transactionId: JsonField, + private val type: JsonField, + private val verification: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("actioner") + @ExcludeMissing + actioner: JsonField = JsonMissing.of(), + @JsonProperty("additional_amounts") + @ExcludeMissing + additionalAmounts: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("card_payment_id") + @ExcludeMissing + cardPaymentId: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + digitalWalletTokenId: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + direction: JsonField = JsonMissing.of(), + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + merchantAcceptorId: JsonField = JsonMissing.of(), + @JsonProperty("merchant_category_code") + @ExcludeMissing + merchantCategoryCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_city") + @ExcludeMissing + merchantCity: JsonField = JsonMissing.of(), + @JsonProperty("merchant_country") + @ExcludeMissing + merchantCountry: JsonField = JsonMissing.of(), + @JsonProperty("merchant_descriptor") + @ExcludeMissing + merchantDescriptor: JsonField = JsonMissing.of(), + @JsonProperty("merchant_postal_code") + @ExcludeMissing + merchantPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_state") + @ExcludeMissing + merchantState: JsonField = JsonMissing.of(), + @JsonProperty("network_details") + @ExcludeMissing + networkDetails: JsonField = JsonMissing.of(), + @JsonProperty("network_identifiers") + @ExcludeMissing + networkIdentifiers: JsonField = JsonMissing.of(), + @JsonProperty("network_risk_score") + @ExcludeMissing + networkRiskScore: JsonField = JsonMissing.of(), + @JsonProperty("physical_card_id") + @ExcludeMissing + physicalCardId: JsonField = JsonMissing.of(), + @JsonProperty("presentment_amount") + @ExcludeMissing + presentmentAmount: JsonField = JsonMissing.of(), + @JsonProperty("presentment_currency") + @ExcludeMissing + presentmentCurrency: JsonField = JsonMissing.of(), + @JsonProperty("processing_category") + @ExcludeMissing + processingCategory: JsonField = JsonMissing.of(), + @JsonProperty("real_time_decision_id") + @ExcludeMissing + realTimeDecisionId: JsonField = JsonMissing.of(), @JsonProperty("terminal_id") @ExcludeMissing terminalId: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("verification") @ExcludeMissing verification: JsonField = JsonMissing.of(), @@ -13462,10 +22486,8 @@ private constructor( amount, cardPaymentId, currency, - declinedTransactionId, digitalWalletTokenId, direction, - incrementedCardAuthorizationId, merchantAcceptorId, merchantCategoryCode, merchantCity, @@ -13481,15 +22503,15 @@ private constructor( presentmentCurrency, processingCategory, realTimeDecisionId, - realTimeDecisionReason, - reason, terminalId, + transactionId, + type, verification, mutableMapOf(), ) /** - * The Card Decline identifier. + * The Card Financial identifier. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13498,8 +22520,8 @@ private constructor( fun id(): String = id.getRequired("id") /** - * Whether this authorization was approved by Increase, the card network through - * stand-in processing, or the user through a real-time decision. + * Whether this financial was approved by Increase, the card network through stand-in + * processing, or the user through a real-time decision. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13520,8 +22542,8 @@ private constructor( additionalAmounts.getRequired("additional_amounts") /** - * The declined amount in the minor unit of the destination account currency. For - * dollars, for example, this is cents. + * The pending amount in the minor unit of the transaction's currency. For dollars, for + * example, this is cents. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13539,8 +22561,8 @@ private constructor( fun cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * currency. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13548,16 +22570,6 @@ private constructor( */ fun currency(): Currency = currency.getRequired("currency") - /** - * The identifier of the declined transaction created for this Card Decline. - * - * @throws IncreaseInvalidDataException 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 declinedTransactionId(): String = - declinedTransactionId.getRequired("declined_transaction_id") - /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay * purchase), the identifier of the token that was used. @@ -13578,16 +22590,6 @@ private constructor( */ fun direction(): Direction = direction.getRequired("direction") - /** - * The identifier of the card authorization this request attempted to incrementally - * authorize. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun incrementedCardAuthorizationId(): Optional = - incrementedCardAuthorizationId.getOptional("incremented_card_authorization_id") - /** * The merchant identifier (commonly abbreviated as MID) of the merchant the card is * transacting with. @@ -13694,7 +22696,7 @@ private constructor( fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id") /** - * The declined amount in the minor unit of the transaction's presentment currency. + * The pending amount in the minor unit of the transaction's presentment currency. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13714,8 +22716,8 @@ private constructor( presentmentCurrency.getRequired("presentment_currency") /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. + * The processing category describes the intent behind the financial, such as whether it + * was used for bill payments or an automatic fuel dispenser. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected @@ -13734,31 +22736,32 @@ private constructor( realTimeDecisionId.getOptional("real_time_decision_id") /** - * This is present if a specific decline reason was given in the real-time decision. + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun realTimeDecisionReason(): Optional = - realTimeDecisionReason.getOptional("real_time_decision_reason") + fun terminalId(): Optional = terminalId.getOptional("terminal_id") /** - * Why the transaction was declined. + * The identifier of the Transaction associated with this Transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is * unexpectedly missing or null (e.g. if the server responded with an unexpected * value). */ - fun reason(): Reason = reason.getRequired("reason") + fun transactionId(): String = transactionId.getRequired("transaction_id") /** - * The terminal identifier (commonly abbreviated as TID) of the terminal the card is - * transacting with. + * A constant representing the object's type. For this resource it will always be + * `card_financial`. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). + * @throws IncreaseInvalidDataException 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 terminalId(): Optional = terminalId.getOptional("terminal_id") + fun type(): Type = type.getRequired("type") /** * Fields related to verification of cardholder-provided values. @@ -13823,16 +22826,6 @@ private constructor( @ExcludeMissing fun _currency(): JsonField = currency - /** - * Returns the raw JSON value of [declinedTransactionId]. - * - * Unlike [declinedTransactionId], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("declined_transaction_id") - @ExcludeMissing - fun _declinedTransactionId(): JsonField = declinedTransactionId - /** * Returns the raw JSON value of [digitalWalletTokenId]. * @@ -13853,17 +22846,6 @@ private constructor( @ExcludeMissing fun _direction(): JsonField = direction - /** - * Returns the raw JSON value of [incrementedCardAuthorizationId]. - * - * Unlike [incrementedCardAuthorizationId], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("incremented_card_authorization_id") - @ExcludeMissing - fun _incrementedCardAuthorizationId(): JsonField = - incrementedCardAuthorizationId - /** * Returns the raw JSON value of [merchantAcceptorId]. * @@ -14015,32 +22997,31 @@ private constructor( fun _realTimeDecisionId(): JsonField = realTimeDecisionId /** - * Returns the raw JSON value of [realTimeDecisionReason]. + * Returns the raw JSON value of [terminalId]. * - * Unlike [realTimeDecisionReason], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("real_time_decision_reason") + @JsonProperty("terminal_id") @ExcludeMissing - fun _realTimeDecisionReason(): JsonField = - realTimeDecisionReason + fun _terminalId(): JsonField = terminalId /** - * Returns the raw JSON value of [reason]. + * Returns the raw JSON value of [transactionId]. * - * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected + * type. */ - @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId /** - * Returns the raw JSON value of [terminalId]. + * Returns the raw JSON value of [type]. * - * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("terminal_id") - @ExcludeMissing - fun _terminalId(): JsonField = terminalId + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type /** * Returns the raw JSON value of [verification]. @@ -14067,7 +23048,7 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardDecline]. + * Returns a mutable builder for constructing an instance of [CardFinancial]. * * The following fields are required: * ```java @@ -14077,10 +23058,8 @@ private constructor( * .amount() * .cardPaymentId() * .currency() - * .declinedTransactionId() * .digitalWalletTokenId() * .direction() - * .incrementedCardAuthorizationId() * .merchantAcceptorId() * .merchantCategoryCode() * .merchantCity() @@ -14096,16 +23075,16 @@ private constructor( * .presentmentCurrency() * .processingCategory() * .realTimeDecisionId() - * .realTimeDecisionReason() - * .reason() * .terminalId() + * .transactionId() + * .type() * .verification() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [CardDecline]. */ + /** A builder for [CardFinancial]. */ class Builder internal constructor() { private var id: JsonField? = null @@ -14114,10 +23093,8 @@ private constructor( private var amount: JsonField? = null private var cardPaymentId: JsonField? = null private var currency: JsonField? = null - private var declinedTransactionId: JsonField? = null private var digitalWalletTokenId: JsonField? = null private var direction: JsonField? = null - private var incrementedCardAuthorizationId: JsonField? = null private var merchantAcceptorId: JsonField? = null private var merchantCategoryCode: JsonField? = null private var merchantCity: JsonField? = null @@ -14133,47 +23110,45 @@ private constructor( private var presentmentCurrency: JsonField? = null private var processingCategory: JsonField? = null private var realTimeDecisionId: JsonField? = null - private var realTimeDecisionReason: JsonField? = null - private var reason: JsonField? = null private var terminalId: JsonField? = null + private var transactionId: JsonField? = null + private var type: JsonField? = null private var verification: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardDecline: CardDecline) = apply { - id = cardDecline.id - actioner = cardDecline.actioner - additionalAmounts = cardDecline.additionalAmounts - amount = cardDecline.amount - cardPaymentId = cardDecline.cardPaymentId - currency = cardDecline.currency - declinedTransactionId = cardDecline.declinedTransactionId - digitalWalletTokenId = cardDecline.digitalWalletTokenId - direction = cardDecline.direction - incrementedCardAuthorizationId = cardDecline.incrementedCardAuthorizationId - merchantAcceptorId = cardDecline.merchantAcceptorId - merchantCategoryCode = cardDecline.merchantCategoryCode - merchantCity = cardDecline.merchantCity - merchantCountry = cardDecline.merchantCountry - merchantDescriptor = cardDecline.merchantDescriptor - merchantPostalCode = cardDecline.merchantPostalCode - merchantState = cardDecline.merchantState - networkDetails = cardDecline.networkDetails - networkIdentifiers = cardDecline.networkIdentifiers - networkRiskScore = cardDecline.networkRiskScore - physicalCardId = cardDecline.physicalCardId - presentmentAmount = cardDecline.presentmentAmount - presentmentCurrency = cardDecline.presentmentCurrency - processingCategory = cardDecline.processingCategory - realTimeDecisionId = cardDecline.realTimeDecisionId - realTimeDecisionReason = cardDecline.realTimeDecisionReason - reason = cardDecline.reason - terminalId = cardDecline.terminalId - verification = cardDecline.verification - additionalProperties = cardDecline.additionalProperties.toMutableMap() - } - - /** The Card Decline identifier. */ + internal fun from(cardFinancial: CardFinancial) = apply { + id = cardFinancial.id + actioner = cardFinancial.actioner + additionalAmounts = cardFinancial.additionalAmounts + amount = cardFinancial.amount + cardPaymentId = cardFinancial.cardPaymentId + currency = cardFinancial.currency + digitalWalletTokenId = cardFinancial.digitalWalletTokenId + direction = cardFinancial.direction + merchantAcceptorId = cardFinancial.merchantAcceptorId + merchantCategoryCode = cardFinancial.merchantCategoryCode + merchantCity = cardFinancial.merchantCity + merchantCountry = cardFinancial.merchantCountry + merchantDescriptor = cardFinancial.merchantDescriptor + merchantPostalCode = cardFinancial.merchantPostalCode + merchantState = cardFinancial.merchantState + networkDetails = cardFinancial.networkDetails + networkIdentifiers = cardFinancial.networkIdentifiers + networkRiskScore = cardFinancial.networkRiskScore + physicalCardId = cardFinancial.physicalCardId + presentmentAmount = cardFinancial.presentmentAmount + presentmentCurrency = cardFinancial.presentmentCurrency + processingCategory = cardFinancial.processingCategory + realTimeDecisionId = cardFinancial.realTimeDecisionId + terminalId = cardFinancial.terminalId + transactionId = cardFinancial.transactionId + type = cardFinancial.type + verification = cardFinancial.verification + additionalProperties = cardFinancial.additionalProperties.toMutableMap() + } + + /** The Card Financial identifier. */ fun id(id: String) = id(JsonField.of(id)) /** @@ -14186,7 +23161,7 @@ private constructor( fun id(id: JsonField) = apply { this.id = id } /** - * Whether this authorization was approved by Increase, the card network through + * Whether this financial was approved by Increase, the card network through * stand-in processing, or the user through a real-time decision. */ fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner)) @@ -14220,8 +23195,8 @@ private constructor( } /** - * The declined amount in the minor unit of the destination account currency. For - * dollars, for example, this is cents. + * The pending amount in the minor unit of the transaction's currency. For dollars, + * for example, this is cents. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -14250,8 +23225,8 @@ private constructor( } /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * currency. */ fun currency(currency: Currency) = currency(JsonField.of(currency)) @@ -14264,21 +23239,6 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The identifier of the declined transaction created for this Card Decline. */ - fun declinedTransactionId(declinedTransactionId: String) = - declinedTransactionId(JsonField.of(declinedTransactionId)) - - /** - * Sets [Builder.declinedTransactionId] to an arbitrary JSON value. - * - * You should usually call [Builder.declinedTransactionId] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun declinedTransactionId(declinedTransactionId: JsonField) = apply { - this.declinedTransactionId = declinedTransactionId - } - /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay * purchase), the identifier of the token that was used. @@ -14321,34 +23281,6 @@ private constructor( this.direction = direction } - /** - * The identifier of the card authorization this request attempted to incrementally - * authorize. - */ - fun incrementedCardAuthorizationId(incrementedCardAuthorizationId: String?) = - incrementedCardAuthorizationId( - JsonField.ofNullable(incrementedCardAuthorizationId) - ) - - /** - * Alias for calling [Builder.incrementedCardAuthorizationId] with - * `incrementedCardAuthorizationId.orElse(null)`. - */ - fun incrementedCardAuthorizationId( - incrementedCardAuthorizationId: Optional - ) = incrementedCardAuthorizationId(incrementedCardAuthorizationId.getOrNull()) - - /** - * Sets [Builder.incrementedCardAuthorizationId] to an arbitrary JSON value. - * - * You should usually call [Builder.incrementedCardAuthorizationId] with a - * well-typed [String] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun incrementedCardAuthorizationId( - incrementedCardAuthorizationId: JsonField - ) = apply { this.incrementedCardAuthorizationId = incrementedCardAuthorizationId } - /** * The merchant identifier (commonly abbreviated as MID) of the merchant the card is * transacting with. @@ -14567,7 +23499,7 @@ private constructor( } /** - * The declined amount in the minor unit of the transaction's presentment currency. + * The pending amount in the minor unit of the transaction's presentment currency. */ fun presentmentAmount(presentmentAmount: Long) = presentmentAmount(JsonField.of(presentmentAmount)) @@ -14602,7 +23534,7 @@ private constructor( } /** - * The processing category describes the intent behind the authorization, such as + * The processing category describes the intent behind the financial, such as * whether it was used for bill payments or an automatic fuel dispenser. */ fun processingCategory(processingCategory: ProcessingCategory) = @@ -14645,61 +23577,54 @@ private constructor( } /** - * This is present if a specific decline reason was given in the real-time decision. + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. */ - fun realTimeDecisionReason(realTimeDecisionReason: RealTimeDecisionReason?) = - realTimeDecisionReason(JsonField.ofNullable(realTimeDecisionReason)) + fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId)) - /** - * Alias for calling [Builder.realTimeDecisionReason] with - * `realTimeDecisionReason.orElse(null)`. - */ - fun realTimeDecisionReason( - realTimeDecisionReason: Optional - ) = realTimeDecisionReason(realTimeDecisionReason.getOrNull()) + /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */ + fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull()) /** - * Sets [Builder.realTimeDecisionReason] to an arbitrary JSON value. + * Sets [Builder.terminalId] to an arbitrary JSON value. * - * You should usually call [Builder.realTimeDecisionReason] with a well-typed - * [RealTimeDecisionReason] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. + * You should usually call [Builder.terminalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. */ - fun realTimeDecisionReason( - realTimeDecisionReason: JsonField - ) = apply { this.realTimeDecisionReason = realTimeDecisionReason } + fun terminalId(terminalId: JsonField) = apply { + this.terminalId = terminalId + } - /** Why the transaction was declined. */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) + /** The identifier of the Transaction associated with this Transaction. */ + fun transactionId(transactionId: String) = + transactionId(JsonField.of(transactionId)) /** - * Sets [Builder.reason] to an arbitrary JSON value. + * Sets [Builder.transactionId] to an arbitrary JSON value. * - * You should usually call [Builder.reason] with a well-typed [Reason] value + * You should usually call [Builder.transactionId] with a well-typed [String] 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 transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } /** - * The terminal identifier (commonly abbreviated as TID) of the terminal the card is - * transacting with. + * A constant representing the object's type. For this resource it will always be + * `card_financial`. */ - fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId)) - - /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */ - fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull()) + fun type(type: Type) = type(JsonField.of(type)) /** - * Sets [Builder.terminalId] to an arbitrary JSON value. + * Sets [Builder.type] to an arbitrary JSON value. * - * You should usually call [Builder.terminalId] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported 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 terminalId(terminalId: JsonField) = apply { - this.terminalId = terminalId - } + fun type(type: JsonField) = apply { this.type = type } /** Fields related to verification of cardholder-provided values. */ fun verification(verification: Verification) = @@ -14739,7 +23664,7 @@ private constructor( } /** - * Returns an immutable instance of [CardDecline]. + * Returns an immutable instance of [CardFinancial]. * * Further updates to this [Builder] will not mutate the returned instance. * @@ -14751,10 +23676,8 @@ private constructor( * .amount() * .cardPaymentId() * .currency() - * .declinedTransactionId() * .digitalWalletTokenId() * .direction() - * .incrementedCardAuthorizationId() * .merchantAcceptorId() * .merchantCategoryCode() * .merchantCity() @@ -14770,29 +23693,24 @@ private constructor( * .presentmentCurrency() * .processingCategory() * .realTimeDecisionId() - * .realTimeDecisionReason() - * .reason() * .terminalId() + * .transactionId() + * .type() * .verification() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardDecline = - CardDecline( + fun build(): CardFinancial = + CardFinancial( checkRequired("id", id), checkRequired("actioner", actioner), checkRequired("additionalAmounts", additionalAmounts), checkRequired("amount", amount), checkRequired("cardPaymentId", cardPaymentId), checkRequired("currency", currency), - checkRequired("declinedTransactionId", declinedTransactionId), checkRequired("digitalWalletTokenId", digitalWalletTokenId), checkRequired("direction", direction), - checkRequired( - "incrementedCardAuthorizationId", - incrementedCardAuthorizationId, - ), checkRequired("merchantAcceptorId", merchantAcceptorId), checkRequired("merchantCategoryCode", merchantCategoryCode), checkRequired("merchantCity", merchantCity), @@ -14808,9 +23726,9 @@ private constructor( checkRequired("presentmentCurrency", presentmentCurrency), checkRequired("processingCategory", processingCategory), checkRequired("realTimeDecisionId", realTimeDecisionId), - checkRequired("realTimeDecisionReason", realTimeDecisionReason), - checkRequired("reason", reason), checkRequired("terminalId", terminalId), + checkRequired("transactionId", transactionId), + checkRequired("type", type), checkRequired("verification", verification), additionalProperties.toMutableMap(), ) @@ -14818,7 +23736,7 @@ private constructor( private var validated: Boolean = false - fun validate(): CardDecline = apply { + fun validate(): CardFinancial = apply { if (validated) { return@apply } @@ -14829,10 +23747,8 @@ private constructor( amount() cardPaymentId() currency().validate() - declinedTransactionId() digitalWalletTokenId() direction().validate() - incrementedCardAuthorizationId() merchantAcceptorId() merchantCategoryCode() merchantCity() @@ -14848,9 +23764,9 @@ private constructor( presentmentCurrency() processingCategory().validate() realTimeDecisionId() - realTimeDecisionReason().ifPresent { it.validate() } - reason().validate() terminalId() + transactionId() + type().validate() verification().validate() validated = true } @@ -14877,10 +23793,8 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (if (cardPaymentId.asKnown().isPresent) 1 else 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + - (if (declinedTransactionId.asKnown().isPresent) 1 else 0) + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + (direction.asKnown().getOrNull()?.validity() ?: 0) + - (if (incrementedCardAuthorizationId.asKnown().isPresent) 1 else 0) + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + (if (merchantCity.asKnown().isPresent) 1 else 0) + @@ -14896,14 +23810,14 @@ private constructor( (if (presentmentCurrency.asKnown().isPresent) 1 else 0) + (processingCategory.asKnown().getOrNull()?.validity() ?: 0) + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + - (realTimeDecisionReason.asKnown().getOrNull()?.validity() ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) + (if (terminalId.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + (verification.asKnown().getOrNull()?.validity() ?: 0) /** - * Whether this authorization was approved by Increase, the card network through - * stand-in processing, or the user through a real-time decision. + * Whether this financial was approved by Increase, the card network through stand-in + * processing, or the user through a real-time decision. */ class Actioner @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -17964,8 +26878,8 @@ private constructor( } /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * currency. */ class Currency @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -20204,8 +29118,8 @@ private constructor( } /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. + * The processing category describes the intent behind the financial, such as whether it + * was used for bill payments or an automatic fuel dispenser. */ class ProcessingCategory @JsonCreator @@ -20451,241 +29365,7 @@ private constructor( return true } - return other is ProcessingCategory && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** This is present if a specific decline reason was given in the real-time decision. */ - class RealTimeDecisionReason - @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 { - - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") - - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") - - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") - - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") - - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") - - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = RealTimeDecisionReason(JsonField.of(value)) - } - - /** An enum containing [RealTimeDecisionReason]'s known values. */ - enum class Known { - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - } - - /** - * An enum containing [RealTimeDecisionReason]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [RealTimeDecisionReason] 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 { - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction - * should not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant - * may attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - /** - * An enum member indicating that [RealTimeDecisionReason] 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) { - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD - OTHER -> Value.OTHER - 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 IncreaseInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - OTHER -> Known.OTHER - else -> - throw IncreaseInvalidDataException( - "Unknown RealTimeDecisionReason: $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 IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): RealTimeDecisionReason = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 RealTimeDecisionReason && value == other.value + return other is ProcessingCategory && value == other.value } override fun hashCode() = value.hashCode() @@ -20693,8 +29373,11 @@ private constructor( override fun toString() = value.toString() } - /** Why the transaction was declined. */ - class Reason @JsonCreator private constructor(private val value: JsonField) : + /** + * A constant representing the object's type. For this resource it will always be + * `card_financial`. + */ + class Type @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -20709,210 +29392,29 @@ private constructor( companion object { - /** The account has been closed. */ - @JvmField val ACCOUNT_CLOSED = of("account_closed") - - /** The Card was not active. */ - @JvmField val CARD_NOT_ACTIVE = of("card_not_active") - - /** The Card has been canceled. */ - @JvmField val CARD_CANCELED = of("card_canceled") - - /** The Physical Card was not active. */ - @JvmField val PHYSICAL_CARD_NOT_ACTIVE = of("physical_card_not_active") - - /** The account's entity was not active. */ - @JvmField val ENTITY_NOT_ACTIVE = of("entity_not_active") - - /** The account was inactive. */ - @JvmField val GROUP_LOCKED = of("group_locked") - - /** The Card's Account did not have a sufficient available balance. */ - @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") - - /** The given CVV2 did not match the card's value. */ - @JvmField val CVV2_MISMATCH = of("cvv2_mismatch") - - /** The given PIN did not match the card's value. */ - @JvmField val PIN_MISMATCH = of("pin_mismatch") - - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - @JvmField val CARD_EXPIRATION_MISMATCH = of("card_expiration_mismatch") - - /** The attempted card transaction is not allowed per Increase's terms. */ - @JvmField val TRANSACTION_NOT_ALLOWED = of("transaction_not_allowed") - - /** The transaction was blocked by a Limit. */ - @JvmField val BREACHES_LIMIT = of("breaches_limit") - - /** Your application declined the transaction via webhook. */ - @JvmField val WEBHOOK_DECLINED = of("webhook_declined") - - /** Your application webhook did not respond without the required timeout. */ - @JvmField val WEBHOOK_TIMED_OUT = of("webhook_timed_out") - - /** Declined by stand-in processing. */ - @JvmField - val DECLINED_BY_STAND_IN_PROCESSING = of("declined_by_stand_in_processing") - - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") - - /** - * The original card authorization for this incremental authorization does not - * exist. - */ - @JvmField - val MISSING_ORIGINAL_AUTHORIZATION = of("missing_original_authorization") - - /** The transaction was declined because the 3DS authentication failed. */ - @JvmField val FAILED_3DS_AUTHENTICATION = of("failed_3ds_authentication") - - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - @JvmField val SUSPECTED_CARD_TESTING = of("suspected_card_testing") - - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + @JvmField val CARD_FINANCIAL = of("card_financial") - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - /** An enum containing [Reason]'s known values. */ + /** An enum containing [Type]'s known values. */ enum class Known { - /** The account has been closed. */ - ACCOUNT_CLOSED, - /** The Card was not active. */ - CARD_NOT_ACTIVE, - /** The Card has been canceled. */ - CARD_CANCELED, - /** The Physical Card was not active. */ - PHYSICAL_CARD_NOT_ACTIVE, - /** The account's entity was not active. */ - ENTITY_NOT_ACTIVE, - /** The account was inactive. */ - GROUP_LOCKED, - /** The Card's Account did not have a sufficient available balance. */ - INSUFFICIENT_FUNDS, - /** The given CVV2 did not match the card's value. */ - CVV2_MISMATCH, - /** The given PIN did not match the card's value. */ - PIN_MISMATCH, - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - CARD_EXPIRATION_MISMATCH, - /** The attempted card transaction is not allowed per Increase's terms. */ - TRANSACTION_NOT_ALLOWED, - /** The transaction was blocked by a Limit. */ - BREACHES_LIMIT, - /** Your application declined the transaction via webhook. */ - WEBHOOK_DECLINED, - /** Your application webhook did not respond without the required timeout. */ - WEBHOOK_TIMED_OUT, - /** Declined by stand-in processing. */ - DECLINED_BY_STAND_IN_PROCESSING, - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - INVALID_PHYSICAL_CARD, - /** - * The original card authorization for this incremental authorization does not - * exist. - */ - MISSING_ORIGINAL_AUTHORIZATION, - /** The transaction was declined because the 3DS authentication failed. */ - FAILED_3DS_AUTHENTICATION, - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - SUSPECTED_CARD_TESTING, - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - SUSPECTED_FRAUD, + CARD_FINANCIAL } /** - * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [Reason] can contain an unknown value in a couple of cases: + * 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 { - /** The account has been closed. */ - ACCOUNT_CLOSED, - /** The Card was not active. */ - CARD_NOT_ACTIVE, - /** The Card has been canceled. */ - CARD_CANCELED, - /** The Physical Card was not active. */ - PHYSICAL_CARD_NOT_ACTIVE, - /** The account's entity was not active. */ - ENTITY_NOT_ACTIVE, - /** The account was inactive. */ - GROUP_LOCKED, - /** The Card's Account did not have a sufficient available balance. */ - INSUFFICIENT_FUNDS, - /** The given CVV2 did not match the card's value. */ - CVV2_MISMATCH, - /** The given PIN did not match the card's value. */ - PIN_MISMATCH, - /** - * The given expiration date did not match the card's value. Only applies when a - * CVV2 is present. - */ - CARD_EXPIRATION_MISMATCH, - /** The attempted card transaction is not allowed per Increase's terms. */ - TRANSACTION_NOT_ALLOWED, - /** The transaction was blocked by a Limit. */ - BREACHES_LIMIT, - /** Your application declined the transaction via webhook. */ - WEBHOOK_DECLINED, - /** Your application webhook did not respond without the required timeout. */ - WEBHOOK_TIMED_OUT, - /** Declined by stand-in processing. */ - DECLINED_BY_STAND_IN_PROCESSING, - /** - * The card read had an invalid CVV, dCVV, or authorization request cryptogram. - */ - INVALID_PHYSICAL_CARD, + CARD_FINANCIAL, /** - * The original card authorization for this incremental authorization does not - * exist. - */ - MISSING_ORIGINAL_AUTHORIZATION, - /** The transaction was declined because the 3DS authentication failed. */ - FAILED_3DS_AUTHENTICATION, - /** - * The transaction was suspected to be used by a card tester to test for valid - * card numbers. - */ - SUSPECTED_CARD_TESTING, - /** - * The transaction was suspected to be fraudulent. Please reach out to - * support@increase.com for more information. - */ - SUSPECTED_FRAUD, - /** - * An enum member indicating that [Reason] was instantiated with an unknown - * value. + * An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -20926,26 +29428,7 @@ private constructor( */ fun value(): Value = when (this) { - ACCOUNT_CLOSED -> Value.ACCOUNT_CLOSED - CARD_NOT_ACTIVE -> Value.CARD_NOT_ACTIVE - CARD_CANCELED -> Value.CARD_CANCELED - PHYSICAL_CARD_NOT_ACTIVE -> Value.PHYSICAL_CARD_NOT_ACTIVE - ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE - GROUP_LOCKED -> Value.GROUP_LOCKED - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - CVV2_MISMATCH -> Value.CVV2_MISMATCH - PIN_MISMATCH -> Value.PIN_MISMATCH - CARD_EXPIRATION_MISMATCH -> Value.CARD_EXPIRATION_MISMATCH - TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED - BREACHES_LIMIT -> Value.BREACHES_LIMIT - WEBHOOK_DECLINED -> Value.WEBHOOK_DECLINED - WEBHOOK_TIMED_OUT -> Value.WEBHOOK_TIMED_OUT - DECLINED_BY_STAND_IN_PROCESSING -> Value.DECLINED_BY_STAND_IN_PROCESSING - INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD - MISSING_ORIGINAL_AUTHORIZATION -> Value.MISSING_ORIGINAL_AUTHORIZATION - FAILED_3DS_AUTHENTICATION -> Value.FAILED_3DS_AUTHENTICATION - SUSPECTED_CARD_TESTING -> Value.SUSPECTED_CARD_TESTING - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + CARD_FINANCIAL -> Value.CARD_FINANCIAL else -> Value._UNKNOWN } @@ -20960,27 +29443,8 @@ private constructor( */ fun known(): Known = when (this) { - ACCOUNT_CLOSED -> Known.ACCOUNT_CLOSED - CARD_NOT_ACTIVE -> Known.CARD_NOT_ACTIVE - CARD_CANCELED -> Known.CARD_CANCELED - PHYSICAL_CARD_NOT_ACTIVE -> Known.PHYSICAL_CARD_NOT_ACTIVE - ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE - GROUP_LOCKED -> Known.GROUP_LOCKED - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - CVV2_MISMATCH -> Known.CVV2_MISMATCH - PIN_MISMATCH -> Known.PIN_MISMATCH - CARD_EXPIRATION_MISMATCH -> Known.CARD_EXPIRATION_MISMATCH - TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED - BREACHES_LIMIT -> Known.BREACHES_LIMIT - WEBHOOK_DECLINED -> Known.WEBHOOK_DECLINED - WEBHOOK_TIMED_OUT -> Known.WEBHOOK_TIMED_OUT - DECLINED_BY_STAND_IN_PROCESSING -> Known.DECLINED_BY_STAND_IN_PROCESSING - INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD - MISSING_ORIGINAL_AUTHORIZATION -> Known.MISSING_ORIGINAL_AUTHORIZATION - FAILED_3DS_AUTHENTICATION -> Known.FAILED_3DS_AUTHENTICATION - SUSPECTED_CARD_TESTING -> Known.SUSPECTED_CARD_TESTING - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + CARD_FINANCIAL -> Known.CARD_FINANCIAL + else -> throw IncreaseInvalidDataException("Unknown Type: $value") } /** @@ -20999,7 +29463,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Reason = apply { + fun validate(): Type = apply { if (validated) { return@apply } @@ -21029,7 +29493,7 @@ private constructor( return true } - return other is Reason && value == other.value + return other is Type && value == other.value } override fun hashCode() = value.hashCode() @@ -22235,17 +30699,15 @@ private constructor( return true } - return other is CardDecline && + return other is CardFinancial && id == other.id && actioner == other.actioner && additionalAmounts == other.additionalAmounts && amount == other.amount && cardPaymentId == other.cardPaymentId && currency == other.currency && - declinedTransactionId == other.declinedTransactionId && digitalWalletTokenId == other.digitalWalletTokenId && direction == other.direction && - incrementedCardAuthorizationId == other.incrementedCardAuthorizationId && merchantAcceptorId == other.merchantAcceptorId && merchantCategoryCode == other.merchantCategoryCode && merchantCity == other.merchantCity && @@ -22261,9 +30723,9 @@ private constructor( presentmentCurrency == other.presentmentCurrency && processingCategory == other.processingCategory && realTimeDecisionId == other.realTimeDecisionId && - realTimeDecisionReason == other.realTimeDecisionReason && - reason == other.reason && terminalId == other.terminalId && + transactionId == other.transactionId && + type == other.type && verification == other.verification && additionalProperties == other.additionalProperties } @@ -22276,10 +30738,8 @@ private constructor( amount, cardPaymentId, currency, - declinedTransactionId, digitalWalletTokenId, direction, - incrementedCardAuthorizationId, merchantAcceptorId, merchantCategoryCode, merchantCity, @@ -22295,9 +30755,9 @@ private constructor( presentmentCurrency, processingCategory, realTimeDecisionId, - realTimeDecisionReason, - reason, terminalId, + transactionId, + type, verification, additionalProperties, ) @@ -22306,7 +30766,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardDecline{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, incrementedCardAuthorizationId=$incrementedCardAuthorizationId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, realTimeDecisionReason=$realTimeDecisionReason, reason=$reason, terminalId=$terminalId, verification=$verification, additionalProperties=$additionalProperties}" + "CardFinancial{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, transactionId=$transactionId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" } /** @@ -58217,6 +66677,9 @@ private constructor( */ @JvmField val CARD_FUEL_CONFIRMATION = of("card_fuel_confirmation") + /** Card Financial: details will be under the `card_financial` object. */ + @JvmField val CARD_FINANCIAL = of("card_financial") + /** Unknown card payment element. */ @JvmField val OTHER = of("other") @@ -58251,6 +66714,8 @@ private constructor( * object. */ CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, /** Unknown card payment element. */ OTHER, } @@ -58291,6 +66756,8 @@ private constructor( * object. */ CARD_FUEL_CONFIRMATION, + /** Card Financial: details will be under the `card_financial` object. */ + CARD_FINANCIAL, /** Unknown card payment element. */ OTHER, /** @@ -58318,6 +66785,7 @@ private constructor( CARD_SETTLEMENT -> Value.CARD_SETTLEMENT CARD_REFUND -> Value.CARD_REFUND CARD_FUEL_CONFIRMATION -> Value.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Value.CARD_FINANCIAL OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -58343,6 +66811,7 @@ private constructor( CARD_SETTLEMENT -> Known.CARD_SETTLEMENT CARD_REFUND -> Known.CARD_REFUND CARD_FUEL_CONFIRMATION -> Known.CARD_FUEL_CONFIRMATION + CARD_FINANCIAL -> Known.CARD_FINANCIAL OTHER -> Known.OTHER else -> throw IncreaseInvalidDataException("Unknown Category: $value") } @@ -58411,6 +66880,7 @@ private constructor( cardAuthorization == other.cardAuthorization && cardAuthorizationExpiration == other.cardAuthorizationExpiration && cardDecline == other.cardDecline && + cardFinancial == other.cardFinancial && cardFuelConfirmation == other.cardFuelConfirmation && cardIncrement == other.cardIncrement && cardRefund == other.cardRefund && @@ -58429,6 +66899,7 @@ private constructor( cardAuthorization, cardAuthorizationExpiration, cardDecline, + cardFinancial, cardFuelConfirmation, cardIncrement, cardRefund, @@ -58445,7 +66916,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" + "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" } /** The summarized state of this card payment. */ diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 2313cabd1..7421ddd9e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -557,6 +557,221 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -2062,51 +2277,17 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) - .currency( - CardPayment.Element.CardFuelConfirmation.Currency - .USD - ) - .network( - CardPayment.Element.CardFuelConfirmation.Network - .VISA - ) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation - .NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") .actioner( - CardPayment.Element.CardIncrement.Actioner.INCREASE + CardPayment.Element.CardFinancial.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -2115,7 +2296,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -2124,7 +2305,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -2133,7 +2314,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -2142,16 +2323,16 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() - .amount(0L) - .currency("currency") + .amount(10L) + .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -2160,7 +2341,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -2169,7 +2350,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -2178,7 +2359,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -2187,7 +2368,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardIncrement + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -2197,22 +2378,271 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(20L) - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .currency( - CardPayment.Element.CardIncrement.Currency.USD + CardPayment.Element.CardFinancial.Currency.USD ) - .network(CardPayment.Element.CardIncrement.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardIncrement.NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardFuelConfirmation.Currency + .USD + ) + .network( + CardPayment.Element.CardFuelConfirmation.Network + .VISA + ) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner( + CardPayment.Element.CardIncrement.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardIncrement + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(20L) + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardIncrement.Currency.USD + ) + .network(CardPayment.Element.CardIncrement.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardIncrement.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() ) .networkRiskScore(10L) .pendingTransactionId( @@ -3360,10 +3790,224 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardDecline.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -3372,7 +4016,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -3381,7 +4025,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -3390,7 +4034,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -3399,7 +4043,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -3408,7 +4052,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -3417,7 +4061,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -3426,7 +4070,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -3435,7 +4079,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -3444,7 +4088,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -3454,48 +4098,47 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardFinancial.Currency.USD ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -3507,7 +4150,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -3517,28 +4160,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -3547,7 +4191,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -3555,7 +4200,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -4862,13 +5507,227 @@ internal class CardPaymentListPageResponseTest { CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -4877,7 +5736,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -4886,7 +5745,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -4895,7 +5754,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -4904,7 +5763,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -4913,7 +5772,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -4922,7 +5781,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -4931,7 +5790,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -4940,7 +5799,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -4949,7 +5808,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -4959,48 +5818,47 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardFinancial.Currency.USD ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -5012,7 +5870,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -5022,28 +5880,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -5052,7 +5911,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -5060,7 +5920,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -6378,15 +7238,225 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -6395,7 +7465,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -6404,7 +7474,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -6413,7 +7483,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -6422,7 +7492,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -6431,7 +7501,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -6440,7 +7510,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -6449,7 +7519,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -6458,7 +7528,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -6467,7 +7537,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -6477,45 +7547,42 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -6527,7 +7594,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -6537,27 +7604,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -6566,7 +7630,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -6574,7 +7638,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -7809,15 +8873,225 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -7826,7 +9100,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -7835,7 +9109,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -7844,7 +9118,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -7853,7 +9127,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -7862,7 +9136,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -7871,7 +9145,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -7880,7 +9154,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -7889,7 +9163,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -7898,7 +9172,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -7908,45 +9182,42 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -7958,7 +9229,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -7968,27 +9239,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -7997,7 +9265,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -8005,7 +9273,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -9240,15 +10508,225 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -9257,7 +10735,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -9266,7 +10744,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -9275,7 +10753,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -9284,7 +10762,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -9293,7 +10771,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -9302,7 +10780,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -9311,7 +10789,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -9320,7 +10798,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -9329,7 +10807,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -9339,45 +10817,42 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -9389,7 +10864,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -9399,27 +10874,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -9428,7 +10900,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -9436,7 +10908,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -10671,15 +12143,225 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -10688,7 +12370,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -10697,7 +12379,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -10706,7 +12388,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -10715,7 +12397,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -10724,7 +12406,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -10733,7 +12415,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -10742,7 +12424,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -10751,7 +12433,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -10760,7 +12442,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -10770,45 +12452,42 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -10820,7 +12499,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -10830,27 +12509,24 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -10859,7 +12535,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -10867,7 +12543,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -12151,17 +13827,231 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE + CardPayment.Element.CardFinancial.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -12170,7 +14060,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -12179,7 +14069,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -12188,7 +14078,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -12197,7 +14087,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -12206,7 +14096,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -12215,7 +14105,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -12224,7 +14114,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -12233,7 +14123,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -12242,7 +14132,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -12252,48 +14142,47 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardFinancial.Currency.USD ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -12305,7 +14194,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -12315,28 +14204,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -12345,7 +14235,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -12353,7 +14244,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -13656,17 +15547,231 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE + CardPayment.Element.CardFinancial.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -13675,7 +15780,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -13684,7 +15789,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -13693,7 +15798,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -13702,7 +15807,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -13711,7 +15816,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -13720,7 +15825,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -13729,7 +15834,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -13738,7 +15843,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -13747,7 +15852,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -13757,48 +15862,47 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardFinancial.Currency.USD ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -13810,7 +15914,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -13820,28 +15924,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -13850,7 +15955,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -13858,7 +15964,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -15161,17 +17267,231 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE + CardPayment.Element.CardFinancial.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -15180,7 +17500,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Dental .builder() @@ -15189,7 +17509,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Original .builder() @@ -15198,7 +17518,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Prescription .builder() @@ -15207,7 +17527,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Surcharge .builder() @@ -15216,7 +17536,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalCumulative .builder() @@ -15225,7 +17545,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .TotalHealthcare .builder() @@ -15234,7 +17554,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Transit .builder() @@ -15243,7 +17563,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Unknown .builder() @@ -15252,7 +17572,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .AdditionalAmounts .Vision .builder() @@ -15262,48 +17582,47 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardFinancial.Currency.USD ) .digitalWalletTokenId(null) .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -15315,7 +17634,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -15325,28 +17644,29 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory + CardPayment.Element.CardFinancial.ProcessingCategory .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardVerificationCode .Result @@ -15355,7 +17675,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -15363,7 +17684,7 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .Verification .CardholderAddress .Result @@ -16880,6 +19201,221 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardFinancial.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction + .SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails + .builder() + .category( + CardPayment.Element.CardFinancial + .NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type( + CardPayment.Element.CardFinancial.Type + .CARD_FINANCIAL + ) + .verification( + CardPayment.Element.CardFinancial.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index 4fa207fe4..279ce852c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -497,6 +497,197 @@ internal class CardPaymentTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -1830,40 +2021,15 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -1871,7 +2037,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) @@ -1879,7 +2045,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Original .builder() .amount(0L) @@ -1887,7 +2053,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -1895,15 +2061,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() - .amount(0L) - .currency("currency") + .amount(10L) + .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -1911,7 +2077,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -1919,7 +2085,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -1927,7 +2093,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -1935,7 +2101,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -1944,12 +2110,53 @@ internal class CardPaymentTest { ) .build() ) - .amount(20L) - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardIncrement.Currency.USD) - .network(CardPayment.Element.CardIncrement.Network.VISA) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) .networkIdentifiers( - CardPayment.Element.CardIncrement.NetworkIdentifiers + CardPayment.Element.CardFinancial.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -1958,13 +2165,188 @@ internal class CardPaymentTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .presentmentAmount(20L) + .physicalCardId(null) + .presentmentAmount(100L) .presentmentCurrency("USD") - .realTimeDecisionId(null) - .type(CardPayment.Element.CardIncrement.Type.CARD_INCREMENT) + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(20L) + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardIncrement.Currency.USD) + .network(CardPayment.Element.CardIncrement.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardIncrement.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .presentmentAmount(20L) + .presentmentCurrency("USD") + .realTimeDecisionId(null) + .type(CardPayment.Element.CardIncrement.Type.CARD_INCREMENT) .updatedAuthorizationAmount(120L) .build() ) @@ -3163,40 +3545,15 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( - CardPayment.Element.CardFuelConfirmation.Type - .CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -3204,7 +3561,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) @@ -3212,7 +3569,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Original .builder() .amount(0L) @@ -3220,7 +3577,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -3228,15 +3585,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() - .amount(0L) - .currency("currency") + .amount(10L) + .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -3244,7 +3601,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -3252,7 +3609,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -3260,7 +3617,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -3268,7 +3625,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -3277,47 +3634,263 @@ internal class CardPaymentTest { ) .build() ) - .amount(20L) - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardIncrement.Currency.USD) - .network(CardPayment.Element.CardIncrement.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardIncrement.NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .networkRiskScore(10L) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .presentmentAmount(20L) - .presentmentCurrency("USD") - .realTimeDecisionId(null) - .type(CardPayment.Element.CardIncrement.Type.CARD_INCREMENT) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardRefund( - CardPayment.Element.CardRefund.builder() - .id("card_refund_imgc2xwplh6t4r3gn16e") .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .cashback( - CardPayment.Element.CardRefund.Cashback.builder() - .amount("0.137465") - .currency( - CardPayment.Element.CardRefund.Cashback.Currency.USD - ) - .build() + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT ) - .currency(CardPayment.Element.CardRefund.Currency.USD) - .interchange( - CardPayment.Element.CardRefund.Interchange.builder() - .amount("0.137465") + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( + CardPayment.Element.CardFuelConfirmation.Type + .CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(20L) + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardIncrement.Currency.USD) + .network(CardPayment.Element.CardIncrement.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardIncrement.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .presentmentAmount(20L) + .presentmentCurrency("USD") + .realTimeDecisionId(null) + .type(CardPayment.Element.CardIncrement.Type.CARD_INCREMENT) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardRefund( + CardPayment.Element.CardRefund.builder() + .id("card_refund_imgc2xwplh6t4r3gn16e") + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .cashback( + CardPayment.Element.CardRefund.Cashback.builder() + .amount("0.137465") + .currency( + CardPayment.Element.CardRefund.Cashback.Currency.USD + ) + .build() + ) + .currency(CardPayment.Element.CardRefund.Currency.USD) + .interchange( + CardPayment.Element.CardRefund.Interchange.builder() + .amount("0.137465") .code("271") .currency( CardPayment.Element.CardRefund.Interchange.Currency @@ -4496,25 +5069,216 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId( - "pending_transaction_k1sfetcau2qbvjbzgju4" - ) - .type( + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId( + "pending_transaction_k1sfetcau2qbvjbzgju4" + ) + .type( CardPayment.Element.CardFuelConfirmation.Type .CARD_FUEL_CONFIRMATION ) @@ -5798,57 +6562,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFuelConfirmation( - CardPayment.Element.CardFuelConfirmation.builder() - .id("card_fuel_confirmation_wuy91qate4judq2la80a") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) - .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) - .networkIdentifiers( - CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers - .builder() - .authorizationIdentificationResponse(null) - .retrievalReferenceNumber("785867080153") - .traceNumber("487941") - .transactionId("627199945183184") - .build() - ) - .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") - .type( - CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION - ) - .updatedAuthorizationAmount(120L) - .build() - ) - .cardIncrement( - CardPayment.Element.CardIncrement.builder() - .id("card_increment_6ztayc58j1od0rpebp3e") - .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardIncrement.AdditionalAmounts.Original + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -5856,15 +6598,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() - .amount(0L) - .currency("currency") + .amount(10L) + .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -5872,7 +6614,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardIncrement.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -5880,21 +6622,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardIncrement.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardIncrement.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardIncrement.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -5902,12 +6644,208 @@ internal class CardPaymentTest { ) .build() ) - .amount(20L) - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardIncrement.Currency.USD) - .network(CardPayment.Element.CardIncrement.Network.VISA) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) .networkIdentifiers( - CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFuelConfirmation( + CardPayment.Element.CardFuelConfirmation.builder() + .id("card_fuel_confirmation_wuy91qate4judq2la80a") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardFuelConfirmation.Currency.USD) + .network(CardPayment.Element.CardFuelConfirmation.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardFuelConfirmation.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .pendingTransactionId("pending_transaction_k1sfetcau2qbvjbzgju4") + .type( + CardPayment.Element.CardFuelConfirmation.Type.CARD_FUEL_CONFIRMATION + ) + .updatedAuthorizationAmount(120L) + .build() + ) + .cardIncrement( + CardPayment.Element.CardIncrement.builder() + .id("card_increment_6ztayc58j1od0rpebp3e") + .actioner(CardPayment.Element.CardIncrement.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardIncrement.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardIncrement.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardIncrement.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardIncrement.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardIncrement.AdditionalAmounts + .Surcharge + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalCumulative( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardIncrement.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardIncrement.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardIncrement.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardIncrement.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(20L) + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardIncrement.Currency.USD) + .network(CardPayment.Element.CardIncrement.Network.VISA) + .networkIdentifiers( + CardPayment.Element.CardIncrement.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -6994,6 +7932,180 @@ internal class CardPaymentTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") @@ -7925,25 +9037,210 @@ internal class CardPaymentTest { .merchantPostalCode("10045") .merchantState("NY") .networkDetails( - CardPayment.Element.CardAuthorization.NetworkDetails.builder() + CardPayment.Element.CardAuthorization.NetworkDetails.builder() + .category( + CardPayment.Element.CardAuthorization.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardAuthorization.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardAuthorization.NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardAuthorization.NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId(null) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardAuthorization.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type(CardPayment.Element.CardAuthorization.Type.CARD_AUTHORIZATION) + .verification( + CardPayment.Element.CardAuthorization.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency(CardPayment.Element.CardAuthorizationExpiration.Currency.USD) + .expiredAmount(20L) + .network(CardPayment.Element.CardAuthorizationExpiration.Network.VISA) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() .category( - CardPayment.Element.CardAuthorization.NetworkDetails - .Category - .VISA + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) .pulse(null) .visa( - CardPayment.Element.CardAuthorization.NetworkDetails.Visa + CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardAuthorization.NetworkDetails - .Visa + CardPayment.Element.CardDecline.NetworkDetails.Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardAuthorization.NetworkDetails - .Visa + CardPayment.Element.CardDecline.NetworkDetails.Visa .PointOfServiceEntryMode .MANUAL ) @@ -7953,7 +9250,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardAuthorization.NetworkIdentifiers.builder() + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -7961,24 +9258,24 @@ internal class CardPaymentTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId(null) .physicalCardId(null) - .presentmentAmount(100L) + .presentmentAmount(-1000L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardAuthorization.ProcessingCategory.PURCHASE + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") - .type(CardPayment.Element.CardAuthorization.Type.CARD_AUTHORIZATION) .verification( - CardPayment.Element.CardAuthorization.Verification.builder() + CardPayment.Element.CardDecline.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardVerificationCode .Result .MATCH @@ -7986,7 +9283,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -7994,7 +9291,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -8005,48 +9302,35 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency(CardPayment.Element.CardAuthorizationExpiration.Currency.USD) - .expiredAmount(20L) - .network(CardPayment.Element.CardAuthorizationExpiration.Network.VISA) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -8054,14 +9338,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -8069,7 +9354,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -8077,21 +9362,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -8099,36 +9384,37 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -8138,7 +9424,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -8147,23 +9433,23 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .Result .MATCH @@ -8171,7 +9457,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -8179,7 +9465,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -9214,35 +10500,207 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardFinancial.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -9250,14 +10708,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -9265,7 +10724,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -9273,21 +10732,21 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardFinancial.AdditionalAmounts.Vision .builder() .amount(0L) .currency("currency") @@ -9295,36 +10754,37 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction(CardPayment.Element.CardFinancial.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardFinancial.NetworkDetails.Category + .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -9334,7 +10794,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -9343,23 +10803,23 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .Result .MATCH @@ -9367,7 +10827,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -9375,7 +10835,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -10460,31 +11920,221 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency( - CardPayment.Element.CardAuthorizationExpiration.Currency.USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration.Network.VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency( + CardPayment.Element.CardAuthorizationExpiration.Currency.USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration.Network.VISA + ) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -10492,7 +12142,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) @@ -10500,7 +12150,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Original .builder() .amount(0L) @@ -10508,7 +12158,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -10516,7 +12166,7 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -10524,7 +12174,7 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -10532,7 +12182,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -10540,7 +12190,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -10548,7 +12198,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -10556,7 +12206,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -10565,42 +12215,41 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -10612,7 +12261,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -10621,25 +12271,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -10647,7 +12297,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -10655,7 +12305,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -11817,7 +13468,197 @@ internal class CardPaymentTest { .additionalAmounts( CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -11825,7 +13666,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) @@ -11833,7 +13674,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Original .builder() .amount(0L) @@ -11841,7 +13682,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -11849,7 +13690,7 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -11857,7 +13698,7 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -11865,7 +13706,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -11873,7 +13714,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -11881,7 +13722,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -11889,7 +13730,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -11898,42 +13739,41 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -11945,7 +13785,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -11954,25 +13795,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -11980,7 +13821,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -11988,7 +13829,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -13076,29 +14918,236 @@ internal class CardPaymentTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId(null) + .pendingTransactionId(null) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardAuthorization.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardAuthorization.Type + .CARD_AUTHORIZATION + ) + .verification( + CardPayment.Element.CardAuthorization.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency( + CardPayment.Element.CardAuthorizationExpiration.Currency.USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration.Network.VISA + ) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(100L) + .presentmentAmount(-1000L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardAuthorization.ProcessingCategory - .PURCHASE + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE ) .realTimeDecisionId(null) - .terminalId("RCN5VNXS") - .type( - CardPayment.Element.CardAuthorization.Type - .CARD_AUTHORIZATION + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS ) + .terminalId("RCN5VNXS") .verification( - CardPayment.Element.CardAuthorization.Verification.builder() + CardPayment.Element.CardDecline.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardAuthorization - .Verification + CardPayment.Element.CardDecline.Verification .CardVerificationCode .Result .MATCH @@ -13106,7 +15155,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardDecline.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -13114,8 +15163,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization - .Verification + CardPayment.Element.CardDecline.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -13126,31 +15174,15 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency( - CardPayment.Element.CardAuthorizationExpiration.Currency.USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration.Network.VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -13158,7 +15190,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Dental .builder() .amount(0L) @@ -13166,7 +15198,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Original .builder() .amount(0L) @@ -13174,7 +15206,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -13182,7 +15214,7 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -13190,7 +15222,7 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -13198,7 +15230,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -13206,7 +15238,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Transit .builder() .amount(0L) @@ -13214,7 +15246,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Unknown .builder() .amount(0L) @@ -13222,7 +15254,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardFinancial.AdditionalAmounts .Vision .builder() .amount(0L) @@ -13231,42 +15263,41 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .amount(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardFinancial.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardFinancial.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardFinancial.NetworkDetails .Category .VISA ) .pulse(null) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardFinancial.NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardFinancial .NetworkDetails .Visa .PointOfServiceEntryMode @@ -13278,7 +15309,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -13287,25 +15319,25 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) + .presentmentAmount(100L) .presentmentCurrency("USD") .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardFinancial.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardVerificationCode .Result .MATCH @@ -13313,7 +15345,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -13321,7 +15353,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardFinancial + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -14665,6 +16698,197 @@ internal class CardPaymentTest { ) .build() ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardFinancial.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardFinancial.Direction.SETTLEMENT + ) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardFinancial.NetworkDetails.builder() + .category( + CardPayment.Element.CardFinancial.NetworkDetails + .Category + .VISA + ) + .pulse(null) + .visa( + CardPayment.Element.CardFinancial.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardFinancial + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardFinancial.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardFinancial.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .type(CardPayment.Element.CardFinancial.Type.CARD_FINANCIAL) + .verification( + CardPayment.Element.CardFinancial.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardFinancial.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardFinancial + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardFinancial.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardFinancial + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardFuelConfirmation( CardPayment.Element.CardFuelConfirmation.builder() .id("card_fuel_confirmation_wuy91qate4judq2la80a") From e135f5f9de55f04bffdd9bf8cdf432cc185ff7dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Oct 2025 23:31:15 +0000 Subject: [PATCH 22/33] feat(api): api update --- .stats.yml | 4 +- .../com/increase/api/models/events/Event.kt | 38 ------------------ .../api/models/events/EventListParams.kt | 40 ------------------- .../eventsubscriptions/EventSubscription.kt | 38 ------------------ .../EventSubscriptionCreateParams.kt | 38 ------------------ 5 files changed, 2 insertions(+), 156 deletions(-) diff --git a/.stats.yml b/.stats.yml index b52e298fa..cdd898dd6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-4aa2f4a453e4fc5f0876f09919d76289bc530dcdd693e6d69db07980803aab6d.yml -openapi_spec_hash: 32bfd518611484cb0777810dd934f1fa +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b91d72f65357f42c5529b6b86bf04409c243e4bf98dd441a64792b86698da51e.yml +openapi_spec_hash: 7b35443ba7263403ac7b0c67bc8826b4 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt index 139b94f88..5096a94c5 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt @@ -617,20 +617,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -903,14 +889,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1139,14 +1117,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1304,10 +1274,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1433,10 +1399,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt index 08edc95ef..4d602f1f4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt @@ -629,22 +629,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField - val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField - val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -919,14 +903,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1157,14 +1133,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1325,10 +1293,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1455,10 +1419,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt index 515b11409..9edcb1147 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt @@ -728,20 +728,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -1014,14 +1000,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1251,14 +1229,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1419,10 +1389,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1548,10 +1514,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt index a7be6d41a..90274b1c6 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt @@ -978,20 +978,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ @JvmField val OAUTH_CONNECTION_DEACTIVATED = of("oauth_connection.deactivated") - /** Occurs whenever a Card Push Transfer is created. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_CREATED = of("outbound_card_push_transfer.created") - - /** Occurs whenever a Card Push Transfer is updated. */ - @JvmField - val OUTBOUND_CARD_PUSH_TRANSFER_UPDATED = of("outbound_card_push_transfer.updated") - - /** Occurs whenever a Card Validation is created. */ - @JvmField val OUTBOUND_CARD_VALIDATION_CREATED = of("outbound_card_validation.created") - - /** Occurs whenever a Card Validation is updated. */ - @JvmField val OUTBOUND_CARD_VALIDATION_UPDATED = of("outbound_card_validation.updated") - /** Occurs whenever a Card Push Transfer is created. */ @JvmField val CARD_PUSH_TRANSFER_CREATED = of("card_push_transfer.created") @@ -1264,14 +1250,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1501,14 +1479,6 @@ private constructor( /** Occurs whenever an OAuth Connection is deactivated. */ OAUTH_CONNECTION_DEACTIVATED, /** Occurs whenever a Card Push Transfer is created. */ - OUTBOUND_CARD_PUSH_TRANSFER_CREATED, - /** Occurs whenever a Card Push Transfer is updated. */ - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED, - /** Occurs whenever a Card Validation is created. */ - OUTBOUND_CARD_VALIDATION_CREATED, - /** Occurs whenever a Card Validation is updated. */ - OUTBOUND_CARD_VALIDATION_UPDATED, - /** Occurs whenever a Card Push Transfer is created. */ CARD_PUSH_TRANSFER_CREATED, /** Occurs whenever a Card Push Transfer is updated. */ CARD_PUSH_TRANSFER_UPDATED, @@ -1669,10 +1639,6 @@ private constructor( LOCKBOX_UPDATED -> Value.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Value.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Value.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Value.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Value.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Value.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Value.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Value.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Value.CARD_VALIDATION_CREATED @@ -1798,10 +1764,6 @@ private constructor( LOCKBOX_UPDATED -> Known.LOCKBOX_UPDATED OAUTH_CONNECTION_CREATED -> Known.OAUTH_CONNECTION_CREATED OAUTH_CONNECTION_DEACTIVATED -> Known.OAUTH_CONNECTION_DEACTIVATED - OUTBOUND_CARD_PUSH_TRANSFER_CREATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_CREATED - OUTBOUND_CARD_PUSH_TRANSFER_UPDATED -> Known.OUTBOUND_CARD_PUSH_TRANSFER_UPDATED - OUTBOUND_CARD_VALIDATION_CREATED -> Known.OUTBOUND_CARD_VALIDATION_CREATED - OUTBOUND_CARD_VALIDATION_UPDATED -> Known.OUTBOUND_CARD_VALIDATION_UPDATED CARD_PUSH_TRANSFER_CREATED -> Known.CARD_PUSH_TRANSFER_CREATED CARD_PUSH_TRANSFER_UPDATED -> Known.CARD_PUSH_TRANSFER_UPDATED CARD_VALIDATION_CREATED -> Known.CARD_VALIDATION_CREATED From 94389080530654e684f60a910d4581f6edc19841 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 01:08:37 +0000 Subject: [PATCH 23/33] feat(api): api update --- .stats.yml | 4 ++-- .../increase/api/models/accounts/AccountCreateParams.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index cdd898dd6..174c00620 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b91d72f65357f42c5529b6b86bf04409c243e4bf98dd441a64792b86698da51e.yml -openapi_spec_hash: 7b35443ba7263403ac7b0c67bc8826b4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5e23344ee5f70c17195f26e0af9e85bed0a92f4e8597db349d0038c316be4ff2.yml +openapi_spec_hash: 02057c342dd5b1c72f2006dd28234429 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt index 15743c3ee..34891d29d 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/accounts/AccountCreateParams.kt @@ -45,7 +45,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -163,7 +163,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. */ fun informationalEntityId(informationalEntityId: String) = apply { body.informationalEntityId(informationalEntityId) @@ -380,7 +380,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with its - * activity. Its relationship to your group must be `informational`. + * activity. This is generally the beneficiary of the funds. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -497,7 +497,7 @@ private constructor( /** * The identifier of an Entity that, while not owning the Account, is associated with - * its activity. Its relationship to your group must be `informational`. + * its activity. This is generally the beneficiary of the funds. */ fun informationalEntityId(informationalEntityId: String) = informationalEntityId(JsonField.of(informationalEntityId)) From 408277389cbc77d1a840a57a6ad0694bdef6a5e9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 21:15:15 +0000 Subject: [PATCH 24/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/carddisputes/CardDispute.kt | 373 +++++++++++++++++- .../CardDisputeListPageResponseTest.kt | 42 +- .../models/carddisputes/CardDisputeTest.kt | 42 +- 4 files changed, 430 insertions(+), 31 deletions(-) diff --git a/.stats.yml b/.stats.yml index 174c00620..4cb0dd946 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5e23344ee5f70c17195f26e0af9e85bed0a92f4e8597db349d0038c316be4ff2.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1c544c0cd5413b2f03b701aba1a0868838270dbe44ebf79d4b4820704e90594b.yml openapi_spec_hash: 02057c342dd5b1c72f2006dd28234429 -config_hash: eb2035151c7b49c2f12caf55469b8f9a +config_hash: fc8a0ae068f2feeac76f728ac6838543 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index 82eaf4cfd..c35dc472b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -6461,7 +6461,8 @@ private constructor( private val cardholderNoLongerDisputes: JsonField, private val creditOrReversalProcessed: JsonField, private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue, + private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField, private val nonFiatCurrencyOrNonFungibleTokenReceived: JsonField, private val proofOfCashDisbursement: JsonField, @@ -6485,7 +6486,9 @@ private constructor( invalidDispute: JsonField = JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue = JsonMissing.of(), + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField = + JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_received") @ExcludeMissing nonFiatCurrencyOrNonFungibleTokenReceived: @@ -6544,11 +6547,15 @@ private constructor( /** * Non-fiat currency or non-fungible token as described details. Present if and only * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): JsonValue = - nonFiatCurrencyOrNonFungibleTokenAsDescribed + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed(): + Optional = + nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOptional( + "non_fiat_currency_or_non_fungible_token_as_described" + ) /** * Non-fiat currency or non-fungible token received details. Present if and only if @@ -6624,6 +6631,18 @@ private constructor( @ExcludeMissing fun _invalidDispute(): JsonField = invalidDispute + /** + * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenAsDescribed]. + * + * Unlike [nonFiatCurrencyOrNonFungibleTokenAsDescribed], this method doesn't throw + * if the JSON field has an unexpected type. + */ + @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): + JsonField = + nonFiatCurrencyOrNonFungibleTokenAsDescribed + /** * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. * @@ -6705,7 +6724,9 @@ private constructor( private var creditOrReversalProcessed: JsonField? = null private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue? = null + private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField? = + null private var nonFiatCurrencyOrNonFungibleTokenReceived: JsonField? = null @@ -6814,7 +6835,38 @@ private constructor( * only if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. */ fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + NonFiatCurrencyOrNonFungibleTokenAsDescribed? + ) = + nonFiatCurrencyOrNonFungibleTokenAsDescribed( + JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenAsDescribed) + ) + + /** + * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with + * `nonFiatCurrencyOrNonFungibleTokenAsDescribed.orElse(null)`. + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + Optional + ) = + nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOrNull() + ) + + /** + * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] to an arbitrary + * JSON value. + * + * You should usually call + * [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with a well-typed + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField ) = apply { this.nonFiatCurrencyOrNonFungibleTokenAsDescribed = nonFiatCurrencyOrNonFungibleTokenAsDescribed @@ -6995,6 +7047,7 @@ private constructor( cardholderNoLongerDisputes().ifPresent { it.validate() } creditOrReversalProcessed().ifPresent { it.validate() } invalidDispute().ifPresent { it.validate() } + nonFiatCurrencyOrNonFungibleTokenAsDescribed().ifPresent { it.validate() } nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } proofOfCashDisbursement().ifPresent { it.validate() } reason().validate() @@ -7021,6 +7074,10 @@ private constructor( (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + + (nonFiatCurrencyOrNonFungibleTokenAsDescribed + .asKnown() + .getOrNull() + ?.validity() ?: 0) + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() ?: 0) + (proofOfCashDisbursement.asKnown().getOrNull()?.validity() ?: 0) + @@ -8362,6 +8419,132 @@ private constructor( "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" } + /** + * Non-fiat currency or non-fungible token as described details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + */ + class NonFiatCurrencyOrNonFungibleTokenAsDescribed + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + NonFiatCurrencyOrNonFungibleTokenAsDescribed + ) = apply { + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenAsDescribed.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 + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = + NonFiatCurrencyOrNonFungibleTokenAsDescribed( + additionalProperties.toMutableMap() + ) + } + + private var validated: Boolean = false + + fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NonFiatCurrencyOrNonFungibleTokenAsDescribed && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" + } + /** * Non-fiat currency or non-fungible token received details. Present if and only if * `reason` is `non_fiat_currency_or_non_fungible_token_received`. @@ -10667,7 +10850,7 @@ private constructor( JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -10732,7 +10915,8 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = + JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -10911,10 +11095,12 @@ private constructor( /** * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` @@ -11121,6 +11307,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -11280,7 +11477,8 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField? = null - private var consumerNonReceiptOfCash: JsonValue? = null + private var consumerNonReceiptOfCash: JsonField? = + null private var consumerOriginalCreditTransactionNotAccepted: JsonField? = null @@ -11679,9 +11877,28 @@ private constructor( * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: ConsumerNonReceiptOfCash? + ) = consumerNonReceiptOfCash(JsonField.ofNullable(consumerNonReceiptOfCash)) + + /** + * Alias for calling [Builder.consumerNonReceiptOfCash] with + * `consumerNonReceiptOfCash.orElse(null)`. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: Optional + ) = consumerNonReceiptOfCash(consumerNonReceiptOfCash.getOrNull()) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Present if and only if @@ -12050,6 +12267,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -12091,6 +12309,7 @@ private constructor( ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted .asKnown() .getOrNull() @@ -26926,6 +27145,126 @@ private constructor( "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantCancellation=$merchantCancellation, merchantResolutionAttempted=$merchantResolutionAttempted, noCancellation=$noCancellation, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, additionalProperties=$additionalProperties}" } + /** + * Non-receipt of cash. Present if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + apply { + additionalProperties = + consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" + } + /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` * is `consumer_original_credit_transaction_not_accepted`. diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index a83b17476..72ac6295e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -206,7 +206,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -880,7 +885,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1497,7 +1507,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2117,7 +2132,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2712,7 +2732,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -3386,7 +3411,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index 9c1e82b54..560738723 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -198,7 +198,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -756,7 +761,12 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1290,7 +1300,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -1826,7 +1841,12 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2364,7 +2384,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2922,7 +2947,12 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted From 05fd77ecbab2646bc41fcbde45b746f6c74d4674 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 22:15:32 +0000 Subject: [PATCH 25/33] feat(api): api update --- .stats.yml | 4 ++-- .../api/models/entities/EntityCreateParams.kt | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4cb0dd946..6a120e927 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1c544c0cd5413b2f03b701aba1a0868838270dbe44ebf79d4b4820704e90594b.yml -openapi_spec_hash: 02057c342dd5b1c72f2006dd28234429 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2453598e129a8305006487bc7616f3ee69eb4355a6d3f185dd51404fa8142246.yml +openapi_spec_hash: e0b54d0015d39f9434659d8899bb2706 config_hash: fc8a0ae068f2feeac76f728ac6838543 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt index c0a89973d..737d95231 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityCreateParams.kt @@ -4854,6 +4854,13 @@ private constructor( /** A public entity acting on behalf of the federal or a state government. */ @JvmField val PUBLIC_ENTITY = of("public_entity") + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + @JvmField val OTHER = of("other") + @JvmStatic fun of(value: String) = BeneficialOwnershipExemptionReason(JsonField.of(value)) } @@ -4866,6 +4873,12 @@ private constructor( PUBLICLY_TRADED_COMPANY, /** A public entity acting on behalf of the federal or a state government. */ PUBLIC_ENTITY, + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + OTHER, } /** @@ -4886,6 +4899,12 @@ private constructor( PUBLICLY_TRADED_COMPANY, /** A public entity acting on behalf of the federal or a state government. */ PUBLIC_ENTITY, + /** + * Any other reason why this entity is exempt from the requirement to submit + * beneficial owners. You can only use this exemption after approval from your bank + * partner. + */ + OTHER, /** * An enum member indicating that [BeneficialOwnershipExemptionReason] was * instantiated with an unknown value. @@ -4905,6 +4924,7 @@ private constructor( REGULATED_FINANCIAL_INSTITUTION -> Value.REGULATED_FINANCIAL_INSTITUTION PUBLICLY_TRADED_COMPANY -> Value.PUBLICLY_TRADED_COMPANY PUBLIC_ENTITY -> Value.PUBLIC_ENTITY + OTHER -> Value.OTHER else -> Value._UNKNOWN } @@ -4922,6 +4942,7 @@ private constructor( REGULATED_FINANCIAL_INSTITUTION -> Known.REGULATED_FINANCIAL_INSTITUTION PUBLICLY_TRADED_COMPANY -> Known.PUBLICLY_TRADED_COMPANY PUBLIC_ENTITY -> Known.PUBLIC_ENTITY + OTHER -> Known.OTHER else -> throw IncreaseInvalidDataException( "Unknown BeneficialOwnershipExemptionReason: $value" From 5803cdab7196ff122cf8f9aedfaf89e3d33d231e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 14:06:57 +0000 Subject: [PATCH 26/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/wiretransfers/WireTransfer.kt | 2084 ++++++++---- .../wiretransfers/WireTransferCreateParams.kt | 2923 ++++++++++------- .../WireTransferCreateParamsTest.kt | 158 +- .../WireTransferListPageResponseTest.kt | 129 +- .../models/wiretransfers/WireTransferTest.kt | 131 +- .../async/WireTransferServiceAsyncTest.kt | 48 +- .../blocking/WireTransferServiceTest.kt | 48 +- 8 files changed, 3706 insertions(+), 1819 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6a120e927..9256ec13b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-2453598e129a8305006487bc7616f3ee69eb4355a6d3f185dd51404fa8142246.yml -openapi_spec_hash: e0b54d0015d39f9434659d8899bb2706 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7689739a12916f3e4cc15be2e057e78b4ede38202bf4cf5f9358ef10374db9b3.yml +openapi_spec_hash: 39b4a0d5d1441d03ed9de368335d78ec config_hash: fc8a0ae068f2feeac76f728ac6838543 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt index 3a79799bd..350d15532 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransfer.kt @@ -32,23 +32,16 @@ private constructor( private val accountNumber: JsonField, private val amount: JsonField, private val approval: JsonField, - private val beneficiaryAddressLine1: JsonField, - private val beneficiaryAddressLine2: JsonField, - private val beneficiaryAddressLine3: JsonField, - private val beneficiaryName: JsonField, private val cancellation: JsonField, private val createdAt: JsonField, private val createdBy: JsonField, + private val creditor: JsonField, private val currency: JsonField, + private val debtor: JsonField, private val externalAccountId: JsonField, private val idempotencyKey: JsonField, private val inboundWireDrawdownRequestId: JsonField, - private val messageToRecipient: JsonField, private val network: JsonField, - private val originatorAddressLine1: JsonField, - private val originatorAddressLine2: JsonField, - private val originatorAddressLine3: JsonField, - private val originatorName: JsonField, private val pendingTransactionId: JsonField, private val remittance: JsonField, private val reversal: JsonField, @@ -70,18 +63,6 @@ private constructor( accountNumber: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), @JsonProperty("approval") @ExcludeMissing approval: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - beneficiaryAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - beneficiaryAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - beneficiaryAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_name") - @ExcludeMissing - beneficiaryName: JsonField = JsonMissing.of(), @JsonProperty("cancellation") @ExcludeMissing cancellation: JsonField = JsonMissing.of(), @@ -91,7 +72,9 @@ private constructor( @JsonProperty("created_by") @ExcludeMissing createdBy: JsonField = JsonMissing.of(), + @JsonProperty("creditor") @ExcludeMissing creditor: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing debtor: JsonField = JsonMissing.of(), @JsonProperty("external_account_id") @ExcludeMissing externalAccountId: JsonField = JsonMissing.of(), @@ -101,22 +84,7 @@ private constructor( @JsonProperty("inbound_wire_drawdown_request_id") @ExcludeMissing inboundWireDrawdownRequestId: JsonField = JsonMissing.of(), - @JsonProperty("message_to_recipient") - @ExcludeMissing - messageToRecipient: JsonField = JsonMissing.of(), @JsonProperty("network") @ExcludeMissing network: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line1") - @ExcludeMissing - originatorAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line2") - @ExcludeMissing - originatorAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line3") - @ExcludeMissing - originatorAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("originator_name") - @ExcludeMissing - originatorName: JsonField = JsonMissing.of(), @JsonProperty("pending_transaction_id") @ExcludeMissing pendingTransactionId: JsonField = JsonMissing.of(), @@ -144,23 +112,16 @@ private constructor( accountNumber, amount, approval, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, - beneficiaryName, cancellation, createdAt, createdBy, + creditor, currency, + debtor, externalAccountId, idempotencyKey, inboundWireDrawdownRequestId, - messageToRecipient, network, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, pendingTransactionId, remittance, reversal, @@ -214,41 +175,6 @@ private constructor( */ fun approval(): Optional = approval.getOptional("approval") - /** - * The beneficiary's address line 1. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine1(): Optional = - beneficiaryAddressLine1.getOptional("beneficiary_address_line1") - - /** - * The beneficiary's address line 2. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine2(): Optional = - beneficiaryAddressLine2.getOptional("beneficiary_address_line2") - - /** - * The beneficiary's address line 3. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryAddressLine3(): Optional = - beneficiaryAddressLine3.getOptional("beneficiary_address_line3") - - /** - * The beneficiary's name. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun beneficiaryName(): Optional = beneficiaryName.getOptional("beneficiary_name") - /** * If your account requires approvals for transfers and the transfer was not approved, this will * contain details of the cancellation. @@ -275,6 +201,14 @@ private constructor( */ fun createdBy(): Optional = createdBy.getOptional("created_by") + /** + * The person or business that is receiving the funds from the transfer. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun creditor(): Optional = creditor.getOptional("creditor") + /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For * wire transfers this is always equal to `usd`. @@ -284,6 +218,14 @@ private constructor( */ fun currency(): Currency = currency.getRequired("currency") + /** + * The person or business whose funds are being transferred. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun debtor(): Optional = debtor.getOptional("debtor") + /** * The identifier of the External Account the transfer was made to, if any. * @@ -311,14 +253,6 @@ private constructor( fun inboundWireDrawdownRequestId(): Optional = inboundWireDrawdownRequestId.getOptional("inbound_wire_drawdown_request_id") - /** - * The message that will show on the recipient's bank statement. - * - * @throws IncreaseInvalidDataException 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 messageToRecipient(): String = messageToRecipient.getRequired("message_to_recipient") - /** * The transfer's network. * @@ -327,41 +261,6 @@ private constructor( */ fun network(): Network = network.getRequired("network") - /** - * The originator's address line 1. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = - originatorAddressLine1.getOptional("originator_address_line1") - - /** - * The originator's address line 2. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = - originatorAddressLine2.getOptional("originator_address_line2") - - /** - * The originator's address line 3. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = - originatorAddressLine3.getOptional("originator_address_line3") - - /** - * The originator's name. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorName(): Optional = originatorName.getOptional("originator_name") - /** * The ID for the pending transaction representing the transfer. A pending transaction is * created when the transfer @@ -477,45 +376,6 @@ private constructor( */ @JsonProperty("approval") @ExcludeMissing fun _approval(): JsonField = approval - /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. - * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - fun _beneficiaryAddressLine1(): JsonField = beneficiaryAddressLine1 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. - * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - fun _beneficiaryAddressLine2(): JsonField = beneficiaryAddressLine2 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. - * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - fun _beneficiaryAddressLine3(): JsonField = beneficiaryAddressLine3 - - /** - * Returns the raw JSON value of [beneficiaryName]. - * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("beneficiary_name") - @ExcludeMissing - fun _beneficiaryName(): JsonField = beneficiaryName - /** * Returns the raw JSON value of [cancellation]. * @@ -541,6 +401,13 @@ private constructor( */ @JsonProperty("created_by") @ExcludeMissing fun _createdBy(): JsonField = createdBy + /** + * Returns the raw JSON value of [creditor]. + * + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor") @ExcludeMissing fun _creditor(): JsonField = creditor + /** * Returns the raw JSON value of [currency]. * @@ -548,6 +415,13 @@ private constructor( */ @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency + /** + * Returns the raw JSON value of [debtor]. + * + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("debtor") @ExcludeMissing fun _debtor(): JsonField = debtor + /** * Returns the raw JSON value of [externalAccountId]. * @@ -577,16 +451,6 @@ private constructor( @ExcludeMissing fun _inboundWireDrawdownRequestId(): JsonField = inboundWireDrawdownRequestId - /** - * Returns the raw JSON value of [messageToRecipient]. - * - * Unlike [messageToRecipient], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("message_to_recipient") - @ExcludeMissing - fun _messageToRecipient(): JsonField = messageToRecipient - /** * Returns the raw JSON value of [network]. * @@ -594,45 +458,6 @@ private constructor( */ @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line1") - @ExcludeMissing - fun _originatorAddressLine1(): JsonField = originatorAddressLine1 - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line2") - @ExcludeMissing - fun _originatorAddressLine2(): JsonField = originatorAddressLine2 - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line3") - @ExcludeMissing - fun _originatorAddressLine3(): JsonField = originatorAddressLine3 - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("originator_name") - @ExcludeMissing - fun _originatorName(): JsonField = originatorName - /** * Returns the raw JSON value of [pendingTransactionId]. * @@ -734,23 +559,16 @@ private constructor( * .accountNumber() * .amount() * .approval() - * .beneficiaryAddressLine1() - * .beneficiaryAddressLine2() - * .beneficiaryAddressLine3() - * .beneficiaryName() * .cancellation() * .createdAt() * .createdBy() + * .creditor() * .currency() + * .debtor() * .externalAccountId() * .idempotencyKey() * .inboundWireDrawdownRequestId() - * .messageToRecipient() * .network() - * .originatorAddressLine1() - * .originatorAddressLine2() - * .originatorAddressLine3() - * .originatorName() * .pendingTransactionId() * .remittance() * .reversal() @@ -773,23 +591,16 @@ private constructor( private var accountNumber: JsonField? = null private var amount: JsonField? = null private var approval: JsonField? = null - private var beneficiaryAddressLine1: JsonField? = null - private var beneficiaryAddressLine2: JsonField? = null - private var beneficiaryAddressLine3: JsonField? = null - private var beneficiaryName: JsonField? = null private var cancellation: JsonField? = null private var createdAt: JsonField? = null private var createdBy: JsonField? = null + private var creditor: JsonField? = null private var currency: JsonField? = null + private var debtor: JsonField? = null private var externalAccountId: JsonField? = null private var idempotencyKey: JsonField? = null private var inboundWireDrawdownRequestId: JsonField? = null - private var messageToRecipient: JsonField? = null private var network: JsonField? = null - private var originatorAddressLine1: JsonField? = null - private var originatorAddressLine2: JsonField? = null - private var originatorAddressLine3: JsonField? = null - private var originatorName: JsonField? = null private var pendingTransactionId: JsonField? = null private var remittance: JsonField? = null private var reversal: JsonField? = null @@ -808,23 +619,16 @@ private constructor( accountNumber = wireTransfer.accountNumber amount = wireTransfer.amount approval = wireTransfer.approval - beneficiaryAddressLine1 = wireTransfer.beneficiaryAddressLine1 - beneficiaryAddressLine2 = wireTransfer.beneficiaryAddressLine2 - beneficiaryAddressLine3 = wireTransfer.beneficiaryAddressLine3 - beneficiaryName = wireTransfer.beneficiaryName cancellation = wireTransfer.cancellation createdAt = wireTransfer.createdAt createdBy = wireTransfer.createdBy + creditor = wireTransfer.creditor currency = wireTransfer.currency + debtor = wireTransfer.debtor externalAccountId = wireTransfer.externalAccountId idempotencyKey = wireTransfer.idempotencyKey inboundWireDrawdownRequestId = wireTransfer.inboundWireDrawdownRequestId - messageToRecipient = wireTransfer.messageToRecipient network = wireTransfer.network - originatorAddressLine1 = wireTransfer.originatorAddressLine1 - originatorAddressLine2 = wireTransfer.originatorAddressLine2 - originatorAddressLine3 = wireTransfer.originatorAddressLine3 - originatorName = wireTransfer.originatorName pendingTransactionId = wireTransfer.pendingTransactionId remittance = wireTransfer.remittance reversal = wireTransfer.reversal @@ -903,91 +707,6 @@ private constructor( */ fun approval(approval: JsonField) = apply { this.approval = approval } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String?) = - beneficiaryAddressLine1(JsonField.ofNullable(beneficiaryAddressLine1)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine1] with - * `beneficiaryAddressLine1.orElse(null)`. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: Optional) = - beneficiaryAddressLine1(beneficiaryAddressLine1.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - this.beneficiaryAddressLine1 = beneficiaryAddressLine1 - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String?) = - beneficiaryAddressLine2(JsonField.ofNullable(beneficiaryAddressLine2)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine2] with - * `beneficiaryAddressLine2.orElse(null)`. - */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: Optional) = - beneficiaryAddressLine2(beneficiaryAddressLine2.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - this.beneficiaryAddressLine2 = beneficiaryAddressLine2 - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String?) = - beneficiaryAddressLine3(JsonField.ofNullable(beneficiaryAddressLine3)) - - /** - * Alias for calling [Builder.beneficiaryAddressLine3] with - * `beneficiaryAddressLine3.orElse(null)`. - */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: Optional) = - beneficiaryAddressLine3(beneficiaryAddressLine3.getOrNull()) - - /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - this.beneficiaryAddressLine3 = beneficiaryAddressLine3 - } - - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String?) = - beneficiaryName(JsonField.ofNullable(beneficiaryName)) - - /** Alias for calling [Builder.beneficiaryName] with `beneficiaryName.orElse(null)`. */ - fun beneficiaryName(beneficiaryName: Optional) = - beneficiaryName(beneficiaryName.getOrNull()) - - /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - this.beneficiaryName = beneficiaryName - } - /** * If your account requires approvals for transfers and the transfer was not approved, this * will contain details of the cancellation. @@ -1040,6 +759,21 @@ private constructor( */ fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy } + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor?) = creditor(JsonField.ofNullable(creditor)) + + /** Alias for calling [Builder.creditor] with `creditor.orElse(null)`. */ + fun creditor(creditor: Optional) = creditor(creditor.getOrNull()) + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditor(creditor: JsonField) = apply { this.creditor = creditor } + /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. * For wire transfers this is always equal to `usd`. @@ -1055,6 +789,20 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } + /** The person or business whose funds are being transferred. */ + fun debtor(debtor: Debtor?) = debtor(JsonField.ofNullable(debtor)) + + /** Alias for calling [Builder.debtor] with `debtor.orElse(null)`. */ + fun debtor(debtor: Optional) = debtor(debtor.getOrNull()) + + /** + * Sets [Builder.debtor] to an arbitrary JSON value. + * + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } + /** The identifier of the External Account the transfer was made to, if any. */ fun externalAccountId(externalAccountId: String?) = externalAccountId(JsonField.ofNullable(externalAccountId)) @@ -1121,21 +869,6 @@ private constructor( this.inboundWireDrawdownRequestId = inboundWireDrawdownRequestId } - /** The message that will show on the recipient's bank statement. */ - fun messageToRecipient(messageToRecipient: String) = - messageToRecipient(JsonField.of(messageToRecipient)) - - /** - * Sets [Builder.messageToRecipient] to an arbitrary JSON value. - * - * You should usually call [Builder.messageToRecipient] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun messageToRecipient(messageToRecipient: JsonField) = apply { - this.messageToRecipient = messageToRecipient - } - /** The transfer's network. */ fun network(network: Network) = network(JsonField.of(network)) @@ -1147,91 +880,6 @@ private constructor( */ fun network(network: JsonField) = apply { this.network = network } - /** The originator's address line 1. */ - fun originatorAddressLine1(originatorAddressLine1: String?) = - originatorAddressLine1(JsonField.ofNullable(originatorAddressLine1)) - - /** - * Alias for calling [Builder.originatorAddressLine1] with - * `originatorAddressLine1.orElse(null)`. - */ - fun originatorAddressLine1(originatorAddressLine1: Optional) = - originatorAddressLine1(originatorAddressLine1.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - this.originatorAddressLine1 = originatorAddressLine1 - } - - /** The originator's address line 2. */ - fun originatorAddressLine2(originatorAddressLine2: String?) = - originatorAddressLine2(JsonField.ofNullable(originatorAddressLine2)) - - /** - * Alias for calling [Builder.originatorAddressLine2] with - * `originatorAddressLine2.orElse(null)`. - */ - fun originatorAddressLine2(originatorAddressLine2: Optional) = - originatorAddressLine2(originatorAddressLine2.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - this.originatorAddressLine2 = originatorAddressLine2 - } - - /** The originator's address line 3. */ - fun originatorAddressLine3(originatorAddressLine3: String?) = - originatorAddressLine3(JsonField.ofNullable(originatorAddressLine3)) - - /** - * Alias for calling [Builder.originatorAddressLine3] with - * `originatorAddressLine3.orElse(null)`. - */ - fun originatorAddressLine3(originatorAddressLine3: Optional) = - originatorAddressLine3(originatorAddressLine3.getOrNull()) - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - this.originatorAddressLine3 = originatorAddressLine3 - } - - /** The originator's name. */ - fun originatorName(originatorName: String?) = - originatorName(JsonField.ofNullable(originatorName)) - - /** Alias for calling [Builder.originatorName] with `originatorName.orElse(null)`. */ - fun originatorName(originatorName: Optional) = - originatorName(originatorName.getOrNull()) - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - this.originatorName = originatorName - } - /** * The ID for the pending transaction representing the transfer. A pending transaction is * created when the transfer @@ -1415,23 +1063,16 @@ private constructor( * .accountNumber() * .amount() * .approval() - * .beneficiaryAddressLine1() - * .beneficiaryAddressLine2() - * .beneficiaryAddressLine3() - * .beneficiaryName() * .cancellation() * .createdAt() * .createdBy() + * .creditor() * .currency() + * .debtor() * .externalAccountId() * .idempotencyKey() * .inboundWireDrawdownRequestId() - * .messageToRecipient() * .network() - * .originatorAddressLine1() - * .originatorAddressLine2() - * .originatorAddressLine3() - * .originatorName() * .pendingTransactionId() * .remittance() * .reversal() @@ -1452,23 +1093,16 @@ private constructor( checkRequired("accountNumber", accountNumber), checkRequired("amount", amount), checkRequired("approval", approval), - checkRequired("beneficiaryAddressLine1", beneficiaryAddressLine1), - checkRequired("beneficiaryAddressLine2", beneficiaryAddressLine2), - checkRequired("beneficiaryAddressLine3", beneficiaryAddressLine3), - checkRequired("beneficiaryName", beneficiaryName), checkRequired("cancellation", cancellation), checkRequired("createdAt", createdAt), checkRequired("createdBy", createdBy), + checkRequired("creditor", creditor), checkRequired("currency", currency), + checkRequired("debtor", debtor), checkRequired("externalAccountId", externalAccountId), checkRequired("idempotencyKey", idempotencyKey), checkRequired("inboundWireDrawdownRequestId", inboundWireDrawdownRequestId), - checkRequired("messageToRecipient", messageToRecipient), checkRequired("network", network), - checkRequired("originatorAddressLine1", originatorAddressLine1), - checkRequired("originatorAddressLine2", originatorAddressLine2), - checkRequired("originatorAddressLine3", originatorAddressLine3), - checkRequired("originatorName", originatorName), checkRequired("pendingTransactionId", pendingTransactionId), checkRequired("remittance", remittance), checkRequired("reversal", reversal), @@ -1494,23 +1128,16 @@ private constructor( accountNumber() amount() approval().ifPresent { it.validate() } - beneficiaryAddressLine1() - beneficiaryAddressLine2() - beneficiaryAddressLine3() - beneficiaryName() cancellation().ifPresent { it.validate() } createdAt() createdBy().ifPresent { it.validate() } + creditor().ifPresent { it.validate() } currency().validate() + debtor().ifPresent { it.validate() } externalAccountId() idempotencyKey() inboundWireDrawdownRequestId() - messageToRecipient() network().validate() - originatorAddressLine1() - originatorAddressLine2() - originatorAddressLine3() - originatorName() pendingTransactionId() remittance().ifPresent { it.validate() } reversal().ifPresent { it.validate() } @@ -1543,23 +1170,16 @@ private constructor( (if (accountNumber.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + (approval.asKnown().getOrNull()?.validity() ?: 0) + - (if (beneficiaryAddressLine1.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine2.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine3.asKnown().isPresent) 1 else 0) + - (if (beneficiaryName.asKnown().isPresent) 1 else 0) + (cancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (createdBy.asKnown().getOrNull()?.validity() ?: 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + (if (externalAccountId.asKnown().isPresent) 1 else 0) + (if (idempotencyKey.asKnown().isPresent) 1 else 0) + (if (inboundWireDrawdownRequestId.asKnown().isPresent) 1 else 0) + - (if (messageToRecipient.asKnown().isPresent) 1 else 0) + (network.asKnown().getOrNull()?.validity() ?: 0) + - (if (originatorAddressLine1.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine2.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine3.asKnown().isPresent) 1 else 0) + - (if (originatorName.asKnown().isPresent) 1 else 0) + (if (pendingTransactionId.asKnown().isPresent) 1 else 0) + (remittance.asKnown().getOrNull()?.validity() ?: 0) + (reversal.asKnown().getOrNull()?.validity() ?: 0) + @@ -2972,147 +2592,170 @@ private constructor( "CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}" } - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For - * wire transfers this is always equal to `usd`. - */ - class Currency @JsonCreator private constructor(private val value: JsonField) : Enum { + /** The person or business that is receiving the funds from the transfer. */ + class Creditor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val address: JsonField
, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(address, name, mutableMapOf()) /** - * Returns this class instance's raw value. + * The person or business's address. * - * 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. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun address(): Optional
= address.getOptional("address") - companion object { + /** + * The person or business's name. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") - /** Canadian Dollar (CAD) */ - @JvmField val CAD = of("CAD") + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address - /** Swiss Franc (CHF) */ - @JvmField val CHF = of("CHF") + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name - /** Euro (EUR) */ - @JvmField val EUR = of("EUR") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** British Pound (GBP) */ - @JvmField val GBP = of("GBP") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** Japanese Yen (JPY) */ - @JvmField val JPY = of("JPY") + fun toBuilder() = Builder().from(this) - /** US Dollar (USD) */ - @JvmField val USD = of("USD") + companion object { - @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + /** + * Returns a mutable builder for constructing an instance of [Creditor]. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() } - /** An enum containing [Currency]'s known values. */ - enum class Known { - /** Canadian Dollar (CAD) */ - CAD, - /** Swiss Franc (CHF) */ - CHF, - /** Euro (EUR) */ - EUR, - /** British Pound (GBP) */ - GBP, - /** Japanese Yen (JPY) */ - JPY, - /** US Dollar (USD) */ - USD, - } + /** A builder for [Creditor]. */ + class Builder internal constructor() { - /** - * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Currency] 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 { - /** Canadian Dollar (CAD) */ - CAD, - /** Swiss Franc (CHF) */ - CHF, - /** Euro (EUR) */ - EUR, - /** British Pound (GBP) */ - GBP, - /** Japanese Yen (JPY) */ - JPY, - /** US Dollar (USD) */ - USD, - /** An enum member indicating that [Currency] was instantiated with an unknown value. */ - _UNKNOWN, - } + private var address: JsonField
? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - /** - * 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) { - CAD -> Value.CAD - CHF -> Value.CHF - EUR -> Value.EUR - GBP -> Value.GBP - JPY -> Value.JPY - USD -> Value.USD - else -> Value._UNKNOWN + @JvmSynthetic + internal fun from(creditor: Creditor) = apply { + address = creditor.address + name = creditor.name + additionalProperties = creditor.additionalProperties.toMutableMap() } - /** - * 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 IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - CAD -> Known.CAD - CHF -> Known.CHF - EUR -> Known.EUR - GBP -> Known.GBP - JPY -> Known.JPY - USD -> Known.USD - else -> throw IncreaseInvalidDataException("Unknown Currency: $value") + /** The person or business's address. */ + fun address(address: Address?) = address(JsonField.ofNullable(address)) + + /** Alias for calling [Builder.address] with `address.orElse(null)`. */ + fun address(address: Optional
) = address(address.getOrNull()) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** The person or business's name. */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * 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 IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + 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 [Creditor]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Creditor = + Creditor( + checkRequired("address", address), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Currency = apply { + fun validate(): Creditor = apply { if (validated) { return@apply } - known() + address().ifPresent { it.validate() } + name() validated = true } @@ -3130,19 +2773,1276 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic + internal fun validity(): Int = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) + + /** + * Unstructured address lines. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is Currency && value == other.value - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - override fun hashCode() = value.hashCode() + fun toBuilder() = Builder().from(this) - override fun toString() = value.toString() + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured?) = + unstructured(JsonField.ofNullable(unstructured)) + + /** Alias for calling [Builder.unstructured] with `unstructured.orElse(null)`. */ + fun unstructured(unstructured: Optional) = + unstructured(unstructured.getOrNull()) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + + /** + * The first line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * The second line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") + + /** + * The third line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField? = null + private var line3: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The first line. */ + fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) + + /** Alias for calling [Builder.line1] with `line1.orElse(null)`. */ + fun line1(line1: Optional) = line1(line1.getOrNull()) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The second line. */ + fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) + + /** Alias for calling [Builder.line2] with `line2.orElse(null)`. */ + fun line2(line2: Optional) = line2(line2.getOrNull()) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The third line. */ + fun line3(line3: String?) = line3(JsonField.ofNullable(line3)) + + /** Alias for calling [Builder.line3] with `line3.orElse(null)`. */ + fun line3(line3: Optional) = line3(line3.getOrNull()) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + checkRequired("line2", line2), + checkRequired("line3", line3), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Creditor && + address == other.address && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(address, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Creditor{address=$address, name=$name, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For + * wire transfers this is always equal to `usd`. + */ + class Currency @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 { + + /** Canadian Dollar (CAD) */ + @JvmField val CAD = of("CAD") + + /** Swiss Franc (CHF) */ + @JvmField val CHF = of("CHF") + + /** Euro (EUR) */ + @JvmField val EUR = of("EUR") + + /** British Pound (GBP) */ + @JvmField val GBP = of("GBP") + + /** Japanese Yen (JPY) */ + @JvmField val JPY = of("JPY") + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** Canadian Dollar (CAD) */ + CAD, + /** Swiss Franc (CHF) */ + CHF, + /** Euro (EUR) */ + EUR, + /** British Pound (GBP) */ + GBP, + /** Japanese Yen (JPY) */ + JPY, + /** US Dollar (USD) */ + USD, + /** An enum member indicating that [Currency] 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) { + CAD -> Value.CAD + CHF -> Value.CHF + EUR -> Value.EUR + GBP -> Value.GBP + JPY -> Value.JPY + USD -> Value.USD + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + CAD -> Known.CAD + CHF -> Known.CHF + EUR -> Known.EUR + GBP -> Known.GBP + JPY -> Known.JPY + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Currency = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** The person or business whose funds are being transferred. */ + class Debtor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val address: JsonField
, + private val name: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + ) : this(address, name, mutableMapOf()) + + /** + * The person or business's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun address(): Optional
= address.getOptional("address") + + /** + * The person or business's name. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun name(): Optional = name.getOptional("name") + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + @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 [Debtor]. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Debtor]. */ + class Builder internal constructor() { + + private var address: JsonField
? = null + private var name: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtor: Debtor) = apply { + address = debtor.address + name = debtor.name + additionalProperties = debtor.additionalProperties.toMutableMap() + } + + /** The person or business's address. */ + fun address(address: Address?) = address(JsonField.ofNullable(address)) + + /** Alias for calling [Builder.address] with `address.orElse(null)`. */ + fun address(address: Optional
) = address(address.getOrNull()) + + /** + * Sets [Builder.address] to an arbitrary JSON value. + * + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun address(address: JsonField
) = apply { this.address = address } + + /** The person or business's name. */ + fun name(name: String?) = name(JsonField.ofNullable(name)) + + /** Alias for calling [Builder.name] with `name.orElse(null)`. */ + fun name(name: Optional) = name(name.getOrNull()) + + /** + * Sets [Builder.name] to an arbitrary JSON value. + * + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun name(name: JsonField) = apply { this.name = name } + + 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 [Debtor]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .address() + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Debtor = + Debtor( + checkRequired("address", address), + checkRequired("name", name), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Debtor = apply { + if (validated) { + return@apply + } + + address().ifPresent { it.validate() } + name() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (name.asKnown().isPresent) 1 else 0) + + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) + + /** + * Unstructured address lines. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured?) = + unstructured(JsonField.ofNullable(unstructured)) + + /** Alias for calling [Builder.unstructured] with `unstructured.orElse(null)`. */ + fun unstructured(unstructured: Optional) = + unstructured(unstructured.getOrNull()) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + + /** + * The first line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line1(): Optional = line1.getOptional("line1") + + /** + * The second line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") + + /** + * The third line. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField? = null + private var line3: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The first line. */ + fun line1(line1: String?) = line1(JsonField.ofNullable(line1)) + + /** Alias for calling [Builder.line1] with `line1.orElse(null)`. */ + fun line1(line1: Optional) = line1(line1.getOrNull()) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The second line. */ + fun line2(line2: String?) = line2(JsonField.ofNullable(line2)) + + /** Alias for calling [Builder.line2] with `line2.orElse(null)`. */ + fun line2(line2: Optional) = line2(line2.getOrNull()) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The third line. */ + fun line3(line3: String?) = line3(JsonField.ofNullable(line3)) + + /** Alias for calling [Builder.line3] with `line3.orElse(null)`. */ + fun line3(line3: Optional) = line3(line3.getOrNull()) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * .line2() + * .line3() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + checkRequired("line2", line2), + checkRequired("line3", line3), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Debtor && + address == other.address && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(address, name, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Debtor{address=$address, name=$name, additionalProperties=$additionalProperties}" } /** The transfer's network. */ @@ -5495,23 +6395,16 @@ private constructor( accountNumber == other.accountNumber && amount == other.amount && approval == other.approval && - beneficiaryAddressLine1 == other.beneficiaryAddressLine1 && - beneficiaryAddressLine2 == other.beneficiaryAddressLine2 && - beneficiaryAddressLine3 == other.beneficiaryAddressLine3 && - beneficiaryName == other.beneficiaryName && cancellation == other.cancellation && createdAt == other.createdAt && createdBy == other.createdBy && + creditor == other.creditor && currency == other.currency && + debtor == other.debtor && externalAccountId == other.externalAccountId && idempotencyKey == other.idempotencyKey && inboundWireDrawdownRequestId == other.inboundWireDrawdownRequestId && - messageToRecipient == other.messageToRecipient && network == other.network && - originatorAddressLine1 == other.originatorAddressLine1 && - originatorAddressLine2 == other.originatorAddressLine2 && - originatorAddressLine3 == other.originatorAddressLine3 && - originatorName == other.originatorName && pendingTransactionId == other.pendingTransactionId && remittance == other.remittance && reversal == other.reversal && @@ -5531,23 +6424,16 @@ private constructor( accountNumber, amount, approval, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, - beneficiaryName, cancellation, createdAt, createdBy, + creditor, currency, + debtor, externalAccountId, idempotencyKey, inboundWireDrawdownRequestId, - messageToRecipient, network, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, pendingTransactionId, remittance, reversal, @@ -5564,5 +6450,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "WireTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, amount=$amount, approval=$approval, beneficiaryAddressLine1=$beneficiaryAddressLine1, beneficiaryAddressLine2=$beneficiaryAddressLine2, beneficiaryAddressLine3=$beneficiaryAddressLine3, beneficiaryName=$beneficiaryName, cancellation=$cancellation, createdAt=$createdAt, createdBy=$createdBy, currency=$currency, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, messageToRecipient=$messageToRecipient, network=$network, originatorAddressLine1=$originatorAddressLine1, originatorAddressLine2=$originatorAddressLine2, originatorAddressLine3=$originatorAddressLine3, originatorName=$originatorName, pendingTransactionId=$pendingTransactionId, remittance=$remittance, reversal=$reversal, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" + "WireTransfer{id=$id, accountId=$accountId, accountNumber=$accountNumber, amount=$amount, approval=$approval, cancellation=$cancellation, createdAt=$createdAt, createdBy=$createdBy, creditor=$creditor, currency=$currency, debtor=$debtor, externalAccountId=$externalAccountId, idempotencyKey=$idempotencyKey, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, network=$network, pendingTransactionId=$pendingTransactionId, remittance=$remittance, reversal=$reversal, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, submission=$submission, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt index fd2679ef8..747ff7d0f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParams.kt @@ -47,44 +47,37 @@ private constructor( fun amount(): Long = body.amount() /** - * The beneficiary's name. + * The person or business that is receiving the funds from the transfer. * * @throws IncreaseInvalidDataException 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 beneficiaryName(): String = body.beneficiaryName() + fun creditor(): Creditor = body.creditor() /** - * The account number for the destination account. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun accountNumber(): Optional = body.accountNumber() - - /** - * The beneficiary's address line 1. + * Additional remittance information related to the wire transfer. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). + * @throws IncreaseInvalidDataException 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 beneficiaryAddressLine1(): Optional = body.beneficiaryAddressLine1() + fun remittance(): Remittance = body.remittance() /** - * The beneficiary's address line 2. + * The account number for the destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun beneficiaryAddressLine2(): Optional = body.beneficiaryAddressLine2() + fun accountNumber(): Optional = body.accountNumber() /** - * The beneficiary's address line 3. + * The person or business whose funds are being transferred. This is only necessary if you're + * transferring from a commingled account. Otherwise, we'll use the associated entity's details. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). */ - fun beneficiaryAddressLine3(): Optional = body.beneficiaryAddressLine3() + fun debtor(): Optional = body.debtor() /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -103,50 +96,6 @@ private constructor( */ fun inboundWireDrawdownRequestId(): Optional = body.inboundWireDrawdownRequestId() - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = body.originatorAddressLine1() - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = body.originatorAddressLine2() - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = body.originatorAddressLine3() - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun originatorName(): Optional = body.originatorName() - - /** - * Additional remittance information related to the wire transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the - * server responded with an unexpected value). - */ - fun remittance(): Optional = body.remittance() - /** * Whether the transfer requires explicit approval via the dashboard or API. * @@ -187,42 +136,32 @@ private constructor( fun _amount(): JsonField = body._amount() /** - * Returns the raw JSON value of [beneficiaryName]. - * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _beneficiaryName(): JsonField = body._beneficiaryName() - - /** - * Returns the raw JSON value of [accountNumber]. + * Returns the raw JSON value of [creditor]. * - * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. */ - fun _accountNumber(): JsonField = body._accountNumber() + fun _creditor(): JsonField = body._creditor() /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. + * Returns the raw JSON value of [remittance]. * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine1(): JsonField = body._beneficiaryAddressLine1() + fun _remittance(): JsonField = body._remittance() /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. + * Returns the raw JSON value of [accountNumber]. * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [accountNumber], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine2(): JsonField = body._beneficiaryAddressLine2() + fun _accountNumber(): JsonField = body._accountNumber() /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. + * Returns the raw JSON value of [debtor]. * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. */ - fun _beneficiaryAddressLine3(): JsonField = body._beneficiaryAddressLine3() + fun _debtor(): JsonField = body._debtor() /** * Returns the raw JSON value of [externalAccountId]. @@ -240,44 +179,6 @@ private constructor( */ fun _inboundWireDrawdownRequestId(): JsonField = body._inboundWireDrawdownRequestId() - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine1(): JsonField = body._originatorAddressLine1() - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine2(): JsonField = body._originatorAddressLine2() - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - fun _originatorAddressLine3(): JsonField = body._originatorAddressLine3() - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _originatorName(): JsonField = body._originatorName() - - /** - * Returns the raw JSON value of [remittance]. - * - * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. - */ - fun _remittance(): JsonField = body._remittance() - /** * Returns the raw JSON value of [requireApproval]. * @@ -319,7 +220,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` */ @JvmStatic fun builder() = Builder() @@ -346,9 +248,9 @@ private constructor( * Otherwise, it's more convenient to use the top-level setters instead: * - [accountId] * - [amount] - * - [beneficiaryName] + * - [creditor] + * - [remittance] * - [accountNumber] - * - [beneficiaryAddressLine1] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -376,21 +278,29 @@ private constructor( */ fun amount(amount: JsonField) = apply { body.amount(amount) } - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String) = apply { - body.beneficiaryName(beneficiaryName) - } + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor) = apply { body.creditor(creditor) } + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun creditor(creditor: JsonField) = apply { body.creditor(creditor) } + + /** Additional remittance information related to the wire transfer. */ + fun remittance(remittance: Remittance) = apply { body.remittance(remittance) } /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. + * Sets [Builder.remittance] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value + * You should usually call [Builder.remittance] with a well-typed [Remittance] value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - body.beneficiaryName(beneficiaryName) - } + fun remittance(remittance: JsonField) = apply { body.remittance(remittance) } /** The account number for the destination account. */ fun accountNumber(accountNumber: String) = apply { body.accountNumber(accountNumber) } @@ -406,53 +316,20 @@ private constructor( body.accountNumber(accountNumber) } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String) = apply { - body.beneficiaryAddressLine1(beneficiaryAddressLine1) - } - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - body.beneficiaryAddressLine1(beneficiaryAddressLine1) - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String) = apply { - body.beneficiaryAddressLine2(beneficiaryAddressLine2) - } - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - body.beneficiaryAddressLine2(beneficiaryAddressLine2) - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String) = apply { - body.beneficiaryAddressLine3(beneficiaryAddressLine3) - } + fun debtor(debtor: Debtor) = apply { body.debtor(debtor) } /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - body.beneficiaryAddressLine3(beneficiaryAddressLine3) - } + fun debtor(debtor: JsonField) = apply { body.debtor(debtor) } /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -492,92 +369,6 @@ private constructor( body.inboundWireDrawdownRequestId(inboundWireDrawdownRequestId) } - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine1(originatorAddressLine1: String) = apply { - body.originatorAddressLine1(originatorAddressLine1) - } - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - body.originatorAddressLine1(originatorAddressLine1) - } - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine2(originatorAddressLine2: String) = apply { - body.originatorAddressLine2(originatorAddressLine2) - } - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - body.originatorAddressLine2(originatorAddressLine2) - } - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine3(originatorAddressLine3: String) = apply { - body.originatorAddressLine3(originatorAddressLine3) - } - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - body.originatorAddressLine3(originatorAddressLine3) - } - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - */ - fun originatorName(originatorName: String) = apply { body.originatorName(originatorName) } - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - body.originatorName(originatorName) - } - - /** Additional remittance information related to the wire transfer. */ - fun remittance(remittance: Remittance) = apply { body.remittance(remittance) } - - /** - * Sets [Builder.remittance] to an arbitrary JSON value. - * - * You should usually call [Builder.remittance] with a well-typed [Remittance] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun remittance(remittance: JsonField) = apply { body.remittance(remittance) } - /** Whether the transfer requires explicit approval via the dashboard or API. */ fun requireApproval(requireApproval: Boolean) = apply { body.requireApproval(requireApproval) @@ -753,7 +544,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` * * @throws IllegalStateException if any required field is unset. @@ -777,18 +569,12 @@ private constructor( private constructor( private val accountId: JsonField, private val amount: JsonField, - private val beneficiaryName: JsonField, + private val creditor: JsonField, + private val remittance: JsonField, private val accountNumber: JsonField, - private val beneficiaryAddressLine1: JsonField, - private val beneficiaryAddressLine2: JsonField, - private val beneficiaryAddressLine3: JsonField, + private val debtor: JsonField, private val externalAccountId: JsonField, private val inboundWireDrawdownRequestId: JsonField, - private val originatorAddressLine1: JsonField, - private val originatorAddressLine2: JsonField, - private val originatorAddressLine3: JsonField, - private val originatorName: JsonField, - private val remittance: JsonField, private val requireApproval: JsonField, private val routingNumber: JsonField, private val sourceAccountNumberId: JsonField, @@ -801,42 +587,22 @@ private constructor( @ExcludeMissing accountId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_name") + @JsonProperty("creditor") @ExcludeMissing - beneficiaryName: JsonField = JsonMissing.of(), + creditor: JsonField = JsonMissing.of(), + @JsonProperty("remittance") + @ExcludeMissing + remittance: JsonField = JsonMissing.of(), @JsonProperty("account_number") @ExcludeMissing accountNumber: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - beneficiaryAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - beneficiaryAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - beneficiaryAddressLine3: JsonField = JsonMissing.of(), + @JsonProperty("debtor") @ExcludeMissing debtor: JsonField = JsonMissing.of(), @JsonProperty("external_account_id") @ExcludeMissing externalAccountId: JsonField = JsonMissing.of(), @JsonProperty("inbound_wire_drawdown_request_id") @ExcludeMissing inboundWireDrawdownRequestId: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line1") - @ExcludeMissing - originatorAddressLine1: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line2") - @ExcludeMissing - originatorAddressLine2: JsonField = JsonMissing.of(), - @JsonProperty("originator_address_line3") - @ExcludeMissing - originatorAddressLine3: JsonField = JsonMissing.of(), - @JsonProperty("originator_name") - @ExcludeMissing - originatorName: JsonField = JsonMissing.of(), - @JsonProperty("remittance") - @ExcludeMissing - remittance: JsonField = JsonMissing.of(), @JsonProperty("require_approval") @ExcludeMissing requireApproval: JsonField = JsonMissing.of(), @@ -849,18 +615,12 @@ private constructor( ) : this( accountId, amount, - beneficiaryName, + creditor, + remittance, accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -884,47 +644,38 @@ private constructor( fun amount(): Long = amount.getRequired("amount") /** - * The beneficiary's name. + * The person or business that is receiving the funds from the transfer. * * @throws IncreaseInvalidDataException 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 beneficiaryName(): String = beneficiaryName.getRequired("beneficiary_name") - - /** - * The account number for the destination account. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun accountNumber(): Optional = accountNumber.getOptional("account_number") + fun creditor(): Creditor = creditor.getRequired("creditor") /** - * The beneficiary's address line 1. + * Additional remittance information related to the wire transfer. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * @throws IncreaseInvalidDataException 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 beneficiaryAddressLine1(): Optional = - beneficiaryAddressLine1.getOptional("beneficiary_address_line1") + fun remittance(): Remittance = remittance.getRequired("remittance") /** - * The beneficiary's address line 2. + * The account number for the destination account. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun beneficiaryAddressLine2(): Optional = - beneficiaryAddressLine2.getOptional("beneficiary_address_line2") + fun accountNumber(): Optional = accountNumber.getOptional("account_number") /** - * The beneficiary's address line 3. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun beneficiaryAddressLine3(): Optional = - beneficiaryAddressLine3.getOptional("beneficiary_address_line3") + fun debtor(): Optional = debtor.getOptional("debtor") /** * The ID of an External Account to initiate a transfer to. If this parameter is provided, @@ -946,53 +697,6 @@ private constructor( fun inboundWireDrawdownRequestId(): Optional = inboundWireDrawdownRequestId.getOptional("inbound_wire_drawdown_request_id") - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine1(): Optional = - originatorAddressLine1.getOptional("originator_address_line1") - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine2(): Optional = - originatorAddressLine2.getOptional("originator_address_line2") - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorAddressLine3(): Optional = - originatorAddressLine3.getOptional("originator_address_line3") - - /** - * The originator's name. This is only necessary if you're transferring from a commingled - * account. Otherwise, we'll use the associated entity's details. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun originatorName(): Optional = originatorName.getOptional("originator_name") - - /** - * Additional remittance information related to the wire transfer. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun remittance(): Optional = remittance.getOptional("remittance") - /** * Whether the transfer requires explicit approval via the dashboard or API. * @@ -1034,14 +738,20 @@ private constructor( @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount /** - * Returns the raw JSON value of [beneficiaryName]. + * Returns the raw JSON value of [creditor]. * - * Unlike [beneficiaryName], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [creditor], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("creditor") @ExcludeMissing fun _creditor(): JsonField = creditor + + /** + * Returns the raw JSON value of [remittance]. + * + * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("beneficiary_name") + @JsonProperty("remittance") @ExcludeMissing - fun _beneficiaryName(): JsonField = beneficiaryName + fun _remittance(): JsonField = remittance /** * Returns the raw JSON value of [accountNumber]. @@ -1054,40 +764,17 @@ private constructor( fun _accountNumber(): JsonField = accountNumber /** - * Returns the raw JSON value of [beneficiaryAddressLine1]. + * Returns the raw JSON value of [debtor]. * - * Unlike [beneficiaryAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [debtor], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("beneficiary_address_line1") - @ExcludeMissing - fun _beneficiaryAddressLine1(): JsonField = beneficiaryAddressLine1 + @JsonProperty("debtor") @ExcludeMissing fun _debtor(): JsonField = debtor /** - * Returns the raw JSON value of [beneficiaryAddressLine2]. + * Returns the raw JSON value of [externalAccountId]. * - * Unlike [beneficiaryAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line2") - @ExcludeMissing - fun _beneficiaryAddressLine2(): JsonField = beneficiaryAddressLine2 - - /** - * Returns the raw JSON value of [beneficiaryAddressLine3]. - * - * Unlike [beneficiaryAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("beneficiary_address_line3") - @ExcludeMissing - fun _beneficiaryAddressLine3(): JsonField = beneficiaryAddressLine3 - - /** - * Returns the raw JSON value of [externalAccountId]. - * - * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [externalAccountId], this method doesn't throw if the JSON field has an unexpected + * type. */ @JsonProperty("external_account_id") @ExcludeMissing @@ -1103,55 +790,6 @@ private constructor( @ExcludeMissing fun _inboundWireDrawdownRequestId(): JsonField = inboundWireDrawdownRequestId - /** - * Returns the raw JSON value of [originatorAddressLine1]. - * - * Unlike [originatorAddressLine1], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line1") - @ExcludeMissing - fun _originatorAddressLine1(): JsonField = originatorAddressLine1 - - /** - * Returns the raw JSON value of [originatorAddressLine2]. - * - * Unlike [originatorAddressLine2], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line2") - @ExcludeMissing - fun _originatorAddressLine2(): JsonField = originatorAddressLine2 - - /** - * Returns the raw JSON value of [originatorAddressLine3]. - * - * Unlike [originatorAddressLine3], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("originator_address_line3") - @ExcludeMissing - fun _originatorAddressLine3(): JsonField = originatorAddressLine3 - - /** - * Returns the raw JSON value of [originatorName]. - * - * Unlike [originatorName], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("originator_name") - @ExcludeMissing - fun _originatorName(): JsonField = originatorName - - /** - * Returns the raw JSON value of [remittance]. - * - * Unlike [remittance], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("remittance") - @ExcludeMissing - fun _remittance(): JsonField = remittance - /** * Returns the raw JSON value of [requireApproval]. * @@ -1203,7 +841,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` */ @JvmStatic fun builder() = Builder() @@ -1214,18 +853,12 @@ private constructor( private var accountId: JsonField? = null private var amount: JsonField? = null - private var beneficiaryName: JsonField? = null + private var creditor: JsonField? = null + private var remittance: JsonField? = null private var accountNumber: JsonField = JsonMissing.of() - private var beneficiaryAddressLine1: JsonField = JsonMissing.of() - private var beneficiaryAddressLine2: JsonField = JsonMissing.of() - private var beneficiaryAddressLine3: JsonField = JsonMissing.of() + private var debtor: JsonField = JsonMissing.of() private var externalAccountId: JsonField = JsonMissing.of() private var inboundWireDrawdownRequestId: JsonField = JsonMissing.of() - private var originatorAddressLine1: JsonField = JsonMissing.of() - private var originatorAddressLine2: JsonField = JsonMissing.of() - private var originatorAddressLine3: JsonField = JsonMissing.of() - private var originatorName: JsonField = JsonMissing.of() - private var remittance: JsonField = JsonMissing.of() private var requireApproval: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() private var sourceAccountNumberId: JsonField = JsonMissing.of() @@ -1235,18 +868,12 @@ private constructor( internal fun from(body: Body) = apply { accountId = body.accountId amount = body.amount - beneficiaryName = body.beneficiaryName + creditor = body.creditor + remittance = body.remittance accountNumber = body.accountNumber - beneficiaryAddressLine1 = body.beneficiaryAddressLine1 - beneficiaryAddressLine2 = body.beneficiaryAddressLine2 - beneficiaryAddressLine3 = body.beneficiaryAddressLine3 + debtor = body.debtor externalAccountId = body.externalAccountId inboundWireDrawdownRequestId = body.inboundWireDrawdownRequestId - originatorAddressLine1 = body.originatorAddressLine1 - originatorAddressLine2 = body.originatorAddressLine2 - originatorAddressLine3 = body.originatorAddressLine3 - originatorName = body.originatorName - remittance = body.remittance requireApproval = body.requireApproval routingNumber = body.routingNumber sourceAccountNumberId = body.sourceAccountNumberId @@ -1277,19 +904,30 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** The beneficiary's name. */ - fun beneficiaryName(beneficiaryName: String) = - beneficiaryName(JsonField.of(beneficiaryName)) + /** The person or business that is receiving the funds from the transfer. */ + fun creditor(creditor: Creditor) = creditor(JsonField.of(creditor)) + + /** + * Sets [Builder.creditor] to an arbitrary JSON value. + * + * You should usually call [Builder.creditor] with a well-typed [Creditor] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun creditor(creditor: JsonField) = apply { this.creditor = creditor } + + /** Additional remittance information related to the wire transfer. */ + fun remittance(remittance: Remittance) = remittance(JsonField.of(remittance)) /** - * Sets [Builder.beneficiaryName] to an arbitrary JSON value. + * Sets [Builder.remittance] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryName] with a well-typed [String] value + * You should usually call [Builder.remittance] with a well-typed [Remittance] value * instead. This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun beneficiaryName(beneficiaryName: JsonField) = apply { - this.beneficiaryName = beneficiaryName + fun remittance(remittance: JsonField) = apply { + this.remittance = remittance } /** The account number for the destination account. */ @@ -1306,50 +944,21 @@ private constructor( this.accountNumber = accountNumber } - /** The beneficiary's address line 1. */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: String) = - beneficiaryAddressLine1(JsonField.of(beneficiaryAddressLine1)) - - /** - * Sets [Builder.beneficiaryAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun beneficiaryAddressLine1(beneficiaryAddressLine1: JsonField) = apply { - this.beneficiaryAddressLine1 = beneficiaryAddressLine1 - } - - /** The beneficiary's address line 2. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: String) = - beneficiaryAddressLine2(JsonField.of(beneficiaryAddressLine2)) - /** - * Sets [Builder.beneficiaryAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.beneficiaryAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * The person or business whose funds are being transferred. This is only necessary if + * you're transferring from a commingled account. Otherwise, we'll use the associated + * entity's details. */ - fun beneficiaryAddressLine2(beneficiaryAddressLine2: JsonField) = apply { - this.beneficiaryAddressLine2 = beneficiaryAddressLine2 - } - - /** The beneficiary's address line 3. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: String) = - beneficiaryAddressLine3(JsonField.of(beneficiaryAddressLine3)) + fun debtor(debtor: Debtor) = debtor(JsonField.of(debtor)) /** - * Sets [Builder.beneficiaryAddressLine3] to an arbitrary JSON value. + * Sets [Builder.debtor] to an arbitrary JSON value. * - * You should usually call [Builder.beneficiaryAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. + * You should usually call [Builder.debtor] with a well-typed [Debtor] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun beneficiaryAddressLine3(beneficiaryAddressLine3: JsonField) = apply { - this.beneficiaryAddressLine3 = beneficiaryAddressLine3 - } + fun debtor(debtor: JsonField) = apply { this.debtor = debtor } /** * The ID of an External Account to initiate a transfer to. If this parameter is @@ -1388,92 +997,6 @@ private constructor( this.inboundWireDrawdownRequestId = inboundWireDrawdownRequestId } - /** - * The originator's address line 1. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine1(originatorAddressLine1: String) = - originatorAddressLine1(JsonField.of(originatorAddressLine1)) - - /** - * Sets [Builder.originatorAddressLine1] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine1] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine1(originatorAddressLine1: JsonField) = apply { - this.originatorAddressLine1 = originatorAddressLine1 - } - - /** - * The originator's address line 2. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine2(originatorAddressLine2: String) = - originatorAddressLine2(JsonField.of(originatorAddressLine2)) - - /** - * Sets [Builder.originatorAddressLine2] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine2] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine2(originatorAddressLine2: JsonField) = apply { - this.originatorAddressLine2 = originatorAddressLine2 - } - - /** - * The originator's address line 3. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorAddressLine3(originatorAddressLine3: String) = - originatorAddressLine3(JsonField.of(originatorAddressLine3)) - - /** - * Sets [Builder.originatorAddressLine3] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorAddressLine3] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun originatorAddressLine3(originatorAddressLine3: JsonField) = apply { - this.originatorAddressLine3 = originatorAddressLine3 - } - - /** - * The originator's name. This is only necessary if you're transferring from a - * commingled account. Otherwise, we'll use the associated entity's details. - */ - fun originatorName(originatorName: String) = - originatorName(JsonField.of(originatorName)) - - /** - * Sets [Builder.originatorName] to an arbitrary JSON value. - * - * You should usually call [Builder.originatorName] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun originatorName(originatorName: JsonField) = apply { - this.originatorName = originatorName - } - - /** Additional remittance information related to the wire transfer. */ - fun remittance(remittance: Remittance) = remittance(JsonField.of(remittance)) - - /** - * Sets [Builder.remittance] to an arbitrary JSON value. - * - * You should usually call [Builder.remittance] with a well-typed [Remittance] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun remittance(remittance: JsonField) = apply { - this.remittance = remittance - } - /** Whether the transfer requires explicit approval via the dashboard or API. */ fun requireApproval(requireApproval: Boolean) = requireApproval(JsonField.of(requireApproval)) @@ -1549,7 +1072,8 @@ private constructor( * ```java * .accountId() * .amount() - * .beneficiaryName() + * .creditor() + * .remittance() * ``` * * @throws IllegalStateException if any required field is unset. @@ -1558,18 +1082,12 @@ private constructor( Body( checkRequired("accountId", accountId), checkRequired("amount", amount), - checkRequired("beneficiaryName", beneficiaryName), + checkRequired("creditor", creditor), + checkRequired("remittance", remittance), accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -1586,18 +1104,12 @@ private constructor( accountId() amount() - beneficiaryName() + creditor().validate() + remittance().validate() accountNumber() - beneficiaryAddressLine1() - beneficiaryAddressLine2() - beneficiaryAddressLine3() + debtor().ifPresent { it.validate() } externalAccountId() inboundWireDrawdownRequestId() - originatorAddressLine1() - originatorAddressLine2() - originatorAddressLine3() - originatorName() - remittance().ifPresent { it.validate() } requireApproval() routingNumber() sourceAccountNumberId() @@ -1622,18 +1134,12 @@ private constructor( internal fun validity(): Int = (if (accountId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + - (if (beneficiaryName.asKnown().isPresent) 1 else 0) + + (creditor.asKnown().getOrNull()?.validity() ?: 0) + + (remittance.asKnown().getOrNull()?.validity() ?: 0) + (if (accountNumber.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine1.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine2.asKnown().isPresent) 1 else 0) + - (if (beneficiaryAddressLine3.asKnown().isPresent) 1 else 0) + + (debtor.asKnown().getOrNull()?.validity() ?: 0) + (if (externalAccountId.asKnown().isPresent) 1 else 0) + (if (inboundWireDrawdownRequestId.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine1.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine2.asKnown().isPresent) 1 else 0) + - (if (originatorAddressLine3.asKnown().isPresent) 1 else 0) + - (if (originatorName.asKnown().isPresent) 1 else 0) + - (remittance.asKnown().getOrNull()?.validity() ?: 0) + (if (requireApproval.asKnown().isPresent) 1 else 0) + (if (routingNumber.asKnown().isPresent) 1 else 0) + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) @@ -1646,18 +1152,12 @@ private constructor( return other is Body && accountId == other.accountId && amount == other.amount && - beneficiaryName == other.beneficiaryName && + creditor == other.creditor && + remittance == other.remittance && accountNumber == other.accountNumber && - beneficiaryAddressLine1 == other.beneficiaryAddressLine1 && - beneficiaryAddressLine2 == other.beneficiaryAddressLine2 && - beneficiaryAddressLine3 == other.beneficiaryAddressLine3 && + debtor == other.debtor && externalAccountId == other.externalAccountId && inboundWireDrawdownRequestId == other.inboundWireDrawdownRequestId && - originatorAddressLine1 == other.originatorAddressLine1 && - originatorAddressLine2 == other.originatorAddressLine2 && - originatorAddressLine3 == other.originatorAddressLine3 && - originatorName == other.originatorName && - remittance == other.remittance && requireApproval == other.requireApproval && routingNumber == other.routingNumber && sourceAccountNumberId == other.sourceAccountNumberId && @@ -1668,18 +1168,12 @@ private constructor( Objects.hash( accountId, amount, - beneficiaryName, + creditor, + remittance, accountNumber, - beneficiaryAddressLine1, - beneficiaryAddressLine2, - beneficiaryAddressLine3, + debtor, externalAccountId, inboundWireDrawdownRequestId, - originatorAddressLine1, - originatorAddressLine2, - originatorAddressLine3, - originatorName, - remittance, requireApproval, routingNumber, sourceAccountNumberId, @@ -1690,78 +1184,53 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{accountId=$accountId, amount=$amount, beneficiaryName=$beneficiaryName, accountNumber=$accountNumber, beneficiaryAddressLine1=$beneficiaryAddressLine1, beneficiaryAddressLine2=$beneficiaryAddressLine2, beneficiaryAddressLine3=$beneficiaryAddressLine3, externalAccountId=$externalAccountId, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, originatorAddressLine1=$originatorAddressLine1, originatorAddressLine2=$originatorAddressLine2, originatorAddressLine3=$originatorAddressLine3, originatorName=$originatorName, remittance=$remittance, requireApproval=$requireApproval, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, additionalProperties=$additionalProperties}" + "Body{accountId=$accountId, amount=$amount, creditor=$creditor, remittance=$remittance, accountNumber=$accountNumber, debtor=$debtor, externalAccountId=$externalAccountId, inboundWireDrawdownRequestId=$inboundWireDrawdownRequestId, requireApproval=$requireApproval, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, additionalProperties=$additionalProperties}" } - /** Additional remittance information related to the wire transfer. */ - class Remittance + /** The person or business that is receiving the funds from the transfer. */ + class Creditor @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val category: JsonField, - private val tax: JsonField, - private val unstructured: JsonField, + private val name: JsonField, + private val address: JsonField
, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), - @JsonProperty("tax") @ExcludeMissing tax: JsonField = JsonMissing.of(), - @JsonProperty("unstructured") - @ExcludeMissing - unstructured: JsonField = JsonMissing.of(), - ) : this(category, tax, unstructured, mutableMapOf()) + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + ) : this(name, address, mutableMapOf()) /** - * The type of remittance information being passed. + * The person or business's name. * * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") - - /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal - * to `tax`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun tax(): Optional = tax.getOptional("tax") + fun name(): String = name.getRequired("name") /** - * Unstructured remittance information. Required if `category` is equal to `unstructured`. + * The person or business's address. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun unstructured(): Optional = unstructured.getOptional("unstructured") - - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + fun address(): Optional
= address.getOptional("address") /** - * Returns the raw JSON value of [tax]. + * Returns the raw JSON value of [name]. * - * Unlike [tax], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("tax") @ExcludeMissing fun _tax(): JsonField = tax + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name /** - * Returns the raw JSON value of [unstructured]. + * Returns the raw JSON value of [address]. * - * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("unstructured") - @ExcludeMissing - fun _unstructured(): JsonField = unstructured + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -1778,75 +1247,53 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Remittance]. + * Returns a mutable builder for constructing an instance of [Creditor]. * * The following fields are required: * ```java - * .category() + * .name() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Remittance]. */ + /** A builder for [Creditor]. */ class Builder internal constructor() { - private var category: JsonField? = null - private var tax: JsonField = JsonMissing.of() - private var unstructured: JsonField = JsonMissing.of() + private var name: JsonField? = null + private var address: JsonField
= JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(remittance: Remittance) = apply { - category = remittance.category - tax = remittance.tax - unstructured = remittance.unstructured - additionalProperties = remittance.additionalProperties.toMutableMap() + internal fun from(creditor: Creditor) = apply { + name = creditor.name + address = creditor.address + additionalProperties = creditor.additionalProperties.toMutableMap() } - /** The type of remittance information being passed. */ - fun category(category: Category) = category(JsonField.of(category)) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - - /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is - * equal to `tax`. - */ - fun tax(tax: Tax) = tax(JsonField.of(tax)) + /** The person or business's name. */ + fun name(name: String) = name(JsonField.of(name)) /** - * Sets [Builder.tax] to an arbitrary JSON value. + * Sets [Builder.name] to an arbitrary JSON value. * - * You should usually call [Builder.tax] with a well-typed [Tax] value instead. This + * You should usually call [Builder.name] with a well-typed [String] value instead. This * method is primarily for setting the field to an undocumented or not yet supported * value. */ - fun tax(tax: JsonField) = apply { this.tax = tax } + fun name(name: JsonField) = apply { this.name = name } - /** - * Unstructured remittance information. Required if `category` is equal to - * `unstructured`. - */ - fun unstructured(unstructured: Unstructured) = unstructured(JsonField.of(unstructured)) + /** The person or business's address. */ + fun address(address: Address) = address(JsonField.of(address)) /** - * Sets [Builder.unstructured] to an arbitrary JSON value. + * Sets [Builder.address] to an arbitrary JSON value. * - * You should usually call [Builder.unstructured] with a well-typed [Unstructured] value - * instead. This method is primarily for setting the field to an undocumented or not yet + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun unstructured(unstructured: JsonField) = apply { - this.unstructured = unstructured - } + fun address(address: JsonField
) = apply { this.address = address } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1868,36 +1315,30 @@ private constructor( } /** - * Returns an immutable instance of [Remittance]. + * Returns an immutable instance of [Creditor]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .category() + * .name() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Remittance = - Remittance( - checkRequired("category", category), - tax, - unstructured, - additionalProperties.toMutableMap(), - ) + fun build(): Creditor = + Creditor(checkRequired("name", name), address, additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): Remittance = apply { + fun validate(): Creditor = apply { if (validated) { return@apply } - category().validate() - tax().ifPresent { it.validate() } - unstructured().ifPresent { it.validate() } + name() + address().ifPresent { it.validate() } validated = true } @@ -1917,124 +1358,1218 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (category.asKnown().getOrNull()?.validity() ?: 0) + - (tax.asKnown().getOrNull()?.validity() ?: 0) + - (unstructured.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) + + (address.asKnown().getOrNull()?.validity() ?: 0) - /** The type of remittance information being passed. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) /** - * Returns this class instance's raw value. + * Unstructured address lines. * - * 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. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun unstructured(): Unstructured = unstructured.getRequired("unstructured") + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 { - /** The wire transfer contains unstructured remittance information. */ - @JvmField val UNSTRUCTURED = of("unstructured") + /** + * Returns a mutable builder for constructing an instance of [Address]. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Address]. */ + class Builder internal constructor() { + + private var unstructured: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() + } + + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured) = + unstructured(JsonField.of(unstructured)) /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. */ - @JvmField val TAX = of("tax") + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } + 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) + } - /** An enum containing [Category]'s known values. */ - enum class Known { - /** The wire transfer contains unstructured remittance information. */ - UNSTRUCTURED, /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * Returns an immutable instance of [Address]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .unstructured() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - TAX, + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Address = apply { + if (validated) { + return@apply + } + + unstructured().validate() + validated = true } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * Returns a score indicating how many valid values are contained in this object + * recursively. * - * An instance of [Category] 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. + * Used for best match union deserialization. */ - enum class Value { - /** The wire transfer contains unstructured remittance information. */ - UNSTRUCTURED, + @JvmSynthetic + internal fun validity(): Int = (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) + /** - * The wire transfer is for tax payment purposes to the Internal Revenue Service - * (IRS). + * The address line 1. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - TAX, + fun line1(): String = line1.getRequired("line1") + /** - * An enum member indicating that [Category] was instantiated with an unknown value. + * The address line 2. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - _UNKNOWN, + fun line2(): Optional = line2.getOptional("line2") + + /** + * The address line 3. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 + + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var line2: JsonField = JsonMissing.of() + private var line3: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The address line 1. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The address line 2. */ + fun line2(line2: String) = line2(JsonField.of(line2)) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The address line 3. */ + fun line3(line3: String) = line3(JsonField.of(line3)) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + 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 [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + line2, + line3, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unstructured = apply { + if (validated) { + return@apply + } + + line1() + line2() + line3() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" } - /** - * 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) { - UNSTRUCTURED -> Value.UNSTRUCTURED - TAX -> Value.TAX - else -> Value._UNKNOWN + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * 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 IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - UNSTRUCTURED -> Known.UNSTRUCTURED - TAX -> Known.TAX - else -> throw IncreaseInvalidDataException("Unknown Category: $value") + return other is Address && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Creditor && + name == other.name && + address == other.address && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(name, address, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Creditor{name=$name, address=$address, additionalProperties=$additionalProperties}" + } + + /** Additional remittance information related to the wire transfer. */ + class Remittance + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val tax: JsonField, + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("tax") @ExcludeMissing tax: JsonField = JsonMissing.of(), + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of(), + ) : this(category, tax, unstructured, mutableMapOf()) + + /** + * The type of remittance information being passed. + * + * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal + * to `tax`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun tax(): Optional = tax.getOptional("tax") + + /** + * Unstructured remittance information. Required if `category` is equal to `unstructured`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun unstructured(): Optional = unstructured.getOptional("unstructured") + + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category + + /** + * Returns the raw JSON value of [tax]. + * + * Unlike [tax], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("tax") @ExcludeMissing fun _tax(): JsonField = tax + + /** + * Returns the raw JSON value of [unstructured]. + * + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured + + @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 [Remittance]. + * + * The following fields are required: + * ```java + * .category() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Remittance]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var tax: JsonField = JsonMissing.of() + private var unstructured: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(remittance: Remittance) = apply { + category = remittance.category + tax = remittance.tax + unstructured = remittance.unstructured + additionalProperties = remittance.additionalProperties.toMutableMap() + } + + /** The type of remittance information being passed. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is + * equal to `tax`. + */ + fun tax(tax: Tax) = tax(JsonField.of(tax)) + + /** + * Sets [Builder.tax] to an arbitrary JSON value. + * + * You should usually call [Builder.tax] with a well-typed [Tax] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun tax(tax: JsonField) = apply { this.tax = tax } + + /** + * Unstructured remittance information. Required if `category` is equal to + * `unstructured`. + */ + fun unstructured(unstructured: Unstructured) = unstructured(JsonField.of(unstructured)) + + /** + * Sets [Builder.unstructured] to an arbitrary JSON value. + * + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured + } + + 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 [Remittance]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Remittance = + Remittance( + checkRequired("category", category), + tax, + unstructured, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Remittance = apply { + if (validated) { + return@apply + } + + category().validate() + tax().ifPresent { it.validate() } + unstructured().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (tax.asKnown().getOrNull()?.validity() ?: 0) + + (unstructured.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of remittance information being passed. */ + class Category @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 { + + /** The wire transfer contains unstructured remittance information. */ + @JvmField val UNSTRUCTURED = of("unstructured") + + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + @JvmField val TAX = of("tax") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** The wire transfer contains unstructured remittance information. */ + UNSTRUCTURED, + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + TAX, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] 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 { + /** The wire transfer contains unstructured remittance information. */ + UNSTRUCTURED, + /** + * The wire transfer is for tax payment purposes to the Internal Revenue Service + * (IRS). + */ + TAX, + /** + * An enum member indicating that [Category] 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) { + UNSTRUCTURED -> Value.UNSTRUCTURED + TAX -> Value.TAX + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + UNSTRUCTURED -> Known.UNSTRUCTURED + TAX -> Known.TAX + else -> throw IncreaseInvalidDataException("Unknown Category: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal + * to `tax`. + */ + class Tax + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val date: JsonField, + private val identificationNumber: JsonField, + private val typeCode: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), + @JsonProperty("identification_number") + @ExcludeMissing + identificationNumber: JsonField = JsonMissing.of(), + @JsonProperty("type_code") + @ExcludeMissing + typeCode: JsonField = JsonMissing.of(), + ) : this(date, identificationNumber, typeCode, mutableMapOf()) + + /** + * The month and year the tax payment is for, in YYYY-MM-DD format. The day is ignored. + * + * @throws IncreaseInvalidDataException 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 date(): LocalDate = date.getRequired("date") + + /** + * The 9-digit Tax Identification Number (TIN) or Employer Identification Number (EIN). + * + * @throws IncreaseInvalidDataException 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 identificationNumber(): String = + identificationNumber.getRequired("identification_number") + + /** + * The 5-character tax type code. + * + * @throws IncreaseInvalidDataException 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 typeCode(): String = typeCode.getRequired("type_code") + + /** + * Returns the raw JSON value of [date]. + * + * Unlike [date], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date + + /** + * Returns the raw JSON value of [identificationNumber]. + * + * Unlike [identificationNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("identification_number") + @ExcludeMissing + fun _identificationNumber(): JsonField = identificationNumber + + /** + * Returns the raw JSON value of [typeCode]. + * + * Unlike [typeCode], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("type_code") @ExcludeMissing fun _typeCode(): JsonField = typeCode + + @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 [Tax]. + * + * The following fields are required: + * ```java + * .date() + * .identificationNumber() + * .typeCode() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Tax]. */ + class Builder internal constructor() { + + private var date: JsonField? = null + private var identificationNumber: JsonField? = null + private var typeCode: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(tax: Tax) = apply { + date = tax.date + identificationNumber = tax.identificationNumber + typeCode = tax.typeCode + additionalProperties = tax.additionalProperties.toMutableMap() + } + + /** + * The month and year the tax payment is for, in YYYY-MM-DD format. The day is + * ignored. + */ + fun date(date: LocalDate) = date(JsonField.of(date)) + + /** + * Sets [Builder.date] to an arbitrary JSON value. + * + * You should usually call [Builder.date] with a well-typed [LocalDate] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun date(date: JsonField) = apply { this.date = date } + + /** + * The 9-digit Tax Identification Number (TIN) or Employer Identification Number + * (EIN). + */ + fun identificationNumber(identificationNumber: String) = + identificationNumber(JsonField.of(identificationNumber)) + + /** + * Sets [Builder.identificationNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.identificationNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun identificationNumber(identificationNumber: JsonField) = apply { + this.identificationNumber = identificationNumber + } + + /** The 5-character tax type code. */ + fun typeCode(typeCode: String) = typeCode(JsonField.of(typeCode)) + + /** + * Sets [Builder.typeCode] to an arbitrary JSON value. + * + * You should usually call [Builder.typeCode] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun typeCode(typeCode: JsonField) = apply { this.typeCode = typeCode } + + 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 [Tax]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .date() + * .identificationNumber() + * .typeCode() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Tax = + Tax( + checkRequired("date", date), + checkRequired("identificationNumber", identificationNumber), + checkRequired("typeCode", typeCode), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Tax = apply { + if (validated) { + return@apply + } + + date() + identificationNumber() + typeCode() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (date.asKnown().isPresent) 1 else 0) + + (if (identificationNumber.asKnown().isPresent) 1 else 0) + + (if (typeCode.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Tax && + date == other.date && + identificationNumber == other.identificationNumber && + typeCode == other.typeCode && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(date, identificationNumber, typeCode, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Tax{date=$date, identificationNumber=$identificationNumber, typeCode=$typeCode, additionalProperties=$additionalProperties}" + } + + /** + * Unstructured remittance information. Required if `category` is equal to `unstructured`. + */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val message: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("message") + @ExcludeMissing + message: JsonField = JsonMissing.of() + ) : this(message, mutableMapOf()) + + /** + * The information. + * + * @throws IncreaseInvalidDataException 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 message(): String = message.getRequired("message") + + /** + * Returns the raw JSON value of [message]. + * + * Unlike [message], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("message") @ExcludeMissing fun _message(): JsonField = message + + @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 [Unstructured]. + * + * The following fields are required: + * ```java + * .message() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unstructured]. */ + class Builder internal constructor() { + + private var message: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + message = unstructured.message + additionalProperties = unstructured.additionalProperties.toMutableMap() + } + + /** The information. */ + fun message(message: String) = message(JsonField.of(message)) + + /** + * Sets [Builder.message] to an arbitrary JSON value. + * + * You should usually call [Builder.message] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun message(message: JsonField) = apply { this.message = message } + + 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) } - /** - * 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 IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .message() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("message", message), + additionalProperties.toMutableMap(), + ) + } + private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): Unstructured = apply { if (validated) { return@apply } - known() + message() validated = true } @@ -2052,97 +2587,258 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = (if (message.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Category && value == other.value + return other is Unstructured && + message == other.message && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(message, additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{message=$message, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Remittance && + category == other.category && + tax == other.tax && + unstructured == other.unstructured && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, tax, unstructured, additionalProperties) } + override fun hashCode(): Int = hashCode + + override fun toString() = + "Remittance{category=$category, tax=$tax, unstructured=$unstructured, additionalProperties=$additionalProperties}" + } + + /** + * The person or business whose funds are being transferred. This is only necessary if you're + * transferring from a commingled account. Otherwise, we'll use the associated entity's details. + */ + class Debtor + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val name: JsonField, + private val address: JsonField
, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), + @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + ) : this(name, address, mutableMapOf()) + /** - * Internal Revenue Service (IRS) tax repayment information. Required if `category` is equal - * to `tax`. + * The person or business's name. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - class Tax - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val date: JsonField, - private val identificationNumber: JsonField, - private val typeCode: JsonField, - private val additionalProperties: MutableMap, - ) { + fun name(): String = name.getRequired("name") - @JsonCreator - private constructor( - @JsonProperty("date") @ExcludeMissing date: JsonField = JsonMissing.of(), - @JsonProperty("identification_number") - @ExcludeMissing - identificationNumber: JsonField = JsonMissing.of(), - @JsonProperty("type_code") - @ExcludeMissing - typeCode: JsonField = JsonMissing.of(), - ) : this(date, identificationNumber, typeCode, mutableMapOf()) + /** + * The person or business's address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun address(): Optional
= address.getOptional("address") + + /** + * Returns the raw JSON value of [name]. + * + * Unlike [name], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("name") @ExcludeMissing fun _name(): JsonField = name + + /** + * Returns the raw JSON value of [address]. + * + * Unlike [address], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + + @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 { /** - * The month and year the tax payment is for, in YYYY-MM-DD format. The day is ignored. + * Returns a mutable builder for constructing an instance of [Debtor]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * The following fields are required: + * ```java + * .name() + * ``` */ - fun date(): LocalDate = date.getRequired("date") + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Debtor]. */ + class Builder internal constructor() { + + private var name: JsonField? = null + private var address: JsonField
= JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(debtor: Debtor) = apply { + name = debtor.name + address = debtor.address + additionalProperties = debtor.additionalProperties.toMutableMap() + } + + /** The person or business's name. */ + fun name(name: String) = name(JsonField.of(name)) /** - * The 9-digit Tax Identification Number (TIN) or Employer Identification Number (EIN). + * Sets [Builder.name] to an arbitrary JSON value. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * You should usually call [Builder.name] with a well-typed [String] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. */ - fun identificationNumber(): String = - identificationNumber.getRequired("identification_number") + fun name(name: JsonField) = apply { this.name = name } + + /** The person or business's address. */ + fun address(address: Address) = address(JsonField.of(address)) /** - * The 5-character tax type code. + * Sets [Builder.address] to an arbitrary JSON value. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * You should usually call [Builder.address] with a well-typed [Address] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. */ - fun typeCode(): String = typeCode.getRequired("type_code") + fun address(address: JsonField
) = apply { this.address = address } + + 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 the raw JSON value of [date]. + * Returns an immutable instance of [Debtor]. * - * Unlike [date], this method doesn't throw if the JSON field has an unexpected type. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .name() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JsonProperty("date") @ExcludeMissing fun _date(): JsonField = date + fun build(): Debtor = + Debtor(checkRequired("name", name), address, additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Debtor = apply { + if (validated) { + return@apply + } + + name() + address().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (name.asKnown().isPresent) 1 else 0) + + (address.asKnown().getOrNull()?.validity() ?: 0) + + /** The person or business's address. */ + class Address + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val unstructured: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("unstructured") + @ExcludeMissing + unstructured: JsonField = JsonMissing.of() + ) : this(unstructured, mutableMapOf()) /** - * Returns the raw JSON value of [identificationNumber]. + * Unstructured address lines. * - * Unlike [identificationNumber], this method doesn't throw if the JSON field has an - * unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @JsonProperty("identification_number") - @ExcludeMissing - fun _identificationNumber(): JsonField = identificationNumber + fun unstructured(): Unstructured = unstructured.getRequired("unstructured") /** - * Returns the raw JSON value of [typeCode]. + * Returns the raw JSON value of [unstructured]. * - * Unlike [typeCode], this method doesn't throw if the JSON field has an unexpected + * Unlike [unstructured], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("type_code") @ExcludeMissing fun _typeCode(): JsonField = typeCode + @JsonProperty("unstructured") + @ExcludeMissing + fun _unstructured(): JsonField = unstructured @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -2159,79 +2855,43 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [Tax]. + * Returns a mutable builder for constructing an instance of [Address]. * * The following fields are required: * ```java - * .date() - * .identificationNumber() - * .typeCode() + * .unstructured() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [Tax]. */ + /** A builder for [Address]. */ class Builder internal constructor() { - private var date: JsonField? = null - private var identificationNumber: JsonField? = null - private var typeCode: JsonField? = null + private var unstructured: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(tax: Tax) = apply { - date = tax.date - identificationNumber = tax.identificationNumber - typeCode = tax.typeCode - additionalProperties = tax.additionalProperties.toMutableMap() + internal fun from(address: Address) = apply { + unstructured = address.unstructured + additionalProperties = address.additionalProperties.toMutableMap() } - /** - * The month and year the tax payment is for, in YYYY-MM-DD format. The day is - * ignored. - */ - fun date(date: LocalDate) = date(JsonField.of(date)) - - /** - * Sets [Builder.date] to an arbitrary JSON value. - * - * You should usually call [Builder.date] with a well-typed [LocalDate] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun date(date: JsonField) = apply { this.date = date } - - /** - * The 9-digit Tax Identification Number (TIN) or Employer Identification Number - * (EIN). - */ - fun identificationNumber(identificationNumber: String) = - identificationNumber(JsonField.of(identificationNumber)) + /** Unstructured address lines. */ + fun unstructured(unstructured: Unstructured) = + unstructured(JsonField.of(unstructured)) /** - * Sets [Builder.identificationNumber] to an arbitrary JSON value. + * Sets [Builder.unstructured] to an arbitrary JSON value. * - * You should usually call [Builder.identificationNumber] with a well-typed [String] + * You should usually call [Builder.unstructured] with a well-typed [Unstructured] * value instead. This method is primarily for setting the field to an undocumented * or not yet supported value. */ - fun identificationNumber(identificationNumber: JsonField) = apply { - this.identificationNumber = identificationNumber + fun unstructured(unstructured: JsonField) = apply { + this.unstructured = unstructured } - /** The 5-character tax type code. */ - fun typeCode(typeCode: String) = typeCode(JsonField.of(typeCode)) - - /** - * Sets [Builder.typeCode] to an arbitrary JSON value. - * - * You should usually call [Builder.typeCode] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun typeCode(typeCode: JsonField) = apply { this.typeCode = typeCode } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -2255,38 +2915,32 @@ private constructor( } /** - * Returns an immutable instance of [Tax]. + * Returns an immutable instance of [Address]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .date() - * .identificationNumber() - * .typeCode() + * .unstructured() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): Tax = - Tax( - checkRequired("date", date), - checkRequired("identificationNumber", identificationNumber), - checkRequired("typeCode", typeCode), + fun build(): Address = + Address( + checkRequired("unstructured", unstructured), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): Tax = apply { + fun validate(): Address = apply { if (validated) { return@apply } - date() - identificationNumber() - typeCode() + unstructured().validate() validated = true } @@ -2305,199 +2959,271 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = - (if (date.asKnown().isPresent) 1 else 0) + - (if (identificationNumber.asKnown().isPresent) 1 else 0) + - (if (typeCode.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + internal fun validity(): Int = (unstructured.asKnown().getOrNull()?.validity() ?: 0) - return other is Tax && - date == other.date && - identificationNumber == other.identificationNumber && - typeCode == other.typeCode && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(date, identificationNumber, typeCode, additionalProperties) - } + /** Unstructured address lines. */ + class Unstructured + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val line1: JsonField, + private val line2: JsonField, + private val line3: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("line2") + @ExcludeMissing + line2: JsonField = JsonMissing.of(), + @JsonProperty("line3") + @ExcludeMissing + line3: JsonField = JsonMissing.of(), + ) : this(line1, line2, line3, mutableMapOf()) - override fun hashCode(): Int = hashCode + /** + * The address line 1. + * + * @throws IncreaseInvalidDataException 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 line1(): String = line1.getRequired("line1") - override fun toString() = - "Tax{date=$date, identificationNumber=$identificationNumber, typeCode=$typeCode, additionalProperties=$additionalProperties}" - } + /** + * The address line 2. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line2(): Optional = line2.getOptional("line2") - /** - * Unstructured remittance information. Required if `category` is equal to `unstructured`. - */ - class Unstructured - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val message: JsonField, - private val additionalProperties: MutableMap, - ) { + /** + * The address line 3. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun line3(): Optional = line3.getOptional("line3") - @JsonCreator - private constructor( - @JsonProperty("message") - @ExcludeMissing - message: JsonField = JsonMissing.of() - ) : this(message, mutableMapOf()) + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 - /** - * The message to the beneficiary. - * - * @throws IncreaseInvalidDataException 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 message(): String = message.getRequired("message") + /** + * Returns the raw JSON value of [line2]. + * + * Unlike [line2], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line2") @ExcludeMissing fun _line2(): JsonField = line2 - /** - * Returns the raw JSON value of [message]. - * - * Unlike [message], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("message") @ExcludeMissing fun _message(): JsonField = message + /** + * Returns the raw JSON value of [line3]. + * + * Unlike [line3], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line3") @ExcludeMissing fun _line3(): JsonField = line3 - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Unstructured]. + * + * The following fields are required: + * ```java + * .line1() + * ``` + */ + @JvmStatic fun builder() = Builder() + } - fun toBuilder() = Builder().from(this) + /** A builder for [Unstructured]. */ + class Builder internal constructor() { - companion object { + private var line1: JsonField? = null + private var line2: JsonField = JsonMissing.of() + private var line3: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Returns a mutable builder for constructing an instance of [Unstructured]. - * - * The following fields are required: - * ```java - * .message() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + @JvmSynthetic + internal fun from(unstructured: Unstructured) = apply { + line1 = unstructured.line1 + line2 = unstructured.line2 + line3 = unstructured.line3 + additionalProperties = unstructured.additionalProperties.toMutableMap() + } - /** A builder for [Unstructured]. */ - class Builder internal constructor() { + /** The address line 1. */ + fun line1(line1: String) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** The address line 2. */ + fun line2(line2: String) = line2(JsonField.of(line2)) + + /** + * Sets [Builder.line2] to an arbitrary JSON value. + * + * You should usually call [Builder.line2] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line2(line2: JsonField) = apply { this.line2 = line2 } + + /** The address line 3. */ + fun line3(line3: String) = line3(JsonField.of(line3)) + + /** + * Sets [Builder.line3] to an arbitrary JSON value. + * + * You should usually call [Builder.line3] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line3(line3: JsonField) = apply { this.line3 = line3 } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - private var message: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - @JvmSynthetic - internal fun from(unstructured: Unstructured) = apply { - message = unstructured.message - additionalProperties = unstructured.additionalProperties.toMutableMap() - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** The message to the beneficiary. */ - fun message(message: String) = message(JsonField.of(message)) + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** - * Sets [Builder.message] to an arbitrary JSON value. - * - * You should usually call [Builder.message] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun message(message: JsonField) = apply { this.message = message } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) + /** + * Returns an immutable instance of [Unstructured]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unstructured = + Unstructured( + checkRequired("line1", line1), + line2, + line3, + additionalProperties.toMutableMap(), + ) } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + private var validated: Boolean = false - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) + fun validate(): Unstructured = apply { + if (validated) { + return@apply } - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) + line1() + line2() + line3() + validated = true } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } /** - * Returns an immutable instance of [Unstructured]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .message() - * ``` + * Returns a score indicating how many valid values are contained in this object + * recursively. * - * @throws IllegalStateException if any required field is unset. + * Used for best match union deserialization. */ - fun build(): Unstructured = - Unstructured( - checkRequired("message", message), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false + @JvmSynthetic + internal fun validity(): Int = + (if (line1.asKnown().isPresent) 1 else 0) + + (if (line2.asKnown().isPresent) 1 else 0) + + (if (line3.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - fun validate(): Unstructured = apply { - if (validated) { - return@apply + return other is Unstructured && + line1 == other.line1 && + line2 == other.line2 && + line3 == other.line3 && + additionalProperties == other.additionalProperties } - message() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false + private val hashCode: Int by lazy { + Objects.hash(line1, line2, line3, additionalProperties) } - /** - * 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 (message.asKnown().isPresent) 1 else 0) + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unstructured{line1=$line1, line2=$line2, line3=$line3, additionalProperties=$additionalProperties}" + } override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Unstructured && - message == other.message && + return other is Address && + unstructured == other.unstructured && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(message, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(unstructured, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Unstructured{message=$message, additionalProperties=$additionalProperties}" + "Address{unstructured=$unstructured, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -2505,21 +3231,18 @@ private constructor( return true } - return other is Remittance && - category == other.category && - tax == other.tax && - unstructured == other.unstructured && + return other is Debtor && + name == other.name && + address == other.address && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash(category, tax, unstructured, additionalProperties) - } + private val hashCode: Int by lazy { Objects.hash(name, address, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Remittance{category=$category, tax=$tax, unstructured=$unstructured, additionalProperties=$additionalProperties}" + "Debtor{name=$name, address=$address, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt index 6e16a8322..e87e60e83 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferCreateParamsTest.kt @@ -13,17 +13,22 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -41,6 +46,25 @@ internal class WireTransferCreateParamsTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") @@ -53,17 +77,22 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -81,6 +110,25 @@ internal class WireTransferCreateParamsTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") @@ -90,19 +138,25 @@ internal class WireTransferCreateParamsTest { assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(body.amount()).isEqualTo(100L) - assertThat(body.beneficiaryName()).isEqualTo("Ian Crease") - assertThat(body.accountNumber()).contains("987654321") - assertThat(body.beneficiaryAddressLine1()).contains("33 Liberty Street") - assertThat(body.beneficiaryAddressLine2()).contains("New York") - assertThat(body.beneficiaryAddressLine3()).contains("NY 10045") - assertThat(body.externalAccountId()).contains("external_account_id") - assertThat(body.inboundWireDrawdownRequestId()).contains("inbound_wire_drawdown_request_id") - assertThat(body.originatorAddressLine1()).contains("x") - assertThat(body.originatorAddressLine2()).contains("x") - assertThat(body.originatorAddressLine3()).contains("x") - assertThat(body.originatorName()).contains("x") + assertThat(body.creditor()) + .isEqualTo( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) assertThat(body.remittance()) - .contains( + .isEqualTo( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) .tax( @@ -119,6 +173,26 @@ internal class WireTransferCreateParamsTest { ) .build() ) + assertThat(body.accountNumber()).contains("987654321") + assertThat(body.debtor()) + .contains( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured.builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + assertThat(body.externalAccountId()).contains("external_account_id") + assertThat(body.inboundWireDrawdownRequestId()).contains("inbound_wire_drawdown_request_id") assertThat(body.requireApproval()).contains(true) assertThat(body.routingNumber()).contains("101050001") assertThat(body.sourceAccountNumberId()).contains("source_account_number_id") @@ -130,13 +204,25 @@ internal class WireTransferCreateParamsTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") + .creditor(WireTransferCreateParams.Creditor.builder().name("Ian Crease").build()) + .remittance( + WireTransferCreateParams.Remittance.builder() + .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) + .build() + ) .build() val body = params._body() assertThat(body.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(body.amount()).isEqualTo(100L) - assertThat(body.beneficiaryName()).isEqualTo("Ian Crease") + assertThat(body.creditor()) + .isEqualTo(WireTransferCreateParams.Creditor.builder().name("Ian Crease").build()) + assertThat(body.remittance()) + .isEqualTo( + WireTransferCreateParams.Remittance.builder() + .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) + .build() + ) } } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt index 6cc652adf..25e92a0da 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferListPageResponseTest.kt @@ -27,10 +27,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -58,16 +54,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -81,7 +104,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -133,10 +156,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -164,16 +183,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -187,7 +233,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -243,10 +289,6 @@ internal class WireTransferListPageResponseTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -274,16 +316,43 @@ internal class WireTransferListPageResponseTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -297,7 +366,7 @@ internal class WireTransferListPageResponseTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt index 22002a893..50f0f31bb 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/wiretransfers/WireTransferTest.kt @@ -25,10 +25,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -52,16 +48,43 @@ internal class WireTransferTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -75,7 +98,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -122,10 +145,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - assertThat(wireTransfer.beneficiaryAddressLine1()).isEmpty - assertThat(wireTransfer.beneficiaryAddressLine2()).isEmpty - assertThat(wireTransfer.beneficiaryAddressLine3()).isEmpty - assertThat(wireTransfer.beneficiaryName()).isEmpty assertThat(wireTransfer.cancellation()) .contains( WireTransfer.Cancellation.builder() @@ -147,17 +166,46 @@ internal class WireTransferTest { .user(WireTransfer.CreatedBy.User.builder().email("user@example.com").build()) .build() ) + assertThat(wireTransfer.creditor()) + .contains( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) assertThat(wireTransfer.currency()).isEqualTo(WireTransfer.Currency.USD) + assertThat(wireTransfer.debtor()) + .contains( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) assertThat(wireTransfer.externalAccountId()) .contains("external_account_ukk55lr923a3ac0pp7iv") assertThat(wireTransfer.idempotencyKey()).isEmpty assertThat(wireTransfer.inboundWireDrawdownRequestId()).isEmpty - assertThat(wireTransfer.messageToRecipient()).isEqualTo("Message to recipient") assertThat(wireTransfer.network()).isEqualTo(WireTransfer.Network.WIRE) - assertThat(wireTransfer.originatorAddressLine1()).isEmpty - assertThat(wireTransfer.originatorAddressLine2()).isEmpty - assertThat(wireTransfer.originatorAddressLine3()).isEmpty - assertThat(wireTransfer.originatorName()).isEmpty assertThat(wireTransfer.pendingTransactionId()).isEmpty assertThat(wireTransfer.remittance()) .contains( @@ -172,7 +220,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() @@ -225,10 +273,6 @@ internal class WireTransferTest { .approvedBy(null) .build() ) - .beneficiaryAddressLine1(null) - .beneficiaryAddressLine2(null) - .beneficiaryAddressLine3(null) - .beneficiaryName(null) .cancellation( WireTransfer.Cancellation.builder() .canceledAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) @@ -252,16 +296,43 @@ internal class WireTransferTest { ) .build() ) + .creditor( + WireTransfer.Creditor.builder() + .address( + WireTransfer.Creditor.Address.builder() + .unstructured( + WireTransfer.Creditor.Address.Unstructured.builder() + .line1("33 Liberty Street") + .line2(null) + .line3(null) + .build() + ) + .build() + ) + .name("National Phonograph Company") + .build() + ) .currency(WireTransfer.Currency.USD) + .debtor( + WireTransfer.Debtor.builder() + .address( + WireTransfer.Debtor.Address.builder() + .unstructured( + WireTransfer.Debtor.Address.Unstructured.builder() + .line1("line1") + .line2("line2") + .line3("line3") + .build() + ) + .build() + ) + .name("name") + .build() + ) .externalAccountId("external_account_ukk55lr923a3ac0pp7iv") .idempotencyKey(null) .inboundWireDrawdownRequestId(null) - .messageToRecipient("Message to recipient") .network(WireTransfer.Network.WIRE) - .originatorAddressLine1(null) - .originatorAddressLine2(null) - .originatorAddressLine3(null) - .originatorName(null) .pendingTransactionId(null) .remittance( WireTransfer.Remittance.builder() @@ -275,7 +346,7 @@ internal class WireTransferTest { ) .unstructured( WireTransfer.Remittance.Unstructured.builder() - .message("Payment for invoice 12345") + .message("Invoice 29582") .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt index 62061e437..29516b117 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/WireTransferServiceAsyncTest.kt @@ -26,17 +26,23 @@ internal class WireTransferServiceAsyncTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured + .builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -54,6 +60,26 @@ internal class WireTransferServiceAsyncTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured + .builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt index 5537e5dce..1b446956d 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/WireTransferServiceTest.kt @@ -26,17 +26,23 @@ internal class WireTransferServiceTest { WireTransferCreateParams.builder() .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .beneficiaryName("Ian Crease") - .accountNumber("987654321") - .beneficiaryAddressLine1("33 Liberty Street") - .beneficiaryAddressLine2("New York") - .beneficiaryAddressLine3("NY 10045") - .externalAccountId("external_account_id") - .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") - .originatorAddressLine1("x") - .originatorAddressLine2("x") - .originatorAddressLine3("x") - .originatorName("x") + .creditor( + WireTransferCreateParams.Creditor.builder() + .name("Ian Crease") + .address( + WireTransferCreateParams.Creditor.Address.builder() + .unstructured( + WireTransferCreateParams.Creditor.Address.Unstructured + .builder() + .line1("33 Liberty Street") + .line2("New York") + .line3("NY 10045") + .build() + ) + .build() + ) + .build() + ) .remittance( WireTransferCreateParams.Remittance.builder() .category(WireTransferCreateParams.Remittance.Category.UNSTRUCTURED) @@ -54,6 +60,26 @@ internal class WireTransferServiceTest { ) .build() ) + .accountNumber("987654321") + .debtor( + WireTransferCreateParams.Debtor.builder() + .name("x") + .address( + WireTransferCreateParams.Debtor.Address.builder() + .unstructured( + WireTransferCreateParams.Debtor.Address.Unstructured + .builder() + .line1("x") + .line2("x") + .line3("x") + .build() + ) + .build() + ) + .build() + ) + .externalAccountId("external_account_id") + .inboundWireDrawdownRequestId("inbound_wire_drawdown_request_id") .requireApproval(true) .routingNumber("101050001") .sourceAccountNumberId("source_account_number_id") From d0e687c0f89f2a26f0a93a706ed365a906a1bfb9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 18:05:04 +0000 Subject: [PATCH 27/33] feat(api): api update --- .stats.yml | 6 +- .../api/models/carddisputes/CardDispute.kt | 373 +----------------- .../pendingtransactions/PendingTransaction.kt | 157 +++++++- .../CardDisputeListPageResponseTest.kt | 42 +- .../models/carddisputes/CardDisputeTest.kt | 42 +- .../PendingTransactionListPageResponseTest.kt | 18 +- .../PendingTransactionTest.kt | 18 +- .../CardAuthorizationCreateResponseTest.kt | 18 +- 8 files changed, 227 insertions(+), 447 deletions(-) diff --git a/.stats.yml b/.stats.yml index 9256ec13b..7f33565d1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-7689739a12916f3e4cc15be2e057e78b4ede38202bf4cf5f9358ef10374db9b3.yml -openapi_spec_hash: 39b4a0d5d1441d03ed9de368335d78ec -config_hash: fc8a0ae068f2feeac76f728ac6838543 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fd1e9a0d66098ce0c20cb6c15bbb8c26a8662d52730907deb4a179aebd6b89d6.yml +openapi_spec_hash: 2139b75a9f653c413775fb96f70ba794 +config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index c35dc472b..82eaf4cfd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -6461,8 +6461,7 @@ private constructor( private val cardholderNoLongerDisputes: JsonField, private val creditOrReversalProcessed: JsonField, private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField, + private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue, private val nonFiatCurrencyOrNonFungibleTokenReceived: JsonField, private val proofOfCashDisbursement: JsonField, @@ -6486,9 +6485,7 @@ private constructor( invalidDispute: JsonField = JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField = - JsonMissing.of(), + nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue = JsonMissing.of(), @JsonProperty("non_fiat_currency_or_non_fungible_token_received") @ExcludeMissing nonFiatCurrencyOrNonFungibleTokenReceived: @@ -6547,15 +6544,11 @@ private constructor( /** * Non-fiat currency or non-fungible token as described details. Present if and only * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed(): - Optional = - nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOptional( - "non_fiat_currency_or_non_fungible_token_as_described" - ) + @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): JsonValue = + nonFiatCurrencyOrNonFungibleTokenAsDescribed /** * Non-fiat currency or non-fungible token received details. Present if and only if @@ -6631,18 +6624,6 @@ private constructor( @ExcludeMissing fun _invalidDispute(): JsonField = invalidDispute - /** - * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenAsDescribed]. - * - * Unlike [nonFiatCurrencyOrNonFungibleTokenAsDescribed], this method doesn't throw - * if the JSON field has an unexpected type. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): - JsonField = - nonFiatCurrencyOrNonFungibleTokenAsDescribed - /** * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. * @@ -6724,9 +6705,7 @@ private constructor( private var creditOrReversalProcessed: JsonField? = null private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField? = - null + private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue? = null private var nonFiatCurrencyOrNonFungibleTokenReceived: JsonField? = null @@ -6835,38 +6814,7 @@ private constructor( * only if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. */ fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - NonFiatCurrencyOrNonFungibleTokenAsDescribed? - ) = - nonFiatCurrencyOrNonFungibleTokenAsDescribed( - JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenAsDescribed) - ) - - /** - * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with - * `nonFiatCurrencyOrNonFungibleTokenAsDescribed.orElse(null)`. - */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - Optional - ) = - nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOrNull() - ) - - /** - * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] to an arbitrary - * JSON value. - * - * You should usually call - * [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with a well-typed - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - JsonField + nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue ) = apply { this.nonFiatCurrencyOrNonFungibleTokenAsDescribed = nonFiatCurrencyOrNonFungibleTokenAsDescribed @@ -7047,7 +6995,6 @@ private constructor( cardholderNoLongerDisputes().ifPresent { it.validate() } creditOrReversalProcessed().ifPresent { it.validate() } invalidDispute().ifPresent { it.validate() } - nonFiatCurrencyOrNonFungibleTokenAsDescribed().ifPresent { it.validate() } nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } proofOfCashDisbursement().ifPresent { it.validate() } reason().validate() @@ -7074,10 +7021,6 @@ private constructor( (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + - (nonFiatCurrencyOrNonFungibleTokenAsDescribed - .asKnown() - .getOrNull() - ?.validity() ?: 0) + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() ?: 0) + (proofOfCashDisbursement.asKnown().getOrNull()?.validity() ?: 0) + @@ -8419,132 +8362,6 @@ private constructor( "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" } - /** - * Non-fiat currency or non-fungible token as described details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - */ - class NonFiatCurrencyOrNonFungibleTokenAsDescribed - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val additionalProperties: MutableMap - ) { - - @JsonCreator private constructor() : this(mutableMapOf()) - - @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 - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: - NonFiatCurrencyOrNonFungibleTokenAsDescribed - ) = apply { - additionalProperties = - nonFiatCurrencyOrNonFungibleTokenAsDescribed.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 - * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = - NonFiatCurrencyOrNonFungibleTokenAsDescribed( - additionalProperties.toMutableMap() - ) - } - - private var validated: Boolean = false - - fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 = 0 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is NonFiatCurrencyOrNonFungibleTokenAsDescribed && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" - } - /** * Non-fiat currency or non-fungible token received details. Present if and only if * `reason` is `non_fiat_currency_or_non_fungible_token_received`. @@ -10850,7 +10667,7 @@ private constructor( JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonField, + private val consumerNonReceiptOfCash: JsonValue, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -10915,8 +10732,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonField = - JsonMissing.of(), + consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -11095,12 +10911,10 @@ private constructor( /** * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). */ - fun consumerNonReceiptOfCash(): Optional = - consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` @@ -11307,17 +11121,6 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived - /** - * Returns the raw JSON value of [consumerNonReceiptOfCash]. - * - * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonField = - consumerNonReceiptOfCash - /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -11477,8 +11280,7 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField? = null - private var consumerNonReceiptOfCash: JsonField? = - null + private var consumerNonReceiptOfCash: JsonValue? = null private var consumerOriginalCreditTransactionNotAccepted: JsonField? = null @@ -11877,28 +11679,9 @@ private constructor( * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: ConsumerNonReceiptOfCash? - ) = consumerNonReceiptOfCash(JsonField.ofNullable(consumerNonReceiptOfCash)) - - /** - * Alias for calling [Builder.consumerNonReceiptOfCash] with - * `consumerNonReceiptOfCash.orElse(null)`. - */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: Optional - ) = consumerNonReceiptOfCash(consumerNonReceiptOfCash.getOrNull()) - - /** - * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. - * - * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed - * [ConsumerNonReceiptOfCash] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun consumerNonReceiptOfCash( - consumerNonReceiptOfCash: JsonField - ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { + this.consumerNonReceiptOfCash = consumerNonReceiptOfCash + } /** * Original Credit Transaction (OCT) not accepted. Present if and only if @@ -12267,7 +12050,6 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } - consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -12309,7 +12091,6 @@ private constructor( ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + - (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted .asKnown() .getOrNull() @@ -27145,126 +26926,6 @@ private constructor( "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantCancellation=$merchantCancellation, merchantResolutionAttempted=$merchantResolutionAttempted, noCancellation=$noCancellation, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, additionalProperties=$additionalProperties}" } - /** - * Non-receipt of cash. Present if and only if `category` is - * `consumer_non_receipt_of_cash`. - */ - class ConsumerNonReceiptOfCash - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val additionalProperties: MutableMap - ) { - - @JsonCreator private constructor() : this(mutableMapOf()) - - @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 - * [ConsumerNonReceiptOfCash]. - */ - @JvmStatic fun builder() = Builder() - } - - /** A builder for [ConsumerNonReceiptOfCash]. */ - class Builder internal constructor() { - - private var additionalProperties: MutableMap = - mutableMapOf() - - @JvmSynthetic - internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = - apply { - additionalProperties = - consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. - * - * Further updates to this [Builder] will not mutate the returned instance. - */ - fun build(): ConsumerNonReceiptOfCash = - ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) - } - - private var validated: Boolean = false - - fun validate(): ConsumerNonReceiptOfCash = apply { - if (validated) { - return@apply - } - - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 = 0 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is ConsumerNonReceiptOfCash && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" - } - /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` * is `consumer_original_credit_transaction_not_accepted`. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index a35be6e13..e497b473e 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -12,6 +12,7 @@ import com.increase.api.core.JsonField import com.increase.api.core.JsonMissing import com.increase.api.core.JsonValue import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable import com.increase.api.errors.IncreaseInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -1164,7 +1165,7 @@ private constructor( private val realTimePaymentsTransferInstruction: JsonField, private val swiftTransferInstruction: JsonField, - private val userInitiatedHold: JsonValue, + private val userInitiatedHold: JsonField, private val wireTransferInstruction: JsonField, private val additionalProperties: MutableMap, ) { @@ -1211,7 +1212,7 @@ private constructor( swiftTransferInstruction: JsonField = JsonMissing.of(), @JsonProperty("user_initiated_hold") @ExcludeMissing - userInitiatedHold: JsonValue = JsonMissing.of(), + userInitiatedHold: JsonField = JsonMissing.of(), @JsonProperty("wire_transfer_instruction") @ExcludeMissing wireTransferInstruction: JsonField = JsonMissing.of(), @@ -1370,10 +1371,12 @@ private constructor( * An User Initiated Hold object. This field will be present in the JSON response if and * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a * hold on funds in their account. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("user_initiated_hold") - @ExcludeMissing - fun _userInitiatedHold(): JsonValue = userInitiatedHold + fun userInitiatedHold(): Optional = + userInitiatedHold.getOptional("user_initiated_hold") /** * A Wire Transfer Instruction object. This field will be present in the JSON response if @@ -1509,6 +1512,16 @@ private constructor( fun _swiftTransferInstruction(): JsonField = swiftTransferInstruction + /** + * Returns the raw JSON value of [userInitiatedHold]. + * + * Unlike [userInitiatedHold], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("user_initiated_hold") + @ExcludeMissing + fun _userInitiatedHold(): JsonField = userInitiatedHold + /** * Returns the raw JSON value of [wireTransferInstruction]. * @@ -1576,7 +1589,7 @@ private constructor( JsonField? = null private var swiftTransferInstruction: JsonField? = null - private var userInitiatedHold: JsonValue? = null + private var userInitiatedHold: JsonField? = null private var wireTransferInstruction: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1924,7 +1937,23 @@ private constructor( * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a * hold on funds in their account. */ - fun userInitiatedHold(userInitiatedHold: JsonValue) = apply { + fun userInitiatedHold(userInitiatedHold: UserInitiatedHold?) = + userInitiatedHold(JsonField.ofNullable(userInitiatedHold)) + + /** + * Alias for calling [Builder.userInitiatedHold] with `userInitiatedHold.orElse(null)`. + */ + fun userInitiatedHold(userInitiatedHold: Optional) = + userInitiatedHold(userInitiatedHold.getOrNull()) + + /** + * Sets [Builder.userInitiatedHold] to an arbitrary JSON value. + * + * You should usually call [Builder.userInitiatedHold] with a well-typed + * [UserInitiatedHold] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun userInitiatedHold(userInitiatedHold: JsonField) = apply { this.userInitiatedHold = userInitiatedHold } @@ -2042,6 +2071,7 @@ private constructor( inboundWireTransferReversal().ifPresent { it.validate() } realTimePaymentsTransferInstruction().ifPresent { it.validate() } swiftTransferInstruction().ifPresent { it.validate() } + userInitiatedHold().ifPresent { it.validate() } wireTransferInstruction().ifPresent { it.validate() } validated = true } @@ -2074,6 +2104,7 @@ private constructor( (inboundWireTransferReversal.asKnown().getOrNull()?.validity() ?: 0) + (realTimePaymentsTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (swiftTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + + (userInitiatedHold.asKnown().getOrNull()?.validity() ?: 0) + (wireTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) /** @@ -14561,6 +14592,118 @@ private constructor( "SwiftTransferInstruction{transferId=$transferId, additionalProperties=$additionalProperties}" } + /** + * An User Initiated Hold object. This field will be present in the JSON response if and + * only if `category` is equal to `user_initiated_hold`. Created when a user initiates a + * hold on funds in their account. + */ + class UserInitiatedHold + @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 [UserInitiatedHold]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserInitiatedHold]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userInitiatedHold: UserInitiatedHold) = apply { + additionalProperties = userInitiatedHold.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 [UserInitiatedHold]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): UserInitiatedHold = + UserInitiatedHold(additionalProperties.toImmutable()) + } + + private var validated: Boolean = false + + fun validate(): UserInitiatedHold = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 UserInitiatedHold && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UserInitiatedHold{additionalProperties=$additionalProperties}" + } + /** * A Wire Transfer Instruction object. This field will be present in the JSON response if * and only if `category` is equal to `wire_transfer_instruction`. diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index 72ac6295e..a83b17476 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -206,12 +206,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -885,12 +880,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1507,12 +1497,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2132,12 +2117,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2732,12 +2712,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -3411,12 +3386,7 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index 560738723..9c1e82b54 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -198,12 +198,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -761,12 +756,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1300,12 +1290,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -1841,12 +1826,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2384,12 +2364,7 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed( - CardDispute.Visa.NetworkEvent.Represented - .NonFiatCurrencyOrNonFungibleTokenAsDescribed - .builder() - .build() - ) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2947,12 +2922,7 @@ internal class CardDisputeTest { ) .build() ) - .consumerNonReceiptOfCash( - CardDispute.Visa.UserSubmission.Chargeback - .ConsumerNonReceiptOfCash - .builder() - .build() - ) + .consumerNonReceiptOfCash(null) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index c18006a5d..bb81c0a49 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -357,7 +357,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -704,7 +708,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -1070,7 +1078,11 @@ internal class PendingTransactionListPageResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index b9d11dde6..5af2fc0f0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -321,7 +321,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -635,7 +639,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -962,7 +970,11 @@ internal class PendingTransactionTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index c328653b0..38526ad81 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -707,7 +707,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -1396,7 +1400,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") @@ -2113,7 +2121,11 @@ internal class CardAuthorizationCreateResponseTest { .transferId("swift_transfer_29h21xkng03788zwd3fh") .build() ) - .userInitiatedHold(JsonValue.from(mapOf())) + .userInitiatedHold( + PendingTransaction.Source.UserInitiatedHold.builder() + .putAdditionalProperty("foo", JsonValue.from("bar")) + .build() + ) .wireTransferInstruction( PendingTransaction.Source.WireTransferInstruction.builder() .accountNumber("987654321") From 945eed1c35b0d13b9f75b3a7830d0ead3f366db0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 20:09:03 +0000 Subject: [PATCH 28/33] feat(api): api update --- .stats.yml | 4 +- .../CheckTransferCreateParams.kt | 246 +++++++++++++++++- .../CheckTransferCreateParamsTest.kt | 3 + .../async/CheckTransferServiceAsyncTest.kt | 1 + .../blocking/CheckTransferServiceTest.kt | 1 + 5 files changed, 251 insertions(+), 4 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7f33565d1..1c0a751d8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fd1e9a0d66098ce0c20cb6c15bbb8c26a8662d52730907deb4a179aebd6b89d6.yml -openapi_spec_hash: 2139b75a9f653c413775fb96f70ba794 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-29da995f8b04baed0eb2b6b038bc14f3165a3e1eae15b7a1136cce323d132bfd.yml +openapi_spec_hash: ff369b84b7477f46c3f3e3edeecaf176 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt index 78eaefde9..08fb93e89 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt @@ -63,6 +63,15 @@ private constructor( */ fun sourceAccountNumberId(): String = body.sourceAccountNumberId() + /** + * How the account's available balance should be checked. Please contact + * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun balanceCheck(): Optional = body.balanceCheck() + /** * The check number Increase should use for the check. This should not contain leading zeroes * and must be unique across the `source_account_number`. If this is omitted, Increase will @@ -131,6 +140,13 @@ private constructor( */ fun _sourceAccountNumberId(): JsonField = body._sourceAccountNumberId() + /** + * Returns the raw JSON value of [balanceCheck]. + * + * Unlike [balanceCheck], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _balanceCheck(): JsonField = body._balanceCheck() + /** * Returns the raw JSON value of [checkNumber]. * @@ -208,7 +224,7 @@ private constructor( * - [amount] * - [fulfillmentMethod] * - [sourceAccountNumberId] - * - [checkNumber] + * - [balanceCheck] * - etc. */ fun body(body: Body) = apply { this.body = body.toBuilder() } @@ -271,6 +287,23 @@ private constructor( body.sourceAccountNumberId(sourceAccountNumberId) } + /** + * How the account's available balance should be checked. Please contact + * [support@increase.com](mailto:support@increase.com) to enable this parameter. + */ + fun balanceCheck(balanceCheck: BalanceCheck) = apply { body.balanceCheck(balanceCheck) } + + /** + * Sets [Builder.balanceCheck] to an arbitrary JSON value. + * + * You should usually call [Builder.balanceCheck] with a well-typed [BalanceCheck] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun balanceCheck(balanceCheck: JsonField) = apply { + body.balanceCheck(balanceCheck) + } + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -492,6 +525,7 @@ private constructor( private val amount: JsonField, private val fulfillmentMethod: JsonField, private val sourceAccountNumberId: JsonField, + private val balanceCheck: JsonField, private val checkNumber: JsonField, private val physicalCheck: JsonField, private val requireApproval: JsonField, @@ -511,6 +545,9 @@ private constructor( @JsonProperty("source_account_number_id") @ExcludeMissing sourceAccountNumberId: JsonField = JsonMissing.of(), + @JsonProperty("balance_check") + @ExcludeMissing + balanceCheck: JsonField = JsonMissing.of(), @JsonProperty("check_number") @ExcludeMissing checkNumber: JsonField = JsonMissing.of(), @@ -528,6 +565,7 @@ private constructor( amount, fulfillmentMethod, sourceAccountNumberId, + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -570,6 +608,15 @@ private constructor( fun sourceAccountNumberId(): String = sourceAccountNumberId.getRequired("source_account_number_id") + /** + * How the account's available balance should be checked. Please contact + * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun balanceCheck(): Optional = balanceCheck.getOptional("balance_check") + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -642,6 +689,16 @@ private constructor( @ExcludeMissing fun _sourceAccountNumberId(): JsonField = sourceAccountNumberId + /** + * Returns the raw JSON value of [balanceCheck]. + * + * Unlike [balanceCheck], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("balance_check") + @ExcludeMissing + fun _balanceCheck(): JsonField = balanceCheck + /** * Returns the raw JSON value of [checkNumber]. * @@ -715,6 +772,7 @@ private constructor( private var amount: JsonField? = null private var fulfillmentMethod: JsonField? = null private var sourceAccountNumberId: JsonField? = null + private var balanceCheck: JsonField = JsonMissing.of() private var checkNumber: JsonField = JsonMissing.of() private var physicalCheck: JsonField = JsonMissing.of() private var requireApproval: JsonField = JsonMissing.of() @@ -727,6 +785,7 @@ private constructor( amount = body.amount fulfillmentMethod = body.fulfillmentMethod sourceAccountNumberId = body.sourceAccountNumberId + balanceCheck = body.balanceCheck checkNumber = body.checkNumber physicalCheck = body.physicalCheck requireApproval = body.requireApproval @@ -791,6 +850,23 @@ private constructor( this.sourceAccountNumberId = sourceAccountNumberId } + /** + * How the account's available balance should be checked. Please contact + * [support@increase.com](mailto:support@increase.com) to enable this parameter. + */ + fun balanceCheck(balanceCheck: BalanceCheck) = balanceCheck(JsonField.of(balanceCheck)) + + /** + * Sets [Builder.balanceCheck] to an arbitrary JSON value. + * + * You should usually call [Builder.balanceCheck] with a well-typed [BalanceCheck] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun balanceCheck(balanceCheck: JsonField) = apply { + this.balanceCheck = balanceCheck + } + /** * The check number Increase should use for the check. This should not contain leading * zeroes and must be unique across the `source_account_number`. If this is omitted, @@ -901,6 +977,7 @@ private constructor( checkRequired("amount", amount), checkRequired("fulfillmentMethod", fulfillmentMethod), checkRequired("sourceAccountNumberId", sourceAccountNumberId), + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -920,6 +997,7 @@ private constructor( amount() fulfillmentMethod().validate() sourceAccountNumberId() + balanceCheck().ifPresent { it.validate() } checkNumber() physicalCheck().ifPresent { it.validate() } requireApproval() @@ -947,6 +1025,7 @@ private constructor( (if (amount.asKnown().isPresent) 1 else 0) + (fulfillmentMethod.asKnown().getOrNull()?.validity() ?: 0) + (if (sourceAccountNumberId.asKnown().isPresent) 1 else 0) + + (balanceCheck.asKnown().getOrNull()?.validity() ?: 0) + (if (checkNumber.asKnown().isPresent) 1 else 0) + (physicalCheck.asKnown().getOrNull()?.validity() ?: 0) + (if (requireApproval.asKnown().isPresent) 1 else 0) + @@ -962,6 +1041,7 @@ private constructor( amount == other.amount && fulfillmentMethod == other.fulfillmentMethod && sourceAccountNumberId == other.sourceAccountNumberId && + balanceCheck == other.balanceCheck && checkNumber == other.checkNumber && physicalCheck == other.physicalCheck && requireApproval == other.requireApproval && @@ -975,6 +1055,7 @@ private constructor( amount, fulfillmentMethod, sourceAccountNumberId, + balanceCheck, checkNumber, physicalCheck, requireApproval, @@ -986,7 +1067,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Body{accountId=$accountId, amount=$amount, fulfillmentMethod=$fulfillmentMethod, sourceAccountNumberId=$sourceAccountNumberId, checkNumber=$checkNumber, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}" + "Body{accountId=$accountId, amount=$amount, fulfillmentMethod=$fulfillmentMethod, sourceAccountNumberId=$sourceAccountNumberId, balanceCheck=$balanceCheck, checkNumber=$checkNumber, physicalCheck=$physicalCheck, requireApproval=$requireApproval, thirdParty=$thirdParty, additionalProperties=$additionalProperties}" } /** Whether Increase will print and mail the check or if you will do it yourself. */ @@ -1136,6 +1217,167 @@ private constructor( override fun toString() = value.toString() } + /** + * How the account's available balance should be checked. Please contact + * [support@increase.com](mailto:support@increase.com) to enable this parameter. + */ + class BalanceCheck @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 { + + /** + * The available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. + */ + @JvmField val FULL = of("full") + + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + @JvmField val NONE = of("none") + + @JvmStatic fun of(value: String) = BalanceCheck(JsonField.of(value)) + } + + /** An enum containing [BalanceCheck]'s known values. */ + enum class Known { + /** + * The available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. + */ + FULL, + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + NONE, + } + + /** + * An enum containing [BalanceCheck]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [BalanceCheck] 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 { + /** + * The available balance of the account must be at least the amount of the check, and a + * Pending Transaction will be created for the full amount. + */ + FULL, + /** + * No balance check will performed when the check transfer is initiated. A zero-dollar + * Pending Transaction will be created. The balance will still be checked when the + * Inbound Check Deposit is created. + */ + NONE, + /** + * An enum member indicating that [BalanceCheck] 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) { + FULL -> Value.FULL + NONE -> Value.NONE + 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 IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + FULL -> Known.FULL + NONE -> Known.NONE + else -> throw IncreaseInvalidDataException("Unknown BalanceCheck: $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 IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): BalanceCheck = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 BalanceCheck && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + /** * Details relating to the physical check that Increase will print and mail. This is required if * `fulfillment_method` is equal to `physical_check`. It must not be included if any other diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt index f523fc6de..18a5ec6e4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParamsTest.kt @@ -14,6 +14,7 @@ internal class CheckTransferCreateParamsTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() @@ -64,6 +65,7 @@ internal class CheckTransferCreateParamsTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() @@ -114,6 +116,7 @@ internal class CheckTransferCreateParamsTest { assertThat(body.fulfillmentMethod()) .isEqualTo(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) assertThat(body.sourceAccountNumberId()).isEqualTo("account_number_v18nkfqm6afpsrvy82b2") + assertThat(body.balanceCheck()).contains(CheckTransferCreateParams.BalanceCheck.FULL) assertThat(body.checkNumber()).contains("x") assertThat(body.physicalCheck()) .contains( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt index ced340bea..6f02ccc1c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CheckTransferServiceAsyncTest.kt @@ -28,6 +28,7 @@ internal class CheckTransferServiceAsyncTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt index 7532b7cbb..9842dafb7 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CheckTransferServiceTest.kt @@ -28,6 +28,7 @@ internal class CheckTransferServiceTest { .amount(1000L) .fulfillmentMethod(CheckTransferCreateParams.FulfillmentMethod.PHYSICAL_CHECK) .sourceAccountNumberId("account_number_v18nkfqm6afpsrvy82b2") + .balanceCheck(CheckTransferCreateParams.BalanceCheck.FULL) .checkNumber("x") .physicalCheck( CheckTransferCreateParams.PhysicalCheck.builder() From 3b68ad78944655bafdafdf3c0323652e11576841 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 04:50:34 +0000 Subject: [PATCH 29/33] feat(api): api update --- .stats.yml | 4 +-- .../models/checktransfers/CheckTransfer.kt | 9 ++++-- .../CheckTransferCreateParams.kt | 29 ++++++++++--------- 3 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1c0a751d8..8014bc2c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-29da995f8b04baed0eb2b6b038bc14f3165a3e1eae15b7a1136cce323d132bfd.yml -openapi_spec_hash: ff369b84b7477f46c3f3e3edeecaf176 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-3d5a35f67916cc1c9e9e4df38edbf72b926effa0faf60ea5cb7047a4a2d7f3c7.yml +openapi_spec_hash: 33c55e463f9bf747f502bdb38d5e2622 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt index f0b144f87..9a1e2680a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransfer.kt @@ -1463,7 +1463,8 @@ private constructor( /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ @JvmField val FULL = of("full") @@ -1481,7 +1482,8 @@ private constructor( enum class Known { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** @@ -1504,7 +1506,8 @@ private constructor( enum class Value { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt index 08fb93e89..52bf09fa0 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checktransfers/CheckTransferCreateParams.kt @@ -64,8 +64,8 @@ private constructor( fun sourceAccountNumberId(): String = body.sourceAccountNumberId() /** - * How the account's available balance should be checked. Please contact - * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * How the account's available balance should be checked. If omitted, the default behavior is + * `balance_check: full`. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the * server responded with an unexpected value). @@ -288,8 +288,8 @@ private constructor( } /** - * How the account's available balance should be checked. Please contact - * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * How the account's available balance should be checked. If omitted, the default behavior + * is `balance_check: full`. */ fun balanceCheck(balanceCheck: BalanceCheck) = apply { body.balanceCheck(balanceCheck) } @@ -609,8 +609,8 @@ private constructor( sourceAccountNumberId.getRequired("source_account_number_id") /** - * How the account's available balance should be checked. Please contact - * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * How the account's available balance should be checked. If omitted, the default behavior + * is `balance_check: full`. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -851,8 +851,8 @@ private constructor( } /** - * How the account's available balance should be checked. Please contact - * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * How the account's available balance should be checked. If omitted, the default + * behavior is `balance_check: full`. */ fun balanceCheck(balanceCheck: BalanceCheck) = balanceCheck(JsonField.of(balanceCheck)) @@ -1218,8 +1218,8 @@ private constructor( } /** - * How the account's available balance should be checked. Please contact - * [support@increase.com](mailto:support@increase.com) to enable this parameter. + * How the account's available balance should be checked. If omitted, the default behavior is + * `balance_check: full`. */ class BalanceCheck @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1238,7 +1238,8 @@ private constructor( /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ @JvmField val FULL = of("full") @@ -1256,7 +1257,8 @@ private constructor( enum class Known { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** @@ -1279,7 +1281,8 @@ private constructor( enum class Value { /** * The available balance of the account must be at least the amount of the check, and a - * Pending Transaction will be created for the full amount. + * Pending Transaction will be created for the full amount. This is the default behavior + * if `balance_check` is omitted. */ FULL, /** From d3025b144aa584b898034e04f7fc1cb53f0ed5de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:10:59 +0000 Subject: [PATCH 30/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/exports/ExportCreateParams.kt | 55 +++++++++++++++++-- .../models/exports/ExportCreateParamsTest.kt | 3 + .../services/async/ExportServiceAsyncTest.kt | 1 + .../services/blocking/ExportServiceTest.kt | 1 + 5 files changed, 57 insertions(+), 7 deletions(-) diff --git a/.stats.yml b/.stats.yml index 8014bc2c8..7ca08cf6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-3d5a35f67916cc1c9e9e4df38edbf72b926effa0faf60ea5cb7047a4a2d7f3c7.yml -openapi_spec_hash: 33c55e463f9bf747f502bdb38d5e2622 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-44b5f1aa7877231cd00051536df52b79d7cdc9cdd18194e9d58416a23c0e3080.yml +openapi_spec_hash: 60f0bd1ca37c9a57996238e105cca091 config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt index 6b94ba47d..8fb51a0b4 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt @@ -1130,6 +1130,7 @@ private constructor( private constructor( private val accountId: JsonField, private val effectiveDate: JsonField, + private val programId: JsonField, private val additionalProperties: MutableMap, ) { @@ -1141,7 +1142,10 @@ private constructor( @JsonProperty("effective_date") @ExcludeMissing effectiveDate: JsonField = JsonMissing.of(), - ) : this(accountId, effectiveDate, mutableMapOf()) + @JsonProperty("program_id") + @ExcludeMissing + programId: JsonField = JsonMissing.of(), + ) : this(accountId, effectiveDate, programId, mutableMapOf()) /** * The Account to create a BAI2 report for. If not provided, all open accounts will be @@ -1162,6 +1166,15 @@ private constructor( */ fun effectiveDate(): Optional = effectiveDate.getOptional("effective_date") + /** + * The Program to create a BAI2 report for. If not provided, all open accounts will be + * included. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun programId(): Optional = programId.getOptional("program_id") + /** * Returns the raw JSON value of [accountId]. * @@ -1179,6 +1192,13 @@ private constructor( @ExcludeMissing fun _effectiveDate(): JsonField = effectiveDate + /** + * Returns the raw JSON value of [programId]. + * + * Unlike [programId], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("program_id") @ExcludeMissing fun _programId(): JsonField = programId + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1202,12 +1222,14 @@ private constructor( private var accountId: JsonField = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var programId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountStatementBai2: AccountStatementBai2) = apply { accountId = accountStatementBai2.accountId effectiveDate = accountStatementBai2.effectiveDate + programId = accountStatementBai2.programId additionalProperties = accountStatementBai2.additionalProperties.toMutableMap() } @@ -1244,6 +1266,21 @@ private constructor( this.effectiveDate = effectiveDate } + /** + * The Program to create a BAI2 report for. If not provided, all open accounts will be + * included. + */ + fun programId(programId: String) = programId(JsonField.of(programId)) + + /** + * Sets [Builder.programId] to an arbitrary JSON value. + * + * You should usually call [Builder.programId] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun programId(programId: JsonField) = apply { this.programId = programId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1269,7 +1306,12 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): AccountStatementBai2 = - AccountStatementBai2(accountId, effectiveDate, additionalProperties.toMutableMap()) + AccountStatementBai2( + accountId, + effectiveDate, + programId, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -1281,6 +1323,7 @@ private constructor( accountId() effectiveDate() + programId() validated = true } @@ -1301,7 +1344,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (accountId.asKnown().isPresent) 1 else 0) + - (if (effectiveDate.asKnown().isPresent) 1 else 0) + (if (effectiveDate.asKnown().isPresent) 1 else 0) + + (if (programId.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -1311,17 +1355,18 @@ private constructor( return other is AccountStatementBai2 && accountId == other.accountId && effectiveDate == other.effectiveDate && + programId == other.programId && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(accountId, effectiveDate, additionalProperties) + Objects.hash(accountId, effectiveDate, programId, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "AccountStatementBai2{accountId=$accountId, effectiveDate=$effectiveDate, additionalProperties=$additionalProperties}" + "AccountStatementBai2{accountId=$accountId, effectiveDate=$effectiveDate, programId=$programId, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt index 5eabcccec..a8ee512ba 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt @@ -18,6 +18,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -96,6 +97,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( @@ -172,6 +174,7 @@ internal class ExportCreateParamsTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) assertThat(body.accountStatementOfx()) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt index 3275f3c89..00fa22cd4 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt @@ -31,6 +31,7 @@ internal class ExportServiceAsyncTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt index b60876bca..35a5dae1c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt @@ -31,6 +31,7 @@ internal class ExportServiceTest { ExportCreateParams.AccountStatementBai2.builder() .accountId("account_id") .effectiveDate(LocalDate.parse("2019-12-27")) + .programId("program_id") .build() ) .accountStatementOfx( From c4c5a15738430ba9fbd51e320cdbcd5db3060240 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 15:50:03 +0000 Subject: [PATCH 31/33] feat(api): api update --- .stats.yml | 4 +- .../pendingtransactions/PendingTransaction.kt | 241 ++++-------------- .../PendingTransactionListPageResponseTest.kt | 6 +- .../PendingTransactionTest.kt | 7 +- .../CardAuthorizationCreateResponseTest.kt | 6 +- 5 files changed, 54 insertions(+), 210 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7ca08cf6a..78b249d42 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-44b5f1aa7877231cd00051536df52b79d7cdc9cdd18194e9d58416a23c0e3080.yml -openapi_spec_hash: 60f0bd1ca37c9a57996238e105cca091 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f07048979577d746042198f73c1bac07529dd48f26402f60def922a12b6e01e0.yml +openapi_spec_hash: 6d1ca8aa0b64f414db957540bbeab5ee config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index e497b473e..5a0d5cac2 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -31,11 +31,11 @@ private constructor( private val id: JsonField, private val accountId: JsonField, private val amount: JsonField, - private val balanceImpact: JsonField, private val completedAt: JsonField, private val createdAt: JsonField, private val currency: JsonField, private val description: JsonField, + private val heldAmount: JsonField, private val routeId: JsonField, private val routeType: JsonField, private val source: JsonField, @@ -49,9 +49,6 @@ private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), @JsonProperty("account_id") @ExcludeMissing accountId: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), - @JsonProperty("balance_impact") - @ExcludeMissing - balanceImpact: JsonField = JsonMissing.of(), @JsonProperty("completed_at") @ExcludeMissing completedAt: JsonField = JsonMissing.of(), @@ -62,6 +59,7 @@ private constructor( @JsonProperty("description") @ExcludeMissing description: JsonField = JsonMissing.of(), + @JsonProperty("held_amount") @ExcludeMissing heldAmount: JsonField = JsonMissing.of(), @JsonProperty("route_id") @ExcludeMissing routeId: JsonField = JsonMissing.of(), @JsonProperty("route_type") @ExcludeMissing @@ -73,11 +71,11 @@ private constructor( id, accountId, amount, - balanceImpact, completedAt, createdAt, currency, description, + heldAmount, routeId, routeType, source, @@ -111,14 +109,6 @@ private constructor( */ fun amount(): Long = amount.getRequired("amount") - /** - * How the Pending Transaction affects the balance of its Account while its status is `pending`. - * - * @throws IncreaseInvalidDataException 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 balanceImpact(): BalanceImpact = balanceImpact.getRequired("balance_impact") - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending Transaction * was completed. @@ -155,6 +145,15 @@ private constructor( */ fun description(): String = description.getRequired("description") + /** + * The amount that this Pending Transaction decrements the available balance of its Account. + * This is usually the same as `amount`, but will differ if the amount is positive. + * + * @throws IncreaseInvalidDataException 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 heldAmount(): Long = heldAmount.getRequired("held_amount") + /** * The identifier for the route this Pending Transaction came through. Routes are things like * cards and ACH details. @@ -220,15 +219,6 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - /** - * Returns the raw JSON value of [balanceImpact]. - * - * Unlike [balanceImpact], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("balance_impact") - @ExcludeMissing - fun _balanceImpact(): JsonField = balanceImpact - /** * Returns the raw JSON value of [completedAt]. * @@ -261,6 +251,13 @@ private constructor( */ @JsonProperty("description") @ExcludeMissing fun _description(): JsonField = description + /** + * Returns the raw JSON value of [heldAmount]. + * + * Unlike [heldAmount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("held_amount") @ExcludeMissing fun _heldAmount(): JsonField = heldAmount + /** * Returns the raw JSON value of [routeId]. * @@ -318,11 +315,11 @@ private constructor( * .id() * .accountId() * .amount() - * .balanceImpact() * .completedAt() * .createdAt() * .currency() * .description() + * .heldAmount() * .routeId() * .routeType() * .source() @@ -339,11 +336,11 @@ private constructor( private var id: JsonField? = null private var accountId: JsonField? = null private var amount: JsonField? = null - private var balanceImpact: JsonField? = null private var completedAt: JsonField? = null private var createdAt: JsonField? = null private var currency: JsonField? = null private var description: JsonField? = null + private var heldAmount: JsonField? = null private var routeId: JsonField? = null private var routeType: JsonField? = null private var source: JsonField? = null @@ -356,11 +353,11 @@ private constructor( id = pendingTransaction.id accountId = pendingTransaction.accountId amount = pendingTransaction.amount - balanceImpact = pendingTransaction.balanceImpact completedAt = pendingTransaction.completedAt createdAt = pendingTransaction.createdAt currency = pendingTransaction.currency description = pendingTransaction.description + heldAmount = pendingTransaction.heldAmount routeId = pendingTransaction.routeId routeType = pendingTransaction.routeType source = pendingTransaction.source @@ -406,23 +403,6 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** - * How the Pending Transaction affects the balance of its Account while its status is - * `pending`. - */ - fun balanceImpact(balanceImpact: BalanceImpact) = balanceImpact(JsonField.of(balanceImpact)) - - /** - * Sets [Builder.balanceImpact] to an arbitrary JSON value. - * - * You should usually call [Builder.balanceImpact] with a well-typed [BalanceImpact] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun balanceImpact(balanceImpact: JsonField) = apply { - this.balanceImpact = balanceImpact - } - /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Pending * Transaction was completed. @@ -490,6 +470,20 @@ private constructor( */ fun description(description: JsonField) = apply { this.description = description } + /** + * The amount that this Pending Transaction decrements the available balance of its Account. + * This is usually the same as `amount`, but will differ if the amount is positive. + */ + fun heldAmount(heldAmount: Long) = heldAmount(JsonField.of(heldAmount)) + + /** + * Sets [Builder.heldAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.heldAmount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported value. + */ + fun heldAmount(heldAmount: JsonField) = apply { this.heldAmount = heldAmount } + /** * The identifier for the route this Pending Transaction came through. Routes are things * like cards and ACH details. @@ -591,11 +585,11 @@ private constructor( * .id() * .accountId() * .amount() - * .balanceImpact() * .completedAt() * .createdAt() * .currency() * .description() + * .heldAmount() * .routeId() * .routeType() * .source() @@ -610,11 +604,11 @@ private constructor( checkRequired("id", id), checkRequired("accountId", accountId), checkRequired("amount", amount), - checkRequired("balanceImpact", balanceImpact), checkRequired("completedAt", completedAt), checkRequired("createdAt", createdAt), checkRequired("currency", currency), checkRequired("description", description), + checkRequired("heldAmount", heldAmount), checkRequired("routeId", routeId), checkRequired("routeType", routeType), checkRequired("source", source), @@ -634,11 +628,11 @@ private constructor( id() accountId() amount() - balanceImpact().validate() completedAt() createdAt() currency().validate() description() + heldAmount() routeId() routeType().ifPresent { it.validate() } source().validate() @@ -665,166 +659,17 @@ private constructor( (if (id.asKnown().isPresent) 1 else 0) + (if (accountId.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + - (balanceImpact.asKnown().getOrNull()?.validity() ?: 0) + (if (completedAt.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + (if (description.asKnown().isPresent) 1 else 0) + + (if (heldAmount.asKnown().isPresent) 1 else 0) + (if (routeId.asKnown().isPresent) 1 else 0) + (routeType.asKnown().getOrNull()?.validity() ?: 0) + (source.asKnown().getOrNull()?.validity() ?: 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) - /** - * How the Pending Transaction affects the balance of its Account while its status is `pending`. - */ - class BalanceImpact @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 { - - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - @JvmField val AFFECTS_AVAILABLE_BALANCE = of("affects_available_balance") - - /** This Pending Transaction does not affect the available balance on the Account. */ - @JvmField val NONE = of("none") - - @JvmStatic fun of(value: String) = BalanceImpact(JsonField.of(value)) - } - - /** An enum containing [BalanceImpact]'s known values. */ - enum class Known { - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - AFFECTS_AVAILABLE_BALANCE, - /** This Pending Transaction does not affect the available balance on the Account. */ - NONE, - } - - /** - * An enum containing [BalanceImpact]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [BalanceImpact] 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 { - /** - * This Pending Transaction will decrement the available balance on the Account while - * its status is `pending`. - */ - AFFECTS_AVAILABLE_BALANCE, - /** This Pending Transaction does not affect the available balance on the Account. */ - NONE, - /** - * An enum member indicating that [BalanceImpact] 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) { - AFFECTS_AVAILABLE_BALANCE -> Value.AFFECTS_AVAILABLE_BALANCE - NONE -> Value.NONE - 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 IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - AFFECTS_AVAILABLE_BALANCE -> Known.AFFECTS_AVAILABLE_BALANCE - NONE -> Known.NONE - else -> throw IncreaseInvalidDataException("Unknown BalanceImpact: $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 IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): BalanceImpact = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 BalanceImpact && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Pending Transaction's * currency. This will match the currency on the Pending Transaction's Account. @@ -15410,11 +15255,11 @@ private constructor( id == other.id && accountId == other.accountId && amount == other.amount && - balanceImpact == other.balanceImpact && completedAt == other.completedAt && createdAt == other.createdAt && currency == other.currency && description == other.description && + heldAmount == other.heldAmount && routeId == other.routeId && routeType == other.routeType && source == other.source && @@ -15428,11 +15273,11 @@ private constructor( id, accountId, amount, - balanceImpact, completedAt, createdAt, currency, description, + heldAmount, routeId, routeType, source, @@ -15445,5 +15290,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "PendingTransaction{id=$id, accountId=$accountId, amount=$amount, balanceImpact=$balanceImpact, completedAt=$completedAt, createdAt=$createdAt, currency=$currency, description=$description, routeId=$routeId, routeType=$routeType, source=$source, status=$status, type=$type, additionalProperties=$additionalProperties}" + "PendingTransaction{id=$id, accountId=$accountId, amount=$amount, completedAt=$completedAt, createdAt=$createdAt, currency=$currency, description=$description, heldAmount=$heldAmount, routeId=$routeId, routeType=$routeType, source=$source, status=$status, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index bb81c0a49..9e6ac9444 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -20,11 +20,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -386,11 +386,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -741,11 +741,11 @@ internal class PendingTransactionListPageResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index 5af2fc0f0..a878ff0ef 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -18,11 +18,11 @@ internal class PendingTransactionTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -344,13 +344,12 @@ internal class PendingTransactionTest { assertThat(pendingTransaction.id()).isEqualTo("pending_transaction_k1sfetcau2qbvjbzgju4") assertThat(pendingTransaction.accountId()).isEqualTo("account_in71c4amph0vgo2qllky") assertThat(pendingTransaction.amount()).isEqualTo(100L) - assertThat(pendingTransaction.balanceImpact()) - .isEqualTo(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) assertThat(pendingTransaction.completedAt()).isEmpty assertThat(pendingTransaction.createdAt()) .isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z")) assertThat(pendingTransaction.currency()).isEqualTo(PendingTransaction.Currency.USD) assertThat(pendingTransaction.description()).isEqualTo("INVOICE 2468") + assertThat(pendingTransaction.heldAmount()).isEqualTo(100L) assertThat(pendingTransaction.routeId()).contains("card_oubs0hwk5rn6knuecxg2") assertThat(pendingTransaction.routeType()).contains(PendingTransaction.RouteType.CARD) assertThat(pendingTransaction.source()) @@ -667,11 +666,11 @@ internal class PendingTransactionTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index 38526ad81..01515703b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -372,11 +372,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -1078,11 +1078,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( @@ -1786,11 +1786,11 @@ internal class CardAuthorizationCreateResponseTest { .id("pending_transaction_k1sfetcau2qbvjbzgju4") .accountId("account_in71c4amph0vgo2qllky") .amount(100L) - .balanceImpact(PendingTransaction.BalanceImpact.AFFECTS_AVAILABLE_BALANCE) .completedAt(null) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .currency(PendingTransaction.Currency.USD) .description("INVOICE 2468") + .heldAmount(100L) .routeId("card_oubs0hwk5rn6knuecxg2") .routeType(PendingTransaction.RouteType.CARD) .source( From 5d1526d1629bb1dcbf40e3e09a921746c2927337 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:09:56 +0000 Subject: [PATCH 32/33] feat(api): api update --- .stats.yml | 4 +- .../api/models/carddisputes/CardDispute.kt | 12683 ++++++++++------ .../carddisputes/CardDisputeCreateParams.kt | 1749 ++- .../CardDisputeSubmitUserSubmissionParams.kt | 1756 ++- .../api/models/cardpayments/CardPayment.kt | 745 +- .../DeclinedTransaction.kt | 293 +- .../api/models/exports/ExportCreateParams.kt | 171 +- .../pendingtransactions/PendingTransaction.kt | 293 +- .../realtimedecisions/RealTimeDecision.kt | 313 +- .../carddisputes/CardDisputeActionParams.kt | 1557 +- .../api/models/transactions/Transaction.kt | 293 +- .../CardDisputeCreateParamsTest.kt | 198 +- .../CardDisputeListPageResponseTest.kt | 401 +- ...rdDisputeSubmitUserSubmissionParamsTest.kt | 244 +- .../models/carddisputes/CardDisputeTest.kt | 418 +- .../CardPaymentListPageResponseTest.kt | 401 +- .../models/cardpayments/CardPaymentTest.kt | 337 +- ...DeclinedTransactionListPageResponseTest.kt | 31 +- .../DeclinedTransactionTest.kt | 27 +- .../models/exports/ExportCreateParamsTest.kt | 7 +- .../PendingTransactionListPageResponseTest.kt | 30 +- .../PendingTransactionTest.kt | 29 +- .../realtimedecisions/RealTimeDecisionTest.kt | 39 +- .../CardAuthorizationCreateResponseTest.kt | 60 +- .../CardDisputeActionParamsTest.kt | 105 +- .../TransactionListPageResponseTest.kt | 28 +- .../models/transactions/TransactionTest.kt | 25 +- .../async/CardDisputeServiceAsyncTest.kt | 159 +- .../services/async/ExportServiceAsyncTest.kt | 3 +- .../CardDisputeServiceAsyncTest.kt | 39 +- .../blocking/CardDisputeServiceTest.kt | 159 +- .../services/blocking/ExportServiceTest.kt | 3 +- .../simulations/CardDisputeServiceTest.kt | 39 +- 33 files changed, 16896 insertions(+), 5743 deletions(-) diff --git a/.stats.yml b/.stats.yml index 78b249d42..fff512bc2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 228 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-f07048979577d746042198f73c1bac07529dd48f26402f60def922a12b6e01e0.yml -openapi_spec_hash: 6d1ca8aa0b64f414db957540bbeab5ee +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e9e51b3c9b5c8d9e6e0267b62a12a00fedbce419b765192aa4e2470984192e1f.yml +openapi_spec_hash: 84bc91dd8b8a80edf447dddad15c23fc config_hash: eb2035151c7b49c2f12caf55469b8f9a diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt index 82eaf4cfd..6dbf64042 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDispute.kt @@ -1764,21 +1764,22 @@ private constructor( private constructor( private val attachmentFiles: JsonField>, private val category: JsonField, - private val chargebackAccepted: JsonValue, - private val chargebackSubmitted: JsonValue, - private val chargebackTimedOut: JsonValue, + private val chargebackAccepted: JsonField, + private val chargebackSubmitted: JsonField, + private val chargebackTimedOut: JsonField, private val createdAt: JsonField, private val disputeFinancialTransactionId: JsonField, - private val merchantPrearbitrationDeclineSubmitted: JsonValue, + private val merchantPrearbitrationDeclineSubmitted: + JsonField, private val merchantPrearbitrationReceived: JsonField, - private val merchantPrearbitrationTimedOut: JsonValue, + private val merchantPrearbitrationTimedOut: JsonField, private val represented: JsonField, - private val representmentTimedOut: JsonValue, - private val userPrearbitrationAccepted: JsonValue, - private val userPrearbitrationDeclined: JsonValue, - private val userPrearbitrationSubmitted: JsonValue, - private val userPrearbitrationTimedOut: JsonValue, - private val userWithdrawalSubmitted: JsonValue, + private val representmentTimedOut: JsonField, + private val userPrearbitrationAccepted: JsonField, + private val userPrearbitrationDeclined: JsonField, + private val userPrearbitrationSubmitted: JsonField, + private val userPrearbitrationTimedOut: JsonField, + private val userWithdrawalSubmitted: JsonField, private val additionalProperties: MutableMap, ) { @@ -1792,13 +1793,13 @@ private constructor( category: JsonField = JsonMissing.of(), @JsonProperty("chargeback_accepted") @ExcludeMissing - chargebackAccepted: JsonValue = JsonMissing.of(), + chargebackAccepted: JsonField = JsonMissing.of(), @JsonProperty("chargeback_submitted") @ExcludeMissing - chargebackSubmitted: JsonValue = JsonMissing.of(), + chargebackSubmitted: JsonField = JsonMissing.of(), @JsonProperty("chargeback_timed_out") @ExcludeMissing - chargebackTimedOut: JsonValue = JsonMissing.of(), + chargebackTimedOut: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), @@ -1807,35 +1808,42 @@ private constructor( disputeFinancialTransactionId: JsonField = JsonMissing.of(), @JsonProperty("merchant_prearbitration_decline_submitted") @ExcludeMissing - merchantPrearbitrationDeclineSubmitted: JsonValue = JsonMissing.of(), + merchantPrearbitrationDeclineSubmitted: + JsonField = + JsonMissing.of(), @JsonProperty("merchant_prearbitration_received") @ExcludeMissing merchantPrearbitrationReceived: JsonField = JsonMissing.of(), @JsonProperty("merchant_prearbitration_timed_out") @ExcludeMissing - merchantPrearbitrationTimedOut: JsonValue = JsonMissing.of(), + merchantPrearbitrationTimedOut: JsonField = + JsonMissing.of(), @JsonProperty("represented") @ExcludeMissing represented: JsonField = JsonMissing.of(), @JsonProperty("representment_timed_out") @ExcludeMissing - representmentTimedOut: JsonValue = JsonMissing.of(), + representmentTimedOut: JsonField = JsonMissing.of(), @JsonProperty("user_prearbitration_accepted") @ExcludeMissing - userPrearbitrationAccepted: JsonValue = JsonMissing.of(), + userPrearbitrationAccepted: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_declined") @ExcludeMissing - userPrearbitrationDeclined: JsonValue = JsonMissing.of(), + userPrearbitrationDeclined: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_submitted") @ExcludeMissing - userPrearbitrationSubmitted: JsonValue = JsonMissing.of(), + userPrearbitrationSubmitted: JsonField = + JsonMissing.of(), @JsonProperty("user_prearbitration_timed_out") @ExcludeMissing - userPrearbitrationTimedOut: JsonValue = JsonMissing.of(), + userPrearbitrationTimedOut: JsonField = + JsonMissing.of(), @JsonProperty("user_withdrawal_submitted") @ExcludeMissing - userWithdrawalSubmitted: JsonValue = JsonMissing.of(), + userWithdrawalSubmitted: JsonField = JsonMissing.of(), ) : this( attachmentFiles, category, @@ -1883,10 +1891,12 @@ private constructor( * `chargeback_accepted`. Contains the details specific to a chargeback accepted Visa * Card Dispute Network Event, which represents that a chargeback has been accepted by * the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_accepted") - @ExcludeMissing - fun _chargebackAccepted(): JsonValue = chargebackAccepted + fun chargebackAccepted(): Optional = + chargebackAccepted.getOptional("chargeback_accepted") /** * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be @@ -1894,10 +1904,12 @@ private constructor( * `chargeback_submitted`. Contains the details specific to a chargeback submitted Visa * Card Dispute Network Event, which represents that a chargeback has been submitted to * the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_submitted") - @ExcludeMissing - fun _chargebackSubmitted(): JsonValue = chargebackSubmitted + fun chargebackSubmitted(): Optional = + chargebackSubmitted.getOptional("chargeback_submitted") /** * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be @@ -1905,10 +1917,12 @@ private constructor( * `chargeback_timed_out`. Contains the details specific to a chargeback timed out Visa * Card Dispute Network Event, which represents that the chargeback has timed out in the * user's favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("chargeback_timed_out") - @ExcludeMissing - fun _chargebackTimedOut(): JsonValue = chargebackTimedOut + fun chargebackTimedOut(): Optional = + chargebackTimedOut.getOptional("chargeback_timed_out") /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the @@ -1936,11 +1950,15 @@ private constructor( * merchant prearbitration decline submitted Visa Card Dispute Network Event, which * represents that the user has declined the merchant's request for a prearbitration * request decision in their favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("merchant_prearbitration_decline_submitted") - @ExcludeMissing - fun _merchantPrearbitrationDeclineSubmitted(): JsonValue = - merchantPrearbitrationDeclineSubmitted + fun merchantPrearbitrationDeclineSubmitted(): + Optional = + merchantPrearbitrationDeclineSubmitted.getOptional( + "merchant_prearbitration_decline_submitted" + ) /** * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This @@ -1961,10 +1979,12 @@ private constructor( * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant * prearbitration timed out Visa Card Dispute Network Event, which represents that the * user has timed out responding to the merchant's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("merchant_prearbitration_timed_out") - @ExcludeMissing - fun _merchantPrearbitrationTimedOut(): JsonValue = merchantPrearbitrationTimedOut + fun merchantPrearbitrationTimedOut(): Optional = + merchantPrearbitrationTimedOut.getOptional("merchant_prearbitration_timed_out") /** * A Card Dispute Re-presented Visa Network Event object. This field will be present in @@ -1984,10 +2004,12 @@ private constructor( * `representment_timed_out`. Contains the details specific to a re-presentment time-out * Visa Card Dispute Network Event, which represents that the user did not respond to * the re-presentment by the merchant within the time limit. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("representment_timed_out") - @ExcludeMissing - fun _representmentTimedOut(): JsonValue = representmentTimedOut + fun representmentTimedOut(): Optional = + representmentTimedOut.getOptional("representment_timed_out") /** * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This field @@ -1995,10 +2017,12 @@ private constructor( * `user_prearbitration_accepted`. Contains the details specific to a user * prearbitration accepted Visa Card Dispute Network Event, which represents that the * merchant has accepted the user's prearbitration request in the user's favor. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_accepted") - @ExcludeMissing - fun _userPrearbitrationAccepted(): JsonValue = userPrearbitrationAccepted + fun userPrearbitrationAccepted(): Optional = + userPrearbitrationAccepted.getOptional("user_prearbitration_accepted") /** * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This field @@ -2006,10 +2030,12 @@ private constructor( * `user_prearbitration_declined`. Contains the details specific to a user * prearbitration declined Visa Card Dispute Network Event, which represents that the * merchant has declined the user's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_declined") - @ExcludeMissing - fun _userPrearbitrationDeclined(): JsonValue = userPrearbitrationDeclined + fun userPrearbitrationDeclined(): Optional = + userPrearbitrationDeclined.getOptional("user_prearbitration_declined") /** * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This field @@ -2017,10 +2043,12 @@ private constructor( * `user_prearbitration_submitted`. Contains the details specific to a user * prearbitration submitted Visa Card Dispute Network Event, which represents that the * user's request for prearbitration has been submitted to the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_submitted") - @ExcludeMissing - fun _userPrearbitrationSubmitted(): JsonValue = userPrearbitrationSubmitted + fun userPrearbitrationSubmitted(): Optional = + userPrearbitrationSubmitted.getOptional("user_prearbitration_submitted") /** * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This field @@ -2028,10 +2056,12 @@ private constructor( * `user_prearbitration_timed_out`. Contains the details specific to a user * prearbitration timed out Visa Card Dispute Network Event, which represents that the * merchant has timed out responding to the user's prearbitration request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_prearbitration_timed_out") - @ExcludeMissing - fun _userPrearbitrationTimedOut(): JsonValue = userPrearbitrationTimedOut + fun userPrearbitrationTimedOut(): Optional = + userPrearbitrationTimedOut.getOptional("user_prearbitration_timed_out") /** * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field will @@ -2039,10 +2069,12 @@ private constructor( * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal * submitted Visa Card Dispute Network Event, which represents that the user's request * to withdraw the dispute has been submitted to the network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("user_withdrawal_submitted") - @ExcludeMissing - fun _userWithdrawalSubmitted(): JsonValue = userWithdrawalSubmitted + fun userWithdrawalSubmitted(): Optional = + userWithdrawalSubmitted.getOptional("user_withdrawal_submitted") /** * Returns the raw JSON value of [attachmentFiles]. @@ -2064,6 +2096,36 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [chargebackAccepted]. + * + * Unlike [chargebackAccepted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_accepted") + @ExcludeMissing + fun _chargebackAccepted(): JsonField = chargebackAccepted + + /** + * Returns the raw JSON value of [chargebackSubmitted]. + * + * Unlike [chargebackSubmitted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_submitted") + @ExcludeMissing + fun _chargebackSubmitted(): JsonField = chargebackSubmitted + + /** + * Returns the raw JSON value of [chargebackTimedOut]. + * + * Unlike [chargebackTimedOut], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("chargeback_timed_out") + @ExcludeMissing + fun _chargebackTimedOut(): JsonField = chargebackTimedOut + /** * Returns the raw JSON value of [createdAt]. * @@ -2084,6 +2146,18 @@ private constructor( @ExcludeMissing fun _disputeFinancialTransactionId(): JsonField = disputeFinancialTransactionId + /** + * Returns the raw JSON value of [merchantPrearbitrationDeclineSubmitted]. + * + * Unlike [merchantPrearbitrationDeclineSubmitted], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("merchant_prearbitration_decline_submitted") + @ExcludeMissing + fun _merchantPrearbitrationDeclineSubmitted(): + JsonField = + merchantPrearbitrationDeclineSubmitted + /** * Returns the raw JSON value of [merchantPrearbitrationReceived]. * @@ -2095,6 +2169,17 @@ private constructor( fun _merchantPrearbitrationReceived(): JsonField = merchantPrearbitrationReceived + /** + * Returns the raw JSON value of [merchantPrearbitrationTimedOut]. + * + * Unlike [merchantPrearbitrationTimedOut], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("merchant_prearbitration_timed_out") + @ExcludeMissing + fun _merchantPrearbitrationTimedOut(): JsonField = + merchantPrearbitrationTimedOut + /** * Returns the raw JSON value of [represented]. * @@ -2105,6 +2190,71 @@ private constructor( @ExcludeMissing fun _represented(): JsonField = represented + /** + * Returns the raw JSON value of [representmentTimedOut]. + * + * Unlike [representmentTimedOut], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("representment_timed_out") + @ExcludeMissing + fun _representmentTimedOut(): JsonField = representmentTimedOut + + /** + * Returns the raw JSON value of [userPrearbitrationAccepted]. + * + * Unlike [userPrearbitrationAccepted], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_accepted") + @ExcludeMissing + fun _userPrearbitrationAccepted(): JsonField = + userPrearbitrationAccepted + + /** + * Returns the raw JSON value of [userPrearbitrationDeclined]. + * + * Unlike [userPrearbitrationDeclined], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_declined") + @ExcludeMissing + fun _userPrearbitrationDeclined(): JsonField = + userPrearbitrationDeclined + + /** + * Returns the raw JSON value of [userPrearbitrationSubmitted]. + * + * Unlike [userPrearbitrationSubmitted], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_submitted") + @ExcludeMissing + fun _userPrearbitrationSubmitted(): JsonField = + userPrearbitrationSubmitted + + /** + * Returns the raw JSON value of [userPrearbitrationTimedOut]. + * + * Unlike [userPrearbitrationTimedOut], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("user_prearbitration_timed_out") + @ExcludeMissing + fun _userPrearbitrationTimedOut(): JsonField = + userPrearbitrationTimedOut + + /** + * Returns the raw JSON value of [userWithdrawalSubmitted]. + * + * Unlike [userWithdrawalSubmitted], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("user_withdrawal_submitted") + @ExcludeMissing + fun _userWithdrawalSubmitted(): JsonField = + userWithdrawalSubmitted + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -2151,23 +2301,31 @@ private constructor( private var attachmentFiles: JsonField>? = null private var category: JsonField? = null - private var chargebackAccepted: JsonValue? = null - private var chargebackSubmitted: JsonValue? = null - private var chargebackTimedOut: JsonValue? = null + private var chargebackAccepted: JsonField? = null + private var chargebackSubmitted: JsonField? = null + private var chargebackTimedOut: JsonField? = null private var createdAt: JsonField? = null private var disputeFinancialTransactionId: JsonField? = null - private var merchantPrearbitrationDeclineSubmitted: JsonValue? = null + private var merchantPrearbitrationDeclineSubmitted: + JsonField? = + null private var merchantPrearbitrationReceived: JsonField? = null - private var merchantPrearbitrationTimedOut: JsonValue? = null + private var merchantPrearbitrationTimedOut: + JsonField? = + null private var represented: JsonField? = null - private var representmentTimedOut: JsonValue? = null - private var userPrearbitrationAccepted: JsonValue? = null - private var userPrearbitrationDeclined: JsonValue? = null - private var userPrearbitrationSubmitted: JsonValue? = null - private var userPrearbitrationTimedOut: JsonValue? = null - private var userWithdrawalSubmitted: JsonValue? = null + private var representmentTimedOut: JsonField? = null + private var userPrearbitrationAccepted: JsonField? = + null + private var userPrearbitrationDeclined: JsonField? = + null + private var userPrearbitrationSubmitted: JsonField? = + null + private var userPrearbitrationTimedOut: JsonField? = + null + private var userWithdrawalSubmitted: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -2243,7 +2401,24 @@ private constructor( * Visa Card Dispute Network Event, which represents that a chargeback has been * accepted by the merchant. */ - fun chargebackAccepted(chargebackAccepted: JsonValue) = apply { + fun chargebackAccepted(chargebackAccepted: ChargebackAccepted?) = + chargebackAccepted(JsonField.ofNullable(chargebackAccepted)) + + /** + * Alias for calling [Builder.chargebackAccepted] with + * `chargebackAccepted.orElse(null)`. + */ + fun chargebackAccepted(chargebackAccepted: Optional) = + chargebackAccepted(chargebackAccepted.getOrNull()) + + /** + * Sets [Builder.chargebackAccepted] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackAccepted] with a well-typed + * [ChargebackAccepted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackAccepted(chargebackAccepted: JsonField) = apply { this.chargebackAccepted = chargebackAccepted } @@ -2254,9 +2429,27 @@ private constructor( * Visa Card Dispute Network Event, which represents that a chargeback has been * submitted to the network. */ - fun chargebackSubmitted(chargebackSubmitted: JsonValue) = apply { - this.chargebackSubmitted = chargebackSubmitted - } + fun chargebackSubmitted(chargebackSubmitted: ChargebackSubmitted?) = + chargebackSubmitted(JsonField.ofNullable(chargebackSubmitted)) + + /** + * Alias for calling [Builder.chargebackSubmitted] with + * `chargebackSubmitted.orElse(null)`. + */ + fun chargebackSubmitted(chargebackSubmitted: Optional) = + chargebackSubmitted(chargebackSubmitted.getOrNull()) + + /** + * Sets [Builder.chargebackSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackSubmitted] with a well-typed + * [ChargebackSubmitted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackSubmitted(chargebackSubmitted: JsonField) = + apply { + this.chargebackSubmitted = chargebackSubmitted + } /** * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be @@ -2265,7 +2458,24 @@ private constructor( * Visa Card Dispute Network Event, which represents that the chargeback has timed * out in the user's favor. */ - fun chargebackTimedOut(chargebackTimedOut: JsonValue) = apply { + fun chargebackTimedOut(chargebackTimedOut: ChargebackTimedOut?) = + chargebackTimedOut(JsonField.ofNullable(chargebackTimedOut)) + + /** + * Alias for calling [Builder.chargebackTimedOut] with + * `chargebackTimedOut.orElse(null)`. + */ + fun chargebackTimedOut(chargebackTimedOut: Optional) = + chargebackTimedOut(chargebackTimedOut.getOrNull()) + + /** + * Sets [Builder.chargebackTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.chargebackTimedOut] with a well-typed + * [ChargebackTimedOut] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun chargebackTimedOut(chargebackTimedOut: JsonField) = apply { this.chargebackTimedOut = chargebackTimedOut } @@ -2321,7 +2531,34 @@ private constructor( * prearbitration request decision in their favor. */ fun merchantPrearbitrationDeclineSubmitted( - merchantPrearbitrationDeclineSubmitted: JsonValue + merchantPrearbitrationDeclineSubmitted: MerchantPrearbitrationDeclineSubmitted? + ) = + merchantPrearbitrationDeclineSubmitted( + JsonField.ofNullable(merchantPrearbitrationDeclineSubmitted) + ) + + /** + * Alias for calling [Builder.merchantPrearbitrationDeclineSubmitted] with + * `merchantPrearbitrationDeclineSubmitted.orElse(null)`. + */ + fun merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted: + Optional + ) = + merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted.getOrNull() + ) + + /** + * Sets [Builder.merchantPrearbitrationDeclineSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPrearbitrationDeclineSubmitted] with a + * well-typed [MerchantPrearbitrationDeclineSubmitted] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun merchantPrearbitrationDeclineSubmitted( + merchantPrearbitrationDeclineSubmitted: + JsonField ) = apply { this.merchantPrearbitrationDeclineSubmitted = merchantPrearbitrationDeclineSubmitted @@ -2367,10 +2604,31 @@ private constructor( * prearbitration timed out Visa Card Dispute Network Event, which represents that * the user has timed out responding to the merchant's prearbitration request. */ - fun merchantPrearbitrationTimedOut(merchantPrearbitrationTimedOut: JsonValue) = - apply { - this.merchantPrearbitrationTimedOut = merchantPrearbitrationTimedOut - } + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: MerchantPrearbitrationTimedOut? + ) = + merchantPrearbitrationTimedOut( + JsonField.ofNullable(merchantPrearbitrationTimedOut) + ) + + /** + * Alias for calling [Builder.merchantPrearbitrationTimedOut] with + * `merchantPrearbitrationTimedOut.orElse(null)`. + */ + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: Optional + ) = merchantPrearbitrationTimedOut(merchantPrearbitrationTimedOut.getOrNull()) + + /** + * Sets [Builder.merchantPrearbitrationTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPrearbitrationTimedOut] with a + * well-typed [MerchantPrearbitrationTimedOut] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun merchantPrearbitrationTimedOut( + merchantPrearbitrationTimedOut: JsonField + ) = apply { this.merchantPrearbitrationTimedOut = merchantPrearbitrationTimedOut } /** * A Card Dispute Re-presented Visa Network Event object. This field will be present @@ -2404,9 +2662,27 @@ private constructor( * time-out Visa Card Dispute Network Event, which represents that the user did not * respond to the re-presentment by the merchant within the time limit. */ - fun representmentTimedOut(representmentTimedOut: JsonValue) = apply { - this.representmentTimedOut = representmentTimedOut - } + fun representmentTimedOut(representmentTimedOut: RepresentmentTimedOut?) = + representmentTimedOut(JsonField.ofNullable(representmentTimedOut)) + + /** + * Alias for calling [Builder.representmentTimedOut] with + * `representmentTimedOut.orElse(null)`. + */ + fun representmentTimedOut(representmentTimedOut: Optional) = + representmentTimedOut(representmentTimedOut.getOrNull()) + + /** + * Sets [Builder.representmentTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.representmentTimedOut] with a well-typed + * [RepresentmentTimedOut] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun representmentTimedOut(representmentTimedOut: JsonField) = + apply { + this.representmentTimedOut = representmentTimedOut + } /** * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This @@ -2415,9 +2691,28 @@ private constructor( * prearbitration accepted Visa Card Dispute Network Event, which represents that * the merchant has accepted the user's prearbitration request in the user's favor. */ - fun userPrearbitrationAccepted(userPrearbitrationAccepted: JsonValue) = apply { - this.userPrearbitrationAccepted = userPrearbitrationAccepted - } + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: UserPrearbitrationAccepted? + ) = userPrearbitrationAccepted(JsonField.ofNullable(userPrearbitrationAccepted)) + + /** + * Alias for calling [Builder.userPrearbitrationAccepted] with + * `userPrearbitrationAccepted.orElse(null)`. + */ + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: Optional + ) = userPrearbitrationAccepted(userPrearbitrationAccepted.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationAccepted] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationAccepted] with a well-typed + * [UserPrearbitrationAccepted] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationAccepted( + userPrearbitrationAccepted: JsonField + ) = apply { this.userPrearbitrationAccepted = userPrearbitrationAccepted } /** * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This @@ -2426,9 +2721,28 @@ private constructor( * prearbitration declined Visa Card Dispute Network Event, which represents that * the merchant has declined the user's prearbitration request. */ - fun userPrearbitrationDeclined(userPrearbitrationDeclined: JsonValue) = apply { - this.userPrearbitrationDeclined = userPrearbitrationDeclined - } + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: UserPrearbitrationDeclined? + ) = userPrearbitrationDeclined(JsonField.ofNullable(userPrearbitrationDeclined)) + + /** + * Alias for calling [Builder.userPrearbitrationDeclined] with + * `userPrearbitrationDeclined.orElse(null)`. + */ + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: Optional + ) = userPrearbitrationDeclined(userPrearbitrationDeclined.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationDeclined] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationDeclined] with a well-typed + * [UserPrearbitrationDeclined] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationDeclined( + userPrearbitrationDeclined: JsonField + ) = apply { this.userPrearbitrationDeclined = userPrearbitrationDeclined } /** * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This @@ -2437,9 +2751,28 @@ private constructor( * prearbitration submitted Visa Card Dispute Network Event, which represents that * the user's request for prearbitration has been submitted to the network. */ - fun userPrearbitrationSubmitted(userPrearbitrationSubmitted: JsonValue) = apply { - this.userPrearbitrationSubmitted = userPrearbitrationSubmitted - } + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: UserPrearbitrationSubmitted? + ) = userPrearbitrationSubmitted(JsonField.ofNullable(userPrearbitrationSubmitted)) + + /** + * Alias for calling [Builder.userPrearbitrationSubmitted] with + * `userPrearbitrationSubmitted.orElse(null)`. + */ + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: Optional + ) = userPrearbitrationSubmitted(userPrearbitrationSubmitted.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationSubmitted] with a well-typed + * [UserPrearbitrationSubmitted] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationSubmitted( + userPrearbitrationSubmitted: JsonField + ) = apply { this.userPrearbitrationSubmitted = userPrearbitrationSubmitted } /** * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This @@ -2448,9 +2781,28 @@ private constructor( * prearbitration timed out Visa Card Dispute Network Event, which represents that * the merchant has timed out responding to the user's prearbitration request. */ - fun userPrearbitrationTimedOut(userPrearbitrationTimedOut: JsonValue) = apply { - this.userPrearbitrationTimedOut = userPrearbitrationTimedOut - } + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: UserPrearbitrationTimedOut? + ) = userPrearbitrationTimedOut(JsonField.ofNullable(userPrearbitrationTimedOut)) + + /** + * Alias for calling [Builder.userPrearbitrationTimedOut] with + * `userPrearbitrationTimedOut.orElse(null)`. + */ + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: Optional + ) = userPrearbitrationTimedOut(userPrearbitrationTimedOut.getOrNull()) + + /** + * Sets [Builder.userPrearbitrationTimedOut] to an arbitrary JSON value. + * + * You should usually call [Builder.userPrearbitrationTimedOut] with a well-typed + * [UserPrearbitrationTimedOut] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun userPrearbitrationTimedOut( + userPrearbitrationTimedOut: JsonField + ) = apply { this.userPrearbitrationTimedOut = userPrearbitrationTimedOut } /** * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field @@ -2459,9 +2811,27 @@ private constructor( * submitted Visa Card Dispute Network Event, which represents that the user's * request to withdraw the dispute has been submitted to the network. */ - fun userWithdrawalSubmitted(userWithdrawalSubmitted: JsonValue) = apply { - this.userWithdrawalSubmitted = userWithdrawalSubmitted - } + fun userWithdrawalSubmitted(userWithdrawalSubmitted: UserWithdrawalSubmitted?) = + userWithdrawalSubmitted(JsonField.ofNullable(userWithdrawalSubmitted)) + + /** + * Alias for calling [Builder.userWithdrawalSubmitted] with + * `userWithdrawalSubmitted.orElse(null)`. + */ + fun userWithdrawalSubmitted( + userWithdrawalSubmitted: Optional + ) = userWithdrawalSubmitted(userWithdrawalSubmitted.getOrNull()) + + /** + * Sets [Builder.userWithdrawalSubmitted] to an arbitrary JSON value. + * + * You should usually call [Builder.userWithdrawalSubmitted] with a well-typed + * [UserWithdrawalSubmitted] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun userWithdrawalSubmitted( + userWithdrawalSubmitted: JsonField + ) = apply { this.userWithdrawalSubmitted = userWithdrawalSubmitted } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2557,10 +2927,21 @@ private constructor( attachmentFiles().forEach { it.validate() } category().validate() + chargebackAccepted().ifPresent { it.validate() } + chargebackSubmitted().ifPresent { it.validate() } + chargebackTimedOut().ifPresent { it.validate() } createdAt() disputeFinancialTransactionId() + merchantPrearbitrationDeclineSubmitted().ifPresent { it.validate() } merchantPrearbitrationReceived().ifPresent { it.validate() } + merchantPrearbitrationTimedOut().ifPresent { it.validate() } represented().ifPresent { it.validate() } + representmentTimedOut().ifPresent { it.validate() } + userPrearbitrationAccepted().ifPresent { it.validate() } + userPrearbitrationDeclined().ifPresent { it.validate() } + userPrearbitrationSubmitted().ifPresent { it.validate() } + userPrearbitrationTimedOut().ifPresent { it.validate() } + userWithdrawalSubmitted().ifPresent { it.validate() } validated = true } @@ -2582,10 +2963,22 @@ private constructor( internal fun validity(): Int = (attachmentFiles.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackAccepted.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackSubmitted.asKnown().getOrNull()?.validity() ?: 0) + + (chargebackTimedOut.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (if (disputeFinancialTransactionId.asKnown().isPresent) 1 else 0) + + (merchantPrearbitrationDeclineSubmitted.asKnown().getOrNull()?.validity() + ?: 0) + (merchantPrearbitrationReceived.asKnown().getOrNull()?.validity() ?: 0) + - (represented.asKnown().getOrNull()?.validity() ?: 0) + (merchantPrearbitrationTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (represented.asKnown().getOrNull()?.validity() ?: 0) + + (representmentTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationAccepted.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationDeclined.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationSubmitted.asKnown().getOrNull()?.validity() ?: 0) + + (userPrearbitrationTimedOut.asKnown().getOrNull()?.validity() ?: 0) + + (userWithdrawalSubmitted.asKnown().getOrNull()?.validity() ?: 0) class AttachmentFile @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -3120,266 +3513,17 @@ private constructor( } /** - * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This - * field will be present in the JSON response if and only if `category` is equal to - * `merchant_prearbitration_received`. Contains the details specific to a merchant - * prearbitration received Visa Card Dispute Network Event, which represents that the - * merchant has issued a prearbitration request in the user's favor. + * A Card Dispute Chargeback Accepted Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_accepted`. Contains the details specific to a chargeback accepted Visa + * Card Dispute Network Event, which represents that a chargeback has been accepted by + * the merchant. */ - class MerchantPrearbitrationReceived + class ChargebackAccepted @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val cardholderNoLongerDisputes: JsonField, - private val compellingEvidence: JsonField, - private val creditOrReversalProcessed: JsonField, - private val delayedChargeTransaction: JsonField, - private val evidenceOfImprint: JsonField, - private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField, - private val priorUndisputedNonFraudTransactions: - JsonField, - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - cardholderNoLongerDisputes: JsonField = - JsonMissing.of(), - @JsonProperty("compelling_evidence") - @ExcludeMissing - compellingEvidence: JsonField = JsonMissing.of(), - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - creditOrReversalProcessed: JsonField = - JsonMissing.of(), - @JsonProperty("delayed_charge_transaction") - @ExcludeMissing - delayedChargeTransaction: JsonField = - JsonMissing.of(), - @JsonProperty("evidence_of_imprint") - @ExcludeMissing - evidenceOfImprint: JsonField = JsonMissing.of(), - @JsonProperty("invalid_dispute") - @ExcludeMissing - invalidDispute: JsonField = JsonMissing.of(), - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField = - JsonMissing.of(), - @JsonProperty("prior_undisputed_non_fraud_transactions") - @ExcludeMissing - priorUndisputedNonFraudTransactions: - JsonField = - JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this( - cardholderNoLongerDisputes, - compellingEvidence, - creditOrReversalProcessed, - delayedChargeTransaction, - evidenceOfImprint, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenReceived, - priorUndisputedNonFraudTransactions, - reason, - mutableMapOf(), - ) - - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun cardholderNoLongerDisputes(): Optional = - cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") - - /** - * Compelling evidence details. Present if and only if `reason` is - * `compelling_evidence`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun compellingEvidence(): Optional = - compellingEvidence.getOptional("compelling_evidence") - - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun creditOrReversalProcessed(): Optional = - creditOrReversalProcessed.getOptional("credit_or_reversal_processed") - - /** - * Delayed charge transaction details. Present if and only if `reason` is - * `delayed_charge_transaction`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun delayedChargeTransaction(): Optional = - delayedChargeTransaction.getOptional("delayed_charge_transaction") - - /** - * Evidence of imprint details. Present if and only if `reason` is - * `evidence_of_imprint`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun evidenceOfImprint(): Optional = - evidenceOfImprint.getOptional("evidence_of_imprint") - - /** - * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun invalidDispute(): Optional = - invalidDispute.getOptional("invalid_dispute") - - /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived(): - Optional = - nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( - "non_fiat_currency_or_non_fungible_token_received" - ) - - /** - * Prior undisputed non-fraud transactions details. Present if and only if `reason` - * is `prior_undisputed_non_fraud_transactions`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun priorUndisputedNonFraudTransactions(): - Optional = - priorUndisputedNonFraudTransactions.getOptional( - "prior_undisputed_non_fraud_transactions" - ) - - /** - * The reason the merchant re-presented the dispute. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or - * is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun reason(): Reason = reason.getRequired("reason") - - /** - * Returns the raw JSON value of [cardholderNoLongerDisputes]. - * - * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - fun _cardholderNoLongerDisputes(): JsonField = - cardholderNoLongerDisputes - - /** - * Returns the raw JSON value of [compellingEvidence]. - * - * Unlike [compellingEvidence], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("compelling_evidence") - @ExcludeMissing - fun _compellingEvidence(): JsonField = compellingEvidence - - /** - * Returns the raw JSON value of [creditOrReversalProcessed]. - * - * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - fun _creditOrReversalProcessed(): JsonField = - creditOrReversalProcessed - - /** - * Returns the raw JSON value of [delayedChargeTransaction]. - * - * Unlike [delayedChargeTransaction], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("delayed_charge_transaction") - @ExcludeMissing - fun _delayedChargeTransaction(): JsonField = - delayedChargeTransaction - - /** - * Returns the raw JSON value of [evidenceOfImprint]. - * - * Unlike [evidenceOfImprint], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("evidence_of_imprint") - @ExcludeMissing - fun _evidenceOfImprint(): JsonField = evidenceOfImprint - - /** - * Returns the raw JSON value of [invalidDispute]. - * - * Unlike [invalidDispute], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("invalid_dispute") - @ExcludeMissing - fun _invalidDispute(): JsonField = invalidDispute - - /** - * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. - * - * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if - * the JSON field has an unexpected type. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenReceived(): - JsonField = - nonFiatCurrencyOrNonFungibleTokenReceived - - /** - * Returns the raw JSON value of [priorUndisputedNonFraudTransactions]. - * - * Unlike [priorUndisputedNonFraudTransactions], this method doesn't throw if the - * JSON field has an unexpected type. - */ - @JsonProperty("prior_undisputed_non_fraud_transactions") - @ExcludeMissing - fun _priorUndisputedNonFraudTransactions(): - JsonField = - priorUndisputedNonFraudTransactions + private constructor(private val additionalProperties: MutableMap) { - /** - * 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 + @JsonCreator private constructor() : this(mutableMapOf()) @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -3397,317 +3541,140 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [MerchantPrearbitrationReceived]. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .compellingEvidence() - * .creditOrReversalProcessed() - * .delayedChargeTransaction() - * .evidenceOfImprint() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .priorUndisputedNonFraudTransactions() - * .reason() - * ``` + * [ChargebackAccepted]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [MerchantPrearbitrationReceived]. */ + /** A builder for [ChargebackAccepted]. */ class Builder internal constructor() { - private var cardholderNoLongerDisputes: JsonField? = - null - private var compellingEvidence: JsonField? = null - private var creditOrReversalProcessed: JsonField? = - null - private var delayedChargeTransaction: JsonField? = - null - private var evidenceOfImprint: JsonField? = null - private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField? = - null - private var priorUndisputedNonFraudTransactions: - JsonField? = - null - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - merchantPrearbitrationReceived: MerchantPrearbitrationReceived - ) = apply { - cardholderNoLongerDisputes = - merchantPrearbitrationReceived.cardholderNoLongerDisputes - compellingEvidence = merchantPrearbitrationReceived.compellingEvidence - creditOrReversalProcessed = - merchantPrearbitrationReceived.creditOrReversalProcessed - delayedChargeTransaction = - merchantPrearbitrationReceived.delayedChargeTransaction - evidenceOfImprint = merchantPrearbitrationReceived.evidenceOfImprint - invalidDispute = merchantPrearbitrationReceived.invalidDispute - nonFiatCurrencyOrNonFungibleTokenReceived = - merchantPrearbitrationReceived.nonFiatCurrencyOrNonFungibleTokenReceived - priorUndisputedNonFraudTransactions = - merchantPrearbitrationReceived.priorUndisputedNonFraudTransactions - reason = merchantPrearbitrationReceived.reason + internal fun from(chargebackAccepted: ChargebackAccepted) = apply { additionalProperties = - merchantPrearbitrationReceived.additionalProperties.toMutableMap() + chargebackAccepted.additionalProperties.toMutableMap() } - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: CardholderNoLongerDisputes? - ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) - - /** - * Alias for calling [Builder.cardholderNoLongerDisputes] with - * `cardholderNoLongerDisputes.orElse(null)`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: Optional - ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) - - /** - * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. - * - * You should usually call [Builder.cardholderNoLongerDisputes] with a - * well-typed [CardholderNoLongerDisputes] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: JsonField - ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } - - /** - * Compelling evidence details. Present if and only if `reason` is - * `compelling_evidence`. - */ - fun compellingEvidence(compellingEvidence: CompellingEvidence?) = - compellingEvidence(JsonField.ofNullable(compellingEvidence)) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - /** - * Alias for calling [Builder.compellingEvidence] with - * `compellingEvidence.orElse(null)`. - */ - fun compellingEvidence(compellingEvidence: Optional) = - compellingEvidence(compellingEvidence.getOrNull()) + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - /** - * Sets [Builder.compellingEvidence] to an arbitrary JSON value. - * - * You should usually call [Builder.compellingEvidence] with a well-typed - * [CompellingEvidence] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun compellingEvidence(compellingEvidence: JsonField) = + fun putAllAdditionalProperties(additionalProperties: Map) = apply { - this.compellingEvidence = compellingEvidence + this.additionalProperties.putAll(additionalProperties) } - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: CreditOrReversalProcessed? - ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** - * Alias for calling [Builder.creditOrReversalProcessed] with - * `creditOrReversalProcessed.orElse(null)`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: Optional - ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. + * Returns an immutable instance of [ChargebackAccepted]. * - * You should usually call [Builder.creditOrReversalProcessed] with a well-typed - * [CreditOrReversalProcessed] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. + * Further updates to this [Builder] will not mutate the returned instance. */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: JsonField - ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } + fun build(): ChargebackAccepted = + ChargebackAccepted(additionalProperties.toMutableMap()) + } - /** - * Delayed charge transaction details. Present if and only if `reason` is - * `delayed_charge_transaction`. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: DelayedChargeTransaction? - ) = delayedChargeTransaction(JsonField.ofNullable(delayedChargeTransaction)) + private var validated: Boolean = false - /** - * Alias for calling [Builder.delayedChargeTransaction] with - * `delayedChargeTransaction.orElse(null)`. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: Optional - ) = delayedChargeTransaction(delayedChargeTransaction.getOrNull()) + fun validate(): ChargebackAccepted = apply { + if (validated) { + return@apply + } - /** - * Sets [Builder.delayedChargeTransaction] to an arbitrary JSON value. - * - * You should usually call [Builder.delayedChargeTransaction] with a well-typed - * [DelayedChargeTransaction] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun delayedChargeTransaction( - delayedChargeTransaction: JsonField - ) = apply { this.delayedChargeTransaction = delayedChargeTransaction } + validated = true + } - /** - * Evidence of imprint details. Present if and only if `reason` is - * `evidence_of_imprint`. - */ - fun evidenceOfImprint(evidenceOfImprint: EvidenceOfImprint?) = - evidenceOfImprint(JsonField.ofNullable(evidenceOfImprint)) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - /** - * Alias for calling [Builder.evidenceOfImprint] with - * `evidenceOfImprint.orElse(null)`. - */ - fun evidenceOfImprint(evidenceOfImprint: Optional) = - evidenceOfImprint(evidenceOfImprint.getOrNull()) + /** + * 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 = 0 - /** - * Sets [Builder.evidenceOfImprint] to an arbitrary JSON value. - * - * You should usually call [Builder.evidenceOfImprint] with a well-typed - * [EvidenceOfImprint] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun evidenceOfImprint(evidenceOfImprint: JsonField) = apply { - this.evidenceOfImprint = evidenceOfImprint + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** - * Invalid dispute details. Present if and only if `reason` is - * `invalid_dispute`. - */ - fun invalidDispute(invalidDispute: InvalidDispute?) = - invalidDispute(JsonField.ofNullable(invalidDispute)) + return other is ChargebackAccepted && + additionalProperties == other.additionalProperties + } - /** - * Alias for calling [Builder.invalidDispute] with - * `invalidDispute.orElse(null)`. - */ - fun invalidDispute(invalidDispute: Optional) = - invalidDispute(invalidDispute.getOrNull()) + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * Sets [Builder.invalidDispute] to an arbitrary JSON value. - * - * You should usually call [Builder.invalidDispute] with a well-typed - * [InvalidDispute] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun invalidDispute(invalidDispute: JsonField) = apply { - this.invalidDispute = invalidDispute - } + override fun hashCode(): Int = hashCode - /** - * Non-fiat currency or non-fungible token received details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived? - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) - ) + override fun toString() = + "ChargebackAccepted{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with - * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - Optional - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() - ) + /** + * A Card Dispute Chargeback Submitted Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_submitted`. Contains the details specific to a chargeback submitted Visa + * Card Dispute Network Event, which represents that a chargeback has been submitted to + * the network. + */ + class ChargebackSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON - * value. - * - * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] - * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField - ) = apply { - this.nonFiatCurrencyOrNonFungibleTokenReceived = - nonFiatCurrencyOrNonFungibleTokenReceived - } + @JsonCreator private constructor() : this(mutableMapOf()) - /** - * Prior undisputed non-fraud transactions details. Present if and only if - * `reason` is `prior_undisputed_non_fraud_transactions`. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions? - ) = - priorUndisputedNonFraudTransactions( - JsonField.ofNullable(priorUndisputedNonFraudTransactions) - ) + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Alias for calling [Builder.priorUndisputedNonFraudTransactions] with - * `priorUndisputedNonFraudTransactions.orElse(null)`. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: - Optional - ) = - priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions.getOrNull() - ) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Sets [Builder.priorUndisputedNonFraudTransactions] to an arbitrary JSON - * value. - * - * You should usually call [Builder.priorUndisputedNonFraudTransactions] with a - * well-typed [PriorUndisputedNonFraudTransactions] value instead. This method - * is primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun priorUndisputedNonFraudTransactions( - priorUndisputedNonFraudTransactions: - JsonField - ) = apply { - this.priorUndisputedNonFraudTransactions = - priorUndisputedNonFraudTransactions - } + fun toBuilder() = Builder().from(this) - /** The reason the merchant re-presented the dispute. */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) + companion object { /** - * 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. + * Returns a mutable builder for constructing an instance of + * [ChargebackSubmitted]. */ - fun reason(reason: JsonField) = apply { this.reason = reason } + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ChargebackSubmitted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(chargebackSubmitted: ChargebackSubmitted) = apply { + additionalProperties = + chargebackSubmitted.additionalProperties.toMutableMap() + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -3732,62 +3699,21 @@ private constructor( } /** - * Returns an immutable instance of [MerchantPrearbitrationReceived]. + * Returns an immutable instance of [ChargebackSubmitted]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .compellingEvidence() - * .creditOrReversalProcessed() - * .delayedChargeTransaction() - * .evidenceOfImprint() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .priorUndisputedNonFraudTransactions() - * .reason() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): MerchantPrearbitrationReceived = - MerchantPrearbitrationReceived( - checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), - checkRequired("compellingEvidence", compellingEvidence), - checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), - checkRequired("delayedChargeTransaction", delayedChargeTransaction), - checkRequired("evidenceOfImprint", evidenceOfImprint), - checkRequired("invalidDispute", invalidDispute), - checkRequired( - "nonFiatCurrencyOrNonFungibleTokenReceived", - nonFiatCurrencyOrNonFungibleTokenReceived, - ), - checkRequired( - "priorUndisputedNonFraudTransactions", - priorUndisputedNonFraudTransactions, - ), - checkRequired("reason", reason), - additionalProperties.toMutableMap(), - ) + fun build(): ChargebackSubmitted = + ChargebackSubmitted(additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): MerchantPrearbitrationReceived = apply { + fun validate(): ChargebackSubmitted = apply { if (validated) { return@apply } - cardholderNoLongerDisputes().ifPresent { it.validate() } - compellingEvidence().ifPresent { it.validate() } - creditOrReversalProcessed().ifPresent { it.validate() } - delayedChargeTransaction().ifPresent { it.validate() } - evidenceOfImprint().ifPresent { it.validate() } - invalidDispute().ifPresent { it.validate() } - nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } - priorUndisputedNonFraudTransactions().ifPresent { it.validate() } - reason().validate() validated = true } @@ -3805,587 +3731,2716 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = - (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + - (compellingEvidence.asKnown().getOrNull()?.validity() ?: 0) + - (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + - (delayedChargeTransaction.asKnown().getOrNull()?.validity() ?: 0) + - (evidenceOfImprint.asKnown().getOrNull()?.validity() ?: 0) + - (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + - (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() - ?: 0) + - (priorUndisputedNonFraudTransactions.asKnown().getOrNull()?.validity() - ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) + @JvmSynthetic internal fun validity(): Int = 0 - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - */ - class CardholderNoLongerDisputes - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + return other is ChargebackSubmitted && + additionalProperties == other.additionalProperties + } - /** - * Explanation for why the merchant believes the cardholder no longer disputes - * the transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun explanation(): Optional = explanation.getOptional("explanation") + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + override fun hashCode(): Int = hashCode - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + override fun toString() = + "ChargebackSubmitted{additionalProperties=$additionalProperties}" + } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** + * A Card Dispute Chargeback Timed Out Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `chargeback_timed_out`. Contains the details specific to a chargeback timed out Visa + * Card Dispute Network Event, which represents that the chargeback has timed out in the + * user's favor. + */ + class ChargebackTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - fun toBuilder() = Builder().from(this) + @JsonCreator private constructor() : this(mutableMapOf()) - companion object { + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Returns a mutable builder for constructing an instance of - * [CardholderNoLongerDisputes]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** A builder for [CardholderNoLongerDisputes]. */ - class Builder internal constructor() { + fun toBuilder() = Builder().from(this) - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + companion object { - @JvmSynthetic - internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = - apply { - explanation = cardholderNoLongerDisputes.explanation - additionalProperties = - cardholderNoLongerDisputes.additionalProperties.toMutableMap() - } + /** + * Returns a mutable builder for constructing an instance of + * [ChargebackTimedOut]. + */ + @JvmStatic fun builder() = Builder() + } - /** - * Explanation for why the merchant believes the cardholder no longer - * disputes the transaction. - */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + /** A builder for [ChargebackTimedOut]. */ + class Builder internal constructor() { - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } - - 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) - } + @JvmSynthetic + internal fun from(chargebackTimedOut: ChargebackTimedOut) = apply { + additionalProperties = + chargebackTimedOut.additionalProperties.toMutableMap() + } - /** - * Returns an immutable instance of [CardholderNoLongerDisputes]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CardholderNoLongerDisputes = - CardholderNoLongerDisputes( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): CardholderNoLongerDisputes = apply { - if (validated) { - return@apply + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [ChargebackTimedOut]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + fun build(): ChargebackTimedOut = + ChargebackTimedOut(additionalProperties.toMutableMap()) + } - return other is CardholderNoLongerDisputes && - explanation == other.explanation && - additionalProperties == other.additionalProperties - } + private var validated: Boolean = false - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) + fun validate(): ChargebackTimedOut = apply { + if (validated) { + return@apply } - override fun hashCode(): Int = hashCode - - override fun toString() = - "CardholderNoLongerDisputes{explanation=$explanation, additionalProperties=$additionalProperties}" + validated = true } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + /** - * Compelling evidence details. Present if and only if `reason` is - * `compelling_evidence`. + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. */ - class CompellingEvidence - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val category: JsonField, - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of(), - ) : this(category, explanation, mutableMapOf()) - - /** - * The category of compelling evidence provided by the merchant. - * - * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") - - /** - * Explanation of the compelling evidence provided by the merchant. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun explanation(): Optional = explanation.getOptional("explanation") - - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("category") - @ExcludeMissing - fun _category(): JsonField = category - - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + @JvmSynthetic internal fun validity(): Int = 0 - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) - - fun toBuilder() = Builder().from(this) - - companion object { - - /** - * Returns a mutable builder for constructing an instance of - * [CompellingEvidence]. - * - * The following fields are required: - * ```java - * .category() - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + return other is ChargebackTimedOut && + additionalProperties == other.additionalProperties + } - /** A builder for [CompellingEvidence]. */ - class Builder internal constructor() { + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - private var category: JsonField? = null - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + override fun hashCode(): Int = hashCode - @JvmSynthetic - internal fun from(compellingEvidence: CompellingEvidence) = apply { - category = compellingEvidence.category - explanation = compellingEvidence.explanation - additionalProperties = - compellingEvidence.additionalProperties.toMutableMap() - } + override fun toString() = + "ChargebackTimedOut{additionalProperties=$additionalProperties}" + } - /** The category of compelling evidence provided by the merchant. */ - fun category(category: Category) = category(JsonField.of(category)) + /** + * A Card Dispute Merchant Pre-Arbitration Decline Submitted Visa Network Event object. + * This field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_decline_submitted`. Contains the details specific to a + * merchant prearbitration decline submitted Visa Card Dispute Network Event, which + * represents that the user has declined the merchant's request for a prearbitration + * request decision in their favor. + */ + class MerchantPrearbitrationDeclineSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun category(category: JsonField) = apply { - this.category = category - } + @JsonCreator private constructor() : this(mutableMapOf()) - /** Explanation of the compelling evidence provided by the merchant. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + fun toBuilder() = Builder().from(this) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + companion object { - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * Returns a mutable builder for constructing an instance of + * [MerchantPrearbitrationDeclineSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + /** A builder for [MerchantPrearbitrationDeclineSubmitted]. */ + class Builder internal constructor() { - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + private var additionalProperties: MutableMap = mutableMapOf() - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + @JvmSynthetic + internal fun from( + merchantPrearbitrationDeclineSubmitted: + MerchantPrearbitrationDeclineSubmitted + ) = apply { + additionalProperties = + merchantPrearbitrationDeclineSubmitted.additionalProperties + .toMutableMap() + } - /** - * Returns an immutable instance of [CompellingEvidence]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .category() - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CompellingEvidence = - CompellingEvidence( - checkRequired("category", category), - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): CompellingEvidence = apply { - if (validated) { - return@apply + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - category().validate() - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [MerchantPrearbitrationDeclineSubmitted]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = - (category.asKnown().getOrNull()?.validity() ?: 0) + - (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): MerchantPrearbitrationDeclineSubmitted = + MerchantPrearbitrationDeclineSubmitted(additionalProperties.toMutableMap()) + } - /** The category of compelling evidence provided by the merchant. */ - class Category - @JsonCreator - private constructor(private val value: JsonField) : Enum { + private var validated: Boolean = false - /** - * 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 + fun validate(): MerchantPrearbitrationDeclineSubmitted = apply { + if (validated) { + return@apply + } - companion object { + validated = true + } - /** Authorized signer known by the cardholder. */ - @JvmField val AUTHORIZED_SIGNER = of("authorized_signer") + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - /** Proof of delivery. */ - @JvmField val DELIVERY = of("delivery") + /** + * 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 = 0 - /** Proof of delivery to cardholder at place of employment. */ - @JvmField - val DELIVERY_AT_PLACE_OF_EMPLOYMENT = - of("delivery_at_place_of_employment") + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** Proof of digital goods download. */ - @JvmField val DIGITAL_GOODS_DOWNLOAD = of("digital_goods_download") + return other is MerchantPrearbitrationDeclineSubmitted && + additionalProperties == other.additionalProperties + } - /** Dynamic Currency Conversion actively chosen by cardholder. */ - @JvmField - val DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN = - of("dynamic_currency_conversion_actively_chosen") + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** Flight manifest with corresponding purchase itinerary record. */ - @JvmField - val FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY = - of("flight_manifest_and_purchase_itinerary") + override fun hashCode(): Int = hashCode - /** Signer is member of cardholder's household. */ - @JvmField val HOUSEHOLD_MEMBER_SIGNER = of("household_member_signer") + override fun toString() = + "MerchantPrearbitrationDeclineSubmitted{additionalProperties=$additionalProperties}" + } - /** - * Legitimate spend across multiple payment types for same merchandise. - */ - @JvmField - val LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE = - of("legitimate_spend_across_payment_types_for_same_merchandise") + /** + * A Card Dispute Merchant Pre-Arbitration Received Visa Network Event object. This + * field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_received`. Contains the details specific to a merchant + * prearbitration received Visa Card Dispute Network Event, which represents that the + * merchant has issued a prearbitration request in the user's favor. + */ + class MerchantPrearbitrationReceived + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardholderNoLongerDisputes: JsonField, + private val compellingEvidence: JsonField, + private val creditOrReversalProcessed: JsonField, + private val delayedChargeTransaction: JsonField, + private val evidenceOfImprint: JsonField, + private val invalidDispute: JsonField, + private val nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField, + private val priorUndisputedNonFraudTransactions: + JsonField, + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { - /** - * Documentation to prove the cardholder is in possession of and/or - * using the merchandise. - */ - @JvmField val MERCHANDISE_USE = of("merchandise_use") + @JsonCreator + private constructor( + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + cardholderNoLongerDisputes: JsonField = + JsonMissing.of(), + @JsonProperty("compelling_evidence") + @ExcludeMissing + compellingEvidence: JsonField = JsonMissing.of(), + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + creditOrReversalProcessed: JsonField = + JsonMissing.of(), + @JsonProperty("delayed_charge_transaction") + @ExcludeMissing + delayedChargeTransaction: JsonField = + JsonMissing.of(), + @JsonProperty("evidence_of_imprint") + @ExcludeMissing + evidenceOfImprint: JsonField = JsonMissing.of(), + @JsonProperty("invalid_dispute") + @ExcludeMissing + invalidDispute: JsonField = JsonMissing.of(), + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField = + JsonMissing.of(), + @JsonProperty("prior_undisputed_non_fraud_transactions") + @ExcludeMissing + priorUndisputedNonFraudTransactions: + JsonField = + JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + ) : this( + cardholderNoLongerDisputes, + compellingEvidence, + creditOrReversalProcessed, + delayedChargeTransaction, + evidenceOfImprint, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenReceived, + priorUndisputedNonFraudTransactions, + reason, + mutableMapOf(), + ) - /** - * Passenger transport: proof ticket was received, scanned at gate or - * other transaction related to original (for example, frequent flyer - * miles.) - */ - @JvmField - val PASSENGER_TRANSPORT_TICKET_USE = - of("passenger_transport_ticket_use") + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun cardholderNoLongerDisputes(): Optional = + cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") - /** - * Recurring transaction with binding contract or previous undisputed + /** + * Compelling evidence details. Present if and only if `reason` is + * `compelling_evidence`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun compellingEvidence(): Optional = + compellingEvidence.getOptional("compelling_evidence") + + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun creditOrReversalProcessed(): Optional = + creditOrReversalProcessed.getOptional("credit_or_reversal_processed") + + /** + * Delayed charge transaction details. Present if and only if `reason` is + * `delayed_charge_transaction`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun delayedChargeTransaction(): Optional = + delayedChargeTransaction.getOptional("delayed_charge_transaction") + + /** + * Evidence of imprint details. Present if and only if `reason` is + * `evidence_of_imprint`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun evidenceOfImprint(): Optional = + evidenceOfImprint.getOptional("evidence_of_imprint") + + /** + * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun invalidDispute(): Optional = + invalidDispute.getOptional("invalid_dispute") + + /** + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived(): + Optional = + nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( + "non_fiat_currency_or_non_fungible_token_received" + ) + + /** + * Prior undisputed non-fraud transactions details. Present if and only if `reason` + * is `prior_undisputed_non_fraud_transactions`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun priorUndisputedNonFraudTransactions(): + Optional = + priorUndisputedNonFraudTransactions.getOptional( + "prior_undisputed_non_fraud_transactions" + ) + + /** + * The reason the merchant re-presented the dispute. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [cardholderNoLongerDisputes]. + * + * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + fun _cardholderNoLongerDisputes(): JsonField = + cardholderNoLongerDisputes + + /** + * Returns the raw JSON value of [compellingEvidence]. + * + * Unlike [compellingEvidence], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("compelling_evidence") + @ExcludeMissing + fun _compellingEvidence(): JsonField = compellingEvidence + + /** + * Returns the raw JSON value of [creditOrReversalProcessed]. + * + * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + fun _creditOrReversalProcessed(): JsonField = + creditOrReversalProcessed + + /** + * Returns the raw JSON value of [delayedChargeTransaction]. + * + * Unlike [delayedChargeTransaction], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("delayed_charge_transaction") + @ExcludeMissing + fun _delayedChargeTransaction(): JsonField = + delayedChargeTransaction + + /** + * Returns the raw JSON value of [evidenceOfImprint]. + * + * Unlike [evidenceOfImprint], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("evidence_of_imprint") + @ExcludeMissing + fun _evidenceOfImprint(): JsonField = evidenceOfImprint + + /** + * Returns the raw JSON value of [invalidDispute]. + * + * Unlike [invalidDispute], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("invalid_dispute") + @ExcludeMissing + fun _invalidDispute(): JsonField = invalidDispute + + /** + * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. + * + * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if + * the JSON field has an unexpected type. + */ + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenReceived(): + JsonField = + nonFiatCurrencyOrNonFungibleTokenReceived + + /** + * Returns the raw JSON value of [priorUndisputedNonFraudTransactions]. + * + * Unlike [priorUndisputedNonFraudTransactions], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("prior_undisputed_non_fraud_transactions") + @ExcludeMissing + fun _priorUndisputedNonFraudTransactions(): + JsonField = + priorUndisputedNonFraudTransactions + + /** + * 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 + * [MerchantPrearbitrationReceived]. + * + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .compellingEvidence() + * .creditOrReversalProcessed() + * .delayedChargeTransaction() + * .evidenceOfImprint() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .priorUndisputedNonFraudTransactions() + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MerchantPrearbitrationReceived]. */ + class Builder internal constructor() { + + private var cardholderNoLongerDisputes: JsonField? = + null + private var compellingEvidence: JsonField? = null + private var creditOrReversalProcessed: JsonField? = + null + private var delayedChargeTransaction: JsonField? = + null + private var evidenceOfImprint: JsonField? = null + private var invalidDispute: JsonField? = null + private var nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField? = + null + private var priorUndisputedNonFraudTransactions: + JsonField? = + null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + merchantPrearbitrationReceived: MerchantPrearbitrationReceived + ) = apply { + cardholderNoLongerDisputes = + merchantPrearbitrationReceived.cardholderNoLongerDisputes + compellingEvidence = merchantPrearbitrationReceived.compellingEvidence + creditOrReversalProcessed = + merchantPrearbitrationReceived.creditOrReversalProcessed + delayedChargeTransaction = + merchantPrearbitrationReceived.delayedChargeTransaction + evidenceOfImprint = merchantPrearbitrationReceived.evidenceOfImprint + invalidDispute = merchantPrearbitrationReceived.invalidDispute + nonFiatCurrencyOrNonFungibleTokenReceived = + merchantPrearbitrationReceived.nonFiatCurrencyOrNonFungibleTokenReceived + priorUndisputedNonFraudTransactions = + merchantPrearbitrationReceived.priorUndisputedNonFraudTransactions + reason = merchantPrearbitrationReceived.reason + additionalProperties = + merchantPrearbitrationReceived.additionalProperties.toMutableMap() + } + + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: CardholderNoLongerDisputes? + ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) + + /** + * Alias for calling [Builder.cardholderNoLongerDisputes] with + * `cardholderNoLongerDisputes.orElse(null)`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: Optional + ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) + + /** + * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderNoLongerDisputes] with a + * well-typed [CardholderNoLongerDisputes] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: JsonField + ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } + + /** + * Compelling evidence details. Present if and only if `reason` is + * `compelling_evidence`. + */ + fun compellingEvidence(compellingEvidence: CompellingEvidence?) = + compellingEvidence(JsonField.ofNullable(compellingEvidence)) + + /** + * Alias for calling [Builder.compellingEvidence] with + * `compellingEvidence.orElse(null)`. + */ + fun compellingEvidence(compellingEvidence: Optional) = + compellingEvidence(compellingEvidence.getOrNull()) + + /** + * Sets [Builder.compellingEvidence] to an arbitrary JSON value. + * + * You should usually call [Builder.compellingEvidence] with a well-typed + * [CompellingEvidence] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun compellingEvidence(compellingEvidence: JsonField) = + apply { + this.compellingEvidence = compellingEvidence + } + + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: CreditOrReversalProcessed? + ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) + + /** + * Alias for calling [Builder.creditOrReversalProcessed] with + * `creditOrReversalProcessed.orElse(null)`. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: Optional + ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) + + /** + * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. + * + * You should usually call [Builder.creditOrReversalProcessed] with a well-typed + * [CreditOrReversalProcessed] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: JsonField + ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } + + /** + * Delayed charge transaction details. Present if and only if `reason` is + * `delayed_charge_transaction`. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: DelayedChargeTransaction? + ) = delayedChargeTransaction(JsonField.ofNullable(delayedChargeTransaction)) + + /** + * Alias for calling [Builder.delayedChargeTransaction] with + * `delayedChargeTransaction.orElse(null)`. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: Optional + ) = delayedChargeTransaction(delayedChargeTransaction.getOrNull()) + + /** + * Sets [Builder.delayedChargeTransaction] to an arbitrary JSON value. + * + * You should usually call [Builder.delayedChargeTransaction] with a well-typed + * [DelayedChargeTransaction] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun delayedChargeTransaction( + delayedChargeTransaction: JsonField + ) = apply { this.delayedChargeTransaction = delayedChargeTransaction } + + /** + * Evidence of imprint details. Present if and only if `reason` is + * `evidence_of_imprint`. + */ + fun evidenceOfImprint(evidenceOfImprint: EvidenceOfImprint?) = + evidenceOfImprint(JsonField.ofNullable(evidenceOfImprint)) + + /** + * Alias for calling [Builder.evidenceOfImprint] with + * `evidenceOfImprint.orElse(null)`. + */ + fun evidenceOfImprint(evidenceOfImprint: Optional) = + evidenceOfImprint(evidenceOfImprint.getOrNull()) + + /** + * Sets [Builder.evidenceOfImprint] to an arbitrary JSON value. + * + * You should usually call [Builder.evidenceOfImprint] with a well-typed + * [EvidenceOfImprint] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun evidenceOfImprint(evidenceOfImprint: JsonField) = apply { + this.evidenceOfImprint = evidenceOfImprint + } + + /** + * Invalid dispute details. Present if and only if `reason` is + * `invalid_dispute`. + */ + fun invalidDispute(invalidDispute: InvalidDispute?) = + invalidDispute(JsonField.ofNullable(invalidDispute)) + + /** + * Alias for calling [Builder.invalidDispute] with + * `invalidDispute.orElse(null)`. + */ + fun invalidDispute(invalidDispute: Optional) = + invalidDispute(invalidDispute.getOrNull()) + + /** + * Sets [Builder.invalidDispute] to an arbitrary JSON value. + * + * You should usually call [Builder.invalidDispute] with a well-typed + * [InvalidDispute] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun invalidDispute(invalidDispute: JsonField) = apply { + this.invalidDispute = invalidDispute + } + + /** + * Non-fiat currency or non-fungible token received details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived? + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) + ) + + /** + * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with + * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + Optional + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() + ) + + /** + * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON + * value. + * + * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] + * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField + ) = apply { + this.nonFiatCurrencyOrNonFungibleTokenReceived = + nonFiatCurrencyOrNonFungibleTokenReceived + } + + /** + * Prior undisputed non-fraud transactions details. Present if and only if + * `reason` is `prior_undisputed_non_fraud_transactions`. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions? + ) = + priorUndisputedNonFraudTransactions( + JsonField.ofNullable(priorUndisputedNonFraudTransactions) + ) + + /** + * Alias for calling [Builder.priorUndisputedNonFraudTransactions] with + * `priorUndisputedNonFraudTransactions.orElse(null)`. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: + Optional + ) = + priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions.getOrNull() + ) + + /** + * Sets [Builder.priorUndisputedNonFraudTransactions] to an arbitrary JSON + * value. + * + * You should usually call [Builder.priorUndisputedNonFraudTransactions] with a + * well-typed [PriorUndisputedNonFraudTransactions] value instead. This method + * is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun priorUndisputedNonFraudTransactions( + priorUndisputedNonFraudTransactions: + JsonField + ) = apply { + this.priorUndisputedNonFraudTransactions = + priorUndisputedNonFraudTransactions + } + + /** The reason the merchant re-presented the dispute. */ + 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 [MerchantPrearbitrationReceived]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .compellingEvidence() + * .creditOrReversalProcessed() + * .delayedChargeTransaction() + * .evidenceOfImprint() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .priorUndisputedNonFraudTransactions() + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): MerchantPrearbitrationReceived = + MerchantPrearbitrationReceived( + checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), + checkRequired("compellingEvidence", compellingEvidence), + checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), + checkRequired("delayedChargeTransaction", delayedChargeTransaction), + checkRequired("evidenceOfImprint", evidenceOfImprint), + checkRequired("invalidDispute", invalidDispute), + checkRequired( + "nonFiatCurrencyOrNonFungibleTokenReceived", + nonFiatCurrencyOrNonFungibleTokenReceived, + ), + checkRequired( + "priorUndisputedNonFraudTransactions", + priorUndisputedNonFraudTransactions, + ), + checkRequired("reason", reason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): MerchantPrearbitrationReceived = apply { + if (validated) { + return@apply + } + + cardholderNoLongerDisputes().ifPresent { it.validate() } + compellingEvidence().ifPresent { it.validate() } + creditOrReversalProcessed().ifPresent { it.validate() } + delayedChargeTransaction().ifPresent { it.validate() } + evidenceOfImprint().ifPresent { it.validate() } + invalidDispute().ifPresent { it.validate() } + nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } + priorUndisputedNonFraudTransactions().ifPresent { it.validate() } + reason().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + + (compellingEvidence.asKnown().getOrNull()?.validity() ?: 0) + + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + + (delayedChargeTransaction.asKnown().getOrNull()?.validity() ?: 0) + + (evidenceOfImprint.asKnown().getOrNull()?.validity() ?: 0) + + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() + ?: 0) + + (priorUndisputedNonFraudTransactions.asKnown().getOrNull()?.validity() + ?: 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + */ + class CardholderNoLongerDisputes + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val explanation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) + + /** + * Explanation for why the merchant believes the cardholder no longer disputes + * the transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + @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 + * [CardholderNoLongerDisputes]. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderNoLongerDisputes]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = + apply { + explanation = cardholderNoLongerDisputes.explanation + additionalProperties = + cardholderNoLongerDisputes.additionalProperties.toMutableMap() + } + + /** + * Explanation for why the merchant believes the cardholder no longer + * disputes the transaction. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + 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 [CardholderNoLongerDisputes]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardholderNoLongerDisputes = + CardholderNoLongerDisputes( + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardholderNoLongerDisputes = apply { + if (validated) { + return@apply + } + + explanation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardholderNoLongerDisputes && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardholderNoLongerDisputes{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** + * Compelling evidence details. Present if and only if `reason` is + * `compelling_evidence`. + */ + class CompellingEvidence + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val explanation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of(), + ) : this(category, explanation, mutableMapOf()) + + /** + * The category of compelling evidence provided by the merchant. + * + * @throws IncreaseInvalidDataException 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 category(): Category = category.getRequired("category") + + /** + * Explanation of the compelling evidence provided by the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("category") + @ExcludeMissing + fun _category(): JsonField = category + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + @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 + * [CompellingEvidence]. + * + * The following fields are required: + * ```java + * .category() + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CompellingEvidence]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(compellingEvidence: CompellingEvidence) = apply { + category = compellingEvidence.category + explanation = compellingEvidence.explanation + additionalProperties = + compellingEvidence.additionalProperties.toMutableMap() + } + + /** The category of compelling evidence provided by the merchant. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun category(category: JsonField) = apply { + this.category = category + } + + /** Explanation of the compelling evidence provided by the merchant. */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + 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 [CompellingEvidence]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CompellingEvidence = + CompellingEvidence( + checkRequired("category", category), + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CompellingEvidence = apply { + if (validated) { + return@apply + } + + category().validate() + explanation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (if (explanation.asKnown().isPresent) 1 else 0) + + /** The category of compelling evidence provided by the merchant. */ + class Category + @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 { + + /** Authorized signer known by the cardholder. */ + @JvmField val AUTHORIZED_SIGNER = of("authorized_signer") + + /** Proof of delivery. */ + @JvmField val DELIVERY = of("delivery") + + /** Proof of delivery to cardholder at place of employment. */ + @JvmField + val DELIVERY_AT_PLACE_OF_EMPLOYMENT = + of("delivery_at_place_of_employment") + + /** Proof of digital goods download. */ + @JvmField val DIGITAL_GOODS_DOWNLOAD = of("digital_goods_download") + + /** Dynamic Currency Conversion actively chosen by cardholder. */ + @JvmField + val DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN = + of("dynamic_currency_conversion_actively_chosen") + + /** Flight manifest with corresponding purchase itinerary record. */ + @JvmField + val FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY = + of("flight_manifest_and_purchase_itinerary") + + /** Signer is member of cardholder's household. */ + @JvmField val HOUSEHOLD_MEMBER_SIGNER = of("household_member_signer") + + /** + * Legitimate spend across multiple payment types for same merchandise. + */ + @JvmField + val LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE = + of("legitimate_spend_across_payment_types_for_same_merchandise") + + /** + * Documentation to prove the cardholder is in possession of and/or + * using the merchandise. + */ + @JvmField val MERCHANDISE_USE = of("merchandise_use") + + /** + * Passenger transport: proof ticket was received, scanned at gate or + * other transaction related to original (for example, frequent flyer + * miles.) + */ + @JvmField + val PASSENGER_TRANSPORT_TICKET_USE = + of("passenger_transport_ticket_use") + + /** + * Recurring transaction with binding contract or previous undisputed + * recurring transactions and proof the cardholder is using the + * merchandise or service. + */ + @JvmField + val RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION = + of( + "recurring_transaction_with_binding_contract_or_previous_undisputed_transaction" + ) + + /** + * Signed delivery form, or copy of/details of identification from + * cardholder as proof goods were picked up at merchant location. + */ + @JvmField + val SIGNED_DELIVERY_OR_PICKUP_FORM = + of("signed_delivery_or_pickup_form") + + /** Signed Mail Order/Phone Order form. */ + @JvmField + val SIGNED_MAIL_ORDER_PHONE_ORDER_FORM = + of("signed_mail_order_phone_order_form") + + /** Travel & Expense: loyalty transactions related to purchase. */ + @JvmField + val TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION = + of("travel_and_expense_loyalty_transaction") + + /** + * Travel & Expense: subsequent purchases made throughout service + * period. + */ + @JvmField + val TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE = + of("travel_and_expense_subsequent_purchase") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** Authorized signer known by the cardholder. */ + AUTHORIZED_SIGNER, + /** Proof of delivery. */ + DELIVERY, + /** Proof of delivery to cardholder at place of employment. */ + DELIVERY_AT_PLACE_OF_EMPLOYMENT, + /** Proof of digital goods download. */ + DIGITAL_GOODS_DOWNLOAD, + /** Dynamic Currency Conversion actively chosen by cardholder. */ + DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN, + /** Flight manifest with corresponding purchase itinerary record. */ + FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY, + /** Signer is member of cardholder's household. */ + HOUSEHOLD_MEMBER_SIGNER, + /** + * Legitimate spend across multiple payment types for same merchandise. + */ + LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE, + /** + * Documentation to prove the cardholder is in possession of and/or + * using the merchandise. + */ + MERCHANDISE_USE, + /** + * Passenger transport: proof ticket was received, scanned at gate or + * other transaction related to original (for example, frequent flyer + * miles.) + */ + PASSENGER_TRANSPORT_TICKET_USE, + /** + * Recurring transaction with binding contract or previous undisputed + * recurring transactions and proof the cardholder is using the + * merchandise or service. + */ + RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION, + /** + * Signed delivery form, or copy of/details of identification from + * cardholder as proof goods were picked up at merchant location. + */ + SIGNED_DELIVERY_OR_PICKUP_FORM, + /** Signed Mail Order/Phone Order form. */ + SIGNED_MAIL_ORDER_PHONE_ORDER_FORM, + /** Travel & Expense: loyalty transactions related to purchase. */ + TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION, + /** + * Travel & Expense: subsequent purchases made throughout service + * period. + */ + TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Category] 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 { + /** Authorized signer known by the cardholder. */ + AUTHORIZED_SIGNER, + /** Proof of delivery. */ + DELIVERY, + /** Proof of delivery to cardholder at place of employment. */ + DELIVERY_AT_PLACE_OF_EMPLOYMENT, + /** Proof of digital goods download. */ + DIGITAL_GOODS_DOWNLOAD, + /** Dynamic Currency Conversion actively chosen by cardholder. */ + DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN, + /** Flight manifest with corresponding purchase itinerary record. */ + FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY, + /** Signer is member of cardholder's household. */ + HOUSEHOLD_MEMBER_SIGNER, + /** + * Legitimate spend across multiple payment types for same merchandise. + */ + LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE, + /** + * Documentation to prove the cardholder is in possession of and/or + * using the merchandise. + */ + MERCHANDISE_USE, + /** + * Passenger transport: proof ticket was received, scanned at gate or + * other transaction related to original (for example, frequent flyer + * miles.) + */ + PASSENGER_TRANSPORT_TICKET_USE, + /** + * Recurring transaction with binding contract or previous undisputed * recurring transactions and proof the cardholder is using the * merchandise or service. */ - @JvmField - val RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION = - of( - "recurring_transaction_with_binding_contract_or_previous_undisputed_transaction" - ) + RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION, + /** + * Signed delivery form, or copy of/details of identification from + * cardholder as proof goods were picked up at merchant location. + */ + SIGNED_DELIVERY_OR_PICKUP_FORM, + /** Signed Mail Order/Phone Order form. */ + SIGNED_MAIL_ORDER_PHONE_ORDER_FORM, + /** Travel & Expense: loyalty transactions related to purchase. */ + TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION, + /** + * Travel & Expense: subsequent purchases made throughout service + * period. + */ + TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE, + /** + * An enum member indicating that [Category] 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) { + AUTHORIZED_SIGNER -> Value.AUTHORIZED_SIGNER + DELIVERY -> Value.DELIVERY + DELIVERY_AT_PLACE_OF_EMPLOYMENT -> + Value.DELIVERY_AT_PLACE_OF_EMPLOYMENT + DIGITAL_GOODS_DOWNLOAD -> Value.DIGITAL_GOODS_DOWNLOAD + DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN -> + Value.DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN + FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY -> + Value.FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY + HOUSEHOLD_MEMBER_SIGNER -> Value.HOUSEHOLD_MEMBER_SIGNER + LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE -> + Value.LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE + MERCHANDISE_USE -> Value.MERCHANDISE_USE + PASSENGER_TRANSPORT_TICKET_USE -> + Value.PASSENGER_TRANSPORT_TICKET_USE + RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION -> + Value + .RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION + SIGNED_DELIVERY_OR_PICKUP_FORM -> + Value.SIGNED_DELIVERY_OR_PICKUP_FORM + SIGNED_MAIL_ORDER_PHONE_ORDER_FORM -> + Value.SIGNED_MAIL_ORDER_PHONE_ORDER_FORM + TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION -> + Value.TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION + TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE -> + Value.TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + AUTHORIZED_SIGNER -> Known.AUTHORIZED_SIGNER + DELIVERY -> Known.DELIVERY + DELIVERY_AT_PLACE_OF_EMPLOYMENT -> + Known.DELIVERY_AT_PLACE_OF_EMPLOYMENT + DIGITAL_GOODS_DOWNLOAD -> Known.DIGITAL_GOODS_DOWNLOAD + DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN -> + Known.DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN + FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY -> + Known.FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY + HOUSEHOLD_MEMBER_SIGNER -> Known.HOUSEHOLD_MEMBER_SIGNER + LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE -> + Known.LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE + MERCHANDISE_USE -> Known.MERCHANDISE_USE + PASSENGER_TRANSPORT_TICKET_USE -> + Known.PASSENGER_TRANSPORT_TICKET_USE + RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION -> + Known + .RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION + SIGNED_DELIVERY_OR_PICKUP_FORM -> + Known.SIGNED_DELIVERY_OR_PICKUP_FORM + SIGNED_MAIL_ORDER_PHONE_ORDER_FORM -> + Known.SIGNED_MAIL_ORDER_PHONE_ORDER_FORM + TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION -> + Known.TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION + TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE -> + Known.TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE + else -> + throw IncreaseInvalidDataException("Unknown Category: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 Category && 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 CompellingEvidence && + category == other.category && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CompellingEvidence{category=$category, explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + */ + class CreditOrReversalProcessed + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val explanation: JsonField, + private val processedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of(), + @JsonProperty("processed_at") + @ExcludeMissing + processedAt: JsonField = JsonMissing.of(), + ) : this(amount, currency, explanation, processedAt, mutableMapOf()) + + /** + * The amount of the credit or reversal in the minor unit of its currency. For + * dollars, for example, this is cents. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the credit or + * reversal's currency. + * + * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + + /** + * Explanation for why the merchant believes the credit or reversal was + * processed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * The date the credit or reversal was processed. + * + * @throws IncreaseInvalidDataException 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 processedAt(): LocalDate = processedAt.getRequired("processed_at") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + /** + * Returns the raw JSON value of [processedAt]. + * + * Unlike [processedAt], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("processed_at") + @ExcludeMissing + fun _processedAt(): JsonField = processedAt + + @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 + * [CreditOrReversalProcessed]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * .explanation() + * .processedAt() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CreditOrReversalProcessed]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var explanation: JsonField? = null + private var processedAt: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(creditOrReversalProcessed: CreditOrReversalProcessed) = + apply { + amount = creditOrReversalProcessed.amount + currency = creditOrReversalProcessed.currency + explanation = creditOrReversalProcessed.explanation + processedAt = creditOrReversalProcessed.processedAt + additionalProperties = + creditOrReversalProcessed.additionalProperties.toMutableMap() + } + + /** + * The amount of the credit or reversal in the minor unit of its currency. + * For dollars, for example, this is cents. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * credit or reversal's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + /** + * Explanation for why the merchant believes the credit or reversal was + * processed. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + /** The date the credit or reversal was processed. */ + fun processedAt(processedAt: LocalDate) = + processedAt(JsonField.of(processedAt)) + + /** + * Sets [Builder.processedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.processedAt] with a well-typed + * [LocalDate] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun processedAt(processedAt: JsonField) = apply { + this.processedAt = processedAt + } + + 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 [CreditOrReversalProcessed]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * .explanation() + * .processedAt() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CreditOrReversalProcessed = + CreditOrReversalProcessed( + checkRequired("amount", amount), + checkRequired("currency", currency), + checkRequired("explanation", explanation), + checkRequired("processedAt", processedAt), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CreditOrReversalProcessed = apply { + if (validated) { + return@apply + } + + amount() + currency() + explanation() + processedAt() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + (if (explanation.asKnown().isPresent) 1 else 0) + + (if (processedAt.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CreditOrReversalProcessed && + amount == other.amount && + currency == other.currency && + explanation == other.explanation && + processedAt == other.processedAt && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + amount, + currency, + explanation, + processedAt, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CreditOrReversalProcessed{amount=$amount, currency=$currency, explanation=$explanation, processedAt=$processedAt, additionalProperties=$additionalProperties}" + } + + /** + * Delayed charge transaction details. Present if and only if `reason` is + * `delayed_charge_transaction`. + */ + class DelayedChargeTransaction + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val explanation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) + + /** + * Additional details about the delayed charge transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + @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 + * [DelayedChargeTransaction]. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DelayedChargeTransaction]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(delayedChargeTransaction: DelayedChargeTransaction) = + apply { + explanation = delayedChargeTransaction.explanation + additionalProperties = + delayedChargeTransaction.additionalProperties.toMutableMap() + } + + /** Additional details about the delayed charge transaction. */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + 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 [DelayedChargeTransaction]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DelayedChargeTransaction = + DelayedChargeTransaction( + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DelayedChargeTransaction = apply { + if (validated) { + return@apply + } + + explanation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DelayedChargeTransaction && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DelayedChargeTransaction{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** + * Evidence of imprint details. Present if and only if `reason` is + * `evidence_of_imprint`. + */ + class EvidenceOfImprint + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val explanation: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) + + /** + * Explanation of the evidence of imprint. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + @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 + * [EvidenceOfImprint]. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [EvidenceOfImprint]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(evidenceOfImprint: EvidenceOfImprint) = apply { + explanation = evidenceOfImprint.explanation + additionalProperties = + evidenceOfImprint.additionalProperties.toMutableMap() + } + + /** Explanation of the evidence of imprint. */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + 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 [EvidenceOfImprint]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): EvidenceOfImprint = + EvidenceOfImprint( + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): EvidenceOfImprint = apply { + if (validated) { + return@apply + } + + explanation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is EvidenceOfImprint && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "EvidenceOfImprint{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** + * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + */ + class InvalidDispute + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val explanation: JsonField, + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("explanation") + @ExcludeMissing + explanation: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + ) : this(explanation, reason, mutableMapOf()) + + /** + * Explanation for why the dispute is considered invalid by the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun explanation(): Optional = explanation.getOptional("explanation") + + /** + * The reason a merchant considers the dispute invalid. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [explanation]. + * + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("explanation") + @ExcludeMissing + fun _explanation(): JsonField = explanation + + /** + * 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 + * [InvalidDispute]. + * + * The following fields are required: + * ```java + * .explanation() + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InvalidDispute]. */ + class Builder internal constructor() { + + private var explanation: JsonField? = null + private var reason: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(invalidDispute: InvalidDispute) = apply { + explanation = invalidDispute.explanation + reason = invalidDispute.reason + additionalProperties = + invalidDispute.additionalProperties.toMutableMap() + } + + /** + * Explanation for why the dispute is considered invalid by the merchant. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) + + /** + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. + */ + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) + + /** + * Sets [Builder.explanation] to an arbitrary JSON value. + * + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + /** The reason a merchant considers the dispute invalid. */ + 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) + } - /** - * Signed delivery form, or copy of/details of identification from - * cardholder as proof goods were picked up at merchant location. - */ - @JvmField - val SIGNED_DELIVERY_OR_PICKUP_FORM = - of("signed_delivery_or_pickup_form") + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } - /** Signed Mail Order/Phone Order form. */ - @JvmField - val SIGNED_MAIL_ORDER_PHONE_ORDER_FORM = - of("signed_mail_order_phone_order_form") + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - /** Travel & Expense: loyalty transactions related to purchase. */ - @JvmField - val TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION = - of("travel_and_expense_loyalty_transaction") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } - /** - * Travel & Expense: subsequent purchases made throughout service - * period. - */ + /** + * Returns an immutable instance of [InvalidDispute]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): InvalidDispute = + InvalidDispute( + checkRequired("explanation", explanation), + checkRequired("reason", reason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): InvalidDispute = apply { + if (validated) { + return@apply + } + + explanation() + reason().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (explanation.asKnown().isPresent) 1 else 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + /** The reason a merchant considers the dispute invalid. */ + 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 { + + /** Other. */ + @JvmField val OTHER = of("other") + + /** Special authorization procedures followed. */ @JvmField - val TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE = - of("travel_and_expense_subsequent_purchase") + val SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED = + of("special_authorization_procedures_followed") - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } - /** An enum containing [Category]'s known values. */ + /** An enum containing [Reason]'s known values. */ enum class Known { - /** Authorized signer known by the cardholder. */ - AUTHORIZED_SIGNER, - /** Proof of delivery. */ - DELIVERY, - /** Proof of delivery to cardholder at place of employment. */ - DELIVERY_AT_PLACE_OF_EMPLOYMENT, - /** Proof of digital goods download. */ - DIGITAL_GOODS_DOWNLOAD, - /** Dynamic Currency Conversion actively chosen by cardholder. */ - DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN, - /** Flight manifest with corresponding purchase itinerary record. */ - FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY, - /** Signer is member of cardholder's household. */ - HOUSEHOLD_MEMBER_SIGNER, - /** - * Legitimate spend across multiple payment types for same merchandise. - */ - LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE, - /** - * Documentation to prove the cardholder is in possession of and/or - * using the merchandise. - */ - MERCHANDISE_USE, - /** - * Passenger transport: proof ticket was received, scanned at gate or - * other transaction related to original (for example, frequent flyer - * miles.) - */ - PASSENGER_TRANSPORT_TICKET_USE, - /** - * Recurring transaction with binding contract or previous undisputed - * recurring transactions and proof the cardholder is using the - * merchandise or service. - */ - RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION, - /** - * Signed delivery form, or copy of/details of identification from - * cardholder as proof goods were picked up at merchant location. - */ - SIGNED_DELIVERY_OR_PICKUP_FORM, - /** Signed Mail Order/Phone Order form. */ - SIGNED_MAIL_ORDER_PHONE_ORDER_FORM, - /** Travel & Expense: loyalty transactions related to purchase. */ - TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION, - /** - * Travel & Expense: subsequent purchases made throughout service - * period. - */ - TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE, + /** Other. */ + OTHER, + /** Special authorization procedures followed. */ + SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED, } /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] * member. * - * An instance of [Category] can contain an unknown value in a couple of + * 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 @@ -4393,57 +6448,12 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** Authorized signer known by the cardholder. */ - AUTHORIZED_SIGNER, - /** Proof of delivery. */ - DELIVERY, - /** Proof of delivery to cardholder at place of employment. */ - DELIVERY_AT_PLACE_OF_EMPLOYMENT, - /** Proof of digital goods download. */ - DIGITAL_GOODS_DOWNLOAD, - /** Dynamic Currency Conversion actively chosen by cardholder. */ - DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN, - /** Flight manifest with corresponding purchase itinerary record. */ - FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY, - /** Signer is member of cardholder's household. */ - HOUSEHOLD_MEMBER_SIGNER, - /** - * Legitimate spend across multiple payment types for same merchandise. - */ - LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE, - /** - * Documentation to prove the cardholder is in possession of and/or - * using the merchandise. - */ - MERCHANDISE_USE, - /** - * Passenger transport: proof ticket was received, scanned at gate or - * other transaction related to original (for example, frequent flyer - * miles.) - */ - PASSENGER_TRANSPORT_TICKET_USE, - /** - * Recurring transaction with binding contract or previous undisputed - * recurring transactions and proof the cardholder is using the - * merchandise or service. - */ - RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION, - /** - * Signed delivery form, or copy of/details of identification from - * cardholder as proof goods were picked up at merchant location. - */ - SIGNED_DELIVERY_OR_PICKUP_FORM, - /** Signed Mail Order/Phone Order form. */ - SIGNED_MAIL_ORDER_PHONE_ORDER_FORM, - /** Travel & Expense: loyalty transactions related to purchase. */ - TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION, - /** - * Travel & Expense: subsequent purchases made throughout service - * period. - */ - TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE, + /** Other. */ + OTHER, + /** Special authorization procedures followed. */ + SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED, /** - * An enum member indicating that [Category] was instantiated with an + * An enum member indicating that [Reason] was instantiated with an * unknown value. */ _UNKNOWN, @@ -4458,32 +6468,9 @@ private constructor( */ fun value(): Value = when (this) { - AUTHORIZED_SIGNER -> Value.AUTHORIZED_SIGNER - DELIVERY -> Value.DELIVERY - DELIVERY_AT_PLACE_OF_EMPLOYMENT -> - Value.DELIVERY_AT_PLACE_OF_EMPLOYMENT - DIGITAL_GOODS_DOWNLOAD -> Value.DIGITAL_GOODS_DOWNLOAD - DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN -> - Value.DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN - FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY -> - Value.FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY - HOUSEHOLD_MEMBER_SIGNER -> Value.HOUSEHOLD_MEMBER_SIGNER - LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE -> - Value.LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE - MERCHANDISE_USE -> Value.MERCHANDISE_USE - PASSENGER_TRANSPORT_TICKET_USE -> - Value.PASSENGER_TRANSPORT_TICKET_USE - RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION -> - Value - .RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION - SIGNED_DELIVERY_OR_PICKUP_FORM -> - Value.SIGNED_DELIVERY_OR_PICKUP_FORM - SIGNED_MAIL_ORDER_PHONE_ORDER_FORM -> - Value.SIGNED_MAIL_ORDER_PHONE_ORDER_FORM - TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION -> - Value.TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION - TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE -> - Value.TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE + OTHER -> Value.OTHER + SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED -> + Value.SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED else -> Value._UNKNOWN } @@ -4498,198 +6485,425 @@ private constructor( */ fun known(): Known = when (this) { - AUTHORIZED_SIGNER -> Known.AUTHORIZED_SIGNER - DELIVERY -> Known.DELIVERY - DELIVERY_AT_PLACE_OF_EMPLOYMENT -> - Known.DELIVERY_AT_PLACE_OF_EMPLOYMENT - DIGITAL_GOODS_DOWNLOAD -> Known.DIGITAL_GOODS_DOWNLOAD - DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN -> - Known.DYNAMIC_CURRENCY_CONVERSION_ACTIVELY_CHOSEN - FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY -> - Known.FLIGHT_MANIFEST_AND_PURCHASE_ITINERARY - HOUSEHOLD_MEMBER_SIGNER -> Known.HOUSEHOLD_MEMBER_SIGNER - LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE -> - Known.LEGITIMATE_SPEND_ACROSS_PAYMENT_TYPES_FOR_SAME_MERCHANDISE - MERCHANDISE_USE -> Known.MERCHANDISE_USE - PASSENGER_TRANSPORT_TICKET_USE -> - Known.PASSENGER_TRANSPORT_TICKET_USE - RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION -> - Known - .RECURRING_TRANSACTION_WITH_BINDING_CONTRACT_OR_PREVIOUS_UNDISPUTED_TRANSACTION - SIGNED_DELIVERY_OR_PICKUP_FORM -> - Known.SIGNED_DELIVERY_OR_PICKUP_FORM - SIGNED_MAIL_ORDER_PHONE_ORDER_FORM -> - Known.SIGNED_MAIL_ORDER_PHONE_ORDER_FORM - TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION -> - Known.TRAVEL_AND_EXPENSE_LOYALTY_TRANSACTION - TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE -> - Known.TRAVEL_AND_EXPENSE_SUBSEQUENT_PURCHASE - else -> - throw IncreaseInvalidDataException("Unknown Category: $value") + OTHER -> Known.OTHER + SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED -> + Known.SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED + else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("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: IncreaseInvalidDataException) { + 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 InvalidDispute && + explanation == other.explanation && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, reason, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" + } + + /** + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + */ + class NonFiatCurrencyOrNonFungibleTokenReceived + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val blockchainTransactionHash: JsonField, + private val destinationWalletAddress: JsonField, + private val priorApprovedTransactions: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("blockchain_transaction_hash") + @ExcludeMissing + blockchainTransactionHash: JsonField = JsonMissing.of(), + @JsonProperty("destination_wallet_address") + @ExcludeMissing + destinationWalletAddress: JsonField = JsonMissing.of(), + @JsonProperty("prior_approved_transactions") + @ExcludeMissing + priorApprovedTransactions: JsonField = JsonMissing.of(), + ) : this( + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, + mutableMapOf(), + ) + + /** + * Blockchain transaction hash. + * + * @throws IncreaseInvalidDataException 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 blockchainTransactionHash(): String = + blockchainTransactionHash.getRequired("blockchain_transaction_hash") + + /** + * Destination wallet address. + * + * @throws IncreaseInvalidDataException 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 destinationWalletAddress(): String = + destinationWalletAddress.getRequired("destination_wallet_address") + + /** + * Prior approved transactions. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun priorApprovedTransactions(): Optional = + priorApprovedTransactions.getOptional("prior_approved_transactions") + + /** + * Returns the raw JSON value of [blockchainTransactionHash]. + * + * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("blockchain_transaction_hash") + @ExcludeMissing + fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash + + /** + * Returns the raw JSON value of [destinationWalletAddress]. + * + * Unlike [destinationWalletAddress], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("destination_wallet_address") + @ExcludeMissing + fun _destinationWalletAddress(): JsonField = destinationWalletAddress + + /** + * Returns the raw JSON value of [priorApprovedTransactions]. + * + * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("prior_approved_transactions") + @ExcludeMissing + fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions + + @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 + * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * + * The following fields are required: + * ```java + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ + class Builder internal constructor() { + + private var blockchainTransactionHash: JsonField? = null + private var destinationWalletAddress: JsonField? = null + private var priorApprovedTransactions: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived + ) = apply { + blockchainTransactionHash = + nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash + destinationWalletAddress = + nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress + priorApprovedTransactions = + nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties + .toMutableMap() + } + + /** Blockchain transaction hash. */ + fun blockchainTransactionHash(blockchainTransactionHash: String) = + blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) + + /** + * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON value. + * + * You should usually call [Builder.blockchainTransactionHash] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun blockchainTransactionHash( + blockchainTransactionHash: JsonField + ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } + + /** Destination wallet address. */ + fun destinationWalletAddress(destinationWalletAddress: String) = + destinationWalletAddress(JsonField.of(destinationWalletAddress)) + /** - * 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. + * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. * - * @throws IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. + * You should usually call [Builder.destinationWalletAddress] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun destinationWalletAddress(destinationWalletAddress: JsonField) = + apply { + this.destinationWalletAddress = destinationWalletAddress } - private var validated: Boolean = false + /** Prior approved transactions. */ + fun priorApprovedTransactions(priorApprovedTransactions: String?) = + priorApprovedTransactions( + JsonField.ofNullable(priorApprovedTransactions) + ) - fun validate(): Category = apply { - if (validated) { - return@apply + /** + * Alias for calling [Builder.priorApprovedTransactions] with + * `priorApprovedTransactions.orElse(null)`. + */ + fun priorApprovedTransactions(priorApprovedTransactions: Optional) = + priorApprovedTransactions(priorApprovedTransactions.getOrNull()) + + /** + * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. + * + * You should usually call [Builder.priorApprovedTransactions] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun priorApprovedTransactions( + priorApprovedTransactions: JsonField + ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - known() - validated = true + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + 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 a score indicating how many valid values are contained in this - * object recursively. + * Returns an immutable instance of + * [NonFiatCurrencyOrNonFungibleTokenReceived]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = + NonFiatCurrencyOrNonFungibleTokenReceived( + checkRequired( + "blockchainTransactionHash", + blockchainTransactionHash, + ), + checkRequired("destinationWalletAddress", destinationWalletAddress), + checkRequired( + "priorApprovedTransactions", + priorApprovedTransactions, + ), + additionalProperties.toMutableMap(), + ) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is Category && value == other.value + fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { + if (validated) { + return@apply } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() + blockchainTransactionHash() + destinationWalletAddress() + priorApprovedTransactions() + validated = true } + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + + (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + + (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) + override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is CompellingEvidence && - category == other.category && - explanation == other.explanation && + return other is NonFiatCurrencyOrNonFungibleTokenReceived && + blockchainTransactionHash == other.blockchainTransactionHash && + destinationWalletAddress == other.destinationWalletAddress && + priorApprovedTransactions == other.priorApprovedTransactions && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(category, explanation, additionalProperties) + Objects.hash( + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, + additionalProperties, + ) } override fun hashCode(): Int = hashCode override fun toString() = - "CompellingEvidence{category=$category, explanation=$explanation, additionalProperties=$additionalProperties}" + "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" } /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. + * Prior undisputed non-fraud transactions details. Present if and only if `reason` + * is `prior_undisputed_non_fraud_transactions`. */ - class CreditOrReversalProcessed + class PriorUndisputedNonFraudTransactions @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val amount: JsonField, - private val currency: JsonField, private val explanation: JsonField, - private val processedAt: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("amount") - @ExcludeMissing - amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") - @ExcludeMissing - currency: JsonField = JsonMissing.of(), @JsonProperty("explanation") @ExcludeMissing - explanation: JsonField = JsonMissing.of(), - @JsonProperty("processed_at") - @ExcludeMissing - processedAt: JsonField = JsonMissing.of(), - ) : this(amount, currency, explanation, processedAt, mutableMapOf()) - - /** - * The amount of the credit or reversal in the minor unit of its currency. For - * dollars, for example, this is cents. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * or is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun amount(): Long = amount.getRequired("amount") - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the credit or - * reversal's currency. - * - * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) /** - * Explanation for why the merchant believes the credit or reversal was - * processed. + * Explanation of the prior undisputed non-fraud transactions provided by the + * merchant. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ fun explanation(): Optional = explanation.getOptional("explanation") - /** - * The date the credit or reversal was processed. - * - * @throws IncreaseInvalidDataException 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 processedAt(): LocalDate = processedAt.getRequired("processed_at") - - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount - - /** - * Returns the raw JSON value of [currency]. - * - * Unlike [currency], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("currency") - @ExcludeMissing - fun _currency(): JsonField = currency - /** * Returns the raw JSON value of [explanation]. * @@ -4700,16 +6914,6 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation - /** - * Returns the raw JSON value of [processedAt]. - * - * Unlike [processedAt], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("processed_at") - @ExcludeMissing - fun _processedAt(): JsonField = processedAt - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -4726,75 +6930,36 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CreditOrReversalProcessed]. + * [PriorUndisputedNonFraudTransactions]. * * The following fields are required: * ```java - * .amount() - * .currency() * .explanation() - * .processedAt() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [CreditOrReversalProcessed]. */ + /** A builder for [PriorUndisputedNonFraudTransactions]. */ class Builder internal constructor() { - private var amount: JsonField? = null - private var currency: JsonField? = null private var explanation: JsonField? = null - private var processedAt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(creditOrReversalProcessed: CreditOrReversalProcessed) = - apply { - amount = creditOrReversalProcessed.amount - currency = creditOrReversalProcessed.currency - explanation = creditOrReversalProcessed.explanation - processedAt = creditOrReversalProcessed.processedAt - additionalProperties = - creditOrReversalProcessed.additionalProperties.toMutableMap() - } - - /** - * The amount of the credit or reversal in the minor unit of its currency. - * For dollars, for example, this is cents. - */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - - /** - * Sets [Builder.amount] to an arbitrary JSON value. - * - * You should usually call [Builder.amount] with a well-typed [Long] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun amount(amount: JsonField) = apply { this.amount = amount } - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - * credit or reversal's currency. - */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** - * Sets [Builder.currency] to an arbitrary JSON value. - * - * You should usually call [Builder.currency] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun currency(currency: JsonField) = apply { - this.currency = currency + internal fun from( + priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions + ) = apply { + explanation = priorUndisputedNonFraudTransactions.explanation + additionalProperties = + priorUndisputedNonFraudTransactions.additionalProperties + .toMutableMap() } /** - * Explanation for why the merchant believes the credit or reversal was - * processed. + * Explanation of the prior undisputed non-fraud transactions provided by + * the merchant. */ fun explanation(explanation: String?) = explanation(JsonField.ofNullable(explanation)) @@ -4816,79 +6981,273 @@ private constructor( this.explanation = explanation } - /** The date the credit or reversal was processed. */ - fun processedAt(processedAt: LocalDate) = - processedAt(JsonField.of(processedAt)) + 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) + } /** - * Sets [Builder.processedAt] to an arbitrary JSON value. + * Returns an immutable instance of [PriorUndisputedNonFraudTransactions]. * - * You should usually call [Builder.processedAt] with a well-typed - * [LocalDate] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .explanation() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - fun processedAt(processedAt: JsonField) = apply { - this.processedAt = processedAt + fun build(): PriorUndisputedNonFraudTransactions = + PriorUndisputedNonFraudTransactions( + checkRequired("explanation", explanation), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): PriorUndisputedNonFraudTransactions = apply { + if (validated) { + return@apply } - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + explanation() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (explanation.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PriorUndisputedNonFraudTransactions && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "PriorUndisputedNonFraudTransactions{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + /** The reason the merchant re-presented the dispute. */ + 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 { + + /** Cardholder no longer disputes the transaction. */ + @JvmField + val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") + + /** Compelling evidence. */ + @JvmField val COMPELLING_EVIDENCE = of("compelling_evidence") + + /** Credit or reversal was processed. */ + @JvmField + val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") + + /** Delayed charge transaction. */ + @JvmField val DELAYED_CHARGE_TRANSACTION = of("delayed_charge_transaction") + + /** Evidence of imprint. */ + @JvmField val EVIDENCE_OF_IMPRINT = of("evidence_of_imprint") + + /** Invalid dispute. */ + @JvmField val INVALID_DISPUTE = of("invalid_dispute") + + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + @JvmField + val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = + of("non_fiat_currency_or_non_fungible_token_received") + + /** Prior undisputed non-fraud transactions. */ + @JvmField + val PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS = + of("prior_undisputed_non_fraud_transactions") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Compelling evidence. */ + COMPELLING_EVIDENCE, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Delayed charge transaction. */ + DELAYED_CHARGE_TRANSACTION, + /** Evidence of imprint. */ + EVIDENCE_OF_IMPRINT, + /** Invalid dispute. */ + INVALID_DISPUTE, + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Prior undisputed non-fraud transactions. */ + PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS, + } + + /** + * 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 { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Compelling evidence. */ + COMPELLING_EVIDENCE, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Delayed charge transaction. */ + DELAYED_CHARGE_TRANSACTION, + /** Evidence of imprint. */ + EVIDENCE_OF_IMPRINT, + /** Invalid dispute. */ + INVALID_DISPUTE, + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Prior undisputed non-fraud transactions. */ + PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS, + /** + * An enum member indicating that [Reason] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) + /** + * 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) { + CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES + COMPELLING_EVIDENCE -> Value.COMPELLING_EVIDENCE + CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED + DELAYED_CHARGE_TRANSACTION -> Value.DELAYED_CHARGE_TRANSACTION + EVIDENCE_OF_IMPRINT -> Value.EVIDENCE_OF_IMPRINT + INVALID_DISPUTE -> Value.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS -> + Value.PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS + else -> Value._UNKNOWN } - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } - - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) + /** + * 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 IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES + COMPELLING_EVIDENCE -> Known.COMPELLING_EVIDENCE + CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED + DELAYED_CHARGE_TRANSACTION -> Known.DELAYED_CHARGE_TRANSACTION + EVIDENCE_OF_IMPRINT -> Known.EVIDENCE_OF_IMPRINT + INVALID_DISPUTE -> Known.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS -> + Known.PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + /** + * 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 IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - /** - * Returns an immutable instance of [CreditOrReversalProcessed]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .amount() - * .currency() - * .explanation() - * .processedAt() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): CreditOrReversalProcessed = - CreditOrReversalProcessed( - checkRequired("amount", amount), - checkRequired("currency", currency), - checkRequired("explanation", explanation), - checkRequired("processedAt", processedAt), - additionalProperties.toMutableMap(), - ) - } - private var validated: Boolean = false - fun validate(): CreditOrReversalProcessed = apply { + fun validate(): Reason = apply { if (validated) { return@apply } - amount() - currency() - explanation() - processedAt() + known() validated = true } @@ -4907,422 +7266,827 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = - (if (amount.asKnown().isPresent) 1 else 0) + - (if (currency.asKnown().isPresent) 1 else 0) + - (if (explanation.asKnown().isPresent) 1 else 0) + - (if (processedAt.asKnown().isPresent) 1 else 0) + 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 CreditOrReversalProcessed && - amount == other.amount && - currency == other.currency && - explanation == other.explanation && - processedAt == other.processedAt && - additionalProperties == other.additionalProperties + return other is Reason && value == other.value } - private val hashCode: Int by lazy { - Objects.hash( - amount, - currency, - explanation, - processedAt, - additionalProperties, - ) + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - override fun hashCode(): Int = hashCode + return other is MerchantPrearbitrationReceived && + cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && + compellingEvidence == other.compellingEvidence && + creditOrReversalProcessed == other.creditOrReversalProcessed && + delayedChargeTransaction == other.delayedChargeTransaction && + evidenceOfImprint == other.evidenceOfImprint && + invalidDispute == other.invalidDispute && + nonFiatCurrencyOrNonFungibleTokenReceived == + other.nonFiatCurrencyOrNonFungibleTokenReceived && + priorUndisputedNonFraudTransactions == + other.priorUndisputedNonFraudTransactions && + reason == other.reason && + additionalProperties == other.additionalProperties + } - override fun toString() = - "CreditOrReversalProcessed{amount=$amount, currency=$currency, explanation=$explanation, processedAt=$processedAt, additionalProperties=$additionalProperties}" + private val hashCode: Int by lazy { + Objects.hash( + cardholderNoLongerDisputes, + compellingEvidence, + creditOrReversalProcessed, + delayedChargeTransaction, + evidenceOfImprint, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenReceived, + priorUndisputedNonFraudTransactions, + reason, + additionalProperties, + ) } - /** - * Delayed charge transaction details. Present if and only if `reason` is - * `delayed_charge_transaction`. - */ - class DelayedChargeTransaction - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + override fun hashCode(): Int = hashCode - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + override fun toString() = + "MerchantPrearbitrationReceived{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, compellingEvidence=$compellingEvidence, creditOrReversalProcessed=$creditOrReversalProcessed, delayedChargeTransaction=$delayedChargeTransaction, evidenceOfImprint=$evidenceOfImprint, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, priorUndisputedNonFraudTransactions=$priorUndisputedNonFraudTransactions, reason=$reason, additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute Merchant Pre-Arbitration Timed Out Visa Network Event object. This + * field will be present in the JSON response if and only if `category` is equal to + * `merchant_prearbitration_timed_out`. Contains the details specific to a merchant + * prearbitration timed out Visa Card Dispute Network Event, which represents that the + * user has timed out responding to the merchant's prearbitration request. + */ + class MerchantPrearbitrationTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 { /** - * Additional details about the delayed charge transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Returns a mutable builder for constructing an instance of + * [MerchantPrearbitrationTimedOut]. */ - fun explanation(): Optional = explanation.getOptional("explanation") + @JvmStatic fun builder() = Builder() + } + + /** A builder for [MerchantPrearbitrationTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + merchantPrearbitrationTimedOut: MerchantPrearbitrationTimedOut + ) = apply { + additionalProperties = + merchantPrearbitrationTimedOut.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 the raw JSON value of [explanation]. + * Returns an immutable instance of [MerchantPrearbitrationTimedOut]. * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + fun build(): MerchantPrearbitrationTimedOut = + MerchantPrearbitrationTimedOut(additionalProperties.toMutableMap()) + } - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + private var validated: Boolean = false + + fun validate(): MerchantPrearbitrationTimedOut = apply { + if (validated) { + return@apply } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + validated = true + } - fun toBuilder() = Builder().from(this) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - companion object { + /** + * 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 = 0 - /** - * Returns a mutable builder for constructing an instance of - * [DelayedChargeTransaction]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** A builder for [DelayedChargeTransaction]. */ - class Builder internal constructor() { + return other is MerchantPrearbitrationTimedOut && + additionalProperties == other.additionalProperties + } - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - @JvmSynthetic - internal fun from(delayedChargeTransaction: DelayedChargeTransaction) = - apply { - explanation = delayedChargeTransaction.explanation - additionalProperties = - delayedChargeTransaction.additionalProperties.toMutableMap() - } + override fun hashCode(): Int = hashCode - /** Additional details about the delayed charge transaction. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + override fun toString() = + "MerchantPrearbitrationTimedOut{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * A Card Dispute Re-presented Visa Network Event object. This field will be present in + * the JSON response if and only if `category` is equal to `represented`. Contains the + * details specific to a re-presented Visa Card Dispute Network Event, which represents + * that the merchant has declined the user's chargeback and has re-presented the + * payment. + */ + class Represented + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardholderNoLongerDisputes: JsonField, + private val creditOrReversalProcessed: JsonField, + private val invalidDispute: JsonField, + private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField, + private val nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField, + private val proofOfCashDisbursement: JsonField, + private val reason: JsonField, + private val reversalIssued: JsonField, + private val additionalProperties: MutableMap, + ) { - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + @JsonCreator + private constructor( + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + cardholderNoLongerDisputes: JsonField = + JsonMissing.of(), + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + creditOrReversalProcessed: JsonField = + JsonMissing.of(), + @JsonProperty("invalid_dispute") + @ExcludeMissing + invalidDispute: JsonField = JsonMissing.of(), + @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") + @ExcludeMissing + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField = + JsonMissing.of(), + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField = + JsonMissing.of(), + @JsonProperty("proof_of_cash_disbursement") + @ExcludeMissing + proofOfCashDisbursement: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + @JsonProperty("reversal_issued") + @ExcludeMissing + reversalIssued: JsonField = JsonMissing.of(), + ) : this( + cardholderNoLongerDisputes, + creditOrReversalProcessed, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenAsDescribed, + nonFiatCurrencyOrNonFungibleTokenReceived, + proofOfCashDisbursement, + reason, + reversalIssued, + mutableMapOf(), + ) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun cardholderNoLongerDisputes(): Optional = + cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun creditOrReversalProcessed(): Optional = + creditOrReversalProcessed.getOptional("credit_or_reversal_processed") - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + /** + * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun invalidDispute(): Optional = + invalidDispute.getOptional("invalid_dispute") + + /** + * Non-fiat currency or non-fungible token as described details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed(): + Optional = + nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOptional( + "non_fiat_currency_or_non_fungible_token_as_described" + ) + + /** + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived(): + Optional = + nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( + "non_fiat_currency_or_non_fungible_token_received" + ) + + /** + * Proof of cash disbursement details. Present if and only if `reason` is + * `proof_of_cash_disbursement`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun proofOfCashDisbursement(): Optional = + proofOfCashDisbursement.getOptional("proof_of_cash_disbursement") + + /** + * The reason the merchant re-presented the dispute. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * Reversal issued by merchant details. Present if and only if `reason` is + * `reversal_issued`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun reversalIssued(): Optional = + reversalIssued.getOptional("reversal_issued") + + /** + * Returns the raw JSON value of [cardholderNoLongerDisputes]. + * + * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("cardholder_no_longer_disputes") + @ExcludeMissing + fun _cardholderNoLongerDisputes(): JsonField = + cardholderNoLongerDisputes + + /** + * Returns the raw JSON value of [creditOrReversalProcessed]. + * + * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("credit_or_reversal_processed") + @ExcludeMissing + fun _creditOrReversalProcessed(): JsonField = + creditOrReversalProcessed + + /** + * Returns the raw JSON value of [invalidDispute]. + * + * Unlike [invalidDispute], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("invalid_dispute") + @ExcludeMissing + fun _invalidDispute(): JsonField = invalidDispute + + /** + * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenAsDescribed]. + * + * Unlike [nonFiatCurrencyOrNonFungibleTokenAsDescribed], this method doesn't throw + * if the JSON field has an unexpected type. + */ + @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): + JsonField = + nonFiatCurrencyOrNonFungibleTokenAsDescribed - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** + * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. + * + * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if + * the JSON field has an unexpected type. + */ + @JsonProperty("non_fiat_currency_or_non_fungible_token_received") + @ExcludeMissing + fun _nonFiatCurrencyOrNonFungibleTokenReceived(): + JsonField = + nonFiatCurrencyOrNonFungibleTokenReceived - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Returns the raw JSON value of [proofOfCashDisbursement]. + * + * Unlike [proofOfCashDisbursement], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("proof_of_cash_disbursement") + @ExcludeMissing + fun _proofOfCashDisbursement(): JsonField = + proofOfCashDisbursement - /** - * Returns an immutable instance of [DelayedChargeTransaction]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): DelayedChargeTransaction = - DelayedChargeTransaction( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) - } + /** + * 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 - private var validated: Boolean = false + /** + * Returns the raw JSON value of [reversalIssued]. + * + * Unlike [reversalIssued], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("reversal_issued") + @ExcludeMissing + fun _reversalIssued(): JsonField = reversalIssued - fun validate(): DelayedChargeTransaction = apply { - if (validated) { - return@apply - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - explanation() - validated = true - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun toBuilder() = Builder().from(this) + + companion object { /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns a mutable builder for constructing an instance of [Represented]. * - * Used for best match union deserialization. + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .creditOrReversalProcessed() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenAsDescribed() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .proofOfCashDisbursement() + * .reason() + * .reversalIssued() + * ``` */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + @JvmStatic fun builder() = Builder() + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + /** A builder for [Represented]. */ + class Builder internal constructor() { - return other is DelayedChargeTransaction && - explanation == other.explanation && - additionalProperties == other.additionalProperties - } + private var cardholderNoLongerDisputes: JsonField? = + null + private var creditOrReversalProcessed: JsonField? = + null + private var invalidDispute: JsonField? = null + private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField? = + null + private var nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField? = + null + private var proofOfCashDisbursement: JsonField? = null + private var reason: JsonField? = null + private var reversalIssued: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) + @JvmSynthetic + internal fun from(represented: Represented) = apply { + cardholderNoLongerDisputes = represented.cardholderNoLongerDisputes + creditOrReversalProcessed = represented.creditOrReversalProcessed + invalidDispute = represented.invalidDispute + nonFiatCurrencyOrNonFungibleTokenAsDescribed = + represented.nonFiatCurrencyOrNonFungibleTokenAsDescribed + nonFiatCurrencyOrNonFungibleTokenReceived = + represented.nonFiatCurrencyOrNonFungibleTokenReceived + proofOfCashDisbursement = represented.proofOfCashDisbursement + reason = represented.reason + reversalIssued = represented.reversalIssued + additionalProperties = represented.additionalProperties.toMutableMap() } - override fun hashCode(): Int = hashCode + /** + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: CardholderNoLongerDisputes? + ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) - override fun toString() = - "DelayedChargeTransaction{explanation=$explanation, additionalProperties=$additionalProperties}" - } + /** + * Alias for calling [Builder.cardholderNoLongerDisputes] with + * `cardholderNoLongerDisputes.orElse(null)`. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: Optional + ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) - /** - * Evidence of imprint details. Present if and only if `reason` is - * `evidence_of_imprint`. - */ - class EvidenceOfImprint - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + /** + * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderNoLongerDisputes] with a + * well-typed [CardholderNoLongerDisputes] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun cardholderNoLongerDisputes( + cardholderNoLongerDisputes: JsonField + ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + /** + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. + */ + fun creditOrReversalProcessed( + creditOrReversalProcessed: CreditOrReversalProcessed? + ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) /** - * Explanation of the evidence of imprint. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Alias for calling [Builder.creditOrReversalProcessed] with + * `creditOrReversalProcessed.orElse(null)`. */ - fun explanation(): Optional = explanation.getOptional("explanation") + fun creditOrReversalProcessed( + creditOrReversalProcessed: Optional + ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) /** - * Returns the raw JSON value of [explanation]. + * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. + * You should usually call [Builder.creditOrReversalProcessed] with a well-typed + * [CreditOrReversalProcessed] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + fun creditOrReversalProcessed( + creditOrReversalProcessed: JsonField + ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + /** + * Invalid dispute details. Present if and only if `reason` is + * `invalid_dispute`. + */ + fun invalidDispute(invalidDispute: InvalidDispute?) = + invalidDispute(JsonField.ofNullable(invalidDispute)) - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** + * Alias for calling [Builder.invalidDispute] with + * `invalidDispute.orElse(null)`. + */ + fun invalidDispute(invalidDispute: Optional) = + invalidDispute(invalidDispute.getOrNull()) - fun toBuilder() = Builder().from(this) + /** + * Sets [Builder.invalidDispute] to an arbitrary JSON value. + * + * You should usually call [Builder.invalidDispute] with a well-typed + * [InvalidDispute] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun invalidDispute(invalidDispute: JsonField) = apply { + this.invalidDispute = invalidDispute + } - companion object { + /** + * Non-fiat currency or non-fungible token as described details. Present if and + * only if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + NonFiatCurrencyOrNonFungibleTokenAsDescribed? + ) = + nonFiatCurrencyOrNonFungibleTokenAsDescribed( + JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenAsDescribed) + ) - /** - * Returns a mutable builder for constructing an instance of - * [EvidenceOfImprint]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + /** + * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with + * `nonFiatCurrencyOrNonFungibleTokenAsDescribed.orElse(null)`. + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + Optional + ) = + nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed.getOrNull() + ) + + /** + * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] to an arbitrary + * JSON value. + * + * You should usually call + * [Builder.nonFiatCurrencyOrNonFungibleTokenAsDescribed] with a well-typed + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + JsonField + ) = apply { + this.nonFiatCurrencyOrNonFungibleTokenAsDescribed = + nonFiatCurrencyOrNonFungibleTokenAsDescribed } - /** A builder for [EvidenceOfImprint]. */ - class Builder internal constructor() { + /** + * Non-fiat currency or non-fungible token received details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived? + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) + ) - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + /** + * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with + * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + Optional + ) = + nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() + ) - @JvmSynthetic - internal fun from(evidenceOfImprint: EvidenceOfImprint) = apply { - explanation = evidenceOfImprint.explanation - additionalProperties = - evidenceOfImprint.additionalProperties.toMutableMap() - } + /** + * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON + * value. + * + * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] + * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun nonFiatCurrencyOrNonFungibleTokenReceived( + nonFiatCurrencyOrNonFungibleTokenReceived: + JsonField + ) = apply { + this.nonFiatCurrencyOrNonFungibleTokenReceived = + nonFiatCurrencyOrNonFungibleTokenReceived + } - /** Explanation of the evidence of imprint. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + /** + * Proof of cash disbursement details. Present if and only if `reason` is + * `proof_of_cash_disbursement`. + */ + fun proofOfCashDisbursement(proofOfCashDisbursement: ProofOfCashDisbursement?) = + proofOfCashDisbursement(JsonField.ofNullable(proofOfCashDisbursement)) - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * Alias for calling [Builder.proofOfCashDisbursement] with + * `proofOfCashDisbursement.orElse(null)`. + */ + fun proofOfCashDisbursement( + proofOfCashDisbursement: Optional + ) = proofOfCashDisbursement(proofOfCashDisbursement.getOrNull()) - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + /** + * Sets [Builder.proofOfCashDisbursement] to an arbitrary JSON value. + * + * You should usually call [Builder.proofOfCashDisbursement] with a well-typed + * [ProofOfCashDisbursement] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun proofOfCashDisbursement( + proofOfCashDisbursement: JsonField + ) = apply { this.proofOfCashDisbursement = proofOfCashDisbursement } - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + /** The reason the merchant re-presented the dispute. */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + /** + * 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 putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + /** + * Reversal issued by merchant details. Present if and only if `reason` is + * `reversal_issued`. + */ + fun reversalIssued(reversalIssued: ReversalIssued?) = + reversalIssued(JsonField.ofNullable(reversalIssued)) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + /** + * Alias for calling [Builder.reversalIssued] with + * `reversalIssued.orElse(null)`. + */ + fun reversalIssued(reversalIssued: Optional) = + reversalIssued(reversalIssued.getOrNull()) - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Sets [Builder.reversalIssued] to an arbitrary JSON value. + * + * You should usually call [Builder.reversalIssued] with a well-typed + * [ReversalIssued] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun reversalIssued(reversalIssued: JsonField) = apply { + this.reversalIssued = reversalIssued + } - /** - * Returns an immutable instance of [EvidenceOfImprint]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): EvidenceOfImprint = - EvidenceOfImprint( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): EvidenceOfImprint = apply { - if (validated) { - return@apply + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [Represented]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardholderNoLongerDisputes() + * .creditOrReversalProcessed() + * .invalidDispute() + * .nonFiatCurrencyOrNonFungibleTokenAsDescribed() + * .nonFiatCurrencyOrNonFungibleTokenReceived() + * .proofOfCashDisbursement() + * .reason() + * .reversalIssued() + * ``` + * + * @throws IllegalStateException if any required field is unset. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): Represented = + Represented( + checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), + checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), + checkRequired("invalidDispute", invalidDispute), + checkRequired( + "nonFiatCurrencyOrNonFungibleTokenAsDescribed", + nonFiatCurrencyOrNonFungibleTokenAsDescribed, + ), + checkRequired( + "nonFiatCurrencyOrNonFungibleTokenReceived", + nonFiatCurrencyOrNonFungibleTokenReceived, + ), + checkRequired("proofOfCashDisbursement", proofOfCashDisbursement), + checkRequired("reason", reason), + checkRequired("reversalIssued", reversalIssued), + additionalProperties.toMutableMap(), + ) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is EvidenceOfImprint && - explanation == other.explanation && - additionalProperties == other.additionalProperties + fun validate(): Represented = apply { + if (validated) { + return@apply } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) - } + cardholderNoLongerDisputes().ifPresent { it.validate() } + creditOrReversalProcessed().ifPresent { it.validate() } + invalidDispute().ifPresent { it.validate() } + nonFiatCurrencyOrNonFungibleTokenAsDescribed().ifPresent { it.validate() } + nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } + proofOfCashDisbursement().ifPresent { it.validate() } + reason().validate() + reversalIssued().ifPresent { it.validate() } + validated = true + } - override fun hashCode(): Int = hashCode + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - override fun toString() = - "EvidenceOfImprint{explanation=$explanation, additionalProperties=$additionalProperties}" - } + /** + * 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 = + (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + + (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + + (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + + (nonFiatCurrencyOrNonFungibleTokenAsDescribed + .asKnown() + .getOrNull() + ?.validity() ?: 0) + + (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() + ?: 0) + + (proofOfCashDisbursement.asKnown().getOrNull()?.validity() ?: 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (reversalIssued.asKnown().getOrNull()?.validity() ?: 0) /** - * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + * Cardholder no longer disputes details. Present if and only if `reason` is + * `cardholder_no_longer_disputes`. */ - class InvalidDispute + class CardholderNoLongerDisputes @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val explanation: JsonField, - private val reason: JsonField, private val additionalProperties: MutableMap, ) { @@ -5330,29 +8094,18 @@ private constructor( private constructor( @JsonProperty("explanation") @ExcludeMissing - explanation: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this(explanation, reason, mutableMapOf()) + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) /** - * Explanation for why the dispute is considered invalid by the merchant. + * Explanation for why the merchant believes the cardholder no longer disputes + * the transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ fun explanation(): Optional = explanation.getOptional("explanation") - /** - * The reason a merchant considers the dispute invalid. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * or is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun reason(): Reason = reason.getRequired("reason") - /** * Returns the raw JSON value of [explanation]. * @@ -5363,16 +8116,6 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation - /** - * 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) @@ -5389,35 +8132,34 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InvalidDispute]. + * [CardholderNoLongerDisputes]. * * The following fields are required: * ```java * .explanation() - * .reason() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [InvalidDispute]. */ + /** A builder for [CardholderNoLongerDisputes]. */ class Builder internal constructor() { private var explanation: JsonField? = null - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(invalidDispute: InvalidDispute) = apply { - explanation = invalidDispute.explanation - reason = invalidDispute.reason - additionalProperties = - invalidDispute.additionalProperties.toMutableMap() - } + internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = + apply { + explanation = cardholderNoLongerDisputes.explanation + additionalProperties = + cardholderNoLongerDisputes.additionalProperties.toMutableMap() + } /** - * Explanation for why the dispute is considered invalid by the merchant. + * Explanation for why the merchant believes the cardholder no longer + * disputes the transaction. */ fun explanation(explanation: String?) = explanation(JsonField.ofNullable(explanation)) @@ -5439,18 +8181,6 @@ private constructor( this.explanation = explanation } - /** The reason a merchant considers the dispute invalid. */ - 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() @@ -5474,35 +8204,32 @@ private constructor( } /** - * Returns an immutable instance of [InvalidDispute]. + * Returns an immutable instance of [CardholderNoLongerDisputes]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .explanation() - * .reason() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): InvalidDispute = - InvalidDispute( + fun build(): CardholderNoLongerDisputes = + CardholderNoLongerDisputes( checkRequired("explanation", explanation), - checkRequired("reason", reason), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): InvalidDispute = apply { + fun validate(): CardholderNoLongerDisputes = apply { if (validated) { return@apply } explanation() - reason().validate() validated = true } @@ -5521,267 +8248,133 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = - (if (explanation.asKnown().isPresent) 1 else 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) - - /** The reason a merchant considers the dispute invalid. */ - 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 { - - /** Other. */ - @JvmField val OTHER = of("other") - - /** Special authorization procedures followed. */ - @JvmField - val SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED = - of("special_authorization_procedures_followed") - - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } - - /** An enum containing [Reason]'s known values. */ - enum class Known { - /** Other. */ - OTHER, - /** Special authorization procedures followed. */ - SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED, - } - - /** - * 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 { - /** Other. */ - OTHER, - /** Special authorization procedures followed. */ - SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED, - /** - * 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) { - OTHER -> Value.OTHER - SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED -> - Value.SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED - 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 IncreaseInvalidDataException if this class instance's value is a - * not a known member. - */ - fun known(): Known = - when (this) { - OTHER -> Known.OTHER - SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED -> - Known.SPECIAL_AUTHORIZATION_PROCEDURES_FOLLOWED - else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("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: IncreaseInvalidDataException) { - 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() - } + internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is InvalidDispute && + return other is CardholderNoLongerDisputes && explanation == other.explanation && - reason == other.reason && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(explanation, reason, additionalProperties) + Objects.hash(explanation, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" + "CardholderNoLongerDisputes{explanation=$explanation, additionalProperties=$additionalProperties}" } /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * Credit or reversal processed details. Present if and only if `reason` is + * `credit_or_reversal_processed`. */ - class NonFiatCurrencyOrNonFungibleTokenReceived + class CreditOrReversalProcessed @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val blockchainTransactionHash: JsonField, - private val destinationWalletAddress: JsonField, - private val priorApprovedTransactions: JsonField, + private val amount: JsonField, + private val currency: JsonField, + private val explanation: JsonField, + private val processedAt: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("blockchain_transaction_hash") + @JsonProperty("amount") @ExcludeMissing - blockchainTransactionHash: JsonField = JsonMissing.of(), - @JsonProperty("destination_wallet_address") + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing - destinationWalletAddress: JsonField = JsonMissing.of(), - @JsonProperty("prior_approved_transactions") + currency: JsonField = JsonMissing.of(), + @JsonProperty("explanation") @ExcludeMissing - priorApprovedTransactions: JsonField = JsonMissing.of(), - ) : this( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, - mutableMapOf(), - ) + explanation: JsonField = JsonMissing.of(), + @JsonProperty("processed_at") + @ExcludeMissing + processedAt: JsonField = JsonMissing.of(), + ) : this(amount, currency, explanation, processedAt, mutableMapOf()) /** - * Blockchain transaction hash. + * The amount of the credit or reversal in the minor unit of its currency. For + * dollars, for example, this is cents. * * @throws IncreaseInvalidDataException 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 blockchainTransactionHash(): String = - blockchainTransactionHash.getRequired("blockchain_transaction_hash") + fun amount(): Long = amount.getRequired("amount") /** - * Destination wallet address. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the credit or + * reversal's currency. * * @throws IncreaseInvalidDataException 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 destinationWalletAddress(): String = - destinationWalletAddress.getRequired("destination_wallet_address") + fun currency(): String = currency.getRequired("currency") /** - * Prior approved transactions. + * Explanation for why the merchant believes the credit or reversal was + * processed. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ - fun priorApprovedTransactions(): Optional = - priorApprovedTransactions.getOptional("prior_approved_transactions") + fun explanation(): Optional = explanation.getOptional("explanation") /** - * Returns the raw JSON value of [blockchainTransactionHash]. + * The date the credit or reversal was processed. * - * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON - * field has an unexpected type. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - @JsonProperty("blockchain_transaction_hash") + fun processedAt(): LocalDate = processedAt.getRequired("processed_at") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") @ExcludeMissing - fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash + fun _currency(): JsonField = currency /** - * Returns the raw JSON value of [destinationWalletAddress]. + * Returns the raw JSON value of [explanation]. * - * Unlike [destinationWalletAddress], this method doesn't throw if the JSON - * field has an unexpected type. + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("destination_wallet_address") + @JsonProperty("explanation") @ExcludeMissing - fun _destinationWalletAddress(): JsonField = destinationWalletAddress + fun _explanation(): JsonField = explanation /** - * Returns the raw JSON value of [priorApprovedTransactions]. + * Returns the raw JSON value of [processedAt]. * - * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON - * field has an unexpected type. + * Unlike [processedAt], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("prior_approved_transactions") + @JsonProperty("processed_at") @ExcludeMissing - fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions + fun _processedAt(): JsonField = processedAt @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -5799,97 +8392,110 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * [CreditOrReversalProcessed]. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .amount() + * .currency() + * .explanation() + * .processedAt() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ + /** A builder for [CreditOrReversalProcessed]. */ class Builder internal constructor() { - private var blockchainTransactionHash: JsonField? = null - private var destinationWalletAddress: JsonField? = null - private var priorApprovedTransactions: JsonField? = null + private var amount: JsonField? = null + private var currency: JsonField? = null + private var explanation: JsonField? = null + private var processedAt: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived - ) = apply { - blockchainTransactionHash = - nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash - destinationWalletAddress = - nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress - priorApprovedTransactions = - nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions - additionalProperties = - nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties - .toMutableMap() - } + internal fun from(creditOrReversalProcessed: CreditOrReversalProcessed) = + apply { + amount = creditOrReversalProcessed.amount + currency = creditOrReversalProcessed.currency + explanation = creditOrReversalProcessed.explanation + processedAt = creditOrReversalProcessed.processedAt + additionalProperties = + creditOrReversalProcessed.additionalProperties.toMutableMap() + } - /** Blockchain transaction hash. */ - fun blockchainTransactionHash(blockchainTransactionHash: String) = - blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) + /** + * The amount of the credit or reversal in the minor unit of its currency. + * For dollars, for example, this is cents. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) /** - * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON value. + * Sets [Builder.amount] to an arbitrary JSON value. * - * You should usually call [Builder.blockchainTransactionHash] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun blockchainTransactionHash( - blockchainTransactionHash: JsonField - ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } + fun amount(amount: JsonField) = apply { this.amount = amount } - /** Destination wallet address. */ - fun destinationWalletAddress(destinationWalletAddress: String) = - destinationWalletAddress(JsonField.of(destinationWalletAddress)) + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * credit or reversal's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) /** - * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. + * Sets [Builder.currency] to an arbitrary JSON value. * - * You should usually call [Builder.destinationWalletAddress] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun destinationWalletAddress(destinationWalletAddress: JsonField) = - apply { - this.destinationWalletAddress = destinationWalletAddress - } + fun currency(currency: JsonField) = apply { + this.currency = currency + } - /** Prior approved transactions. */ - fun priorApprovedTransactions(priorApprovedTransactions: String?) = - priorApprovedTransactions( - JsonField.ofNullable(priorApprovedTransactions) - ) + /** + * Explanation for why the merchant believes the credit or reversal was + * processed. + */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) /** - * Alias for calling [Builder.priorApprovedTransactions] with - * `priorApprovedTransactions.orElse(null)`. + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. */ - fun priorApprovedTransactions(priorApprovedTransactions: Optional) = - priorApprovedTransactions(priorApprovedTransactions.getOrNull()) + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) /** - * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. + * Sets [Builder.explanation] to an arbitrary JSON value. * - * You should usually call [Builder.priorApprovedTransactions] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun priorApprovedTransactions( - priorApprovedTransactions: JsonField - ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } + + /** The date the credit or reversal was processed. */ + fun processedAt(processedAt: LocalDate) = + processedAt(JsonField.of(processedAt)) + + /** + * Sets [Builder.processedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.processedAt] with a well-typed + * [LocalDate] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun processedAt(processedAt: JsonField) = apply { + this.processedAt = processedAt + } fun additionalProperties(additionalProperties: Map) = apply { @@ -5914,45 +8520,41 @@ private constructor( } /** - * Returns an immutable instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * Returns an immutable instance of [CreditOrReversalProcessed]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .amount() + * .currency() + * .explanation() + * .processedAt() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = - NonFiatCurrencyOrNonFungibleTokenReceived( - checkRequired( - "blockchainTransactionHash", - blockchainTransactionHash, - ), - checkRequired("destinationWalletAddress", destinationWalletAddress), - checkRequired( - "priorApprovedTransactions", - priorApprovedTransactions, - ), + fun build(): CreditOrReversalProcessed = + CreditOrReversalProcessed( + checkRequired("amount", amount), + checkRequired("currency", currency), + checkRequired("explanation", explanation), + checkRequired("processedAt", processedAt), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { + fun validate(): CreditOrReversalProcessed = apply { if (validated) { return@apply } - blockchainTransactionHash() - destinationWalletAddress() - priorApprovedTransactions() + amount() + currency() + explanation() + processedAt() validated = true } @@ -5972,27 +8574,30 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + - (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + - (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) + (if (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + (if (explanation.asKnown().isPresent) 1 else 0) + + (if (processedAt.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is NonFiatCurrencyOrNonFungibleTokenReceived && - blockchainTransactionHash == other.blockchainTransactionHash && - destinationWalletAddress == other.destinationWalletAddress && - priorApprovedTransactions == other.priorApprovedTransactions && + return other is CreditOrReversalProcessed && + amount == other.amount && + currency == other.currency && + explanation == other.explanation && + processedAt == other.processedAt && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, + amount, + currency, + explanation, + processedAt, additionalProperties, ) } @@ -6000,17 +8605,17 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" + "CreditOrReversalProcessed{amount=$amount, currency=$currency, explanation=$explanation, processedAt=$processedAt, additionalProperties=$additionalProperties}" } /** - * Prior undisputed non-fraud transactions details. Present if and only if `reason` - * is `prior_undisputed_non_fraud_transactions`. + * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. */ - class PriorUndisputedNonFraudTransactions + class InvalidDispute @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val explanation: JsonField, + private val reason: JsonField, private val additionalProperties: MutableMap, ) { @@ -6018,18 +8623,29 @@ private constructor( private constructor( @JsonProperty("explanation") @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + explanation: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + ) : this(explanation, reason, mutableMapOf()) /** - * Explanation of the prior undisputed non-fraud transactions provided by the - * merchant. + * Explanation for why the dispute is considered invalid by the merchant. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ fun explanation(): Optional = explanation.getOptional("explanation") + /** + * The reason a merchant considers the dispute invalid. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + /** * Returns the raw JSON value of [explanation]. * @@ -6040,6 +8656,16 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation + /** + * 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) @@ -6056,36 +8682,35 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [PriorUndisputedNonFraudTransactions]. + * [InvalidDispute]. * * The following fields are required: * ```java * .explanation() + * .reason() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [PriorUndisputedNonFraudTransactions]. */ + /** A builder for [InvalidDispute]. */ class Builder internal constructor() { private var explanation: JsonField? = null + private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - priorUndisputedNonFraudTransactions: PriorUndisputedNonFraudTransactions - ) = apply { - explanation = priorUndisputedNonFraudTransactions.explanation + internal fun from(invalidDispute: InvalidDispute) = apply { + explanation = invalidDispute.explanation + reason = invalidDispute.reason additionalProperties = - priorUndisputedNonFraudTransactions.additionalProperties - .toMutableMap() + invalidDispute.additionalProperties.toMutableMap() } /** - * Explanation of the prior undisputed non-fraud transactions provided by - * the merchant. + * Explanation for why the dispute is considered invalid by the merchant. */ fun explanation(explanation: String?) = explanation(JsonField.ofNullable(explanation)) @@ -6107,6 +8732,18 @@ private constructor( this.explanation = explanation } + /** The reason a merchant considers the dispute invalid. */ + 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() @@ -6130,32 +8767,35 @@ private constructor( } /** - * Returns an immutable instance of [PriorUndisputedNonFraudTransactions]. + * Returns an immutable instance of [InvalidDispute]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .explanation() + * .reason() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): PriorUndisputedNonFraudTransactions = - PriorUndisputedNonFraudTransactions( + fun build(): InvalidDispute = + InvalidDispute( checkRequired("explanation", explanation), + checkRequired("reason", reason), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): PriorUndisputedNonFraudTransactions = apply { + fun validate(): InvalidDispute = apply { if (validated) { return@apply } explanation() + reason().validate() validated = true } @@ -6174,895 +8814,617 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is PriorUndisputedNonFraudTransactions && - explanation == other.explanation && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) - } - - override fun hashCode(): Int = hashCode - - override fun toString() = - "PriorUndisputedNonFraudTransactions{explanation=$explanation, additionalProperties=$additionalProperties}" - } - - /** The reason the merchant re-presented the dispute. */ - 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 { - - /** Cardholder no longer disputes the transaction. */ - @JvmField - val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") - - /** Compelling evidence. */ - @JvmField val COMPELLING_EVIDENCE = of("compelling_evidence") - - /** Credit or reversal was processed. */ - @JvmField - val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") - - /** Delayed charge transaction. */ - @JvmField val DELAYED_CHARGE_TRANSACTION = of("delayed_charge_transaction") - - /** Evidence of imprint. */ - @JvmField val EVIDENCE_OF_IMPRINT = of("evidence_of_imprint") - - /** Invalid dispute. */ - @JvmField val INVALID_DISPUTE = of("invalid_dispute") - - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - @JvmField - val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = - of("non_fiat_currency_or_non_fungible_token_received") - - /** Prior undisputed non-fraud transactions. */ - @JvmField - val PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS = - of("prior_undisputed_non_fraud_transactions") - - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } + internal fun validity(): Int = + (if (explanation.asKnown().isPresent) 1 else 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) - /** An enum containing [Reason]'s known values. */ - enum class Known { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Compelling evidence. */ - COMPELLING_EVIDENCE, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Delayed charge transaction. */ - DELAYED_CHARGE_TRANSACTION, - /** Evidence of imprint. */ - EVIDENCE_OF_IMPRINT, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Prior undisputed non-fraud transactions. */ - PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS, - } + /** The reason a merchant considers the dispute invalid. */ + class Reason + @JsonCreator + private constructor(private val value: JsonField) : Enum { - /** - * 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 { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Compelling evidence. */ - COMPELLING_EVIDENCE, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Delayed charge transaction. */ - DELAYED_CHARGE_TRANSACTION, - /** Evidence of imprint. */ - EVIDENCE_OF_IMPRINT, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Prior undisputed non-fraud transactions. */ - PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS, /** - * An enum member indicating that [Reason] was instantiated with an unknown - * 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. */ - _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) { - CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES - COMPELLING_EVIDENCE -> Value.COMPELLING_EVIDENCE - CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED - DELAYED_CHARGE_TRANSACTION -> Value.DELAYED_CHARGE_TRANSACTION - EVIDENCE_OF_IMPRINT -> Value.EVIDENCE_OF_IMPRINT - INVALID_DISPUTE -> Value.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS -> - Value.PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS - 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 IncreaseInvalidDataException if this class instance's value is a not - * a known member. - */ - fun known(): Known = - when (this) { - CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES - COMPELLING_EVIDENCE -> Known.COMPELLING_EVIDENCE - CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED - DELAYED_CHARGE_TRANSACTION -> Known.DELAYED_CHARGE_TRANSACTION - EVIDENCE_OF_IMPRINT -> Known.EVIDENCE_OF_IMPRINT - INVALID_DISPUTE -> Known.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS -> - Known.PRIOR_UNDISPUTED_NON_FRAUD_TRANSACTIONS - else -> throw IncreaseInvalidDataException("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 IncreaseInvalidDataException if this class instance's value does not - * have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("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: IncreaseInvalidDataException) { - 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 MerchantPrearbitrationReceived && - cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && - compellingEvidence == other.compellingEvidence && - creditOrReversalProcessed == other.creditOrReversalProcessed && - delayedChargeTransaction == other.delayedChargeTransaction && - evidenceOfImprint == other.evidenceOfImprint && - invalidDispute == other.invalidDispute && - nonFiatCurrencyOrNonFungibleTokenReceived == - other.nonFiatCurrencyOrNonFungibleTokenReceived && - priorUndisputedNonFraudTransactions == - other.priorUndisputedNonFraudTransactions && - reason == other.reason && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash( - cardholderNoLongerDisputes, - compellingEvidence, - creditOrReversalProcessed, - delayedChargeTransaction, - evidenceOfImprint, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenReceived, - priorUndisputedNonFraudTransactions, - reason, - additionalProperties, - ) - } + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value - override fun hashCode(): Int = hashCode + companion object { - override fun toString() = - "MerchantPrearbitrationReceived{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, compellingEvidence=$compellingEvidence, creditOrReversalProcessed=$creditOrReversalProcessed, delayedChargeTransaction=$delayedChargeTransaction, evidenceOfImprint=$evidenceOfImprint, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, priorUndisputedNonFraudTransactions=$priorUndisputedNonFraudTransactions, reason=$reason, additionalProperties=$additionalProperties}" - } + /** Automatic Teller Machine (ATM) transaction proof provided. */ + @JvmField + val AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED = + of("automatic_teller_machine_transaction_proof_provided") - /** - * A Card Dispute Re-presented Visa Network Event object. This field will be present in - * the JSON response if and only if `category` is equal to `represented`. Contains the - * details specific to a re-presented Visa Card Dispute Network Event, which represents - * that the merchant has declined the user's chargeback and has re-presented the - * payment. - */ - class Represented - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val cardholderNoLongerDisputes: JsonField, - private val creditOrReversalProcessed: JsonField, - private val invalidDispute: JsonField, - private val nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue, - private val nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField, - private val proofOfCashDisbursement: JsonField, - private val reason: JsonField, - private val reversalIssued: JsonField, - private val additionalProperties: MutableMap, - ) { + /** Balance of partial prepayment not paid. */ + @JvmField + val BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID = + of("balance_of_partial_prepayment_not_paid") - @JsonCreator - private constructor( - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - cardholderNoLongerDisputes: JsonField = - JsonMissing.of(), - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - creditOrReversalProcessed: JsonField = - JsonMissing.of(), - @JsonProperty("invalid_dispute") - @ExcludeMissing - invalidDispute: JsonField = JsonMissing.of(), - @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") - @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue = JsonMissing.of(), - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField = - JsonMissing.of(), - @JsonProperty("proof_of_cash_disbursement") - @ExcludeMissing - proofOfCashDisbursement: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - @JsonProperty("reversal_issued") - @ExcludeMissing - reversalIssued: JsonField = JsonMissing.of(), - ) : this( - cardholderNoLongerDisputes, - creditOrReversalProcessed, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenAsDescribed, - nonFiatCurrencyOrNonFungibleTokenReceived, - proofOfCashDisbursement, - reason, - reversalIssued, - mutableMapOf(), - ) + /** + * Cardholder canceled before expected receipt date of the merchandise. + */ + @JvmField + val CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE = + of("cardholder_canceled_before_expected_merchandise_receipt_date") - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun cardholderNoLongerDisputes(): Optional = - cardholderNoLongerDisputes.getOptional("cardholder_no_longer_disputes") + /** Cardholder canceled before expected receipt date of the services. */ + @JvmField + val CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE = + of("cardholder_canceled_before_expected_services_receipt_date") - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun creditOrReversalProcessed(): Optional = - creditOrReversalProcessed.getOptional("credit_or_reversal_processed") + /** Cardholder canceled on a different date than claimed. */ + @JvmField + val CARDHOLDER_CANCELED_DIFFERENT_DATE = + of("cardholder_canceled_different_date") - /** - * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun invalidDispute(): Optional = - invalidDispute.getOptional("invalid_dispute") + /** Cardholder received did not cancel according to policy. */ + @JvmField + val CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY = + of("cardholder_did_not_cancel_according_to_policy") - /** - * Non-fiat currency or non-fungible token as described details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_as_described") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenAsDescribed(): JsonValue = - nonFiatCurrencyOrNonFungibleTokenAsDescribed + /** Cardholder received the merchandise. */ + @JvmField + val CARDHOLDER_RECEIVED_MERCHANDISE = + of("cardholder_received_merchandise") - /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived(): - Optional = - nonFiatCurrencyOrNonFungibleTokenReceived.getOptional( - "non_fiat_currency_or_non_fungible_token_received" - ) + /** Country code is correct. */ + @JvmField val COUNTRY_CODE_CORRECT = of("country_code_correct") - /** - * Proof of cash disbursement details. Present if and only if `reason` is - * `proof_of_cash_disbursement`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun proofOfCashDisbursement(): Optional = - proofOfCashDisbursement.getOptional("proof_of_cash_disbursement") + /** Credit was processed correctly. */ + @JvmField + val CREDIT_PROCESSED_CORRECTLY = of("credit_processed_correctly") - /** - * The reason the merchant re-presented the dispute. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or - * is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun reason(): Reason = reason.getRequired("reason") + /** Currency is correct. */ + @JvmField val CURRENCY_CORRECT = of("currency_correct") - /** - * Reversal issued by merchant details. Present if and only if `reason` is - * `reversal_issued`. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun reversalIssued(): Optional = - reversalIssued.getOptional("reversal_issued") + /** Dispute is for quality. */ + @JvmField val DISPUTE_IS_FOR_QUALITY = of("dispute_is_for_quality") - /** - * Returns the raw JSON value of [cardholderNoLongerDisputes]. - * - * Unlike [cardholderNoLongerDisputes], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("cardholder_no_longer_disputes") - @ExcludeMissing - fun _cardholderNoLongerDisputes(): JsonField = - cardholderNoLongerDisputes + /** Dispute is for Visa Cash Back transaction portion. */ + @JvmField + val DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION = + of("dispute_is_for_visa_cash_back_transaction_portion") - /** - * Returns the raw JSON value of [creditOrReversalProcessed]. - * - * Unlike [creditOrReversalProcessed], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("credit_or_reversal_processed") - @ExcludeMissing - fun _creditOrReversalProcessed(): JsonField = - creditOrReversalProcessed + /** Disputed amount is Value Added Tax (VAT). */ + @JvmField + val DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX = + of("disputed_amount_is_value_added_tax") - /** - * Returns the raw JSON value of [invalidDispute]. - * - * Unlike [invalidDispute], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("invalid_dispute") - @ExcludeMissing - fun _invalidDispute(): JsonField = invalidDispute + /** + * Disputed amount is Value Added Tax (VAT) but no credit receipt was + * provided by the cardholder. + */ + @JvmField + val DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED = + of("disputed_amount_is_value_added_tax_no_credit_receipt_provided") - /** - * Returns the raw JSON value of [nonFiatCurrencyOrNonFungibleTokenReceived]. - * - * Unlike [nonFiatCurrencyOrNonFungibleTokenReceived], this method doesn't throw if - * the JSON field has an unexpected type. - */ - @JsonProperty("non_fiat_currency_or_non_fungible_token_received") - @ExcludeMissing - fun _nonFiatCurrencyOrNonFungibleTokenReceived(): - JsonField = - nonFiatCurrencyOrNonFungibleTokenReceived + /** Limited return or cancellation policy was properly disclosed. */ + @JvmField + val LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED = + of("limited_return_or_cancellation_policy_properly_disclosed") - /** - * Returns the raw JSON value of [proofOfCashDisbursement]. - * - * Unlike [proofOfCashDisbursement], this method doesn't throw if the JSON field has - * an unexpected type. - */ - @JsonProperty("proof_of_cash_disbursement") - @ExcludeMissing - fun _proofOfCashDisbursement(): JsonField = - proofOfCashDisbursement + /** Merchandise held at cardholder customs agency. */ + @JvmField + val MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY = + of("merchandise_held_at_cardholder_customs_agency") - /** - * 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 + /** Merchandise matches the merchant's description. */ + @JvmField + val MERCHANDISE_MATCHES_DESCRIPTION = + of("merchandise_matches_description") - /** - * Returns the raw JSON value of [reversalIssued]. - * - * Unlike [reversalIssued], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("reversal_issued") - @ExcludeMissing - fun _reversalIssued(): JsonField = reversalIssued + /** Merchandise is not counterfeit. */ + @JvmField + val MERCHANDISE_NOT_COUNTERFEIT = of("merchandise_not_counterfeit") - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) - } + /** Merchandise is not damaged. */ + @JvmField val MERCHANDISE_NOT_DAMAGED = of("merchandise_not_damaged") - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + /** Merchandise is not defective. */ + @JvmField + val MERCHANDISE_NOT_DEFECTIVE = of("merchandise_not_defective") - fun toBuilder() = Builder().from(this) + /** Merchandise was provided prior to the cancellation date. */ + @JvmField + val MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE = + of("merchandise_provided_prior_to_cancellation_date") - companion object { + /** Merchandise quality matches the merchant's description. */ + @JvmField + val MERCHANDISE_QUALITY_MATCHES_DESCRIPTION = + of("merchandise_quality_matches_description") - /** - * Returns a mutable builder for constructing an instance of [Represented]. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .creditOrReversalProcessed() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenAsDescribed() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .proofOfCashDisbursement() - * .reason() - * .reversalIssued() - * ``` - */ - @JvmStatic fun builder() = Builder() - } + /** Merchandise was not attempted returned to the merchant. */ + @JvmField + val MERCHANDISE_RETURN_NOT_ATTEMPTED = + of("merchandise_return_not_attempted") - /** A builder for [Represented]. */ - class Builder internal constructor() { + /** Merchant was not notified of the closed account. */ + @JvmField + val MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT = + of("merchant_not_notified_of_closed_account") - private var cardholderNoLongerDisputes: JsonField? = - null - private var creditOrReversalProcessed: JsonField? = - null - private var invalidDispute: JsonField? = null - private var nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue? = null - private var nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField? = - null - private var proofOfCashDisbursement: JsonField? = null - private var reason: JsonField? = null - private var reversalIssued: JsonField? = null - private var additionalProperties: MutableMap = mutableMapOf() + /** + * Name on manifest of departed flight matches name on purchased + * itinerary. + */ + @JvmField + val NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE = + of("name_on_flight_manifest_matches_purchase") - @JvmSynthetic - internal fun from(represented: Represented) = apply { - cardholderNoLongerDisputes = represented.cardholderNoLongerDisputes - creditOrReversalProcessed = represented.creditOrReversalProcessed - invalidDispute = represented.invalidDispute - nonFiatCurrencyOrNonFungibleTokenAsDescribed = - represented.nonFiatCurrencyOrNonFungibleTokenAsDescribed - nonFiatCurrencyOrNonFungibleTokenReceived = - represented.nonFiatCurrencyOrNonFungibleTokenReceived - proofOfCashDisbursement = represented.proofOfCashDisbursement - reason = represented.reason - reversalIssued = represented.reversalIssued - additionalProperties = represented.additionalProperties.toMutableMap() - } + /** No credit receipt was provided by the cardholder. */ + @JvmField + val NO_CREDIT_RECEIPT_PROVIDED = of("no_credit_receipt_provided") - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: CardholderNoLongerDisputes? - ) = cardholderNoLongerDisputes(JsonField.ofNullable(cardholderNoLongerDisputes)) + /** Other. */ + @JvmField val OTHER = of("other") - /** - * Alias for calling [Builder.cardholderNoLongerDisputes] with - * `cardholderNoLongerDisputes.orElse(null)`. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: Optional - ) = cardholderNoLongerDisputes(cardholderNoLongerDisputes.getOrNull()) + /** The claimed processing error did not occur. */ + @JvmField + val PROCESSING_ERROR_INCORRECT = of("processing_error_incorrect") - /** - * Sets [Builder.cardholderNoLongerDisputes] to an arbitrary JSON value. - * - * You should usually call [Builder.cardholderNoLongerDisputes] with a - * well-typed [CardholderNoLongerDisputes] value instead. This method is - * primarily for setting the field to an undocumented or not yet supported - * value. - */ - fun cardholderNoLongerDisputes( - cardholderNoLongerDisputes: JsonField - ) = apply { this.cardholderNoLongerDisputes = cardholderNoLongerDisputes } + /** + * Returned merchandise held at customs agency outside the merchant's + * country. + */ + @JvmField + val RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY = + of( + "returned_mechandise_held_at_customs_agency_outside_merchant_country" + ) - /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: CreditOrReversalProcessed? - ) = creditOrReversalProcessed(JsonField.ofNullable(creditOrReversalProcessed)) + /** Services match the merchant's description. */ + @JvmField + val SERVICES_MATCH_DESCRIPTION = of("services_match_description") - /** - * Alias for calling [Builder.creditOrReversalProcessed] with - * `creditOrReversalProcessed.orElse(null)`. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: Optional - ) = creditOrReversalProcessed(creditOrReversalProcessed.getOrNull()) + /** Services were provided prior to the cancellation date. */ + @JvmField + val SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE = + of("services_provided_prior_to_cancellation_date") - /** - * Sets [Builder.creditOrReversalProcessed] to an arbitrary JSON value. - * - * You should usually call [Builder.creditOrReversalProcessed] with a well-typed - * [CreditOrReversalProcessed] value instead. This method is primarily for - * setting the field to an undocumented or not yet supported value. - */ - fun creditOrReversalProcessed( - creditOrReversalProcessed: JsonField - ) = apply { this.creditOrReversalProcessed = creditOrReversalProcessed } + /** + * Services were used after the cancellation date and prior to the + * dispute submission date. + */ + @JvmField + val SERVICES_USED_AFTER_CANCELLATION_DATE = + of("services_used_after_cancellation_date") - /** - * Invalid dispute details. Present if and only if `reason` is - * `invalid_dispute`. - */ - fun invalidDispute(invalidDispute: InvalidDispute?) = - invalidDispute(JsonField.ofNullable(invalidDispute)) + /** Terms of service were not misrepresented. */ + @JvmField + val TERMS_OF_SERVICE_NOT_MISREPRESENTED = + of("terms_of_service_not_misrepresented") - /** - * Alias for calling [Builder.invalidDispute] with - * `invalidDispute.orElse(null)`. - */ - fun invalidDispute(invalidDispute: Optional) = - invalidDispute(invalidDispute.getOrNull()) + /** Transaction code is correct. */ + @JvmField val TRANSACTION_CODE_CORRECT = of("transaction_code_correct") - /** - * Sets [Builder.invalidDispute] to an arbitrary JSON value. - * - * You should usually call [Builder.invalidDispute] with a well-typed - * [InvalidDispute] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun invalidDispute(invalidDispute: JsonField) = apply { - this.invalidDispute = invalidDispute - } + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } - /** - * Non-fiat currency or non-fungible token as described details. Present if and - * only if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. - */ - fun nonFiatCurrencyOrNonFungibleTokenAsDescribed( - nonFiatCurrencyOrNonFungibleTokenAsDescribed: JsonValue - ) = apply { - this.nonFiatCurrencyOrNonFungibleTokenAsDescribed = - nonFiatCurrencyOrNonFungibleTokenAsDescribed - } + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** Automatic Teller Machine (ATM) transaction proof provided. */ + AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED, + /** Balance of partial prepayment not paid. */ + BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID, + /** + * Cardholder canceled before expected receipt date of the merchandise. + */ + CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE, + /** Cardholder canceled before expected receipt date of the services. */ + CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE, + /** Cardholder canceled on a different date than claimed. */ + CARDHOLDER_CANCELED_DIFFERENT_DATE, + /** Cardholder received did not cancel according to policy. */ + CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY, + /** Cardholder received the merchandise. */ + CARDHOLDER_RECEIVED_MERCHANDISE, + /** Country code is correct. */ + COUNTRY_CODE_CORRECT, + /** Credit was processed correctly. */ + CREDIT_PROCESSED_CORRECTLY, + /** Currency is correct. */ + CURRENCY_CORRECT, + /** Dispute is for quality. */ + DISPUTE_IS_FOR_QUALITY, + /** Dispute is for Visa Cash Back transaction portion. */ + DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION, + /** Disputed amount is Value Added Tax (VAT). */ + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX, + /** + * Disputed amount is Value Added Tax (VAT) but no credit receipt was + * provided by the cardholder. + */ + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED, + /** Limited return or cancellation policy was properly disclosed. */ + LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED, + /** Merchandise held at cardholder customs agency. */ + MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY, + /** Merchandise matches the merchant's description. */ + MERCHANDISE_MATCHES_DESCRIPTION, + /** Merchandise is not counterfeit. */ + MERCHANDISE_NOT_COUNTERFEIT, + /** Merchandise is not damaged. */ + MERCHANDISE_NOT_DAMAGED, + /** Merchandise is not defective. */ + MERCHANDISE_NOT_DEFECTIVE, + /** Merchandise was provided prior to the cancellation date. */ + MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE, + /** Merchandise quality matches the merchant's description. */ + MERCHANDISE_QUALITY_MATCHES_DESCRIPTION, + /** Merchandise was not attempted returned to the merchant. */ + MERCHANDISE_RETURN_NOT_ATTEMPTED, + /** Merchant was not notified of the closed account. */ + MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT, + /** + * Name on manifest of departed flight matches name on purchased + * itinerary. + */ + NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE, + /** No credit receipt was provided by the cardholder. */ + NO_CREDIT_RECEIPT_PROVIDED, + /** Other. */ + OTHER, + /** The claimed processing error did not occur. */ + PROCESSING_ERROR_INCORRECT, + /** + * Returned merchandise held at customs agency outside the merchant's + * country. + */ + RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY, + /** Services match the merchant's description. */ + SERVICES_MATCH_DESCRIPTION, + /** Services were provided prior to the cancellation date. */ + SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE, + /** + * Services were used after the cancellation date and prior to the + * dispute submission date. + */ + SERVICES_USED_AFTER_CANCELLATION_DATE, + /** Terms of service were not misrepresented. */ + TERMS_OF_SERVICE_NOT_MISREPRESENTED, + /** Transaction code is correct. */ + TRANSACTION_CODE_CORRECT, + } - /** - * Non-fiat currency or non-fungible token received details. Present if and only - * if `reason` is `non_fiat_currency_or_non_fungible_token_received`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived? - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - JsonField.ofNullable(nonFiatCurrencyOrNonFungibleTokenReceived) - ) + /** + * 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 { + /** Automatic Teller Machine (ATM) transaction proof provided. */ + AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED, + /** Balance of partial prepayment not paid. */ + BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID, + /** + * Cardholder canceled before expected receipt date of the merchandise. + */ + CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE, + /** Cardholder canceled before expected receipt date of the services. */ + CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE, + /** Cardholder canceled on a different date than claimed. */ + CARDHOLDER_CANCELED_DIFFERENT_DATE, + /** Cardholder received did not cancel according to policy. */ + CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY, + /** Cardholder received the merchandise. */ + CARDHOLDER_RECEIVED_MERCHANDISE, + /** Country code is correct. */ + COUNTRY_CODE_CORRECT, + /** Credit was processed correctly. */ + CREDIT_PROCESSED_CORRECTLY, + /** Currency is correct. */ + CURRENCY_CORRECT, + /** Dispute is for quality. */ + DISPUTE_IS_FOR_QUALITY, + /** Dispute is for Visa Cash Back transaction portion. */ + DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION, + /** Disputed amount is Value Added Tax (VAT). */ + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX, + /** + * Disputed amount is Value Added Tax (VAT) but no credit receipt was + * provided by the cardholder. + */ + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED, + /** Limited return or cancellation policy was properly disclosed. */ + LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED, + /** Merchandise held at cardholder customs agency. */ + MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY, + /** Merchandise matches the merchant's description. */ + MERCHANDISE_MATCHES_DESCRIPTION, + /** Merchandise is not counterfeit. */ + MERCHANDISE_NOT_COUNTERFEIT, + /** Merchandise is not damaged. */ + MERCHANDISE_NOT_DAMAGED, + /** Merchandise is not defective. */ + MERCHANDISE_NOT_DEFECTIVE, + /** Merchandise was provided prior to the cancellation date. */ + MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE, + /** Merchandise quality matches the merchant's description. */ + MERCHANDISE_QUALITY_MATCHES_DESCRIPTION, + /** Merchandise was not attempted returned to the merchant. */ + MERCHANDISE_RETURN_NOT_ATTEMPTED, + /** Merchant was not notified of the closed account. */ + MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT, + /** + * Name on manifest of departed flight matches name on purchased + * itinerary. + */ + NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE, + /** No credit receipt was provided by the cardholder. */ + NO_CREDIT_RECEIPT_PROVIDED, + /** Other. */ + OTHER, + /** The claimed processing error did not occur. */ + PROCESSING_ERROR_INCORRECT, + /** + * Returned merchandise held at customs agency outside the merchant's + * country. + */ + RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY, + /** Services match the merchant's description. */ + SERVICES_MATCH_DESCRIPTION, + /** Services were provided prior to the cancellation date. */ + SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE, + /** + * Services were used after the cancellation date and prior to the + * dispute submission date. + */ + SERVICES_USED_AFTER_CANCELLATION_DATE, + /** Terms of service were not misrepresented. */ + TERMS_OF_SERVICE_NOT_MISREPRESENTED, + /** Transaction code is correct. */ + TRANSACTION_CODE_CORRECT, + /** + * An enum member indicating that [Reason] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } - /** - * Alias for calling [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] with - * `nonFiatCurrencyOrNonFungibleTokenReceived.orElse(null)`. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - Optional - ) = - nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived.getOrNull() - ) + /** + * 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) { + AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> + Value.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED + BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> + Value.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID + CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> + Value + .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE + CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> + Value.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE + CARDHOLDER_CANCELED_DIFFERENT_DATE -> + Value.CARDHOLDER_CANCELED_DIFFERENT_DATE + CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> + Value.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY + CARDHOLDER_RECEIVED_MERCHANDISE -> + Value.CARDHOLDER_RECEIVED_MERCHANDISE + COUNTRY_CODE_CORRECT -> Value.COUNTRY_CODE_CORRECT + CREDIT_PROCESSED_CORRECTLY -> Value.CREDIT_PROCESSED_CORRECTLY + CURRENCY_CORRECT -> Value.CURRENCY_CORRECT + DISPUTE_IS_FOR_QUALITY -> Value.DISPUTE_IS_FOR_QUALITY + DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> + Value.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> + Value.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> + Value + .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED + LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> + Value.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED + MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> + Value.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY + MERCHANDISE_MATCHES_DESCRIPTION -> + Value.MERCHANDISE_MATCHES_DESCRIPTION + MERCHANDISE_NOT_COUNTERFEIT -> Value.MERCHANDISE_NOT_COUNTERFEIT + MERCHANDISE_NOT_DAMAGED -> Value.MERCHANDISE_NOT_DAMAGED + MERCHANDISE_NOT_DEFECTIVE -> Value.MERCHANDISE_NOT_DEFECTIVE + MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Value.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE + MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> + Value.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION + MERCHANDISE_RETURN_NOT_ATTEMPTED -> + Value.MERCHANDISE_RETURN_NOT_ATTEMPTED + MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> + Value.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT + NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> + Value.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE + NO_CREDIT_RECEIPT_PROVIDED -> Value.NO_CREDIT_RECEIPT_PROVIDED + OTHER -> Value.OTHER + PROCESSING_ERROR_INCORRECT -> Value.PROCESSING_ERROR_INCORRECT + RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> + Value + .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY + SERVICES_MATCH_DESCRIPTION -> Value.SERVICES_MATCH_DESCRIPTION + SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Value.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE + SERVICES_USED_AFTER_CANCELLATION_DATE -> + Value.SERVICES_USED_AFTER_CANCELLATION_DATE + TERMS_OF_SERVICE_NOT_MISREPRESENTED -> + Value.TERMS_OF_SERVICE_NOT_MISREPRESENTED + TRANSACTION_CODE_CORRECT -> Value.TRANSACTION_CODE_CORRECT + else -> Value._UNKNOWN + } - /** - * Sets [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] to an arbitrary JSON - * value. - * - * You should usually call [Builder.nonFiatCurrencyOrNonFungibleTokenReceived] - * with a well-typed [NonFiatCurrencyOrNonFungibleTokenReceived] value instead. - * This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun nonFiatCurrencyOrNonFungibleTokenReceived( - nonFiatCurrencyOrNonFungibleTokenReceived: - JsonField - ) = apply { - this.nonFiatCurrencyOrNonFungibleTokenReceived = - nonFiatCurrencyOrNonFungibleTokenReceived - } + /** + * 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> + Known.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED + BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> + Known.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID + CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> + Known + .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE + CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> + Known.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE + CARDHOLDER_CANCELED_DIFFERENT_DATE -> + Known.CARDHOLDER_CANCELED_DIFFERENT_DATE + CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> + Known.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY + CARDHOLDER_RECEIVED_MERCHANDISE -> + Known.CARDHOLDER_RECEIVED_MERCHANDISE + COUNTRY_CODE_CORRECT -> Known.COUNTRY_CODE_CORRECT + CREDIT_PROCESSED_CORRECTLY -> Known.CREDIT_PROCESSED_CORRECTLY + CURRENCY_CORRECT -> Known.CURRENCY_CORRECT + DISPUTE_IS_FOR_QUALITY -> Known.DISPUTE_IS_FOR_QUALITY + DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> + Known.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> + Known.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX + DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> + Known + .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED + LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> + Known.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED + MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> + Known.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY + MERCHANDISE_MATCHES_DESCRIPTION -> + Known.MERCHANDISE_MATCHES_DESCRIPTION + MERCHANDISE_NOT_COUNTERFEIT -> Known.MERCHANDISE_NOT_COUNTERFEIT + MERCHANDISE_NOT_DAMAGED -> Known.MERCHANDISE_NOT_DAMAGED + MERCHANDISE_NOT_DEFECTIVE -> Known.MERCHANDISE_NOT_DEFECTIVE + MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Known.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE + MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> + Known.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION + MERCHANDISE_RETURN_NOT_ATTEMPTED -> + Known.MERCHANDISE_RETURN_NOT_ATTEMPTED + MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> + Known.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT + NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> + Known.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE + NO_CREDIT_RECEIPT_PROVIDED -> Known.NO_CREDIT_RECEIPT_PROVIDED + OTHER -> Known.OTHER + PROCESSING_ERROR_INCORRECT -> Known.PROCESSING_ERROR_INCORRECT + RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> + Known + .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY + SERVICES_MATCH_DESCRIPTION -> Known.SERVICES_MATCH_DESCRIPTION + SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> + Known.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE + SERVICES_USED_AFTER_CANCELLATION_DATE -> + Known.SERVICES_USED_AFTER_CANCELLATION_DATE + TERMS_OF_SERVICE_NOT_MISREPRESENTED -> + Known.TERMS_OF_SERVICE_NOT_MISREPRESENTED + TRANSACTION_CODE_CORRECT -> Known.TRANSACTION_CODE_CORRECT + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + } - /** - * Proof of cash disbursement details. Present if and only if `reason` is - * `proof_of_cash_disbursement`. - */ - fun proofOfCashDisbursement(proofOfCashDisbursement: ProofOfCashDisbursement?) = - proofOfCashDisbursement(JsonField.ofNullable(proofOfCashDisbursement)) + /** + * 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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } - /** - * Alias for calling [Builder.proofOfCashDisbursement] with - * `proofOfCashDisbursement.orElse(null)`. - */ - fun proofOfCashDisbursement( - proofOfCashDisbursement: Optional - ) = proofOfCashDisbursement(proofOfCashDisbursement.getOrNull()) + private var validated: Boolean = false - /** - * Sets [Builder.proofOfCashDisbursement] to an arbitrary JSON value. - * - * You should usually call [Builder.proofOfCashDisbursement] with a well-typed - * [ProofOfCashDisbursement] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun proofOfCashDisbursement( - proofOfCashDisbursement: JsonField - ) = apply { this.proofOfCashDisbursement = proofOfCashDisbursement } + fun validate(): Reason = apply { + if (validated) { + return@apply + } - /** The reason the merchant re-presented the dispute. */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) + known() + validated = true + } - /** - * 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 isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - /** - * Reversal issued by merchant details. Present if and only if `reason` is - * `reversal_issued`. - */ - fun reversalIssued(reversalIssued: ReversalIssued?) = - reversalIssued(JsonField.ofNullable(reversalIssued)) + /** + * 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 - /** - * Alias for calling [Builder.reversalIssued] with - * `reversalIssued.orElse(null)`. - */ - fun reversalIssued(reversalIssued: Optional) = - reversalIssued(reversalIssued.getOrNull()) + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** - * Sets [Builder.reversalIssued] to an arbitrary JSON value. - * - * You should usually call [Builder.reversalIssued] with a well-typed - * [ReversalIssued] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun reversalIssued(reversalIssued: JsonField) = apply { - this.reversalIssued = reversalIssued - } + return other is Reason && value == other.value + } - fun additionalProperties(additionalProperties: Map) = apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + override fun hashCode() = value.hashCode() - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) + override fun toString() = value.toString() } - fun putAllAdditionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.putAll(additionalProperties) + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) + return other is InvalidDispute && + explanation == other.explanation && + reason == other.reason && + additionalProperties == other.additionalProperties } - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + private val hashCode: Int by lazy { + Objects.hash(explanation, reason, additionalProperties) } - /** - * Returns an immutable instance of [Represented]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .cardholderNoLongerDisputes() - * .creditOrReversalProcessed() - * .invalidDispute() - * .nonFiatCurrencyOrNonFungibleTokenAsDescribed() - * .nonFiatCurrencyOrNonFungibleTokenReceived() - * .proofOfCashDisbursement() - * .reason() - * .reversalIssued() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): Represented = - Represented( - checkRequired("cardholderNoLongerDisputes", cardholderNoLongerDisputes), - checkRequired("creditOrReversalProcessed", creditOrReversalProcessed), - checkRequired("invalidDispute", invalidDispute), - checkRequired( - "nonFiatCurrencyOrNonFungibleTokenAsDescribed", - nonFiatCurrencyOrNonFungibleTokenAsDescribed, - ), - checkRequired( - "nonFiatCurrencyOrNonFungibleTokenReceived", - nonFiatCurrencyOrNonFungibleTokenReceived, - ), - checkRequired("proofOfCashDisbursement", proofOfCashDisbursement), - checkRequired("reason", reason), - checkRequired("reversalIssued", reversalIssued), - additionalProperties.toMutableMap(), - ) - } - - private var validated: Boolean = false - - fun validate(): Represented = apply { - if (validated) { - return@apply - } + override fun hashCode(): Int = hashCode - cardholderNoLongerDisputes().ifPresent { it.validate() } - creditOrReversalProcessed().ifPresent { it.validate() } - invalidDispute().ifPresent { it.validate() } - nonFiatCurrencyOrNonFungibleTokenReceived().ifPresent { it.validate() } - proofOfCashDisbursement().ifPresent { it.validate() } - reason().validate() - reversalIssued().ifPresent { it.validate() } - validated = true + override fun toString() = + "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - 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 = - (cardholderNoLongerDisputes.asKnown().getOrNull()?.validity() ?: 0) + - (creditOrReversalProcessed.asKnown().getOrNull()?.validity() ?: 0) + - (invalidDispute.asKnown().getOrNull()?.validity() ?: 0) + - (nonFiatCurrencyOrNonFungibleTokenReceived.asKnown().getOrNull()?.validity() - ?: 0) + - (proofOfCashDisbursement.asKnown().getOrNull()?.validity() ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) + - (reversalIssued.asKnown().getOrNull()?.validity() ?: 0) - /** - * Cardholder no longer disputes details. Present if and only if `reason` is - * `cardholder_no_longer_disputes`. + * Non-fiat currency or non-fungible token as described details. Present if and only + * if `reason` is `non_fiat_currency_or_non_fungible_token_as_described`. */ - class CardholderNoLongerDisputes + class NonFiatCurrencyOrNonFungibleTokenAsDescribed @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, + private val additionalProperties: MutableMap ) { - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) - - /** - * Explanation for why the merchant believes the cardholder no longer disputes - * the transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). - */ - fun explanation(): Optional = explanation.getOptional("explanation") - - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + @JsonCreator private constructor() : this(mutableMapOf()) @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -7080,53 +9442,25 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CardholderNoLongerDisputes]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [CardholderNoLongerDisputes]. */ + /** A builder for [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. */ class Builder internal constructor() { - private var explanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardholderNoLongerDisputes: CardholderNoLongerDisputes) = - apply { - explanation = cardholderNoLongerDisputes.explanation - additionalProperties = - cardholderNoLongerDisputes.additionalProperties.toMutableMap() - } - - /** - * Explanation for why the merchant believes the cardholder no longer - * disputes the transaction. - */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) - - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) - - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation + internal fun from( + nonFiatCurrencyOrNonFungibleTokenAsDescribed: + NonFiatCurrencyOrNonFungibleTokenAsDescribed + ) = apply { + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenAsDescribed.additionalProperties + .toMutableMap() } fun additionalProperties(additionalProperties: Map) = @@ -7152,32 +9486,24 @@ private constructor( } /** - * Returns an immutable instance of [CardholderNoLongerDisputes]. + * Returns an immutable instance of + * [NonFiatCurrencyOrNonFungibleTokenAsDescribed]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): CardholderNoLongerDisputes = - CardholderNoLongerDisputes( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), + fun build(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = + NonFiatCurrencyOrNonFungibleTokenAsDescribed( + additionalProperties.toMutableMap() ) } private var validated: Boolean = false - fun validate(): CardholderNoLongerDisputes = apply { + fun validate(): NonFiatCurrencyOrNonFungibleTokenAsDescribed = apply { if (validated) { return@apply } - explanation() validated = true } @@ -7195,134 +9521,114 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is CardholderNoLongerDisputes && - explanation == other.explanation && + return other is NonFiatCurrencyOrNonFungibleTokenAsDescribed && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) - } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CardholderNoLongerDisputes{explanation=$explanation, additionalProperties=$additionalProperties}" + "NonFiatCurrencyOrNonFungibleTokenAsDescribed{additionalProperties=$additionalProperties}" } /** - * Credit or reversal processed details. Present if and only if `reason` is - * `credit_or_reversal_processed`. + * Non-fiat currency or non-fungible token received details. Present if and only if + * `reason` is `non_fiat_currency_or_non_fungible_token_received`. */ - class CreditOrReversalProcessed + class NonFiatCurrencyOrNonFungibleTokenReceived @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val amount: JsonField, - private val currency: JsonField, - private val explanation: JsonField, - private val processedAt: JsonField, + private val blockchainTransactionHash: JsonField, + private val destinationWalletAddress: JsonField, + private val priorApprovedTransactions: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("amount") - @ExcludeMissing - amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") + @JsonProperty("blockchain_transaction_hash") @ExcludeMissing - currency: JsonField = JsonMissing.of(), - @JsonProperty("explanation") + blockchainTransactionHash: JsonField = JsonMissing.of(), + @JsonProperty("destination_wallet_address") @ExcludeMissing - explanation: JsonField = JsonMissing.of(), - @JsonProperty("processed_at") + destinationWalletAddress: JsonField = JsonMissing.of(), + @JsonProperty("prior_approved_transactions") @ExcludeMissing - processedAt: JsonField = JsonMissing.of(), - ) : this(amount, currency, explanation, processedAt, mutableMapOf()) + priorApprovedTransactions: JsonField = JsonMissing.of(), + ) : this( + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, + mutableMapOf(), + ) /** - * The amount of the credit or reversal in the minor unit of its currency. For - * dollars, for example, this is cents. + * Blockchain transaction hash. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * or is unexpectedly missing or null (e.g. if the server responded with an * unexpected value). */ - fun amount(): Long = amount.getRequired("amount") + fun blockchainTransactionHash(): String = + blockchainTransactionHash.getRequired("blockchain_transaction_hash") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the credit or - * reversal's currency. + * Destination wallet address. * * @throws IncreaseInvalidDataException 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 currency(): String = currency.getRequired("currency") + fun destinationWalletAddress(): String = + destinationWalletAddress.getRequired("destination_wallet_address") /** - * Explanation for why the merchant believes the credit or reversal was - * processed. + * Prior approved transactions. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ - fun explanation(): Optional = explanation.getOptional("explanation") - - /** - * The date the credit or reversal was processed. - * - * @throws IncreaseInvalidDataException 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 processedAt(): LocalDate = processedAt.getRequired("processed_at") - - /** - * Returns the raw JSON value of [amount]. - * - * Unlike [amount], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + fun priorApprovedTransactions(): Optional = + priorApprovedTransactions.getOptional("prior_approved_transactions") /** - * Returns the raw JSON value of [currency]. + * Returns the raw JSON value of [blockchainTransactionHash]. * - * Unlike [currency], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON + * field has an unexpected type. */ - @JsonProperty("currency") + @JsonProperty("blockchain_transaction_hash") @ExcludeMissing - fun _currency(): JsonField = currency + fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash /** - * Returns the raw JSON value of [explanation]. + * Returns the raw JSON value of [destinationWalletAddress]. * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [destinationWalletAddress], this method doesn't throw if the JSON + * field has an unexpected type. */ - @JsonProperty("explanation") + @JsonProperty("destination_wallet_address") @ExcludeMissing - fun _explanation(): JsonField = explanation + fun _destinationWalletAddress(): JsonField = destinationWalletAddress /** - * Returns the raw JSON value of [processedAt]. + * Returns the raw JSON value of [priorApprovedTransactions]. * - * Unlike [processedAt], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON + * field has an unexpected type. */ - @JsonProperty("processed_at") + @JsonProperty("prior_approved_transactions") @ExcludeMissing - fun _processedAt(): JsonField = processedAt + fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -7340,110 +9646,97 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [CreditOrReversalProcessed]. + * [NonFiatCurrencyOrNonFungibleTokenReceived]. * * The following fields are required: * ```java - * .amount() - * .currency() - * .explanation() - * .processedAt() + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [CreditOrReversalProcessed]. */ + /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ class Builder internal constructor() { - private var amount: JsonField? = null - private var currency: JsonField? = null - private var explanation: JsonField? = null - private var processedAt: JsonField? = null + private var blockchainTransactionHash: JsonField? = null + private var destinationWalletAddress: JsonField? = null + private var priorApprovedTransactions: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(creditOrReversalProcessed: CreditOrReversalProcessed) = - apply { - amount = creditOrReversalProcessed.amount - currency = creditOrReversalProcessed.currency - explanation = creditOrReversalProcessed.explanation - processedAt = creditOrReversalProcessed.processedAt - additionalProperties = - creditOrReversalProcessed.additionalProperties.toMutableMap() - } + internal fun from( + nonFiatCurrencyOrNonFungibleTokenReceived: + NonFiatCurrencyOrNonFungibleTokenReceived + ) = apply { + blockchainTransactionHash = + nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash + destinationWalletAddress = + nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress + priorApprovedTransactions = + nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions + additionalProperties = + nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties + .toMutableMap() + } - /** - * The amount of the credit or reversal in the minor unit of its currency. - * For dollars, for example, this is cents. - */ - fun amount(amount: Long) = amount(JsonField.of(amount)) + /** Blockchain transaction hash. */ + fun blockchainTransactionHash(blockchainTransactionHash: String) = + blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) /** - * Sets [Builder.amount] to an arbitrary JSON value. + * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON value. * - * You should usually call [Builder.amount] with a well-typed [Long] value - * instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. + * You should usually call [Builder.blockchainTransactionHash] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun amount(amount: JsonField) = apply { this.amount = amount } + fun blockchainTransactionHash( + blockchainTransactionHash: JsonField + ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - * credit or reversal's currency. - */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** Destination wallet address. */ + fun destinationWalletAddress(destinationWalletAddress: String) = + destinationWalletAddress(JsonField.of(destinationWalletAddress)) /** - * Sets [Builder.currency] to an arbitrary JSON value. + * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. * - * You should usually call [Builder.currency] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun currency(currency: JsonField) = apply { - this.currency = currency - } - - /** - * Explanation for why the merchant believes the credit or reversal was - * processed. + * You should usually call [Builder.destinationWalletAddress] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + fun destinationWalletAddress(destinationWalletAddress: JsonField) = + apply { + this.destinationWalletAddress = destinationWalletAddress + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** Prior approved transactions. */ + fun priorApprovedTransactions(priorApprovedTransactions: String?) = + priorApprovedTransactions( + JsonField.ofNullable(priorApprovedTransactions) + ) /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. + * Alias for calling [Builder.priorApprovedTransactions] with + * `priorApprovedTransactions.orElse(null)`. */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } - - /** The date the credit or reversal was processed. */ - fun processedAt(processedAt: LocalDate) = - processedAt(JsonField.of(processedAt)) + fun priorApprovedTransactions(priorApprovedTransactions: Optional) = + priorApprovedTransactions(priorApprovedTransactions.getOrNull()) /** - * Sets [Builder.processedAt] to an arbitrary JSON value. + * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. * - * You should usually call [Builder.processedAt] with a well-typed - * [LocalDate] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. + * You should usually call [Builder.priorApprovedTransactions] with a + * well-typed [String] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. */ - fun processedAt(processedAt: JsonField) = apply { - this.processedAt = processedAt - } + fun priorApprovedTransactions( + priorApprovedTransactions: JsonField + ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } fun additionalProperties(additionalProperties: Map) = apply { @@ -7468,41 +9761,45 @@ private constructor( } /** - * Returns an immutable instance of [CreditOrReversalProcessed]. + * Returns an immutable instance of + * [NonFiatCurrencyOrNonFungibleTokenReceived]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .amount() - * .currency() - * .explanation() - * .processedAt() + * .blockchainTransactionHash() + * .destinationWalletAddress() + * .priorApprovedTransactions() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): CreditOrReversalProcessed = - CreditOrReversalProcessed( - checkRequired("amount", amount), - checkRequired("currency", currency), - checkRequired("explanation", explanation), - checkRequired("processedAt", processedAt), + fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = + NonFiatCurrencyOrNonFungibleTokenReceived( + checkRequired( + "blockchainTransactionHash", + blockchainTransactionHash, + ), + checkRequired("destinationWalletAddress", destinationWalletAddress), + checkRequired( + "priorApprovedTransactions", + priorApprovedTransactions, + ), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): CreditOrReversalProcessed = apply { + fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { if (validated) { return@apply } - amount() - currency() - explanation() - processedAt() + blockchainTransactionHash() + destinationWalletAddress() + priorApprovedTransactions() validated = true } @@ -7522,30 +9819,27 @@ private constructor( */ @JvmSynthetic internal fun validity(): Int = - (if (amount.asKnown().isPresent) 1 else 0) + - (if (currency.asKnown().isPresent) 1 else 0) + - (if (explanation.asKnown().isPresent) 1 else 0) + - (if (processedAt.asKnown().isPresent) 1 else 0) + (if (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + + (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + + (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is CreditOrReversalProcessed && - amount == other.amount && - currency == other.currency && - explanation == other.explanation && - processedAt == other.processedAt && + return other is NonFiatCurrencyOrNonFungibleTokenReceived && + blockchainTransactionHash == other.blockchainTransactionHash && + destinationWalletAddress == other.destinationWalletAddress && + priorApprovedTransactions == other.priorApprovedTransactions && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { Objects.hash( - amount, - currency, - explanation, - processedAt, + blockchainTransactionHash, + destinationWalletAddress, + priorApprovedTransactions, additionalProperties, ) } @@ -7553,17 +9847,17 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CreditOrReversalProcessed{amount=$amount, currency=$currency, explanation=$explanation, processedAt=$processedAt, additionalProperties=$additionalProperties}" + "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" } /** - * Invalid dispute details. Present if and only if `reason` is `invalid_dispute`. + * Proof of cash disbursement details. Present if and only if `reason` is + * `proof_of_cash_disbursement`. */ - class InvalidDispute + class ProofOfCashDisbursement @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val explanation: JsonField, - private val reason: JsonField, private val additionalProperties: MutableMap, ) { @@ -7571,29 +9865,18 @@ private constructor( private constructor( @JsonProperty("explanation") @ExcludeMissing - explanation: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), - ) : this(explanation, reason, mutableMapOf()) + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) /** - * Explanation for why the dispute is considered invalid by the merchant. + * Explanation for why the merchant believes the evidence provides proof of cash + * disbursement. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ fun explanation(): Optional = explanation.getOptional("explanation") - /** - * The reason a merchant considers the dispute invalid. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * or is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun reason(): Reason = reason.getRequired("reason") - /** * Returns the raw JSON value of [explanation]. * @@ -7604,16 +9887,6 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation - /** - * 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) @@ -7630,35 +9903,34 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [InvalidDispute]. + * [ProofOfCashDisbursement]. * * The following fields are required: * ```java * .explanation() - * .reason() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [InvalidDispute]. */ + /** A builder for [ProofOfCashDisbursement]. */ class Builder internal constructor() { private var explanation: JsonField? = null - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(invalidDispute: InvalidDispute) = apply { - explanation = invalidDispute.explanation - reason = invalidDispute.reason - additionalProperties = - invalidDispute.additionalProperties.toMutableMap() - } + internal fun from(proofOfCashDisbursement: ProofOfCashDisbursement) = + apply { + explanation = proofOfCashDisbursement.explanation + additionalProperties = + proofOfCashDisbursement.additionalProperties.toMutableMap() + } /** - * Explanation for why the dispute is considered invalid by the merchant. + * Explanation for why the merchant believes the evidence provides proof of + * cash disbursement. */ fun explanation(explanation: String?) = explanation(JsonField.ofNullable(explanation)) @@ -7680,18 +9952,6 @@ private constructor( this.explanation = explanation } - /** The reason a merchant considers the dispute invalid. */ - 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() @@ -7715,35 +9975,32 @@ private constructor( } /** - * Returns an immutable instance of [InvalidDispute]. + * Returns an immutable instance of [ProofOfCashDisbursement]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .explanation() - * .reason() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): InvalidDispute = - InvalidDispute( + fun build(): ProofOfCashDisbursement = + ProofOfCashDisbursement( checkRequired("explanation", explanation), - checkRequired("reason", reason), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): InvalidDispute = apply { + fun validate(): ProofOfCashDisbursement = apply { if (validated) { return@apply } explanation() - reason().validate() validated = true } @@ -7757,700 +10014,276 @@ private constructor( /** * 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 (explanation.asKnown().isPresent) 1 else 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) - - /** The reason a merchant considers the dispute invalid. */ - 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 { - - /** Automatic Teller Machine (ATM) transaction proof provided. */ - @JvmField - val AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED = - of("automatic_teller_machine_transaction_proof_provided") - - /** Balance of partial prepayment not paid. */ - @JvmField - val BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID = - of("balance_of_partial_prepayment_not_paid") - - /** - * Cardholder canceled before expected receipt date of the merchandise. - */ - @JvmField - val CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE = - of("cardholder_canceled_before_expected_merchandise_receipt_date") - - /** Cardholder canceled before expected receipt date of the services. */ - @JvmField - val CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE = - of("cardholder_canceled_before_expected_services_receipt_date") - - /** Cardholder canceled on a different date than claimed. */ - @JvmField - val CARDHOLDER_CANCELED_DIFFERENT_DATE = - of("cardholder_canceled_different_date") - - /** Cardholder received did not cancel according to policy. */ - @JvmField - val CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY = - of("cardholder_did_not_cancel_according_to_policy") - - /** Cardholder received the merchandise. */ - @JvmField - val CARDHOLDER_RECEIVED_MERCHANDISE = - of("cardholder_received_merchandise") - - /** Country code is correct. */ - @JvmField val COUNTRY_CODE_CORRECT = of("country_code_correct") - - /** Credit was processed correctly. */ - @JvmField - val CREDIT_PROCESSED_CORRECTLY = of("credit_processed_correctly") - - /** Currency is correct. */ - @JvmField val CURRENCY_CORRECT = of("currency_correct") - - /** Dispute is for quality. */ - @JvmField val DISPUTE_IS_FOR_QUALITY = of("dispute_is_for_quality") - - /** Dispute is for Visa Cash Back transaction portion. */ - @JvmField - val DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION = - of("dispute_is_for_visa_cash_back_transaction_portion") - - /** Disputed amount is Value Added Tax (VAT). */ - @JvmField - val DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX = - of("disputed_amount_is_value_added_tax") - - /** - * Disputed amount is Value Added Tax (VAT) but no credit receipt was - * provided by the cardholder. - */ - @JvmField - val DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED = - of("disputed_amount_is_value_added_tax_no_credit_receipt_provided") - - /** Limited return or cancellation policy was properly disclosed. */ - @JvmField - val LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED = - of("limited_return_or_cancellation_policy_properly_disclosed") - - /** Merchandise held at cardholder customs agency. */ - @JvmField - val MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY = - of("merchandise_held_at_cardholder_customs_agency") - - /** Merchandise matches the merchant's description. */ - @JvmField - val MERCHANDISE_MATCHES_DESCRIPTION = - of("merchandise_matches_description") - - /** Merchandise is not counterfeit. */ - @JvmField - val MERCHANDISE_NOT_COUNTERFEIT = of("merchandise_not_counterfeit") - - /** Merchandise is not damaged. */ - @JvmField val MERCHANDISE_NOT_DAMAGED = of("merchandise_not_damaged") - - /** Merchandise is not defective. */ - @JvmField - val MERCHANDISE_NOT_DEFECTIVE = of("merchandise_not_defective") + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) - /** Merchandise was provided prior to the cancellation date. */ - @JvmField - val MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE = - of("merchandise_provided_prior_to_cancellation_date") + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } - /** Merchandise quality matches the merchant's description. */ - @JvmField - val MERCHANDISE_QUALITY_MATCHES_DESCRIPTION = - of("merchandise_quality_matches_description") + return other is ProofOfCashDisbursement && + explanation == other.explanation && + additionalProperties == other.additionalProperties + } - /** Merchandise was not attempted returned to the merchant. */ - @JvmField - val MERCHANDISE_RETURN_NOT_ATTEMPTED = - of("merchandise_return_not_attempted") + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } - /** Merchant was not notified of the closed account. */ - @JvmField - val MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT = - of("merchant_not_notified_of_closed_account") + override fun hashCode(): Int = hashCode - /** - * Name on manifest of departed flight matches name on purchased - * itinerary. - */ - @JvmField - val NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE = - of("name_on_flight_manifest_matches_purchase") + override fun toString() = + "ProofOfCashDisbursement{explanation=$explanation, additionalProperties=$additionalProperties}" + } - /** No credit receipt was provided by the cardholder. */ - @JvmField - val NO_CREDIT_RECEIPT_PROVIDED = of("no_credit_receipt_provided") + /** The reason the merchant re-presented the dispute. */ + class Reason + @JsonCreator + private constructor(private val value: JsonField) : Enum { - /** Other. */ - @JvmField val OTHER = of("other") + /** + * 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 - /** The claimed processing error did not occur. */ - @JvmField - val PROCESSING_ERROR_INCORRECT = of("processing_error_incorrect") + companion object { - /** - * Returned merchandise held at customs agency outside the merchant's - * country. - */ - @JvmField - val RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY = - of( - "returned_mechandise_held_at_customs_agency_outside_merchant_country" - ) + /** Cardholder no longer disputes the transaction. */ + @JvmField + val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") - /** Services match the merchant's description. */ - @JvmField - val SERVICES_MATCH_DESCRIPTION = of("services_match_description") + /** Credit or reversal was processed. */ + @JvmField + val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") - /** Services were provided prior to the cancellation date. */ - @JvmField - val SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE = - of("services_provided_prior_to_cancellation_date") + /** Invalid dispute. */ + @JvmField val INVALID_DISPUTE = of("invalid_dispute") - /** - * Services were used after the cancellation date and prior to the - * dispute submission date. - */ - @JvmField - val SERVICES_USED_AFTER_CANCELLATION_DATE = - of("services_used_after_cancellation_date") + /** + * Non-fiat currency or non-fungible token is as described by the merchant. + */ + @JvmField + val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED = + of("non_fiat_currency_or_non_fungible_token_as_described") - /** Terms of service were not misrepresented. */ - @JvmField - val TERMS_OF_SERVICE_NOT_MISREPRESENTED = - of("terms_of_service_not_misrepresented") + /** + * Non-fiat currency or non-fungible token was received by the cardholder. + */ + @JvmField + val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = + of("non_fiat_currency_or_non_fungible_token_received") - /** Transaction code is correct. */ - @JvmField val TRANSACTION_CODE_CORRECT = of("transaction_code_correct") + /** Proof of cash disbursement provided. */ + @JvmField val PROOF_OF_CASH_DISBURSEMENT = of("proof_of_cash_disbursement") - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } + /** Reversal issued by merchant. */ + @JvmField val REVERSAL_ISSUED = of("reversal_issued") - /** An enum containing [Reason]'s known values. */ - enum class Known { - /** Automatic Teller Machine (ATM) transaction proof provided. */ - AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED, - /** Balance of partial prepayment not paid. */ - BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID, - /** - * Cardholder canceled before expected receipt date of the merchandise. - */ - CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE, - /** Cardholder canceled before expected receipt date of the services. */ - CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE, - /** Cardholder canceled on a different date than claimed. */ - CARDHOLDER_CANCELED_DIFFERENT_DATE, - /** Cardholder received did not cancel according to policy. */ - CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY, - /** Cardholder received the merchandise. */ - CARDHOLDER_RECEIVED_MERCHANDISE, - /** Country code is correct. */ - COUNTRY_CODE_CORRECT, - /** Credit was processed correctly. */ - CREDIT_PROCESSED_CORRECTLY, - /** Currency is correct. */ - CURRENCY_CORRECT, - /** Dispute is for quality. */ - DISPUTE_IS_FOR_QUALITY, - /** Dispute is for Visa Cash Back transaction portion. */ - DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION, - /** Disputed amount is Value Added Tax (VAT). */ - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX, - /** - * Disputed amount is Value Added Tax (VAT) but no credit receipt was - * provided by the cardholder. - */ - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED, - /** Limited return or cancellation policy was properly disclosed. */ - LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED, - /** Merchandise held at cardholder customs agency. */ - MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY, - /** Merchandise matches the merchant's description. */ - MERCHANDISE_MATCHES_DESCRIPTION, - /** Merchandise is not counterfeit. */ - MERCHANDISE_NOT_COUNTERFEIT, - /** Merchandise is not damaged. */ - MERCHANDISE_NOT_DAMAGED, - /** Merchandise is not defective. */ - MERCHANDISE_NOT_DEFECTIVE, - /** Merchandise was provided prior to the cancellation date. */ - MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE, - /** Merchandise quality matches the merchant's description. */ - MERCHANDISE_QUALITY_MATCHES_DESCRIPTION, - /** Merchandise was not attempted returned to the merchant. */ - MERCHANDISE_RETURN_NOT_ATTEMPTED, - /** Merchant was not notified of the closed account. */ - MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT, - /** - * Name on manifest of departed flight matches name on purchased - * itinerary. - */ - NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE, - /** No credit receipt was provided by the cardholder. */ - NO_CREDIT_RECEIPT_PROVIDED, - /** Other. */ - OTHER, - /** The claimed processing error did not occur. */ - PROCESSING_ERROR_INCORRECT, - /** - * Returned merchandise held at customs agency outside the merchant's - * country. - */ - RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY, - /** Services match the merchant's description. */ - SERVICES_MATCH_DESCRIPTION, - /** Services were provided prior to the cancellation date. */ - SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE, - /** - * Services were used after the cancellation date and prior to the - * dispute submission date. - */ - SERVICES_USED_AFTER_CANCELLATION_DATE, - /** Terms of service were not misrepresented. */ - TERMS_OF_SERVICE_NOT_MISREPRESENTED, - /** Transaction code is correct. */ - TRANSACTION_CODE_CORRECT, - } + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Invalid dispute. */ + INVALID_DISPUTE, /** - * 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. + * Non-fiat currency or non-fungible token is as described by the merchant. */ - enum class Value { - /** Automatic Teller Machine (ATM) transaction proof provided. */ - AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED, - /** Balance of partial prepayment not paid. */ - BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID, - /** - * Cardholder canceled before expected receipt date of the merchandise. - */ - CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE, - /** Cardholder canceled before expected receipt date of the services. */ - CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE, - /** Cardholder canceled on a different date than claimed. */ - CARDHOLDER_CANCELED_DIFFERENT_DATE, - /** Cardholder received did not cancel according to policy. */ - CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY, - /** Cardholder received the merchandise. */ - CARDHOLDER_RECEIVED_MERCHANDISE, - /** Country code is correct. */ - COUNTRY_CODE_CORRECT, - /** Credit was processed correctly. */ - CREDIT_PROCESSED_CORRECTLY, - /** Currency is correct. */ - CURRENCY_CORRECT, - /** Dispute is for quality. */ - DISPUTE_IS_FOR_QUALITY, - /** Dispute is for Visa Cash Back transaction portion. */ - DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION, - /** Disputed amount is Value Added Tax (VAT). */ - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX, - /** - * Disputed amount is Value Added Tax (VAT) but no credit receipt was - * provided by the cardholder. - */ - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED, - /** Limited return or cancellation policy was properly disclosed. */ - LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED, - /** Merchandise held at cardholder customs agency. */ - MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY, - /** Merchandise matches the merchant's description. */ - MERCHANDISE_MATCHES_DESCRIPTION, - /** Merchandise is not counterfeit. */ - MERCHANDISE_NOT_COUNTERFEIT, - /** Merchandise is not damaged. */ - MERCHANDISE_NOT_DAMAGED, - /** Merchandise is not defective. */ - MERCHANDISE_NOT_DEFECTIVE, - /** Merchandise was provided prior to the cancellation date. */ - MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE, - /** Merchandise quality matches the merchant's description. */ - MERCHANDISE_QUALITY_MATCHES_DESCRIPTION, - /** Merchandise was not attempted returned to the merchant. */ - MERCHANDISE_RETURN_NOT_ATTEMPTED, - /** Merchant was not notified of the closed account. */ - MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT, - /** - * Name on manifest of departed flight matches name on purchased - * itinerary. - */ - NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE, - /** No credit receipt was provided by the cardholder. */ - NO_CREDIT_RECEIPT_PROVIDED, - /** Other. */ - OTHER, - /** The claimed processing error did not occur. */ - PROCESSING_ERROR_INCORRECT, - /** - * Returned merchandise held at customs agency outside the merchant's - * country. - */ - RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY, - /** Services match the merchant's description. */ - SERVICES_MATCH_DESCRIPTION, - /** Services were provided prior to the cancellation date. */ - SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE, - /** - * Services were used after the cancellation date and prior to the - * dispute submission date. - */ - SERVICES_USED_AFTER_CANCELLATION_DATE, - /** Terms of service were not misrepresented. */ - TERMS_OF_SERVICE_NOT_MISREPRESENTED, - /** Transaction code is correct. */ - TRANSACTION_CODE_CORRECT, - /** - * An enum member indicating that [Reason] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, /** - * 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. + * Non-fiat currency or non-fungible token was received by the cardholder. */ - fun value(): Value = - when (this) { - AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> - Value.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED - BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> - Value.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID - CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> - Value - .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE - CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> - Value.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE - CARDHOLDER_CANCELED_DIFFERENT_DATE -> - Value.CARDHOLDER_CANCELED_DIFFERENT_DATE - CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> - Value.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY - CARDHOLDER_RECEIVED_MERCHANDISE -> - Value.CARDHOLDER_RECEIVED_MERCHANDISE - COUNTRY_CODE_CORRECT -> Value.COUNTRY_CODE_CORRECT - CREDIT_PROCESSED_CORRECTLY -> Value.CREDIT_PROCESSED_CORRECTLY - CURRENCY_CORRECT -> Value.CURRENCY_CORRECT - DISPUTE_IS_FOR_QUALITY -> Value.DISPUTE_IS_FOR_QUALITY - DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> - Value.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> - Value.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> - Value - .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED - LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> - Value.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED - MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> - Value.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY - MERCHANDISE_MATCHES_DESCRIPTION -> - Value.MERCHANDISE_MATCHES_DESCRIPTION - MERCHANDISE_NOT_COUNTERFEIT -> Value.MERCHANDISE_NOT_COUNTERFEIT - MERCHANDISE_NOT_DAMAGED -> Value.MERCHANDISE_NOT_DAMAGED - MERCHANDISE_NOT_DEFECTIVE -> Value.MERCHANDISE_NOT_DEFECTIVE - MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Value.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE - MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> - Value.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION - MERCHANDISE_RETURN_NOT_ATTEMPTED -> - Value.MERCHANDISE_RETURN_NOT_ATTEMPTED - MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> - Value.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT - NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> - Value.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE - NO_CREDIT_RECEIPT_PROVIDED -> Value.NO_CREDIT_RECEIPT_PROVIDED - OTHER -> Value.OTHER - PROCESSING_ERROR_INCORRECT -> Value.PROCESSING_ERROR_INCORRECT - RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> - Value - .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY - SERVICES_MATCH_DESCRIPTION -> Value.SERVICES_MATCH_DESCRIPTION - SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Value.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE - SERVICES_USED_AFTER_CANCELLATION_DATE -> - Value.SERVICES_USED_AFTER_CANCELLATION_DATE - TERMS_OF_SERVICE_NOT_MISREPRESENTED -> - Value.TERMS_OF_SERVICE_NOT_MISREPRESENTED - TRANSACTION_CODE_CORRECT -> Value.TRANSACTION_CODE_CORRECT - else -> Value._UNKNOWN - } + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Proof of cash disbursement provided. */ + PROOF_OF_CASH_DISBURSEMENT, + /** Reversal issued by merchant. */ + REVERSAL_ISSUED, + } + /** + * 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 { + /** Cardholder no longer disputes the transaction. */ + CARDHOLDER_NO_LONGER_DISPUTES, + /** Credit or reversal was processed. */ + CREDIT_OR_REVERSAL_PROCESSED, + /** Invalid dispute. */ + INVALID_DISPUTE, /** - * 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 IncreaseInvalidDataException if this class instance's value is a - * not a known member. + * Non-fiat currency or non-fungible token is as described by the merchant. */ - fun known(): Known = - when (this) { - AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED -> - Known.AUTOMATIC_TELLER_MACHINE_TRANSACTION_PROOF_PROVIDED - BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID -> - Known.BALANCE_OF_PARTIAL_PREPAYMENT_NOT_PAID - CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE -> - Known - .CARDHOLDER_CANCELED_BEFORE_EXPECTED_MERCHANDISE_RECEIPT_DATE - CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE -> - Known.CARDHOLDER_CANCELED_BEFORE_EXPECTED_SERVICES_RECEIPT_DATE - CARDHOLDER_CANCELED_DIFFERENT_DATE -> - Known.CARDHOLDER_CANCELED_DIFFERENT_DATE - CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY -> - Known.CARDHOLDER_DID_NOT_CANCEL_ACCORDING_TO_POLICY - CARDHOLDER_RECEIVED_MERCHANDISE -> - Known.CARDHOLDER_RECEIVED_MERCHANDISE - COUNTRY_CODE_CORRECT -> Known.COUNTRY_CODE_CORRECT - CREDIT_PROCESSED_CORRECTLY -> Known.CREDIT_PROCESSED_CORRECTLY - CURRENCY_CORRECT -> Known.CURRENCY_CORRECT - DISPUTE_IS_FOR_QUALITY -> Known.DISPUTE_IS_FOR_QUALITY - DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION -> - Known.DISPUTE_IS_FOR_VISA_CASH_BACK_TRANSACTION_PORTION - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX -> - Known.DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX - DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED -> - Known - .DISPUTED_AMOUNT_IS_VALUE_ADDED_TAX_NO_CREDIT_RECEIPT_PROVIDED - LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED -> - Known.LIMITED_RETURN_OR_CANCELLATION_POLICY_PROPERLY_DISCLOSED - MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY -> - Known.MERCHANDISE_HELD_AT_CARDHOLDER_CUSTOMS_AGENCY - MERCHANDISE_MATCHES_DESCRIPTION -> - Known.MERCHANDISE_MATCHES_DESCRIPTION - MERCHANDISE_NOT_COUNTERFEIT -> Known.MERCHANDISE_NOT_COUNTERFEIT - MERCHANDISE_NOT_DAMAGED -> Known.MERCHANDISE_NOT_DAMAGED - MERCHANDISE_NOT_DEFECTIVE -> Known.MERCHANDISE_NOT_DEFECTIVE - MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Known.MERCHANDISE_PROVIDED_PRIOR_TO_CANCELLATION_DATE - MERCHANDISE_QUALITY_MATCHES_DESCRIPTION -> - Known.MERCHANDISE_QUALITY_MATCHES_DESCRIPTION - MERCHANDISE_RETURN_NOT_ATTEMPTED -> - Known.MERCHANDISE_RETURN_NOT_ATTEMPTED - MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT -> - Known.MERCHANT_NOT_NOTIFIED_OF_CLOSED_ACCOUNT - NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE -> - Known.NAME_ON_FLIGHT_MANIFEST_MATCHES_PURCHASE - NO_CREDIT_RECEIPT_PROVIDED -> Known.NO_CREDIT_RECEIPT_PROVIDED - OTHER -> Known.OTHER - PROCESSING_ERROR_INCORRECT -> Known.PROCESSING_ERROR_INCORRECT - RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY -> - Known - .RETURNED_MECHANDISE_HELD_AT_CUSTOMS_AGENCY_OUTSIDE_MERCHANT_COUNTRY - SERVICES_MATCH_DESCRIPTION -> Known.SERVICES_MATCH_DESCRIPTION - SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE -> - Known.SERVICES_PROVIDED_PRIOR_TO_CANCELLATION_DATE - SERVICES_USED_AFTER_CANCELLATION_DATE -> - Known.SERVICES_USED_AFTER_CANCELLATION_DATE - TERMS_OF_SERVICE_NOT_MISREPRESENTED -> - Known.TERMS_OF_SERVICE_NOT_MISREPRESENTED - TRANSACTION_CODE_CORRECT -> Known.TRANSACTION_CODE_CORRECT - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") - } - + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, /** - * 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 IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. + * Non-fiat currency or non-fungible token was received by the cardholder. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, + /** Proof of cash disbursement provided. */ + PROOF_OF_CASH_DISBURSEMENT, + /** Reversal issued by merchant. */ + REVERSAL_ISSUED, + /** + * An enum member indicating that [Reason] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } - private var validated: Boolean = false + /** + * 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) { + CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES + CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED + INVALID_DISPUTE -> Value.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> + Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PROOF_OF_CASH_DISBURSEMENT -> Value.PROOF_OF_CASH_DISBURSEMENT + REVERSAL_ISSUED -> Value.REVERSAL_ISSUED + else -> Value._UNKNOWN + } - fun validate(): Reason = apply { - if (validated) { - return@apply - } + /** + * 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 IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES + CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED + INVALID_DISPUTE -> Known.INVALID_DISPUTE + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> + Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED + NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> + Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED + PROOF_OF_CASH_DISBURSEMENT -> Known.PROOF_OF_CASH_DISBURSEMENT + REVERSAL_ISSUED -> Known.REVERSAL_ISSUED + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + } - known() - validated = true + /** + * 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 IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + private var validated: Boolean = 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 + fun validate(): Reason = apply { + if (validated) { + return@apply + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + known() + validated = true + } - return other is Reason && value == other.value + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } + /** + * 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 InvalidDispute && - explanation == other.explanation && - reason == other.reason && - additionalProperties == other.additionalProperties - } - - private val hashCode: Int by lazy { - Objects.hash(explanation, reason, additionalProperties) + return other is Reason && value == other.value } - override fun hashCode(): Int = hashCode + override fun hashCode() = value.hashCode() - override fun toString() = - "InvalidDispute{explanation=$explanation, reason=$reason, additionalProperties=$additionalProperties}" + override fun toString() = value.toString() } /** - * Non-fiat currency or non-fungible token received details. Present if and only if - * `reason` is `non_fiat_currency_or_non_fungible_token_received`. + * Reversal issued by merchant details. Present if and only if `reason` is + * `reversal_issued`. */ - class NonFiatCurrencyOrNonFungibleTokenReceived + class ReversalIssued @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( - private val blockchainTransactionHash: JsonField, - private val destinationWalletAddress: JsonField, - private val priorApprovedTransactions: JsonField, + private val explanation: JsonField, private val additionalProperties: MutableMap, ) { @JsonCreator private constructor( - @JsonProperty("blockchain_transaction_hash") - @ExcludeMissing - blockchainTransactionHash: JsonField = JsonMissing.of(), - @JsonProperty("destination_wallet_address") - @ExcludeMissing - destinationWalletAddress: JsonField = JsonMissing.of(), - @JsonProperty("prior_approved_transactions") + @JsonProperty("explanation") @ExcludeMissing - priorApprovedTransactions: JsonField = JsonMissing.of(), - ) : this( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, - mutableMapOf(), - ) - - /** - * Blockchain transaction hash. - * - * @throws IncreaseInvalidDataException 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 blockchainTransactionHash(): String = - blockchainTransactionHash.getRequired("blockchain_transaction_hash") - - /** - * Destination wallet address. - * - * @throws IncreaseInvalidDataException 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 destinationWalletAddress(): String = - destinationWalletAddress.getRequired("destination_wallet_address") + explanation: JsonField = JsonMissing.of() + ) : this(explanation, mutableMapOf()) /** - * Prior approved transactions. + * Explanation of the reversal issued by the merchant. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type * (e.g. if the server responded with an unexpected value). */ - fun priorApprovedTransactions(): Optional = - priorApprovedTransactions.getOptional("prior_approved_transactions") - - /** - * Returns the raw JSON value of [blockchainTransactionHash]. - * - * Unlike [blockchainTransactionHash], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("blockchain_transaction_hash") - @ExcludeMissing - fun _blockchainTransactionHash(): JsonField = blockchainTransactionHash - - /** - * Returns the raw JSON value of [destinationWalletAddress]. - * - * Unlike [destinationWalletAddress], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("destination_wallet_address") - @ExcludeMissing - fun _destinationWalletAddress(): JsonField = destinationWalletAddress + fun explanation(): Optional = explanation.getOptional("explanation") /** - * Returns the raw JSON value of [priorApprovedTransactions]. + * Returns the raw JSON value of [explanation]. * - * Unlike [priorApprovedTransactions], this method doesn't throw if the JSON - * field has an unexpected type. + * Unlike [explanation], this method doesn't throw if the JSON field has an + * unexpected type. */ - @JsonProperty("prior_approved_transactions") + @JsonProperty("explanation") @ExcludeMissing - fun _priorApprovedTransactions(): JsonField = priorApprovedTransactions + fun _explanation(): JsonField = explanation @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -8468,97 +10301,50 @@ private constructor( /** * Returns a mutable builder for constructing an instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * [ReversalIssued]. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .explanation() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [NonFiatCurrencyOrNonFungibleTokenReceived]. */ + /** A builder for [ReversalIssued]. */ class Builder internal constructor() { - private var blockchainTransactionHash: JsonField? = null - private var destinationWalletAddress: JsonField? = null - private var priorApprovedTransactions: JsonField? = null + private var explanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from( - nonFiatCurrencyOrNonFungibleTokenReceived: - NonFiatCurrencyOrNonFungibleTokenReceived - ) = apply { - blockchainTransactionHash = - nonFiatCurrencyOrNonFungibleTokenReceived.blockchainTransactionHash - destinationWalletAddress = - nonFiatCurrencyOrNonFungibleTokenReceived.destinationWalletAddress - priorApprovedTransactions = - nonFiatCurrencyOrNonFungibleTokenReceived.priorApprovedTransactions + internal fun from(reversalIssued: ReversalIssued) = apply { + explanation = reversalIssued.explanation additionalProperties = - nonFiatCurrencyOrNonFungibleTokenReceived.additionalProperties - .toMutableMap() + reversalIssued.additionalProperties.toMutableMap() } - /** Blockchain transaction hash. */ - fun blockchainTransactionHash(blockchainTransactionHash: String) = - blockchainTransactionHash(JsonField.of(blockchainTransactionHash)) - - /** - * Sets [Builder.blockchainTransactionHash] to an arbitrary JSON value. - * - * You should usually call [Builder.blockchainTransactionHash] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun blockchainTransactionHash( - blockchainTransactionHash: JsonField - ) = apply { this.blockchainTransactionHash = blockchainTransactionHash } - - /** Destination wallet address. */ - fun destinationWalletAddress(destinationWalletAddress: String) = - destinationWalletAddress(JsonField.of(destinationWalletAddress)) - - /** - * Sets [Builder.destinationWalletAddress] to an arbitrary JSON value. - * - * You should usually call [Builder.destinationWalletAddress] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. - */ - fun destinationWalletAddress(destinationWalletAddress: JsonField) = - apply { - this.destinationWalletAddress = destinationWalletAddress - } - - /** Prior approved transactions. */ - fun priorApprovedTransactions(priorApprovedTransactions: String?) = - priorApprovedTransactions( - JsonField.ofNullable(priorApprovedTransactions) - ) + /** Explanation of the reversal issued by the merchant. */ + fun explanation(explanation: String?) = + explanation(JsonField.ofNullable(explanation)) /** - * Alias for calling [Builder.priorApprovedTransactions] with - * `priorApprovedTransactions.orElse(null)`. + * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. */ - fun priorApprovedTransactions(priorApprovedTransactions: Optional) = - priorApprovedTransactions(priorApprovedTransactions.getOrNull()) + fun explanation(explanation: Optional) = + explanation(explanation.getOrNull()) /** - * Sets [Builder.priorApprovedTransactions] to an arbitrary JSON value. + * Sets [Builder.explanation] to an arbitrary JSON value. * - * You should usually call [Builder.priorApprovedTransactions] with a - * well-typed [String] value instead. This method is primarily for setting - * the field to an undocumented or not yet supported value. + * You should usually call [Builder.explanation] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. */ - fun priorApprovedTransactions( - priorApprovedTransactions: JsonField - ) = apply { this.priorApprovedTransactions = priorApprovedTransactions } + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } fun additionalProperties(additionalProperties: Map) = apply { @@ -8583,45 +10369,32 @@ private constructor( } /** - * Returns an immutable instance of - * [NonFiatCurrencyOrNonFungibleTokenReceived]. + * Returns an immutable instance of [ReversalIssued]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java - * .blockchainTransactionHash() - * .destinationWalletAddress() - * .priorApprovedTransactions() + * .explanation() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): NonFiatCurrencyOrNonFungibleTokenReceived = - NonFiatCurrencyOrNonFungibleTokenReceived( - checkRequired( - "blockchainTransactionHash", - blockchainTransactionHash, - ), - checkRequired("destinationWalletAddress", destinationWalletAddress), - checkRequired( - "priorApprovedTransactions", - priorApprovedTransactions, - ), + fun build(): ReversalIssued = + ReversalIssued( + checkRequired("explanation", explanation), additionalProperties.toMutableMap(), ) } private var validated: Boolean = false - fun validate(): NonFiatCurrencyOrNonFungibleTokenReceived = apply { + fun validate(): ReversalIssued = apply { if (validated) { return@apply } - blockchainTransactionHash() - destinationWalletAddress() - priorApprovedTransactions() + explanation() validated = true } @@ -8640,660 +10413,783 @@ private constructor( * Used for best match union deserialization. */ @JvmSynthetic - internal fun validity(): Int = - (if (blockchainTransactionHash.asKnown().isPresent) 1 else 0) + - (if (destinationWalletAddress.asKnown().isPresent) 1 else 0) + - (if (priorApprovedTransactions.asKnown().isPresent) 1 else 0) + internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is NonFiatCurrencyOrNonFungibleTokenReceived && - blockchainTransactionHash == other.blockchainTransactionHash && - destinationWalletAddress == other.destinationWalletAddress && - priorApprovedTransactions == other.priorApprovedTransactions && + return other is ReversalIssued && + explanation == other.explanation && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash( - blockchainTransactionHash, - destinationWalletAddress, - priorApprovedTransactions, - additionalProperties, - ) + private val hashCode: Int by lazy { + Objects.hash(explanation, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ReversalIssued{explanation=$explanation, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Represented && + cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && + creditOrReversalProcessed == other.creditOrReversalProcessed && + invalidDispute == other.invalidDispute && + nonFiatCurrencyOrNonFungibleTokenAsDescribed == + other.nonFiatCurrencyOrNonFungibleTokenAsDescribed && + nonFiatCurrencyOrNonFungibleTokenReceived == + other.nonFiatCurrencyOrNonFungibleTokenReceived && + proofOfCashDisbursement == other.proofOfCashDisbursement && + reason == other.reason && + reversalIssued == other.reversalIssued && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderNoLongerDisputes, + creditOrReversalProcessed, + invalidDispute, + nonFiatCurrencyOrNonFungibleTokenAsDescribed, + nonFiatCurrencyOrNonFungibleTokenReceived, + proofOfCashDisbursement, + reason, + reversalIssued, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Represented{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, creditOrReversalProcessed=$creditOrReversalProcessed, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenAsDescribed=$nonFiatCurrencyOrNonFungibleTokenAsDescribed, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, proofOfCashDisbursement=$proofOfCashDisbursement, reason=$reason, reversalIssued=$reversalIssued, additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute Re-presentment Timed Out Visa Network Event object. This field will be + * present in the JSON response if and only if `category` is equal to + * `representment_timed_out`. Contains the details specific to a re-presentment time-out + * Visa Card Dispute Network Event, which represents that the user did not respond to + * the re-presentment by the merchant within the time limit. + */ + class RepresentmentTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [RepresentmentTimedOut]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RepresentmentTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(representmentTimedOut: RepresentmentTimedOut) = apply { + additionalProperties = + representmentTimedOut.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 [RepresentmentTimedOut]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): RepresentmentTimedOut = + RepresentmentTimedOut(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): RepresentmentTimedOut = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RepresentmentTimedOut && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RepresentmentTimedOut{additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute User Pre-Arbitration Accepted Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_accepted`. Contains the details specific to a user + * prearbitration accepted Visa Card Dispute Network Event, which represents that the + * merchant has accepted the user's prearbitration request in the user's favor. + */ + class UserPrearbitrationAccepted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [UserPrearbitrationAccepted]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserPrearbitrationAccepted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationAccepted: UserPrearbitrationAccepted) = + apply { + additionalProperties = + userPrearbitrationAccepted.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - override fun hashCode(): Int = hashCode + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - override fun toString() = - "NonFiatCurrencyOrNonFungibleTokenReceived{blockchainTransactionHash=$blockchainTransactionHash, destinationWalletAddress=$destinationWalletAddress, priorApprovedTransactions=$priorApprovedTransactions, additionalProperties=$additionalProperties}" - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** - * Proof of cash disbursement details. Present if and only if `reason` is - * `proof_of_cash_disbursement`. - */ - class ProofOfCashDisbursement - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Explanation for why the merchant believes the evidence provides proof of cash - * disbursement. + * Returns an immutable instance of [UserPrearbitrationAccepted]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Further updates to this [Builder] will not mutate the returned instance. */ - fun explanation(): Optional = explanation.getOptional("explanation") + fun build(): UserPrearbitrationAccepted = + UserPrearbitrationAccepted(additionalProperties.toMutableMap()) + } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + private var validated: Boolean = false - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + fun validate(): UserPrearbitrationAccepted = apply { + if (validated) { + return@apply } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + validated = true + } - fun toBuilder() = Builder().from(this) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - companion object { + /** + * 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 = 0 - /** - * Returns a mutable builder for constructing an instance of - * [ProofOfCashDisbursement]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** A builder for [ProofOfCashDisbursement]. */ - class Builder internal constructor() { + return other is UserPrearbitrationAccepted && + additionalProperties == other.additionalProperties + } - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - @JvmSynthetic - internal fun from(proofOfCashDisbursement: ProofOfCashDisbursement) = - apply { - explanation = proofOfCashDisbursement.explanation - additionalProperties = - proofOfCashDisbursement.additionalProperties.toMutableMap() - } + override fun hashCode(): Int = hashCode - /** - * Explanation for why the merchant believes the evidence provides proof of - * cash disbursement. - */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + override fun toString() = + "UserPrearbitrationAccepted{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * A Card Dispute User Pre-Arbitration Declined Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_declined`. Contains the details specific to a user + * prearbitration declined Visa Card Dispute Network Event, which represents that the + * merchant has declined the user's prearbitration request. + */ + class UserPrearbitrationDeclined + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + @JsonCreator private constructor() : this(mutableMapOf()) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun toBuilder() = Builder().from(this) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + companion object { - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) + /** + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationDeclined]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [UserPrearbitrationDeclined]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationDeclined: UserPrearbitrationDeclined) = + apply { + additionalProperties = + userPrearbitrationDeclined.additionalProperties.toMutableMap() } - /** - * Returns an immutable instance of [ProofOfCashDisbursement]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ProofOfCashDisbursement = - ProofOfCashDisbursement( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - private var validated: Boolean = false + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - fun validate(): ProofOfCashDisbursement = apply { - if (validated) { - return@apply + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [UserPrearbitrationDeclined]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): UserPrearbitrationDeclined = + UserPrearbitrationDeclined(additionalProperties.toMutableMap()) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is ProofOfCashDisbursement && - explanation == other.explanation && - additionalProperties == other.additionalProperties + fun validate(): UserPrearbitrationDeclined = apply { + if (validated) { + return@apply } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false } - override fun hashCode(): Int = hashCode + /** + * 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 = 0 - override fun toString() = - "ProofOfCashDisbursement{explanation=$explanation, additionalProperties=$additionalProperties}" + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is UserPrearbitrationDeclined && + additionalProperties == other.additionalProperties } - /** The reason the merchant re-presented the dispute. */ - class Reason - @JsonCreator - private constructor(private val value: JsonField) : Enum { + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - /** - * 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 + override fun hashCode(): Int = hashCode - companion object { + override fun toString() = + "UserPrearbitrationDeclined{additionalProperties=$additionalProperties}" + } - /** Cardholder no longer disputes the transaction. */ - @JvmField - val CARDHOLDER_NO_LONGER_DISPUTES = of("cardholder_no_longer_disputes") + /** + * A Card Dispute User Pre-Arbitration Submitted Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_submitted`. Contains the details specific to a user + * prearbitration submitted Visa Card Dispute Network Event, which represents that the + * user's request for prearbitration has been submitted to the network. + */ + class UserPrearbitrationSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** Credit or reversal was processed. */ - @JvmField - val CREDIT_OR_REVERSAL_PROCESSED = of("credit_or_reversal_processed") + @JsonCreator private constructor() : this(mutableMapOf()) - /** Invalid dispute. */ - @JvmField val INVALID_DISPUTE = of("invalid_dispute") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - @JvmField - val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED = - of("non_fiat_currency_or_non_fungible_token_as_described") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - @JvmField - val NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED = - of("non_fiat_currency_or_non_fungible_token_received") + fun toBuilder() = Builder().from(this) - /** Proof of cash disbursement provided. */ - @JvmField val PROOF_OF_CASH_DISBURSEMENT = of("proof_of_cash_disbursement") + companion object { - /** Reversal issued by merchant. */ - @JvmField val REVERSAL_ISSUED = of("reversal_issued") + /** + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } - @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) - } + /** A builder for [UserPrearbitrationSubmitted]. */ + class Builder internal constructor() { - /** An enum containing [Reason]'s known values. */ - enum class Known { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Proof of cash disbursement provided. */ - PROOF_OF_CASH_DISBURSEMENT, - /** Reversal issued by merchant. */ - REVERSAL_ISSUED, + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationSubmitted: UserPrearbitrationSubmitted) = + apply { + additionalProperties = + userPrearbitrationSubmitted.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * 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 { - /** Cardholder no longer disputes the transaction. */ - CARDHOLDER_NO_LONGER_DISPUTES, - /** Credit or reversal was processed. */ - CREDIT_OR_REVERSAL_PROCESSED, - /** Invalid dispute. */ - INVALID_DISPUTE, - /** - * Non-fiat currency or non-fungible token is as described by the merchant. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED, - /** - * Non-fiat currency or non-fungible token was received by the cardholder. - */ - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED, - /** Proof of cash disbursement provided. */ - PROOF_OF_CASH_DISBURSEMENT, - /** Reversal issued by merchant. */ - REVERSAL_ISSUED, - /** - * An enum member indicating that [Reason] was instantiated with an unknown - * value. - */ - _UNKNOWN, + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) } - /** - * 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) { - CARDHOLDER_NO_LONGER_DISPUTES -> Value.CARDHOLDER_NO_LONGER_DISPUTES - CREDIT_OR_REVERSAL_PROCESSED -> Value.CREDIT_OR_REVERSAL_PROCESSED - INVALID_DISPUTE -> Value.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> - Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Value.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PROOF_OF_CASH_DISBURSEMENT -> Value.PROOF_OF_CASH_DISBURSEMENT - REVERSAL_ISSUED -> Value.REVERSAL_ISSUED - else -> Value._UNKNOWN + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - /** - * 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 IncreaseInvalidDataException if this class instance's value is a not - * a known member. - */ - fun known(): Known = - when (this) { - CARDHOLDER_NO_LONGER_DISPUTES -> Known.CARDHOLDER_NO_LONGER_DISPUTES - CREDIT_OR_REVERSAL_PROCESSED -> Known.CREDIT_OR_REVERSAL_PROCESSED - INVALID_DISPUTE -> Known.INVALID_DISPUTE - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED -> - Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_AS_DESCRIBED - NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED -> - Known.NON_FIAT_CURRENCY_OR_NON_FUNGIBLE_TOKEN_RECEIVED - PROOF_OF_CASH_DISBURSEMENT -> Known.PROOF_OF_CASH_DISBURSEMENT - REVERSAL_ISSUED -> Known.REVERSAL_ISSUED - else -> throw IncreaseInvalidDataException("Unknown Reason: $value") - } + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * 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. + * Returns an immutable instance of [UserPrearbitrationSubmitted]. * - * @throws IncreaseInvalidDataException if this class instance's value does not - * have the expected primitive type. + * Further updates to this [Builder] will not mutate the returned instance. */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } + fun build(): UserPrearbitrationSubmitted = + UserPrearbitrationSubmitted(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): UserPrearbitrationSubmitted = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is UserPrearbitrationSubmitted && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "UserPrearbitrationSubmitted{additionalProperties=$additionalProperties}" + } + + /** + * A Card Dispute User Pre-Arbitration Timed Out Visa Network Event object. This field + * will be present in the JSON response if and only if `category` is equal to + * `user_prearbitration_timed_out`. Contains the details specific to a user + * prearbitration timed out Visa Card Dispute Network Event, which represents that the + * merchant has timed out responding to the user's prearbitration request. + */ + class UserPrearbitrationTimedOut + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - private var validated: Boolean = false + @JsonCreator private constructor() : this(mutableMapOf()) - fun validate(): Reason = apply { - if (validated) { - return@apply - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - known() - validated = true - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun toBuilder() = Builder().from(this) + + companion object { /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. + * Returns a mutable builder for constructing an instance of + * [UserPrearbitrationTimedOut]. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmStatic fun builder() = Builder() + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** A builder for [UserPrearbitrationTimedOut]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userPrearbitrationTimedOut: UserPrearbitrationTimedOut) = + apply { + additionalProperties = + userPrearbitrationTimedOut.additionalProperties.toMutableMap() } - return other is Reason && value == other.value + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - override fun hashCode() = value.hashCode() + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } - override fun toString() = value.toString() - } + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } - /** - * Reversal issued by merchant details. Present if and only if `reason` is - * `reversal_issued`. - */ - class ReversalIssued - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val explanation: JsonField, - private val additionalProperties: MutableMap, - ) { + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } - @JsonCreator - private constructor( - @JsonProperty("explanation") - @ExcludeMissing - explanation: JsonField = JsonMissing.of() - ) : this(explanation, mutableMapOf()) + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Explanation of the reversal issued by the merchant. + * Returns an immutable instance of [UserPrearbitrationTimedOut]. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type - * (e.g. if the server responded with an unexpected value). + * Further updates to this [Builder] will not mutate the returned instance. */ - fun explanation(): Optional = explanation.getOptional("explanation") + fun build(): UserPrearbitrationTimedOut = + UserPrearbitrationTimedOut(additionalProperties.toMutableMap()) + } - /** - * Returns the raw JSON value of [explanation]. - * - * Unlike [explanation], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("explanation") - @ExcludeMissing - fun _explanation(): JsonField = explanation + private var validated: Boolean = false - @JsonAnySetter - private fun putAdditionalProperty(key: String, value: JsonValue) { - additionalProperties.put(key, value) + fun validate(): UserPrearbitrationTimedOut = apply { + if (validated) { + return@apply } - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = - Collections.unmodifiableMap(additionalProperties) + validated = true + } - fun toBuilder() = Builder().from(this) + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - companion object { + /** + * 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 = 0 - /** - * Returns a mutable builder for constructing an instance of - * [ReversalIssued]. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - */ - @JvmStatic fun builder() = Builder() + override fun equals(other: Any?): Boolean { + if (this === other) { + return true } - /** A builder for [ReversalIssued]. */ - class Builder internal constructor() { + return other is UserPrearbitrationTimedOut && + additionalProperties == other.additionalProperties + } - private var explanation: JsonField? = null - private var additionalProperties: MutableMap = - mutableMapOf() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - @JvmSynthetic - internal fun from(reversalIssued: ReversalIssued) = apply { - explanation = reversalIssued.explanation - additionalProperties = - reversalIssued.additionalProperties.toMutableMap() - } + override fun hashCode(): Int = hashCode - /** Explanation of the reversal issued by the merchant. */ - fun explanation(explanation: String?) = - explanation(JsonField.ofNullable(explanation)) + override fun toString() = + "UserPrearbitrationTimedOut{additionalProperties=$additionalProperties}" + } - /** - * Alias for calling [Builder.explanation] with `explanation.orElse(null)`. - */ - fun explanation(explanation: Optional) = - explanation(explanation.getOrNull()) + /** + * A Card Dispute User Withdrawal Submitted Visa Network Event object. This field will + * be present in the JSON response if and only if `category` is equal to + * `user_withdrawal_submitted`. Contains the details specific to a user withdrawal + * submitted Visa Card Dispute Network Event, which represents that the user's request + * to withdraw the dispute has been submitted to the network. + */ + class UserWithdrawalSubmitted + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { - /** - * Sets [Builder.explanation] to an arbitrary JSON value. - * - * You should usually call [Builder.explanation] with a well-typed [String] - * value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + @JsonCreator private constructor() : this(mutableMapOf()) - fun additionalProperties(additionalProperties: Map) = - apply { - this.additionalProperties.clear() - putAllAdditionalProperties(additionalProperties) - } + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - fun putAdditionalProperty(key: String, value: JsonValue) = apply { - additionalProperties.put(key, value) - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - fun putAllAdditionalProperties( - additionalProperties: Map - ) = apply { this.additionalProperties.putAll(additionalProperties) } + fun toBuilder() = Builder().from(this) - fun removeAdditionalProperty(key: String) = apply { - additionalProperties.remove(key) - } + companion object { - fun removeAllAdditionalProperties(keys: Set) = apply { - keys.forEach(::removeAdditionalProperty) - } + /** + * Returns a mutable builder for constructing an instance of + * [UserWithdrawalSubmitted]. + */ + @JvmStatic fun builder() = Builder() + } - /** - * Returns an immutable instance of [ReversalIssued]. - * - * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .explanation() - * ``` - * - * @throws IllegalStateException if any required field is unset. - */ - fun build(): ReversalIssued = - ReversalIssued( - checkRequired("explanation", explanation), - additionalProperties.toMutableMap(), - ) + /** A builder for [UserWithdrawalSubmitted]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(userWithdrawalSubmitted: UserWithdrawalSubmitted) = apply { + additionalProperties = + userWithdrawalSubmitted.additionalProperties.toMutableMap() } - private var validated: Boolean = false + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } - fun validate(): ReversalIssued = apply { - if (validated) { - return@apply + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) } - explanation() - validated = true + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) } - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } /** - * Returns a score indicating how many valid values are contained in this object - * recursively. + * Returns an immutable instance of [UserWithdrawalSubmitted]. * - * Used for best match union deserialization. + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmSynthetic - internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + fun build(): UserWithdrawalSubmitted = + UserWithdrawalSubmitted(additionalProperties.toMutableMap()) + } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } + private var validated: Boolean = false - return other is ReversalIssued && - explanation == other.explanation && - additionalProperties == other.additionalProperties + fun validate(): UserWithdrawalSubmitted = apply { + if (validated) { + return@apply } - private val hashCode: Int by lazy { - Objects.hash(explanation, additionalProperties) - } + validated = true + } - override fun hashCode(): Int = hashCode + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } - override fun toString() = - "ReversalIssued{explanation=$explanation, additionalProperties=$additionalProperties}" - } + /** + * 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 = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is Represented && - cardholderNoLongerDisputes == other.cardholderNoLongerDisputes && - creditOrReversalProcessed == other.creditOrReversalProcessed && - invalidDispute == other.invalidDispute && - nonFiatCurrencyOrNonFungibleTokenAsDescribed == - other.nonFiatCurrencyOrNonFungibleTokenAsDescribed && - nonFiatCurrencyOrNonFungibleTokenReceived == - other.nonFiatCurrencyOrNonFungibleTokenReceived && - proofOfCashDisbursement == other.proofOfCashDisbursement && - reason == other.reason && - reversalIssued == other.reversalIssued && + return other is UserWithdrawalSubmitted && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash( - cardholderNoLongerDisputes, - creditOrReversalProcessed, - invalidDispute, - nonFiatCurrencyOrNonFungibleTokenAsDescribed, - nonFiatCurrencyOrNonFungibleTokenReceived, - proofOfCashDisbursement, - reason, - reversalIssued, - additionalProperties, - ) - } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "Represented{cardholderNoLongerDisputes=$cardholderNoLongerDisputes, creditOrReversalProcessed=$creditOrReversalProcessed, invalidDispute=$invalidDispute, nonFiatCurrencyOrNonFungibleTokenAsDescribed=$nonFiatCurrencyOrNonFungibleTokenAsDescribed, nonFiatCurrencyOrNonFungibleTokenReceived=$nonFiatCurrencyOrNonFungibleTokenReceived, proofOfCashDisbursement=$proofOfCashDisbursement, reason=$reason, reversalIssued=$reversalIssued, additionalProperties=$additionalProperties}" + "UserWithdrawalSubmitted{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -10667,7 +12563,7 @@ private constructor( JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -10732,7 +12628,8 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = + JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -10911,10 +12808,12 @@ private constructor( /** * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` @@ -11121,6 +13020,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -11280,7 +13190,8 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField? = null - private var consumerNonReceiptOfCash: JsonValue? = null + private var consumerNonReceiptOfCash: JsonField? = + null private var consumerOriginalCreditTransactionNotAccepted: JsonField? = null @@ -11679,9 +13590,28 @@ private constructor( * Non-receipt of cash. Present if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: ConsumerNonReceiptOfCash? + ) = consumerNonReceiptOfCash(JsonField.ofNullable(consumerNonReceiptOfCash)) + + /** + * Alias for calling [Builder.consumerNonReceiptOfCash] with + * `consumerNonReceiptOfCash.orElse(null)`. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: Optional + ) = consumerNonReceiptOfCash(consumerNonReceiptOfCash.getOrNull()) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for + * setting the field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Present if and only if @@ -12050,6 +13980,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -12091,6 +14022,7 @@ private constructor( ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted .asKnown() .getOrNull() @@ -12781,7 +14713,7 @@ private constructor( private constructor( private val cardholderCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val purchaseExplanation: JsonField, private val receivedOrExpectedAt: JsonField, private val returnAttempted: JsonField, @@ -12802,7 +14734,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -12849,10 +14781,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Purchase explanation. @@ -12923,6 +14859,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -13014,7 +14960,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var purchaseExplanation: JsonField? = null private var receivedOrExpectedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -13086,7 +15032,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -13245,6 +15207,7 @@ private constructor( cardholderCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } purchaseExplanation() receivedOrExpectedAt() returnAttempted().ifPresent { it.validate() } @@ -13271,6 +15234,7 @@ private constructor( internal fun validity(): Int = (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -14080,6 +16044,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -16388,10 +18469,10 @@ private constructor( private val contractedAt: JsonField, private val guaranteedReservation: JsonField, private val merchantResolutionAttempted: JsonField, - private val other: JsonValue, + private val other: JsonField, private val purchaseExplanation: JsonField, private val serviceType: JsonField, - private val timeshare: JsonValue, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -16411,7 +18492,9 @@ private constructor( @ExcludeMissing merchantResolutionAttempted: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") + @ExcludeMissing + other: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -16420,7 +18503,7 @@ private constructor( serviceType: JsonField = JsonMissing.of(), @JsonProperty("timeshare") @ExcludeMissing - timeshare: JsonValue = JsonMissing.of(), + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -16475,8 +18558,11 @@ private constructor( /** * Other service type explanation. Present if and only if `service_type` is * `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * Purchase explanation. @@ -16499,10 +18585,11 @@ private constructor( /** * Timeshare explanation. Present if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("timeshare") - @ExcludeMissing - fun _timeshare(): JsonValue = timeshare + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -16547,6 +18634,14 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -16567,6 +18662,16 @@ private constructor( @ExcludeMissing fun _serviceType(): JsonField = serviceType + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -16610,10 +18715,10 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var purchaseExplanation: JsonField? = null private var serviceType: JsonField? = null - private var timeshare: JsonValue? = null + private var timeshare: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -16713,7 +18818,19 @@ private constructor( * Other service type explanation. Present if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** Purchase explanation. */ fun purchaseExplanation(purchaseExplanation: String) = @@ -16749,7 +18866,23 @@ private constructor( * Timeshare explanation. Present if and only if `service_type` is * `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare?) = + timeshare(JsonField.ofNullable(timeshare)) + + /** Alias for calling [Builder.timeshare] with `timeshare.orElse(null)`. */ + fun timeshare(timeshare: Optional) = + timeshare(timeshare.getOrNull()) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { @@ -16820,8 +18953,10 @@ private constructor( contractedAt() guaranteedReservation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + other().ifPresent { it.validate() } purchaseExplanation() serviceType().validate() + timeshare().ifPresent { it.validate() } validated = true } @@ -16845,8 +18980,10 @@ private constructor( (if (contractedAt.asKnown().isPresent) 1 else 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + - (serviceType.asKnown().getOrNull()?.validity() ?: 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -17785,7 +19922,279 @@ private constructor( return true } - return other is MerchantResolutionAttempted && value == other.value + return other is MerchantResolutionAttempted && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Other service type explanation. Present if and only if `service_type` is + * `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Other{additionalProperties=$additionalProperties}" + } + + /** Service type. */ + class ServiceType + @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 { + + /** Guaranteed reservation. */ + @JvmField val GUARANTEED_RESERVATION = of("guaranteed_reservation") + + /** Other. */ + @JvmField val OTHER = of("other") + + /** Timeshare. */ + @JvmField val TIMESHARE = of("timeshare") + + @JvmStatic fun of(value: String) = ServiceType(JsonField.of(value)) + } + + /** An enum containing [ServiceType]'s known values. */ + enum class Known { + /** Guaranteed reservation. */ + GUARANTEED_RESERVATION, + /** Other. */ + OTHER, + /** Timeshare. */ + TIMESHARE, + } + + /** + * An enum containing [ServiceType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ServiceType] 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 { + /** Guaranteed reservation. */ + GUARANTEED_RESERVATION, + /** Other. */ + OTHER, + /** Timeshare. */ + TIMESHARE, + /** + * An enum member indicating that [ServiceType] 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) { + GUARANTEED_RESERVATION -> Value.GUARANTEED_RESERVATION + OTHER -> Value.OTHER + TIMESHARE -> Value.TIMESHARE + 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + GUARANTEED_RESERVATION -> Known.GUARANTEED_RESERVATION + OTHER -> Known.OTHER + TIMESHARE -> Known.TIMESHARE + else -> + throw IncreaseInvalidDataException( + "Unknown ServiceType: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): ServiceType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 ServiceType && value == other.value } override fun hashCode() = value.hashCode() @@ -17793,128 +20202,87 @@ private constructor( override fun toString() = value.toString() } - /** Service type. */ - class ServiceType - @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 { + /** + * Timeshare explanation. Present if and only if `service_type` is `timeshare`. + */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { - /** Guaranteed reservation. */ - @JvmField val GUARANTEED_RESERVATION = of("guaranteed_reservation") + @JsonCreator private constructor() : this(mutableMapOf()) - /** Other. */ - @JvmField val OTHER = of("other") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** Timeshare. */ - @JvmField val TIMESHARE = of("timeshare") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - @JvmStatic fun of(value: String) = ServiceType(JsonField.of(value)) - } + fun toBuilder() = Builder().from(this) - /** An enum containing [ServiceType]'s known values. */ - enum class Known { - /** Guaranteed reservation. */ - GUARANTEED_RESERVATION, - /** Other. */ - OTHER, - /** Timeshare. */ - TIMESHARE, - } + companion object { - /** - * An enum containing [ServiceType]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [ServiceType] 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 { - /** Guaranteed reservation. */ - GUARANTEED_RESERVATION, - /** Other. */ - OTHER, - /** Timeshare. */ - TIMESHARE, /** - * An enum member indicating that [ServiceType] was instantiated with an - * unknown value. + * Returns a mutable builder for constructing an instance of + * [Timeshare]. */ - _UNKNOWN, + @JvmStatic fun builder() = Builder() } - /** - * 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) { - GUARANTEED_RESERVATION -> Value.GUARANTEED_RESERVATION - OTHER -> Value.OTHER - TIMESHARE -> Value.TIMESHARE - else -> Value._UNKNOWN + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.additionalProperties.toMutableMap() } - /** - * 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 IncreaseInvalidDataException if this class instance's value is a - * not a known member. - */ - fun known(): Known = - when (this) { - GUARANTEED_RESERVATION -> Known.GUARANTEED_RESERVATION - OTHER -> Known.OTHER - TIMESHARE -> Known.TIMESHARE - else -> - throw IncreaseInvalidDataException( - "Unknown ServiceType: $value" - ) + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, 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 IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + 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 [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ServiceType = apply { + fun validate(): Timeshare = apply { if (validated) { return@apply } - known() validated = true } @@ -17932,20 +20300,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ServiceType && value == other.value + return other is Timeshare && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "Timeshare{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -18578,7 +20949,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnAttempted: JsonField, @@ -18595,7 +20966,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("order_and_issue_explanation") @ExcludeMissing orderAndIssueExplanation: JsonField = JsonMissing.of(), @@ -18632,10 +21003,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Order and issue explanation. @@ -18694,6 +21069,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [orderAndIssueExplanation]. * @@ -18782,7 +21167,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -18830,7 +21215,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -18985,6 +21386,7 @@ private constructor( } merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } orderAndIssueExplanation() receivedAt() returnAttempted().ifPresent { it.validate() } @@ -19010,6 +21412,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -19163,6 +21566,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -20470,7 +22990,7 @@ private constructor( private constructor( private val merchantResolutionAttempted: JsonField, private val misrepresentationExplanation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnAttempted: JsonField, @@ -20490,7 +23010,7 @@ private constructor( misrepresentationExplanation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("purchase_explanation") @ExcludeMissing purchaseExplanation: JsonField = JsonMissing.of(), @@ -20538,10 +23058,14 @@ private constructor( fun misrepresentationExplanation(): String = misrepresentationExplanation.getRequired("misrepresentation_explanation") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Purchase explanation. @@ -20611,6 +23135,16 @@ private constructor( fun _misrepresentationExplanation(): JsonField = misrepresentationExplanation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [purchaseExplanation]. * @@ -20701,7 +23235,7 @@ private constructor( JsonField? = null private var misrepresentationExplanation: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnAttempted: JsonField? = null @@ -20768,7 +23302,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -20928,6 +23478,7 @@ private constructor( merchantResolutionAttempted().validate() misrepresentationExplanation() + notReturned().ifPresent { it.validate() } purchaseExplanation() receivedAt() returnAttempted().ifPresent { it.validate() } @@ -20954,6 +23505,7 @@ private constructor( internal fun validity(): Int = (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (misrepresentationExplanation.asKnown().isPresent) 1 else 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + @@ -21107,6 +23659,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -24229,7 +26898,7 @@ private constructor( private val lastExpectedReceiptAt: JsonField, private val merchantCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val purchaseInfoAndExplanation: JsonField, private val additionalProperties: MutableMap, ) { @@ -24266,7 +26935,7 @@ private constructor( JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), @JsonProperty("purchase_info_and_explanation") @ExcludeMissing purchaseInfoAndExplanation: JsonField = JsonMissing.of(), @@ -24368,10 +27037,12 @@ private constructor( /** * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Purchase information and explanation. @@ -24468,6 +27139,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + /** * Returns the raw JSON value of [purchaseInfoAndExplanation]. * @@ -24530,7 +27211,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var noCancellation: JsonValue? = null + private var noCancellation: JsonField? = null private var purchaseInfoAndExplanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -24739,7 +27420,24 @@ private constructor( * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation?) = + noCancellation(JsonField.ofNullable(noCancellation)) + + /** + * Alias for calling [Builder.noCancellation] with + * `noCancellation.orElse(null)`. + */ + fun noCancellation(noCancellation: Optional) = + noCancellation(noCancellation.getOrNull()) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -24841,6 +27539,7 @@ private constructor( lastExpectedReceiptAt() merchantCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + noCancellation().ifPresent { it.validate() } purchaseInfoAndExplanation() validated = true } @@ -24872,6 +27571,7 @@ private constructor( (if (lastExpectedReceiptAt.asKnown().isPresent) 1 else 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) /** Cancellation outcome. */ @@ -25274,7 +27974,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val explanation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returnOutcome: JsonField, private val returned: JsonField, @@ -25288,7 +27988,7 @@ private constructor( explanation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -25318,10 +28018,12 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected + * type (e.g. if the server responded with an unexpected value). */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Return attempted. Present if and only if `return_outcome` is @@ -25361,6 +28063,16 @@ private constructor( @ExcludeMissing fun _explanation(): JsonField = explanation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -25424,7 +28136,7 @@ private constructor( class Builder internal constructor() { private var explanation: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var returnAttempted: JsonField? = null private var returnOutcome: JsonField? = null private var returned: JsonField? = null @@ -25460,7 +28172,24 @@ private constructor( * Not returned. Present if and only if `return_outcome` is * `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with + * `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -25584,6 +28313,7 @@ private constructor( } explanation() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returnOutcome().validate() returned().ifPresent { it.validate() } @@ -25607,10 +28337,131 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Present if and only if `return_outcome` is * `return_attempted`. @@ -26884,6 +29735,126 @@ private constructor( override fun toString() = value.toString() } + /** + * No cancellation. Present if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -26926,6 +29897,126 @@ private constructor( "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantCancellation=$merchantCancellation, merchantResolutionAttempted=$merchantResolutionAttempted, noCancellation=$noCancellation, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, additionalProperties=$additionalProperties}" } + /** + * Non-receipt of cash. Present if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + apply { + additionalProperties = + consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" + } + /** * Original Credit Transaction (OCT) not accepted. Present if and only if `category` * is `consumer_original_credit_transaction_not_accepted`. @@ -27312,7 +30403,7 @@ private constructor( private constructor( private val expectedAt: JsonField, private val merchantResolutionAttempted: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, @@ -27333,7 +30424,7 @@ private constructor( JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -27384,10 +30475,14 @@ private constructor( fun merchantResolutionAttempted(): MerchantResolutionAttempted = merchantResolutionAttempted.getRequired("merchant_resolution_attempted") - /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Present if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing @@ -27466,6 +30561,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -27568,7 +30673,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var notReturned: JsonValue? = null + private var notReturned: JsonField? = null private var ongoingNegotiations: JsonField? = null private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null @@ -27630,7 +30735,23 @@ private constructor( /** * Not returned. Present if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned?) = + notReturned(JsonField.ofNullable(notReturned)) + + /** + * Alias for calling [Builder.notReturned] with `notReturned.orElse(null)`. + */ + fun notReturned(notReturned: Optional) = + notReturned(notReturned.getOrNull()) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -27818,6 +30939,7 @@ private constructor( expectedAt() merchantResolutionAttempted().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } purchaseInfoAndQualityIssue() receivedAt() @@ -27845,6 +30967,7 @@ private constructor( internal fun validity(): Int = (if (expectedAt.asKnown().isPresent) 1 else 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + @@ -27999,6 +31122,123 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Present if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Ongoing negotiations. Exclude if there is no evidence of ongoing * negotiations. @@ -33239,7 +36479,7 @@ private constructor( private val lastExpectedReceiptAt: JsonField, private val merchantCancellation: JsonField, private val merchantResolutionAttempted: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val purchaseInfoAndExplanation: JsonField, private val additionalProperties: MutableMap, ) { @@ -33266,7 +36506,7 @@ private constructor( JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), @JsonProperty("purchase_info_and_explanation") @ExcludeMissing purchaseInfoAndExplanation: JsonField = JsonMissing.of(), @@ -33338,10 +36578,12 @@ private constructor( /** * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Purchase information and explanation. @@ -33407,6 +36649,16 @@ private constructor( fun _merchantResolutionAttempted(): JsonField = merchantResolutionAttempted + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + /** * Returns the raw JSON value of [purchaseInfoAndExplanation]. * @@ -33462,7 +36714,7 @@ private constructor( private var merchantResolutionAttempted: JsonField? = null - private var noCancellation: JsonValue? = null + private var noCancellation: JsonField? = null private var purchaseInfoAndExplanation: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -33608,7 +36860,24 @@ private constructor( * No cancellation. Present if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation?) = + noCancellation(JsonField.ofNullable(noCancellation)) + + /** + * Alias for calling [Builder.noCancellation] with + * `noCancellation.orElse(null)`. + */ + fun noCancellation(noCancellation: Optional) = + noCancellation(noCancellation.getOrNull()) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -33701,6 +36970,7 @@ private constructor( lastExpectedReceiptAt() merchantCancellation().ifPresent { it.validate() } merchantResolutionAttempted().validate() + noCancellation().ifPresent { it.validate() } purchaseInfoAndExplanation() validated = true } @@ -33729,6 +36999,7 @@ private constructor( (if (lastExpectedReceiptAt.asKnown().isPresent) 1 else 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) /** Cancellation outcome. */ @@ -34456,6 +37727,126 @@ private constructor( override fun toString() = value.toString() } + /** + * No cancellation. Present if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt index f595e7bd8..9fd2064d1 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParams.kt @@ -1063,7 +1063,7 @@ private constructor( JsonField, private val consumerMerchandiseNotAsDescribed: JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -1120,7 +1120,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -1286,10 +1286,12 @@ private constructor( /** * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -1487,6 +1489,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -1622,7 +1635,8 @@ private constructor( JsonMissing.of() private var consumerMerchandiseNotReceived: JsonField = JsonMissing.of() - private var consumerNonReceiptOfCash: JsonValue = JsonMissing.of() + private var consumerNonReceiptOfCash: JsonField = + JsonMissing.of() private var consumerOriginalCreditTransactionNotAccepted: JsonField = JsonMissing.of() @@ -1885,9 +1899,19 @@ private constructor( * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + consumerNonReceiptOfCash(JsonField.of(consumerNonReceiptOfCash)) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -2112,6 +2136,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -2150,6 +2175,7 @@ private constructor( (consumerMerchandiseMisrepresentation.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted.asKnown().getOrNull()?.validity() ?: 0) + (consumerQualityMerchandise.asKnown().getOrNull()?.validity() ?: 0) + @@ -2808,7 +2834,7 @@ private constructor( private val receivedOrExpectedAt: JsonField, private val returnOutcome: JsonField, private val cardholderCancellation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -2834,7 +2860,7 @@ private constructor( cardholderCancellation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -2901,10 +2927,13 @@ private constructor( fun cardholderCancellation(): Optional = cardholderCancellation.getOptional("cardholder_cancellation") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -2975,6 +3004,16 @@ private constructor( fun _cardholderCancellation(): JsonField = cardholderCancellation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -3034,7 +3073,7 @@ private constructor( private var returnOutcome: JsonField? = null private var cardholderCancellation: JsonField = JsonMissing.of() - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3132,7 +3171,18 @@ private constructor( ) = apply { this.cardholderCancellation = cardholderCancellation } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -3226,6 +3276,7 @@ private constructor( receivedOrExpectedAt() returnOutcome().validate() cardholderCancellation().ifPresent { it.validate() } + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -3252,6 +3303,7 @@ private constructor( (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -4176,6 +4228,113 @@ private constructor( "CardholderCancellation{canceledAt=$canceledAt, canceledPriorToShipDate=$canceledPriorToShipDate, cancellationPolicyProvided=$cancellationPolicyProvided, reason=$reason, additionalProperties=$additionalProperties}" } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -6160,8 +6319,8 @@ private constructor( private val purchaseExplanation: JsonField, private val serviceType: JsonField, private val guaranteedReservation: JsonField, - private val other: JsonValue, - private val timeshare: JsonValue, + private val other: JsonField, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -6186,8 +6345,10 @@ private constructor( @JsonProperty("guaranteed_reservation") @ExcludeMissing guaranteedReservation: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), - @JsonProperty("timeshare") @ExcludeMissing timeshare: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), + @JsonProperty("timeshare") + @ExcludeMissing + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -6260,11 +6421,19 @@ private constructor( /** * Other service type explanation. Required if and only if `service_type` is `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") - /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - @JsonProperty("timeshare") @ExcludeMissing fun _timeshare(): JsonValue = timeshare + /** + * Timeshare explanation. Required if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -6328,6 +6497,23 @@ private constructor( @ExcludeMissing fun _guaranteedReservation(): JsonField = guaranteedReservation + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6369,8 +6555,8 @@ private constructor( private var serviceType: JsonField? = null private var guaranteedReservation: JsonField = JsonMissing.of() - private var other: JsonValue = JsonMissing.of() - private var timeshare: JsonValue = JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var timeshare: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6485,10 +6671,30 @@ private constructor( * Other service type explanation. Required if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other) = other(JsonField.of(other)) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare) = timeshare(JsonField.of(timeshare)) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -6555,6 +6761,8 @@ private constructor( purchaseExplanation() serviceType().validate() guaranteedReservation().ifPresent { it.validate() } + other().ifPresent { it.validate() } + timeshare().ifPresent { it.validate() } validated = true } @@ -6579,7 +6787,9 @@ private constructor( (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + - (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -7640,84 +7850,298 @@ private constructor( "GuaranteedReservation{explanation=$explanation, additionalProperties=$additionalProperties}" } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Other service type explanation. Required if and only if `service_type` is `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is ConsumerCanceledServices && - cardholderCancellation == other.cardholderCancellation && - contractedAt == other.contractedAt && - merchantResolutionAttempted == other.merchantResolutionAttempted && - purchaseExplanation == other.purchaseExplanation && - serviceType == other.serviceType && - guaranteedReservation == other.guaranteedReservation && - this.other == other.other && - timeshare == other.timeshare && - additionalProperties == other.additionalProperties - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - private val hashCode: Int by lazy { - Objects.hash( - cardholderCancellation, - contractedAt, - merchantResolutionAttempted, - purchaseExplanation, - serviceType, - guaranteedReservation, - other, - timeshare, - additionalProperties, - ) - } + fun toBuilder() = Builder().from(this) - override fun hashCode(): Int = hashCode + companion object { - override fun toString() = - "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" - } + /** Returns a mutable builder for constructing an instance of [Other]. */ + @JvmStatic fun builder() = Builder() + } - /** - * Counterfeit merchandise. Required if and only if `category` is - * `consumer_counterfeit_merchandise`. - */ - class ConsumerCounterfeitMerchandise - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val counterfeitExplanation: JsonField, - private val dispositionExplanation: JsonField, - private val orderExplanation: JsonField, - private val receivedAt: JsonField, - private val additionalProperties: MutableMap, - ) { + /** A builder for [Other]. */ + class Builder internal constructor() { - @JsonCreator - private constructor( - @JsonProperty("counterfeit_explanation") - @ExcludeMissing - counterfeitExplanation: JsonField = JsonMissing.of(), - @JsonProperty("disposition_explanation") - @ExcludeMissing - dispositionExplanation: JsonField = JsonMissing.of(), - @JsonProperty("order_explanation") - @ExcludeMissing - orderExplanation: JsonField = JsonMissing.of(), - @JsonProperty("received_at") - @ExcludeMissing - receivedAt: JsonField = JsonMissing.of(), - ) : this( - counterfeitExplanation, - dispositionExplanation, - orderExplanation, - receivedAt, - mutableMapOf(), - ) + private var additionalProperties: MutableMap = mutableMapOf() - /** - * Counterfeit explanation. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + + /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Timeshare]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.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 [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Timeshare = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Timeshare && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Timeshare{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerCanceledServices && + cardholderCancellation == other.cardholderCancellation && + contractedAt == other.contractedAt && + merchantResolutionAttempted == other.merchantResolutionAttempted && + purchaseExplanation == other.purchaseExplanation && + serviceType == other.serviceType && + guaranteedReservation == other.guaranteedReservation && + this.other == other.other && + timeshare == other.timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderCancellation, + contractedAt, + merchantResolutionAttempted, + purchaseExplanation, + serviceType, + guaranteedReservation, + other, + timeshare, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" + } + + /** + * Counterfeit merchandise. Required if and only if `category` is + * `consumer_counterfeit_merchandise`. + */ + class ConsumerCounterfeitMerchandise + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val counterfeitExplanation: JsonField, + private val dispositionExplanation: JsonField, + private val orderExplanation: JsonField, + private val receivedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("counterfeit_explanation") + @ExcludeMissing + counterfeitExplanation: JsonField = JsonMissing.of(), + @JsonProperty("disposition_explanation") + @ExcludeMissing + dispositionExplanation: JsonField = JsonMissing.of(), + @JsonProperty("order_explanation") + @ExcludeMissing + orderExplanation: JsonField = JsonMissing.of(), + @JsonProperty("received_at") + @ExcludeMissing + receivedAt: JsonField = JsonMissing.of(), + ) : this( + counterfeitExplanation, + dispositionExplanation, + orderExplanation, + receivedAt, + mutableMapOf(), + ) + + /** + * Counterfeit explanation. + * + * @throws IncreaseInvalidDataException 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 counterfeitExplanation(): String = @@ -8236,7 +8660,7 @@ private constructor( private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -8259,7 +8683,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -8315,10 +8739,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8378,6 +8805,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -8435,7 +8872,7 @@ private constructor( private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -8518,7 +8955,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8610,6 +9058,7 @@ private constructor( orderAndIssueExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -8635,6 +9084,7 @@ private constructor( (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -8932,6 +9382,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -10029,7 +10586,7 @@ private constructor( private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -10055,7 +10612,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -10122,10 +10679,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10193,7 +10753,17 @@ private constructor( */ @JsonProperty("return_outcome") @ExcludeMissing - fun _returnOutcome(): JsonField = returnOutcome + fun _returnOutcome(): JsonField = returnOutcome + + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned /** * Returns the raw JSON value of [returnAttempted]. @@ -10254,7 +10824,7 @@ private constructor( private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10354,7 +10924,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10449,6 +11030,7 @@ private constructor( purchaseExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -10475,6 +11057,7 @@ private constructor( (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -10772,6 +11355,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ class ReturnAttempted @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -13591,7 +14281,7 @@ private constructor( private val delayed: JsonField, private val deliveredToWrongLocation: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -13629,7 +14319,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, deliveryIssue, @@ -13736,10 +14426,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -13832,6 +14524,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -13878,7 +14580,7 @@ private constructor( private var deliveredToWrongLocation: JsonField = JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -14063,7 +14765,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -14137,6 +14849,7 @@ private constructor( delayed().ifPresent { it.validate() } deliveredToWrongLocation().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -14165,7 +14878,8 @@ private constructor( ?: 0) + (delayed.asKnown().getOrNull()?.validity() ?: 0) + (deliveredToWrongLocation.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -14838,7 +15552,7 @@ private constructor( private constructor( private val explanation: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -14854,7 +15568,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -14888,10 +15602,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -14930,6 +15647,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -14981,7 +15708,7 @@ private constructor( private var explanation: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -15026,7 +15753,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -15115,6 +15852,7 @@ private constructor( explanation() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -15138,6 +15876,7 @@ private constructor( internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -15221,46 +15960,156 @@ private constructor( 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 IncreaseInvalidDataException if this class instance's value is a not - * a known member. - */ - fun known(): Known = - when (this) { - NOT_RETURNED -> Known.NOT_RETURNED - RETURNED -> Known.RETURNED - RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED - else -> - throw IncreaseInvalidDataException("Unknown ReturnOutcome: $value") + /** + * 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 IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + NOT_RETURNED -> Known.NOT_RETURNED + RETURNED -> Known.RETURNED + RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED + else -> + throw IncreaseInvalidDataException("Unknown ReturnOutcome: $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 IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): ReturnOutcome = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 ReturnOutcome && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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) } - /** - * 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 IncreaseInvalidDataException if this class instance's value does not - * have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ReturnOutcome = apply { + fun validate(): NotReturned = apply { if (validated) { return@apply } - known() validated = true } @@ -15278,20 +16127,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ReturnOutcome && value == other.value + return other is NotReturned && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" } /** @@ -16085,6 +16937,119 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -16105,26 +17070,142 @@ private constructor( additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { - Objects.hash( - cancellationOutcome, - deliveryIssue, - lastExpectedReceiptAt, - merchantResolutionAttempted, - purchaseInfoAndExplanation, - cardholderCancellationPriorToExpectedReceipt, - delayed, - deliveredToWrongLocation, - merchantCancellation, - noCancellation, - additionalProperties, - ) - } + private val hashCode: Int by lazy { + Objects.hash( + cancellationOutcome, + deliveryIssue, + lastExpectedReceiptAt, + merchantResolutionAttempted, + purchaseInfoAndExplanation, + cardholderCancellationPriorToExpectedReceipt, + delayed, + deliveredToWrongLocation, + merchantCancellation, + noCancellation, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + } + + /** + * Non-receipt of cash. Required if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = apply { + additionalProperties = + consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" } /** @@ -16503,7 +17584,7 @@ private constructor( private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, @@ -16530,7 +17611,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -16600,10 +17681,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -16682,6 +17766,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -16751,7 +17845,7 @@ private constructor( private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var ongoingNegotiations: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() @@ -16850,7 +17944,18 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { this.notReturned = notReturned } + fun notReturned(notReturned: NotReturned) = notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { + this.notReturned = notReturned + } /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -16964,6 +18069,7 @@ private constructor( purchaseInfoAndQualityIssue() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } @@ -16991,6 +18097,7 @@ private constructor( (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -17289,6 +18396,113 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NotReturned{additionalProperties=$additionalProperties}" + } + /** Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. */ class OngoingNegotiations @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -22140,7 +23354,7 @@ private constructor( private val cardholderCancellationPriorToExpectedReceipt: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -22169,7 +23383,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, lastExpectedReceiptAt, @@ -22246,10 +23460,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -22314,6 +23530,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -22355,7 +23581,7 @@ private constructor( JsonField = JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -22490,7 +23716,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -22557,6 +23793,7 @@ private constructor( purchaseInfoAndExplanation() cardholderCancellationPriorToExpectedReceipt().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -22582,7 +23819,8 @@ private constructor( (if (purchaseInfoAndExplanation.asKnown().isPresent) 1 else 0) + (cardholderCancellationPriorToExpectedReceipt.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -23286,6 +24524,119 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt index d70b15821..fd9c0cad3 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParams.kt @@ -1442,7 +1442,7 @@ private constructor( private val consumerMerchandiseNotAsDescribed: JsonField, private val consumerMerchandiseNotReceived: JsonField, - private val consumerNonReceiptOfCash: JsonValue, + private val consumerNonReceiptOfCash: JsonField, private val consumerOriginalCreditTransactionNotAccepted: JsonField, private val consumerQualityMerchandise: JsonField, @@ -1504,7 +1504,7 @@ private constructor( JsonMissing.of(), @JsonProperty("consumer_non_receipt_of_cash") @ExcludeMissing - consumerNonReceiptOfCash: JsonValue = JsonMissing.of(), + consumerNonReceiptOfCash: JsonField = JsonMissing.of(), @JsonProperty("consumer_original_credit_transaction_not_accepted") @ExcludeMissing consumerOriginalCreditTransactionNotAccepted: @@ -1679,10 +1679,12 @@ private constructor( /** * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @JsonProperty("consumer_non_receipt_of_cash") - @ExcludeMissing - fun _consumerNonReceiptOfCash(): JsonValue = consumerNonReceiptOfCash + fun consumerNonReceiptOfCash(): Optional = + consumerNonReceiptOfCash.getOptional("consumer_non_receipt_of_cash") /** * Original Credit Transaction (OCT) not accepted. Required if and only if `category` is @@ -1886,6 +1888,17 @@ private constructor( fun _consumerMerchandiseNotReceived(): JsonField = consumerMerchandiseNotReceived + /** + * Returns the raw JSON value of [consumerNonReceiptOfCash]. + * + * Unlike [consumerNonReceiptOfCash], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("consumer_non_receipt_of_cash") + @ExcludeMissing + fun _consumerNonReceiptOfCash(): JsonField = + consumerNonReceiptOfCash + /** * Returns the raw JSON value of [consumerOriginalCreditTransactionNotAccepted]. * @@ -2024,7 +2037,8 @@ private constructor( private var consumerMerchandiseNotReceived: JsonField = JsonMissing.of() - private var consumerNonReceiptOfCash: JsonValue = JsonMissing.of() + private var consumerNonReceiptOfCash: JsonField = + JsonMissing.of() private var consumerOriginalCreditTransactionNotAccepted: JsonField = JsonMissing.of() @@ -2298,9 +2312,19 @@ private constructor( * Non-receipt of cash. Required if and only if `category` is * `consumer_non_receipt_of_cash`. */ - fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: JsonValue) = apply { - this.consumerNonReceiptOfCash = consumerNonReceiptOfCash - } + fun consumerNonReceiptOfCash(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = + consumerNonReceiptOfCash(JsonField.of(consumerNonReceiptOfCash)) + + /** + * Sets [Builder.consumerNonReceiptOfCash] to an arbitrary JSON value. + * + * You should usually call [Builder.consumerNonReceiptOfCash] with a well-typed + * [ConsumerNonReceiptOfCash] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun consumerNonReceiptOfCash( + consumerNonReceiptOfCash: JsonField + ) = apply { this.consumerNonReceiptOfCash = consumerNonReceiptOfCash } /** * Original Credit Transaction (OCT) not accepted. Required if and only if @@ -2535,6 +2559,7 @@ private constructor( consumerMerchandiseMisrepresentation().ifPresent { it.validate() } consumerMerchandiseNotAsDescribed().ifPresent { it.validate() } consumerMerchandiseNotReceived().ifPresent { it.validate() } + consumerNonReceiptOfCash().ifPresent { it.validate() } consumerOriginalCreditTransactionNotAccepted().ifPresent { it.validate() } consumerQualityMerchandise().ifPresent { it.validate() } consumerQualityServices().ifPresent { it.validate() } @@ -2573,6 +2598,7 @@ private constructor( (consumerMerchandiseMisrepresentation.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotAsDescribed.asKnown().getOrNull()?.validity() ?: 0) + (consumerMerchandiseNotReceived.asKnown().getOrNull()?.validity() ?: 0) + + (consumerNonReceiptOfCash.asKnown().getOrNull()?.validity() ?: 0) + (consumerOriginalCreditTransactionNotAccepted.asKnown().getOrNull()?.validity() ?: 0) + (consumerQualityMerchandise.asKnown().getOrNull()?.validity() ?: 0) + @@ -3248,7 +3274,7 @@ private constructor( private val receivedOrExpectedAt: JsonField, private val returnOutcome: JsonField, private val cardholderCancellation: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -3274,7 +3300,7 @@ private constructor( cardholderCancellation: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -3341,10 +3367,13 @@ private constructor( fun cardholderCancellation(): Optional = cardholderCancellation.getOptional("cardholder_cancellation") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -3415,6 +3444,16 @@ private constructor( fun _cardholderCancellation(): JsonField = cardholderCancellation + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -3475,7 +3514,7 @@ private constructor( private var returnOutcome: JsonField? = null private var cardholderCancellation: JsonField = JsonMissing.of() - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -3575,7 +3614,17 @@ private constructor( ) = apply { this.cardholderCancellation = cardholderCancellation } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -3675,6 +3724,7 @@ private constructor( receivedOrExpectedAt() returnOutcome().validate() cardholderCancellation().ifPresent { it.validate() } + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -3701,6 +3751,7 @@ private constructor( (if (receivedOrExpectedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + (cardholderCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -4645,6 +4696,119 @@ private constructor( "CardholderCancellation{canceledAt=$canceledAt, canceledPriorToShipDate=$canceledPriorToShipDate, cancellationPolicyProvided=$cancellationPolicyProvided, reason=$reason, additionalProperties=$additionalProperties}" } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -6654,8 +6818,8 @@ private constructor( private val purchaseExplanation: JsonField, private val serviceType: JsonField, private val guaranteedReservation: JsonField, - private val other: JsonValue, - private val timeshare: JsonValue, + private val other: JsonField, + private val timeshare: JsonField, private val additionalProperties: MutableMap, ) { @@ -6680,10 +6844,12 @@ private constructor( @JsonProperty("guaranteed_reservation") @ExcludeMissing guaranteedReservation: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") + @ExcludeMissing + other: JsonField = JsonMissing.of(), @JsonProperty("timeshare") @ExcludeMissing - timeshare: JsonValue = JsonMissing.of(), + timeshare: JsonField = JsonMissing.of(), ) : this( cardholderCancellation, contractedAt, @@ -6757,11 +6923,19 @@ private constructor( /** * Other service type explanation. Required if and only if `service_type` is * `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") - /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - @JsonProperty("timeshare") @ExcludeMissing fun _timeshare(): JsonValue = timeshare + /** + * Timeshare explanation. Required if and only if `service_type` is `timeshare`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun timeshare(): Optional = timeshare.getOptional("timeshare") /** * Returns the raw JSON value of [cardholderCancellation]. @@ -6826,6 +7000,24 @@ private constructor( fun _guaranteedReservation(): JsonField = guaranteedReservation + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + + /** + * Returns the raw JSON value of [timeshare]. + * + * Unlike [timeshare], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("timeshare") + @ExcludeMissing + fun _timeshare(): JsonField = timeshare + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -6868,8 +7060,8 @@ private constructor( private var serviceType: JsonField? = null private var guaranteedReservation: JsonField = JsonMissing.of() - private var other: JsonValue = JsonMissing.of() - private var timeshare: JsonValue = JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var timeshare: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -6986,12 +7178,32 @@ private constructor( * Other service type explanation. Required if and only if `service_type` is * `other`. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other) = other(JsonField.of(other)) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ - fun timeshare(timeshare: JsonValue) = apply { this.timeshare = timeshare } + fun timeshare(timeshare: Timeshare) = timeshare(JsonField.of(timeshare)) + + /** + * Sets [Builder.timeshare] to an arbitrary JSON value. + * + * You should usually call [Builder.timeshare] with a well-typed [Timeshare] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun timeshare(timeshare: JsonField) = apply { + this.timeshare = timeshare + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -7061,6 +7273,8 @@ private constructor( purchaseExplanation() serviceType().validate() guaranteedReservation().ifPresent { it.validate() } + other().ifPresent { it.validate() } + timeshare().ifPresent { it.validate() } validated = true } @@ -7085,7 +7299,9 @@ private constructor( (merchantResolutionAttempted.asKnown().getOrNull()?.validity() ?: 0) + (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (serviceType.asKnown().getOrNull()?.validity() ?: 0) + - (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + (guaranteedReservation.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (timeshare.asKnown().getOrNull()?.validity() ?: 0) /** Cardholder cancellation. */ class CardholderCancellation @@ -8166,75 +8382,300 @@ private constructor( "GuaranteedReservation{explanation=$explanation, additionalProperties=$additionalProperties}" } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** + * Other service type explanation. Required if and only if `service_type` is + * `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is ConsumerCanceledServices && - cardholderCancellation == other.cardholderCancellation && - contractedAt == other.contractedAt && - merchantResolutionAttempted == other.merchantResolutionAttempted && - purchaseExplanation == other.purchaseExplanation && - serviceType == other.serviceType && - guaranteedReservation == other.guaranteedReservation && - this.other == other.other && - timeshare == other.timeshare && - additionalProperties == other.additionalProperties - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - private val hashCode: Int by lazy { - Objects.hash( - cardholderCancellation, - contractedAt, - merchantResolutionAttempted, - purchaseExplanation, - serviceType, - guaranteedReservation, - other, - timeshare, - additionalProperties, - ) - } + fun toBuilder() = Builder().from(this) - override fun hashCode(): Int = hashCode + companion object { - override fun toString() = - "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" - } + /** Returns a mutable builder for constructing an instance of [Other]. */ + @JvmStatic fun builder() = Builder() + } - /** - * Counterfeit merchandise. Required if and only if `category` is - * `consumer_counterfeit_merchandise`. - */ - class ConsumerCounterfeitMerchandise - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val counterfeitExplanation: JsonField, - private val dispositionExplanation: JsonField, - private val orderExplanation: JsonField, - private val receivedAt: JsonField, - private val additionalProperties: MutableMap, - ) { + /** A builder for [Other]. */ + class Builder internal constructor() { - @JsonCreator - private constructor( - @JsonProperty("counterfeit_explanation") - @ExcludeMissing - counterfeitExplanation: JsonField = JsonMissing.of(), - @JsonProperty("disposition_explanation") - @ExcludeMissing - dispositionExplanation: JsonField = JsonMissing.of(), - @JsonProperty("order_explanation") - @ExcludeMissing - orderExplanation: JsonField = JsonMissing.of(), - @JsonProperty("received_at") - @ExcludeMissing - receivedAt: JsonField = JsonMissing.of(), - ) : this( - counterfeitExplanation, - dispositionExplanation, - orderExplanation, + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + + /** Timeshare explanation. Required if and only if `service_type` is `timeshare`. */ + class Timeshare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Timeshare]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Timeshare]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(timeshare: Timeshare) = apply { + additionalProperties = timeshare.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 [Timeshare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Timeshare = Timeshare(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Timeshare = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Timeshare{additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerCanceledServices && + cardholderCancellation == other.cardholderCancellation && + contractedAt == other.contractedAt && + merchantResolutionAttempted == other.merchantResolutionAttempted && + purchaseExplanation == other.purchaseExplanation && + serviceType == other.serviceType && + guaranteedReservation == other.guaranteedReservation && + this.other == other.other && + timeshare == other.timeshare && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + cardholderCancellation, + contractedAt, + merchantResolutionAttempted, + purchaseExplanation, + serviceType, + guaranteedReservation, + other, + timeshare, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerCanceledServices{cardholderCancellation=$cardholderCancellation, contractedAt=$contractedAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseExplanation=$purchaseExplanation, serviceType=$serviceType, guaranteedReservation=$guaranteedReservation, other=$other, timeshare=$timeshare, additionalProperties=$additionalProperties}" + } + + /** + * Counterfeit merchandise. Required if and only if `category` is + * `consumer_counterfeit_merchandise`. + */ + class ConsumerCounterfeitMerchandise + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val counterfeitExplanation: JsonField, + private val dispositionExplanation: JsonField, + private val orderExplanation: JsonField, + private val receivedAt: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("counterfeit_explanation") + @ExcludeMissing + counterfeitExplanation: JsonField = JsonMissing.of(), + @JsonProperty("disposition_explanation") + @ExcludeMissing + dispositionExplanation: JsonField = JsonMissing.of(), + @JsonProperty("order_explanation") + @ExcludeMissing + orderExplanation: JsonField = JsonMissing.of(), + @JsonProperty("received_at") + @ExcludeMissing + receivedAt: JsonField = JsonMissing.of(), + ) : this( + counterfeitExplanation, + dispositionExplanation, + orderExplanation, receivedAt, mutableMapOf(), ) @@ -8764,7 +9205,7 @@ private constructor( private val orderAndIssueExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -8787,7 +9228,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -8843,10 +9284,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -8906,6 +9350,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -8964,7 +9418,7 @@ private constructor( private var orderAndIssueExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -9050,7 +9504,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -9148,6 +9612,7 @@ private constructor( orderAndIssueExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -9173,6 +9638,7 @@ private constructor( (if (orderAndIssueExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -9476,6 +9942,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -10587,7 +11166,7 @@ private constructor( private val purchaseExplanation: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -10613,7 +11192,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -10680,10 +11259,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. @@ -10752,7 +11334,17 @@ private constructor( */ @JsonProperty("return_outcome") @ExcludeMissing - fun _returnOutcome(): JsonField = returnOutcome + fun _returnOutcome(): JsonField = returnOutcome + + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned /** * Returns the raw JSON value of [returnAttempted]. @@ -10814,7 +11406,7 @@ private constructor( private var purchaseExplanation: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -10915,7 +11507,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -11019,6 +11621,7 @@ private constructor( purchaseExplanation() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -11045,6 +11648,7 @@ private constructor( (if (purchaseExplanation.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -11348,6 +11952,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Return attempted. Required if and only if `return_outcome` is `return_attempted`. */ @@ -14207,7 +14924,7 @@ private constructor( private val delayed: JsonField, private val deliveredToWrongLocation: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -14246,7 +14963,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, deliveryIssue, @@ -14354,10 +15071,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -14453,6 +15172,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -14501,7 +15230,7 @@ private constructor( JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -14690,7 +15419,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -14767,6 +15506,7 @@ private constructor( delayed().ifPresent { it.validate() } deliveredToWrongLocation().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -14797,7 +15537,8 @@ private constructor( ?.validity() ?: 0) + (delayed.asKnown().getOrNull()?.validity() ?: 0) + (deliveredToWrongLocation.asKnown().getOrNull()?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -15482,7 +16223,7 @@ private constructor( private constructor( private val explanation: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, private val additionalProperties: MutableMap, @@ -15498,7 +16239,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("return_attempted") @ExcludeMissing returnAttempted: JsonField = JsonMissing.of(), @@ -15532,10 +16273,14 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = + notReturned.getOptional("not_returned") /** * Return attempted. Required if and only if `return_outcome` is @@ -15575,6 +16320,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [returnAttempted]. * @@ -15626,7 +16381,7 @@ private constructor( private var explanation: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() private var returned: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = @@ -15675,7 +16430,17 @@ private constructor( /** * Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed + * [NotReturned] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -15766,6 +16531,7 @@ private constructor( explanation() returnOutcome().validate() + notReturned().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } validated = true @@ -15789,6 +16555,7 @@ private constructor( internal fun validity(): Int = (if (explanation.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -15872,48 +16639,162 @@ private constructor( 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 IncreaseInvalidDataException if this class instance's value is a - * not a known member. - */ - fun known(): Known = - when (this) { - NOT_RETURNED -> Known.NOT_RETURNED - RETURNED -> Known.RETURNED - RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED - else -> - throw IncreaseInvalidDataException( - "Unknown ReturnOutcome: $value" - ) + /** + * 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 IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + NOT_RETURNED -> Known.NOT_RETURNED + RETURNED -> Known.RETURNED + RETURN_ATTEMPTED -> Known.RETURN_ATTEMPTED + else -> + throw IncreaseInvalidDataException( + "Unknown ReturnOutcome: $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 IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): ReturnOutcome = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 ReturnOutcome && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = + notReturned.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) } - /** - * 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 IncreaseInvalidDataException if this class instance's value does - * not have the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) } + /** + * Returns an immutable instance of [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned + * instance. + */ + fun build(): NotReturned = + NotReturned(additionalProperties.toMutableMap()) + } + private var validated: Boolean = false - fun validate(): ReturnOutcome = apply { + fun validate(): NotReturned = apply { if (validated) { return@apply } - known() validated = true } @@ -15931,20 +16812,23 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic - internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is ReturnOutcome && value == other.value + return other is NotReturned && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" } /** @@ -16753,6 +17637,125 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -16792,7 +17795,123 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + "ConsumerMerchandiseNotReceived{cancellationOutcome=$cancellationOutcome, deliveryIssue=$deliveryIssue, lastExpectedReceiptAt=$lastExpectedReceiptAt, merchantResolutionAttempted=$merchantResolutionAttempted, purchaseInfoAndExplanation=$purchaseInfoAndExplanation, cardholderCancellationPriorToExpectedReceipt=$cardholderCancellationPriorToExpectedReceipt, delayed=$delayed, deliveredToWrongLocation=$deliveredToWrongLocation, merchantCancellation=$merchantCancellation, noCancellation=$noCancellation, additionalProperties=$additionalProperties}" + } + + /** + * Non-receipt of cash. Required if and only if `category` is + * `consumer_non_receipt_of_cash`. + */ + class ConsumerNonReceiptOfCash + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ConsumerNonReceiptOfCash]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ConsumerNonReceiptOfCash]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(consumerNonReceiptOfCash: ConsumerNonReceiptOfCash) = apply { + additionalProperties = + consumerNonReceiptOfCash.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 [ConsumerNonReceiptOfCash]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ConsumerNonReceiptOfCash = + ConsumerNonReceiptOfCash(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ConsumerNonReceiptOfCash = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ConsumerNonReceiptOfCash && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ConsumerNonReceiptOfCash{additionalProperties=$additionalProperties}" } /** @@ -17178,7 +18297,7 @@ private constructor( private val purchaseInfoAndQualityIssue: JsonField, private val receivedAt: JsonField, private val returnOutcome: JsonField, - private val notReturned: JsonValue, + private val notReturned: JsonField, private val ongoingNegotiations: JsonField, private val returnAttempted: JsonField, private val returned: JsonField, @@ -17205,7 +18324,7 @@ private constructor( returnOutcome: JsonField = JsonMissing.of(), @JsonProperty("not_returned") @ExcludeMissing - notReturned: JsonValue = JsonMissing.of(), + notReturned: JsonField = JsonMissing.of(), @JsonProperty("ongoing_negotiations") @ExcludeMissing ongoingNegotiations: JsonField = JsonMissing.of(), @@ -17275,10 +18394,13 @@ private constructor( */ fun returnOutcome(): ReturnOutcome = returnOutcome.getRequired("return_outcome") - /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - @JsonProperty("not_returned") - @ExcludeMissing - fun _notReturned(): JsonValue = notReturned + /** + * Not returned. Required if and only if `return_outcome` is `not_returned`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun notReturned(): Optional = notReturned.getOptional("not_returned") /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. @@ -17357,6 +18479,16 @@ private constructor( @ExcludeMissing fun _returnOutcome(): JsonField = returnOutcome + /** + * Returns the raw JSON value of [notReturned]. + * + * Unlike [notReturned], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("not_returned") + @ExcludeMissing + fun _notReturned(): JsonField = notReturned + /** * Returns the raw JSON value of [ongoingNegotiations]. * @@ -17427,7 +18559,7 @@ private constructor( private var purchaseInfoAndQualityIssue: JsonField? = null private var receivedAt: JsonField? = null private var returnOutcome: JsonField? = null - private var notReturned: JsonValue = JsonMissing.of() + private var notReturned: JsonField = JsonMissing.of() private var ongoingNegotiations: JsonField = JsonMissing.of() private var returnAttempted: JsonField = JsonMissing.of() @@ -17528,7 +18660,17 @@ private constructor( } /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ - fun notReturned(notReturned: JsonValue) = apply { + fun notReturned(notReturned: NotReturned) = + notReturned(JsonField.of(notReturned)) + + /** + * Sets [Builder.notReturned] to an arbitrary JSON value. + * + * You should usually call [Builder.notReturned] with a well-typed [NotReturned] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun notReturned(notReturned: JsonField) = apply { this.notReturned = notReturned } @@ -17652,6 +18794,7 @@ private constructor( purchaseInfoAndQualityIssue() receivedAt() returnOutcome().validate() + notReturned().ifPresent { it.validate() } ongoingNegotiations().ifPresent { it.validate() } returnAttempted().ifPresent { it.validate() } returned().ifPresent { it.validate() } @@ -17679,6 +18822,7 @@ private constructor( (if (purchaseInfoAndQualityIssue.asKnown().isPresent) 1 else 0) + (if (receivedAt.asKnown().isPresent) 1 else 0) + (returnOutcome.asKnown().getOrNull()?.validity() ?: 0) + + (notReturned.asKnown().getOrNull()?.validity() ?: 0) + (ongoingNegotiations.asKnown().getOrNull()?.validity() ?: 0) + (returnAttempted.asKnown().getOrNull()?.validity() ?: 0) + (returned.asKnown().getOrNull()?.validity() ?: 0) @@ -17983,6 +19127,119 @@ private constructor( override fun toString() = value.toString() } + /** Not returned. Required if and only if `return_outcome` is `not_returned`. */ + class NotReturned + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [NotReturned]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NotReturned]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(notReturned: NotReturned) = apply { + additionalProperties = notReturned.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 [NotReturned]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NotReturned = NotReturned(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NotReturned = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NotReturned && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NotReturned{additionalProperties=$additionalProperties}" + } + /** * Ongoing negotiations. Exclude if there is no evidence of ongoing negotiations. */ @@ -22918,7 +24175,7 @@ private constructor( private val cardholderCancellationPriorToExpectedReceipt: JsonField, private val merchantCancellation: JsonField, - private val noCancellation: JsonValue, + private val noCancellation: JsonField, private val additionalProperties: MutableMap, ) { @@ -22947,7 +24204,7 @@ private constructor( merchantCancellation: JsonField = JsonMissing.of(), @JsonProperty("no_cancellation") @ExcludeMissing - noCancellation: JsonValue = JsonMissing.of(), + noCancellation: JsonField = JsonMissing.of(), ) : this( cancellationOutcome, lastExpectedReceiptAt, @@ -23025,10 +24282,12 @@ private constructor( /** * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). */ - @JsonProperty("no_cancellation") - @ExcludeMissing - fun _noCancellation(): JsonValue = noCancellation + fun noCancellation(): Optional = + noCancellation.getOptional("no_cancellation") /** * Returns the raw JSON value of [cancellationOutcome]. @@ -23093,6 +24352,16 @@ private constructor( @ExcludeMissing fun _merchantCancellation(): JsonField = merchantCancellation + /** + * Returns the raw JSON value of [noCancellation]. + * + * Unlike [noCancellation], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("no_cancellation") + @ExcludeMissing + fun _noCancellation(): JsonField = noCancellation + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -23136,7 +24405,7 @@ private constructor( JsonMissing.of() private var merchantCancellation: JsonField = JsonMissing.of() - private var noCancellation: JsonValue = JsonMissing.of() + private var noCancellation: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -23275,7 +24544,17 @@ private constructor( * No cancellation. Required if and only if `cancellation_outcome` is * `no_cancellation`. */ - fun noCancellation(noCancellation: JsonValue) = apply { + fun noCancellation(noCancellation: NoCancellation) = + noCancellation(JsonField.of(noCancellation)) + + /** + * Sets [Builder.noCancellation] to an arbitrary JSON value. + * + * You should usually call [Builder.noCancellation] with a well-typed + * [NoCancellation] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun noCancellation(noCancellation: JsonField) = apply { this.noCancellation = noCancellation } @@ -23345,6 +24624,7 @@ private constructor( purchaseInfoAndExplanation() cardholderCancellationPriorToExpectedReceipt().ifPresent { it.validate() } merchantCancellation().ifPresent { it.validate() } + noCancellation().ifPresent { it.validate() } validated = true } @@ -23372,7 +24652,8 @@ private constructor( .asKnown() .getOrNull() ?.validity() ?: 0) + - (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + (merchantCancellation.asKnown().getOrNull()?.validity() ?: 0) + + (noCancellation.asKnown().getOrNull()?.validity() ?: 0) /** Cancellation outcome. */ class CancellationOutcome @@ -24086,6 +25367,125 @@ private constructor( "MerchantCancellation{canceledAt=$canceledAt, additionalProperties=$additionalProperties}" } + /** + * No cancellation. Required if and only if `cancellation_outcome` is + * `no_cancellation`. + */ + class NoCancellation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [NoCancellation]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NoCancellation]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(noCancellation: NoCancellation) = apply { + additionalProperties = + noCancellation.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 [NoCancellation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NoCancellation = + NoCancellation(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NoCancellation = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NoCancellation && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NoCancellation{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index a71010fae..87597f9dd 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -534,7 +534,7 @@ private constructor( private val cardValidation: JsonField, private val category: JsonField, private val createdAt: JsonField, - private val other: JsonValue, + private val other: JsonField, private val additionalProperties: MutableMap, ) { @@ -579,7 +579,7 @@ private constructor( @JsonProperty("created_at") @ExcludeMissing createdAt: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), ) : this( cardAuthentication, cardAuthorization, @@ -737,8 +737,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * Returns the raw JSON value of [cardAuthentication]. @@ -865,6 +868,13 @@ private constructor( @ExcludeMissing fun _createdAt(): JsonField = createdAt + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -919,7 +929,7 @@ private constructor( private var cardValidation: JsonField? = null private var category: JsonField? = null private var createdAt: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1247,7 +1257,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1333,6 +1355,7 @@ private constructor( cardValidation().ifPresent { it.validate() } category().validate() createdAt() + other().ifPresent { it.validate() } validated = true } @@ -1364,7 +1387,8 @@ private constructor( (cardSettlement.asKnown().getOrNull()?.validity() ?: 0) + (cardValidation.asKnown().getOrNull()?.validity() ?: 0) + (category.asKnown().getOrNull()?.validity() ?: 0) + - (if (createdAt.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) /** * A Card Authentication object. This field will be present in the JSON response if and only @@ -8964,7 +8988,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -8974,7 +8998,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -8987,8 +9013,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -9008,6 +9039,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -9047,7 +9086,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -9072,7 +9111,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -9142,6 +9193,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -9163,6 +9215,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -9307,6 +9360,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -18350,7 +18512,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -18360,7 +18522,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -18373,8 +18537,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -18394,6 +18563,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -18433,7 +18610,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -18458,7 +18635,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -18528,6 +18717,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -18549,6 +18739,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -18693,6 +18884,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -27209,7 +27509,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -27219,7 +27519,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -27232,8 +27534,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -27253,6 +27560,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -27292,7 +27607,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -27317,7 +27632,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -27387,6 +27714,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -27408,6 +27736,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -27552,6 +27881,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -63330,7 +63768,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -63340,7 +63778,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -63353,8 +63793,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -63374,6 +63819,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -63413,7 +63866,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -63438,7 +63891,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -63508,6 +63973,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -63529,6 +63995,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -63673,6 +64140,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -66870,6 +67446,115 @@ private constructor( override fun toString() = value.toString() } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index b8f1ca77c..8b1e3e84b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -878,7 +878,7 @@ private constructor( private val inboundFednowTransferDecline: JsonField, private val inboundRealTimePaymentsTransferDecline: JsonField, - private val other: JsonValue, + private val other: JsonField, private val wireDecline: JsonField, private val additionalProperties: MutableMap, ) { @@ -909,7 +909,7 @@ private constructor( inboundRealTimePaymentsTransferDecline: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("wire_decline") @ExcludeMissing wireDecline: JsonField = JsonMissing.of(), @@ -999,8 +999,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Wire Decline object. This field will be present in the JSON response if and only if @@ -1079,6 +1082,13 @@ private constructor( JsonField = inboundRealTimePaymentsTransferDecline + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [wireDecline]. * @@ -1134,7 +1144,7 @@ private constructor( private var inboundRealTimePaymentsTransferDecline: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var wireDecline: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1327,7 +1337,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Wire Decline object. This field will be present in the JSON response if and only if @@ -1422,6 +1444,7 @@ private constructor( checkDepositRejection().ifPresent { it.validate() } inboundFednowTransferDecline().ifPresent { it.validate() } inboundRealTimePaymentsTransferDecline().ifPresent { it.validate() } + other().ifPresent { it.validate() } wireDecline().ifPresent { it.validate() } validated = true } @@ -1449,6 +1472,7 @@ private constructor( (checkDepositRejection.asKnown().getOrNull()?.validity() ?: 0) + (inboundFednowTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + (inboundRealTimePaymentsTransferDecline.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (wireDecline.asKnown().getOrNull()?.validity() ?: 0) /** @@ -7587,7 +7611,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7597,7 +7621,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -7610,8 +7636,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -7631,6 +7662,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -7670,7 +7709,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -7695,7 +7734,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7765,6 +7816,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -7786,6 +7838,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -7930,6 +7983,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -14811,6 +14973,115 @@ private constructor( "InboundRealTimePaymentsTransferDecline{amount=$amount, creditorName=$creditorName, currency=$currency, debtorAccountNumber=$debtorAccountNumber, debtorName=$debtorName, debtorRoutingNumber=$debtorRoutingNumber, reason=$reason, remittanceInformation=$remittanceInformation, transactionIdentification=$transactionIdentification, transferId=$transferId, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Wire Decline object. This field will be present in the JSON response if and only if * `category` is equal to `wire_decline`. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt index 8fb51a0b4..907e1eb7b 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/exports/ExportCreateParams.kt @@ -91,8 +91,13 @@ private constructor( */ fun transactionCsv(): Optional = body.transactionCsv() - /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun _vendorCsv(): JsonValue = body._vendorCsv() + /** + * Options for the created export. Required if `category` is equal to `vendor_csv`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if the + * server responded with an unexpected value). + */ + fun vendorCsv(): Optional = body.vendorCsv() /** * Returns the raw JSON value of [category]. @@ -147,6 +152,13 @@ private constructor( */ fun _transactionCsv(): JsonField = body._transactionCsv() + /** + * Returns the raw JSON value of [vendorCsv]. + * + * Unlike [vendorCsv], this method doesn't throw if the JSON field has an unexpected type. + */ + fun _vendorCsv(): JsonField = body._vendorCsv() + fun _additionalBodyProperties(): Map = body._additionalProperties() /** Additional headers to send with the request. */ @@ -308,7 +320,16 @@ private constructor( } /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun vendorCsv(vendorCsv: JsonValue) = apply { body.vendorCsv(vendorCsv) } + fun vendorCsv(vendorCsv: VendorCsv) = apply { body.vendorCsv(vendorCsv) } + + /** + * Sets [Builder.vendorCsv] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorCsv] with a well-typed [VendorCsv] value instead. + * This method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun vendorCsv(vendorCsv: JsonField) = apply { body.vendorCsv(vendorCsv) } fun additionalBodyProperties(additionalBodyProperties: Map) = apply { body.additionalProperties(additionalBodyProperties) @@ -463,7 +484,7 @@ private constructor( private val bookkeepingAccountBalanceCsv: JsonField, private val entityCsv: JsonField, private val transactionCsv: JsonField, - private val vendorCsv: JsonValue, + private val vendorCsv: JsonField, private val additionalProperties: MutableMap, ) { @@ -491,7 +512,9 @@ private constructor( @JsonProperty("transaction_csv") @ExcludeMissing transactionCsv: JsonField = JsonMissing.of(), - @JsonProperty("vendor_csv") @ExcludeMissing vendorCsv: JsonValue = JsonMissing.of(), + @JsonProperty("vendor_csv") + @ExcludeMissing + vendorCsv: JsonField = JsonMissing.of(), ) : this( category, accountStatementBai2, @@ -567,8 +590,13 @@ private constructor( fun transactionCsv(): Optional = transactionCsv.getOptional("transaction_csv") - /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - @JsonProperty("vendor_csv") @ExcludeMissing fun _vendorCsv(): JsonValue = vendorCsv + /** + * Options for the created export. Required if `category` is equal to `vendor_csv`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun vendorCsv(): Optional = vendorCsv.getOptional("vendor_csv") /** * Returns the raw JSON value of [category]. @@ -636,6 +664,15 @@ private constructor( @ExcludeMissing fun _transactionCsv(): JsonField = transactionCsv + /** + * Returns the raw JSON value of [vendorCsv]. + * + * Unlike [vendorCsv], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("vendor_csv") + @ExcludeMissing + fun _vendorCsv(): JsonField = vendorCsv + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -672,7 +709,7 @@ private constructor( JsonMissing.of() private var entityCsv: JsonField = JsonMissing.of() private var transactionCsv: JsonField = JsonMissing.of() - private var vendorCsv: JsonValue = JsonMissing.of() + private var vendorCsv: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -800,7 +837,16 @@ private constructor( } /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ - fun vendorCsv(vendorCsv: JsonValue) = apply { this.vendorCsv = vendorCsv } + fun vendorCsv(vendorCsv: VendorCsv) = vendorCsv(JsonField.of(vendorCsv)) + + /** + * Sets [Builder.vendorCsv] to an arbitrary JSON value. + * + * You should usually call [Builder.vendorCsv] with a well-typed [VendorCsv] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun vendorCsv(vendorCsv: JsonField) = apply { this.vendorCsv = vendorCsv } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -861,6 +907,7 @@ private constructor( bookkeepingAccountBalanceCsv().ifPresent { it.validate() } entityCsv().ifPresent { it.validate() } transactionCsv().ifPresent { it.validate() } + vendorCsv().ifPresent { it.validate() } validated = true } @@ -886,7 +933,8 @@ private constructor( (balanceCsv.asKnown().getOrNull()?.validity() ?: 0) + (bookkeepingAccountBalanceCsv.asKnown().getOrNull()?.validity() ?: 0) + (entityCsv.asKnown().getOrNull()?.validity() ?: 0) + - (transactionCsv.asKnown().getOrNull()?.validity() ?: 0) + (transactionCsv.asKnown().getOrNull()?.validity() ?: 0) + + (vendorCsv.asKnown().getOrNull()?.validity() ?: 0) override fun equals(other: Any?): Boolean { if (this === other) { @@ -3878,6 +3926,109 @@ private constructor( "TransactionCsv{accountId=$accountId, createdAt=$createdAt, programId=$programId, additionalProperties=$additionalProperties}" } + /** Options for the created export. Required if `category` is equal to `vendor_csv`. */ + class VendorCsv + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [VendorCsv]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [VendorCsv]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(vendorCsv: VendorCsv) = apply { + additionalProperties = vendorCsv.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 [VendorCsv]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): VendorCsv = VendorCsv(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): VendorCsv = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is VendorCsv && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "VendorCsv{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index 5a0d5cac2..ffd305483 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -1006,7 +1006,7 @@ private constructor( private val fednowTransferInstruction: JsonField, private val inboundFundsHold: JsonField, private val inboundWireTransferReversal: JsonField, - private val other: JsonValue, + private val other: JsonField, private val realTimePaymentsTransferInstruction: JsonField, private val swiftTransferInstruction: JsonField, @@ -1047,7 +1047,7 @@ private constructor( @JsonProperty("inbound_wire_transfer_reversal") @ExcludeMissing inboundWireTransferReversal: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("real_time_payments_transfer_instruction") @ExcludeMissing realTimePaymentsTransferInstruction: JsonField = @@ -1187,8 +1187,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Real-Time Payments Transfer Instruction object. This field will be present in the JSON @@ -1335,6 +1338,13 @@ private constructor( fun _inboundWireTransferReversal(): JsonField = inboundWireTransferReversal + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [realTimePaymentsTransferInstruction]. * @@ -1429,7 +1439,7 @@ private constructor( private var fednowTransferInstruction: JsonField? = null private var inboundFundsHold: JsonField? = null private var inboundWireTransferReversal: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var realTimePaymentsTransferInstruction: JsonField? = null @@ -1716,7 +1726,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Real-Time Payments Transfer Instruction object. This field will be present in the @@ -1914,6 +1936,7 @@ private constructor( fednowTransferInstruction().ifPresent { it.validate() } inboundFundsHold().ifPresent { it.validate() } inboundWireTransferReversal().ifPresent { it.validate() } + other().ifPresent { it.validate() } realTimePaymentsTransferInstruction().ifPresent { it.validate() } swiftTransferInstruction().ifPresent { it.validate() } userInitiatedHold().ifPresent { it.validate() } @@ -1947,6 +1970,7 @@ private constructor( (fednowTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (inboundFundsHold.asKnown().getOrNull()?.validity() ?: 0) + (inboundWireTransferReversal.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (realTimePaymentsTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (swiftTransferInstruction.asKnown().getOrNull()?.validity() ?: 0) + (userInitiatedHold.asKnown().getOrNull()?.validity() ?: 0) + @@ -7517,7 +7541,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -7527,7 +7551,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -7540,8 +7566,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -7561,6 +7592,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -7600,7 +7639,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -7625,7 +7664,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -7695,6 +7746,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -7716,6 +7768,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -7860,6 +7913,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -14036,6 +14198,115 @@ private constructor( "InboundWireTransferReversal{inboundWireTransferId=$inboundWireTransferId, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Real-Time Payments Transfer Instruction object. This field will be present in the JSON * response if and only if `category` is equal to `real_time_payments_transfer_instruction`. diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index c33b61b1e..e6f630c54 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -6275,7 +6275,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -6285,7 +6285,7 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") @ExcludeMissing pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -6298,8 +6298,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -6319,6 +6324,13 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -6357,7 +6369,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -6382,7 +6394,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -6452,6 +6476,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -6473,6 +6498,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -6613,6 +6639,112 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -8408,7 +8540,7 @@ private constructor( private constructor( private val category: JsonField, private val incrementalAuthorization: JsonField, - private val initialAuthorization: JsonValue, + private val initialAuthorization: JsonField, private val additionalProperties: MutableMap, ) { @@ -8422,7 +8554,7 @@ private constructor( incrementalAuthorization: JsonField = JsonMissing.of(), @JsonProperty("initial_authorization") @ExcludeMissing - initialAuthorization: JsonValue = JsonMissing.of(), + initialAuthorization: JsonField = JsonMissing.of(), ) : this(category, incrementalAuthorization, initialAuthorization, mutableMapOf()) /** @@ -8444,10 +8576,14 @@ private constructor( fun incrementalAuthorization(): Optional = incrementalAuthorization.getOptional("incremental_authorization") - /** Fields specific to the category `initial_authorization`. */ - @JsonProperty("initial_authorization") - @ExcludeMissing - fun _initialAuthorization(): JsonValue = initialAuthorization + /** + * Fields specific to the category `initial_authorization`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun initialAuthorization(): Optional = + initialAuthorization.getOptional("initial_authorization") /** * Returns the raw JSON value of [category]. @@ -8470,6 +8606,16 @@ private constructor( fun _incrementalAuthorization(): JsonField = incrementalAuthorization + /** + * Returns the raw JSON value of [initialAuthorization]. + * + * Unlike [initialAuthorization], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("initial_authorization") + @ExcludeMissing + fun _initialAuthorization(): JsonField = initialAuthorization + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -8502,7 +8648,7 @@ private constructor( private var category: JsonField? = null private var incrementalAuthorization: JsonField? = null - private var initialAuthorization: JsonValue? = null + private var initialAuthorization: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -8552,9 +8698,27 @@ private constructor( ) = apply { this.incrementalAuthorization = incrementalAuthorization } /** Fields specific to the category `initial_authorization`. */ - fun initialAuthorization(initialAuthorization: JsonValue) = apply { - this.initialAuthorization = initialAuthorization - } + fun initialAuthorization(initialAuthorization: InitialAuthorization?) = + initialAuthorization(JsonField.ofNullable(initialAuthorization)) + + /** + * Alias for calling [Builder.initialAuthorization] with + * `initialAuthorization.orElse(null)`. + */ + fun initialAuthorization(initialAuthorization: Optional) = + initialAuthorization(initialAuthorization.getOrNull()) + + /** + * Sets [Builder.initialAuthorization] to an arbitrary JSON value. + * + * You should usually call [Builder.initialAuthorization] with a well-typed + * [InitialAuthorization] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun initialAuthorization(initialAuthorization: JsonField) = + apply { + this.initialAuthorization = initialAuthorization + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -8610,6 +8774,7 @@ private constructor( category().validate() incrementalAuthorization().ifPresent { it.validate() } + initialAuthorization().ifPresent { it.validate() } validated = true } @@ -8630,7 +8795,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + - (incrementalAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (incrementalAuthorization.asKnown().getOrNull()?.validity() ?: 0) + + (initialAuthorization.asKnown().getOrNull()?.validity() ?: 0) /** * The type of this request (e.g., an initial authorization or an incremental @@ -9011,6 +9177,119 @@ private constructor( "IncrementalAuthorization{cardPaymentId=$cardPaymentId, originalCardAuthorizationId=$originalCardAuthorizationId, additionalProperties=$additionalProperties}" } + /** Fields specific to the category `initial_authorization`. */ + class InitialAuthorization + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [InitialAuthorization]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [InitialAuthorization]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(initialAuthorization: InitialAuthorization) = apply { + additionalProperties = + initialAuthorization.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 [InitialAuthorization]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): InitialAuthorization = + InitialAuthorization(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): InitialAuthorization = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is InitialAuthorization && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "InitialAuthorization{additionalProperties=$additionalProperties}" + } + override fun equals(other: Any?): Boolean { if (this === other) { return true diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt index e603dd75d..fa5172a66 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParams.kt @@ -639,16 +639,16 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val action: JsonField, - private val acceptChargeback: JsonValue, - private val acceptUserSubmission: JsonValue, - private val declineUserPrearbitration: JsonValue, - private val receiveMerchantPrearbitration: JsonValue, - private val represent: JsonValue, + private val acceptChargeback: JsonField, + private val acceptUserSubmission: JsonField, + private val declineUserPrearbitration: JsonField, + private val receiveMerchantPrearbitration: JsonField, + private val represent: JsonField, private val requestFurtherInformation: JsonField, - private val timeOutChargeback: JsonValue, - private val timeOutMerchantPrearbitration: JsonValue, - private val timeOutRepresentment: JsonValue, - private val timeOutUserPrearbitration: JsonValue, + private val timeOutChargeback: JsonField, + private val timeOutMerchantPrearbitration: JsonField, + private val timeOutRepresentment: JsonField, + private val timeOutUserPrearbitration: JsonField, private val additionalProperties: MutableMap, ) { @@ -657,32 +657,36 @@ private constructor( @JsonProperty("action") @ExcludeMissing action: JsonField = JsonMissing.of(), @JsonProperty("accept_chargeback") @ExcludeMissing - acceptChargeback: JsonValue = JsonMissing.of(), + acceptChargeback: JsonField = JsonMissing.of(), @JsonProperty("accept_user_submission") @ExcludeMissing - acceptUserSubmission: JsonValue = JsonMissing.of(), + acceptUserSubmission: JsonField = JsonMissing.of(), @JsonProperty("decline_user_prearbitration") @ExcludeMissing - declineUserPrearbitration: JsonValue = JsonMissing.of(), + declineUserPrearbitration: JsonField = JsonMissing.of(), @JsonProperty("receive_merchant_prearbitration") @ExcludeMissing - receiveMerchantPrearbitration: JsonValue = JsonMissing.of(), - @JsonProperty("represent") @ExcludeMissing represent: JsonValue = JsonMissing.of(), + receiveMerchantPrearbitration: JsonField = + JsonMissing.of(), + @JsonProperty("represent") + @ExcludeMissing + represent: JsonField = JsonMissing.of(), @JsonProperty("request_further_information") @ExcludeMissing requestFurtherInformation: JsonField = JsonMissing.of(), @JsonProperty("time_out_chargeback") @ExcludeMissing - timeOutChargeback: JsonValue = JsonMissing.of(), + timeOutChargeback: JsonField = JsonMissing.of(), @JsonProperty("time_out_merchant_prearbitration") @ExcludeMissing - timeOutMerchantPrearbitration: JsonValue = JsonMissing.of(), + timeOutMerchantPrearbitration: JsonField = + JsonMissing.of(), @JsonProperty("time_out_representment") @ExcludeMissing - timeOutRepresentment: JsonValue = JsonMissing.of(), + timeOutRepresentment: JsonField = JsonMissing.of(), @JsonProperty("time_out_user_prearbitration") @ExcludeMissing - timeOutUserPrearbitration: JsonValue = JsonMissing.of(), + timeOutUserPrearbitration: JsonField = JsonMissing.of(), ) : this( action, acceptChargeback, @@ -710,40 +714,51 @@ private constructor( /** * The parameters for accepting the chargeback. Required if and only if `action` is * `accept_chargeback`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("accept_chargeback") - @ExcludeMissing - fun _acceptChargeback(): JsonValue = acceptChargeback + fun acceptChargeback(): Optional = + acceptChargeback.getOptional("accept_chargeback") /** * The parameters for accepting the user submission. Required if and only if `action` is * `accept_user_submission`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("accept_user_submission") - @ExcludeMissing - fun _acceptUserSubmission(): JsonValue = acceptUserSubmission + fun acceptUserSubmission(): Optional = + acceptUserSubmission.getOptional("accept_user_submission") /** * The parameters for declining the prearbitration. Required if and only if `action` is * `decline_user_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("decline_user_prearbitration") - @ExcludeMissing - fun _declineUserPrearbitration(): JsonValue = declineUserPrearbitration + fun declineUserPrearbitration(): Optional = + declineUserPrearbitration.getOptional("decline_user_prearbitration") /** * The parameters for receiving the prearbitration. Required if and only if `action` is * `receive_merchant_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("receive_merchant_prearbitration") - @ExcludeMissing - fun _receiveMerchantPrearbitration(): JsonValue = receiveMerchantPrearbitration + fun receiveMerchantPrearbitration(): Optional = + receiveMerchantPrearbitration.getOptional("receive_merchant_prearbitration") /** * The parameters for re-presenting the dispute. Required if and only if `action` is * `represent`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("represent") @ExcludeMissing fun _represent(): JsonValue = represent + fun represent(): Optional = represent.getOptional("represent") /** * The parameters for requesting further information from the user. Required if and only if @@ -758,34 +773,42 @@ private constructor( /** * The parameters for timing out the chargeback. Required if and only if `action` is * `time_out_chargeback`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_chargeback") - @ExcludeMissing - fun _timeOutChargeback(): JsonValue = timeOutChargeback + fun timeOutChargeback(): Optional = + timeOutChargeback.getOptional("time_out_chargeback") /** * The parameters for timing out the merchant prearbitration. Required if and only if * `action` is `time_out_merchant_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_merchant_prearbitration") - @ExcludeMissing - fun _timeOutMerchantPrearbitration(): JsonValue = timeOutMerchantPrearbitration + fun timeOutMerchantPrearbitration(): Optional = + timeOutMerchantPrearbitration.getOptional("time_out_merchant_prearbitration") /** * The parameters for timing out the re-presentment. Required if and only if `action` is * `time_out_representment`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_representment") - @ExcludeMissing - fun _timeOutRepresentment(): JsonValue = timeOutRepresentment + fun timeOutRepresentment(): Optional = + timeOutRepresentment.getOptional("time_out_representment") /** * The parameters for timing out the user prearbitration. Required if and only if `action` * is `time_out_user_prearbitration`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("time_out_user_prearbitration") - @ExcludeMissing - fun _timeOutUserPrearbitration(): JsonValue = timeOutUserPrearbitration + fun timeOutUserPrearbitration(): Optional = + timeOutUserPrearbitration.getOptional("time_out_user_prearbitration") /** * Returns the raw JSON value of [action]. @@ -794,6 +817,57 @@ private constructor( */ @JsonProperty("action") @ExcludeMissing fun _action(): JsonField = action + /** + * Returns the raw JSON value of [acceptChargeback]. + * + * Unlike [acceptChargeback], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("accept_chargeback") + @ExcludeMissing + fun _acceptChargeback(): JsonField = acceptChargeback + + /** + * Returns the raw JSON value of [acceptUserSubmission]. + * + * Unlike [acceptUserSubmission], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("accept_user_submission") + @ExcludeMissing + fun _acceptUserSubmission(): JsonField = acceptUserSubmission + + /** + * Returns the raw JSON value of [declineUserPrearbitration]. + * + * Unlike [declineUserPrearbitration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("decline_user_prearbitration") + @ExcludeMissing + fun _declineUserPrearbitration(): JsonField = + declineUserPrearbitration + + /** + * Returns the raw JSON value of [receiveMerchantPrearbitration]. + * + * Unlike [receiveMerchantPrearbitration], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("receive_merchant_prearbitration") + @ExcludeMissing + fun _receiveMerchantPrearbitration(): JsonField = + receiveMerchantPrearbitration + + /** + * Returns the raw JSON value of [represent]. + * + * Unlike [represent], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("represent") + @ExcludeMissing + fun _represent(): JsonField = represent + /** * Returns the raw JSON value of [requestFurtherInformation]. * @@ -805,6 +879,48 @@ private constructor( fun _requestFurtherInformation(): JsonField = requestFurtherInformation + /** + * Returns the raw JSON value of [timeOutChargeback]. + * + * Unlike [timeOutChargeback], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("time_out_chargeback") + @ExcludeMissing + fun _timeOutChargeback(): JsonField = timeOutChargeback + + /** + * Returns the raw JSON value of [timeOutMerchantPrearbitration]. + * + * Unlike [timeOutMerchantPrearbitration], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("time_out_merchant_prearbitration") + @ExcludeMissing + fun _timeOutMerchantPrearbitration(): JsonField = + timeOutMerchantPrearbitration + + /** + * Returns the raw JSON value of [timeOutRepresentment]. + * + * Unlike [timeOutRepresentment], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("time_out_representment") + @ExcludeMissing + fun _timeOutRepresentment(): JsonField = timeOutRepresentment + + /** + * Returns the raw JSON value of [timeOutUserPrearbitration]. + * + * Unlike [timeOutUserPrearbitration], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("time_out_user_prearbitration") + @ExcludeMissing + fun _timeOutUserPrearbitration(): JsonField = + timeOutUserPrearbitration + @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -834,17 +950,21 @@ private constructor( class Builder internal constructor() { private var action: JsonField? = null - private var acceptChargeback: JsonValue = JsonMissing.of() - private var acceptUserSubmission: JsonValue = JsonMissing.of() - private var declineUserPrearbitration: JsonValue = JsonMissing.of() - private var receiveMerchantPrearbitration: JsonValue = JsonMissing.of() - private var represent: JsonValue = JsonMissing.of() + private var acceptChargeback: JsonField = JsonMissing.of() + private var acceptUserSubmission: JsonField = JsonMissing.of() + private var declineUserPrearbitration: JsonField = + JsonMissing.of() + private var receiveMerchantPrearbitration: JsonField = + JsonMissing.of() + private var represent: JsonField = JsonMissing.of() private var requestFurtherInformation: JsonField = JsonMissing.of() - private var timeOutChargeback: JsonValue = JsonMissing.of() - private var timeOutMerchantPrearbitration: JsonValue = JsonMissing.of() - private var timeOutRepresentment: JsonValue = JsonMissing.of() - private var timeOutUserPrearbitration: JsonValue = JsonMissing.of() + private var timeOutChargeback: JsonField = JsonMissing.of() + private var timeOutMerchantPrearbitration: JsonField = + JsonMissing.of() + private var timeOutRepresentment: JsonField = JsonMissing.of() + private var timeOutUserPrearbitration: JsonField = + JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -882,7 +1002,17 @@ private constructor( * The parameters for accepting the chargeback. Required if and only if `action` is * `accept_chargeback`. */ - fun acceptChargeback(acceptChargeback: JsonValue) = apply { + fun acceptChargeback(acceptChargeback: AcceptChargeback) = + acceptChargeback(JsonField.of(acceptChargeback)) + + /** + * Sets [Builder.acceptChargeback] to an arbitrary JSON value. + * + * You should usually call [Builder.acceptChargeback] with a well-typed + * [AcceptChargeback] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun acceptChargeback(acceptChargeback: JsonField) = apply { this.acceptChargeback = acceptChargeback } @@ -890,31 +1020,72 @@ private constructor( * The parameters for accepting the user submission. Required if and only if `action` is * `accept_user_submission`. */ - fun acceptUserSubmission(acceptUserSubmission: JsonValue) = apply { - this.acceptUserSubmission = acceptUserSubmission - } + fun acceptUserSubmission(acceptUserSubmission: AcceptUserSubmission) = + acceptUserSubmission(JsonField.of(acceptUserSubmission)) + + /** + * Sets [Builder.acceptUserSubmission] to an arbitrary JSON value. + * + * You should usually call [Builder.acceptUserSubmission] with a well-typed + * [AcceptUserSubmission] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun acceptUserSubmission(acceptUserSubmission: JsonField) = + apply { + this.acceptUserSubmission = acceptUserSubmission + } /** * The parameters for declining the prearbitration. Required if and only if `action` is * `decline_user_prearbitration`. */ - fun declineUserPrearbitration(declineUserPrearbitration: JsonValue) = apply { - this.declineUserPrearbitration = declineUserPrearbitration - } + fun declineUserPrearbitration(declineUserPrearbitration: DeclineUserPrearbitration) = + declineUserPrearbitration(JsonField.of(declineUserPrearbitration)) + + /** + * Sets [Builder.declineUserPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.declineUserPrearbitration] with a well-typed + * [DeclineUserPrearbitration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun declineUserPrearbitration( + declineUserPrearbitration: JsonField + ) = apply { this.declineUserPrearbitration = declineUserPrearbitration } /** * The parameters for receiving the prearbitration. Required if and only if `action` is * `receive_merchant_prearbitration`. */ - fun receiveMerchantPrearbitration(receiveMerchantPrearbitration: JsonValue) = apply { - this.receiveMerchantPrearbitration = receiveMerchantPrearbitration - } + fun receiveMerchantPrearbitration( + receiveMerchantPrearbitration: ReceiveMerchantPrearbitration + ) = receiveMerchantPrearbitration(JsonField.of(receiveMerchantPrearbitration)) + + /** + * Sets [Builder.receiveMerchantPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.receiveMerchantPrearbitration] with a well-typed + * [ReceiveMerchantPrearbitration] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun receiveMerchantPrearbitration( + receiveMerchantPrearbitration: JsonField + ) = apply { this.receiveMerchantPrearbitration = receiveMerchantPrearbitration } /** * The parameters for re-presenting the dispute. Required if and only if `action` is * `represent`. */ - fun represent(represent: JsonValue) = apply { this.represent = represent } + fun represent(represent: Represent) = represent(JsonField.of(represent)) + + /** + * Sets [Builder.represent] to an arbitrary JSON value. + * + * You should usually call [Builder.represent] with a well-typed [Represent] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun represent(represent: JsonField) = apply { this.represent = represent } /** * The parameters for requesting further information from the user. Required if and only @@ -938,7 +1109,17 @@ private constructor( * The parameters for timing out the chargeback. Required if and only if `action` is * `time_out_chargeback`. */ - fun timeOutChargeback(timeOutChargeback: JsonValue) = apply { + fun timeOutChargeback(timeOutChargeback: TimeOutChargeback) = + timeOutChargeback(JsonField.of(timeOutChargeback)) + + /** + * Sets [Builder.timeOutChargeback] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutChargeback] with a well-typed + * [TimeOutChargeback] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun timeOutChargeback(timeOutChargeback: JsonField) = apply { this.timeOutChargeback = timeOutChargeback } @@ -946,25 +1127,57 @@ private constructor( * The parameters for timing out the merchant prearbitration. Required if and only if * `action` is `time_out_merchant_prearbitration`. */ - fun timeOutMerchantPrearbitration(timeOutMerchantPrearbitration: JsonValue) = apply { - this.timeOutMerchantPrearbitration = timeOutMerchantPrearbitration - } + fun timeOutMerchantPrearbitration( + timeOutMerchantPrearbitration: TimeOutMerchantPrearbitration + ) = timeOutMerchantPrearbitration(JsonField.of(timeOutMerchantPrearbitration)) + + /** + * Sets [Builder.timeOutMerchantPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutMerchantPrearbitration] with a well-typed + * [TimeOutMerchantPrearbitration] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun timeOutMerchantPrearbitration( + timeOutMerchantPrearbitration: JsonField + ) = apply { this.timeOutMerchantPrearbitration = timeOutMerchantPrearbitration } /** * The parameters for timing out the re-presentment. Required if and only if `action` is * `time_out_representment`. */ - fun timeOutRepresentment(timeOutRepresentment: JsonValue) = apply { - this.timeOutRepresentment = timeOutRepresentment - } + fun timeOutRepresentment(timeOutRepresentment: TimeOutRepresentment) = + timeOutRepresentment(JsonField.of(timeOutRepresentment)) + + /** + * Sets [Builder.timeOutRepresentment] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutRepresentment] with a well-typed + * [TimeOutRepresentment] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun timeOutRepresentment(timeOutRepresentment: JsonField) = + apply { + this.timeOutRepresentment = timeOutRepresentment + } /** * The parameters for timing out the user prearbitration. Required if and only if * `action` is `time_out_user_prearbitration`. */ - fun timeOutUserPrearbitration(timeOutUserPrearbitration: JsonValue) = apply { - this.timeOutUserPrearbitration = timeOutUserPrearbitration - } + fun timeOutUserPrearbitration(timeOutUserPrearbitration: TimeOutUserPrearbitration) = + timeOutUserPrearbitration(JsonField.of(timeOutUserPrearbitration)) + + /** + * Sets [Builder.timeOutUserPrearbitration] to an arbitrary JSON value. + * + * You should usually call [Builder.timeOutUserPrearbitration] with a well-typed + * [TimeOutUserPrearbitration] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun timeOutUserPrearbitration( + timeOutUserPrearbitration: JsonField + ) = apply { this.timeOutUserPrearbitration = timeOutUserPrearbitration } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1022,7 +1235,16 @@ private constructor( } action().validate() + acceptChargeback().ifPresent { it.validate() } + acceptUserSubmission().ifPresent { it.validate() } + declineUserPrearbitration().ifPresent { it.validate() } + receiveMerchantPrearbitration().ifPresent { it.validate() } + represent().ifPresent { it.validate() } requestFurtherInformation().ifPresent { it.validate() } + timeOutChargeback().ifPresent { it.validate() } + timeOutMerchantPrearbitration().ifPresent { it.validate() } + timeOutRepresentment().ifPresent { it.validate() } + timeOutUserPrearbitration().ifPresent { it.validate() } validated = true } @@ -1043,7 +1265,16 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (action.asKnown().getOrNull()?.validity() ?: 0) + - (requestFurtherInformation.asKnown().getOrNull()?.validity() ?: 0) + (acceptChargeback.asKnown().getOrNull()?.validity() ?: 0) + + (acceptUserSubmission.asKnown().getOrNull()?.validity() ?: 0) + + (declineUserPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (receiveMerchantPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (represent.asKnown().getOrNull()?.validity() ?: 0) + + (requestFurtherInformation.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutChargeback.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutMerchantPrearbitration.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutRepresentment.asKnown().getOrNull()?.validity() ?: 0) + + (timeOutUserPrearbitration.asKnown().getOrNull()?.validity() ?: 0) /** * The action to take. Details specific to the action are required under the sub-object with @@ -1349,36 +1580,14 @@ private constructor( } /** - * The parameters for requesting further information from the user. Required if and only if - * `action` is `request_further_information`. + * The parameters for accepting the chargeback. Required if and only if `action` is + * `accept_chargeback`. */ - class RequestFurtherInformation + class AcceptChargeback @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val reason: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() - ) : this(reason, mutableMapOf()) - - /** - * The reason for requesting further information from the user. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). - */ - fun reason(): String = reason.getRequired("reason") + private constructor(private val additionalProperties: MutableMap) { - /** - * 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 + @JsonCreator private constructor() : this(mutableMapOf()) @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -1394,43 +1603,20 @@ private constructor( companion object { - /** - * Returns a mutable builder for constructing an instance of - * [RequestFurtherInformation]. - * - * The following fields are required: - * ```java - * .reason() - * ``` - */ + /** Returns a mutable builder for constructing an instance of [AcceptChargeback]. */ @JvmStatic fun builder() = Builder() } - /** A builder for [RequestFurtherInformation]. */ + /** A builder for [AcceptChargeback]. */ class Builder internal constructor() { - private var reason: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(requestFurtherInformation: RequestFurtherInformation) = apply { - reason = requestFurtherInformation.reason - additionalProperties = - requestFurtherInformation.additionalProperties.toMutableMap() + internal fun from(acceptChargeback: AcceptChargeback) = apply { + additionalProperties = acceptChargeback.additionalProperties.toMutableMap() } - /** The reason for requesting further information from the user. */ - fun reason(reason: String) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [String] 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) @@ -1454,32 +1640,21 @@ private constructor( } /** - * Returns an immutable instance of [RequestFurtherInformation]. + * Returns an immutable instance of [AcceptChargeback]. * * Further updates to this [Builder] will not mutate the returned instance. - * - * The following fields are required: - * ```java - * .reason() - * ``` - * - * @throws IllegalStateException if any required field is unset. */ - fun build(): RequestFurtherInformation = - RequestFurtherInformation( - checkRequired("reason", reason), - additionalProperties.toMutableMap(), - ) + fun build(): AcceptChargeback = + AcceptChargeback(additionalProperties.toMutableMap()) } private var validated: Boolean = false - fun validate(): RequestFurtherInformation = apply { + fun validate(): AcceptChargeback = apply { if (validated) { return@apply } - reason() validated = true } @@ -1497,24 +1672,1108 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = (if (reason.asKnown().isPresent) 1 else 0) + @JvmSynthetic internal fun validity(): Int = 0 override fun equals(other: Any?): Boolean { if (this === other) { return true } - return other is RequestFurtherInformation && - reason == other.reason && + return other is AcceptChargeback && additionalProperties == other.additionalProperties } - private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } override fun hashCode(): Int = hashCode - override fun toString() = - "RequestFurtherInformation{reason=$reason, additionalProperties=$additionalProperties}" + override fun toString() = "AcceptChargeback{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for accepting the user submission. Required if and only if `action` is + * `accept_user_submission`. + */ + class AcceptUserSubmission + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [AcceptUserSubmission]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AcceptUserSubmission]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(acceptUserSubmission: AcceptUserSubmission) = apply { + additionalProperties = acceptUserSubmission.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 [AcceptUserSubmission]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): AcceptUserSubmission = + AcceptUserSubmission(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): AcceptUserSubmission = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AcceptUserSubmission && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AcceptUserSubmission{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for declining the prearbitration. Required if and only if `action` is + * `decline_user_prearbitration`. + */ + class DeclineUserPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [DeclineUserPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DeclineUserPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(declineUserPrearbitration: DeclineUserPrearbitration) = apply { + additionalProperties = + declineUserPrearbitration.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 [DeclineUserPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): DeclineUserPrearbitration = + DeclineUserPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): DeclineUserPrearbitration = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DeclineUserPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DeclineUserPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for receiving the prearbitration. Required if and only if `action` is + * `receive_merchant_prearbitration`. + */ + class ReceiveMerchantPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [ReceiveMerchantPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [ReceiveMerchantPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(receiveMerchantPrearbitration: ReceiveMerchantPrearbitration) = + apply { + additionalProperties = + receiveMerchantPrearbitration.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 [ReceiveMerchantPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): ReceiveMerchantPrearbitration = + ReceiveMerchantPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): ReceiveMerchantPrearbitration = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ReceiveMerchantPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "ReceiveMerchantPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for re-presenting the dispute. Required if and only if `action` is + * `represent`. + */ + class Represent + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Represent]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Represent]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(represent: Represent) = apply { + additionalProperties = represent.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 [Represent]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Represent = Represent(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Represent = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Represent && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Represent{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for requesting further information from the user. Required if and only if + * `action` is `request_further_information`. + */ + class RequestFurtherInformation + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() + ) : this(reason, mutableMapOf()) + + /** + * The reason for requesting further information from the user. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun reason(): String = reason.getRequired("reason") + + /** + * 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 + * [RequestFurtherInformation]. + * + * The following fields are required: + * ```java + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [RequestFurtherInformation]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(requestFurtherInformation: RequestFurtherInformation) = apply { + reason = requestFurtherInformation.reason + additionalProperties = + requestFurtherInformation.additionalProperties.toMutableMap() + } + + /** The reason for requesting further information from the user. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [String] 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 [RequestFurtherInformation]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): RequestFurtherInformation = + RequestFurtherInformation( + checkRequired("reason", reason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): RequestFurtherInformation = apply { + if (validated) { + return@apply + } + + reason() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 (reason.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is RequestFurtherInformation && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "RequestFurtherInformation{reason=$reason, additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the chargeback. Required if and only if `action` is + * `time_out_chargeback`. + */ + class TimeOutChargeback + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [TimeOutChargeback]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutChargeback]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutChargeback: TimeOutChargeback) = apply { + additionalProperties = timeOutChargeback.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 [TimeOutChargeback]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutChargeback = + TimeOutChargeback(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutChargeback = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutChargeback && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutChargeback{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the merchant prearbitration. Required if and only if + * `action` is `time_out_merchant_prearbitration`. + */ + class TimeOutMerchantPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [TimeOutMerchantPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutMerchantPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutMerchantPrearbitration: TimeOutMerchantPrearbitration) = + apply { + additionalProperties = + timeOutMerchantPrearbitration.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 [TimeOutMerchantPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutMerchantPrearbitration = + TimeOutMerchantPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutMerchantPrearbitration = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutMerchantPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutMerchantPrearbitration{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the re-presentment. Required if and only if `action` is + * `time_out_representment`. + */ + class TimeOutRepresentment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [TimeOutRepresentment]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutRepresentment]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutRepresentment: TimeOutRepresentment) = apply { + additionalProperties = timeOutRepresentment.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 [TimeOutRepresentment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutRepresentment = + TimeOutRepresentment(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutRepresentment = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutRepresentment && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutRepresentment{additionalProperties=$additionalProperties}" + } + + /** + * The parameters for timing out the user prearbitration. Required if and only if `action` + * is `time_out_user_prearbitration`. + */ + class TimeOutUserPrearbitration + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 + * [TimeOutUserPrearbitration]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TimeOutUserPrearbitration]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(timeOutUserPrearbitration: TimeOutUserPrearbitration) = apply { + additionalProperties = + timeOutUserPrearbitration.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 [TimeOutUserPrearbitration]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): TimeOutUserPrearbitration = + TimeOutUserPrearbitration(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): TimeOutUserPrearbitration = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TimeOutUserPrearbitration && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TimeOutUserPrearbitration{additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt index 5be99a9d5..2fa22e28a 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/transactions/Transaction.kt @@ -903,7 +903,7 @@ private constructor( private val inboundWireTransferReversal: JsonField, private val interestPayment: JsonField, private val internalSource: JsonField, - private val other: JsonValue, + private val other: JsonField, private val realTimePaymentsTransferAcknowledgement: JsonField, private val sampleFunds: JsonField, @@ -1014,7 +1014,7 @@ private constructor( @JsonProperty("internal_source") @ExcludeMissing internalSource: JsonField = JsonMissing.of(), - @JsonProperty("other") @ExcludeMissing other: JsonValue = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), @JsonProperty("real_time_payments_transfer_acknowledgement") @ExcludeMissing realTimePaymentsTransferAcknowledgement: @@ -1442,8 +1442,11 @@ private constructor( /** * If the category of this Transaction source is equal to `other`, this field will contain * an empty object, otherwise it will contain null. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). */ - @JsonProperty("other") @ExcludeMissing fun _other(): JsonValue = other + fun other(): Optional = other.getOptional("other") /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in the @@ -1817,6 +1820,13 @@ private constructor( @ExcludeMissing fun _internalSource(): JsonField = internalSource + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + /** * Returns the raw JSON value of [realTimePaymentsTransferAcknowledgement]. * @@ -1972,7 +1982,7 @@ private constructor( private var inboundWireTransferReversal: JsonField? = null private var interestPayment: JsonField? = null private var internalSource: JsonField? = null - private var other: JsonValue? = null + private var other: JsonField? = null private var realTimePaymentsTransferAcknowledgement: JsonField? = null @@ -2873,7 +2883,19 @@ private constructor( * If the category of this Transaction source is equal to `other`, this field will * contain an empty object, otherwise it will contain null. */ - fun other(other: JsonValue) = apply { this.other = other } + fun other(other: Other?) = other(JsonField.ofNullable(other)) + + /** Alias for calling [Builder.other] with `other.orElse(null)`. */ + fun other(other: Optional) = other(other.getOrNull()) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun other(other: JsonField) = apply { this.other = other } /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in @@ -3181,6 +3203,7 @@ private constructor( inboundWireTransferReversal().ifPresent { it.validate() } interestPayment().ifPresent { it.validate() } internalSource().ifPresent { it.validate() } + other().ifPresent { it.validate() } realTimePaymentsTransferAcknowledgement().ifPresent { it.validate() } sampleFunds().ifPresent { it.validate() } swiftTransferIntention().ifPresent { it.validate() } @@ -3237,6 +3260,7 @@ private constructor( (inboundWireTransferReversal.asKnown().getOrNull()?.validity() ?: 0) + (interestPayment.asKnown().getOrNull()?.validity() ?: 0) + (internalSource.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + (realTimePaymentsTransferAcknowledgement.asKnown().getOrNull()?.validity() ?: 0) + (sampleFunds.asKnown().getOrNull()?.validity() ?: 0) + (swiftTransferIntention.asKnown().getOrNull()?.validity() ?: 0) + @@ -12591,7 +12615,7 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val category: JsonField, - private val pulse: JsonValue, + private val pulse: JsonField, private val visa: JsonField, private val additionalProperties: MutableMap, ) { @@ -12601,7 +12625,9 @@ private constructor( @JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(), - @JsonProperty("pulse") @ExcludeMissing pulse: JsonValue = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), ) : this(category, pulse, visa, mutableMapOf()) @@ -12614,8 +12640,13 @@ private constructor( */ fun category(): Category = category.getRequired("category") - /** Fields specific to the `pulse` network. */ - @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonValue = pulse + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") /** * Fields specific to the `visa` network. @@ -12635,6 +12666,14 @@ private constructor( @ExcludeMissing fun _category(): JsonField = category + /** + * Returns the raw JSON value of [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + /** * Returns the raw JSON value of [visa]. * @@ -12674,7 +12713,7 @@ private constructor( class Builder internal constructor() { private var category: JsonField? = null - private var pulse: JsonValue? = null + private var pulse: JsonField? = null private var visa: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -12699,7 +12738,19 @@ private constructor( fun category(category: JsonField) = apply { this.category = category } /** Fields specific to the `pulse` network. */ - fun pulse(pulse: JsonValue) = apply { this.pulse = pulse } + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } /** Fields specific to the `visa` network. */ fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) @@ -12769,6 +12820,7 @@ private constructor( } category().validate() + pulse().ifPresent { it.validate() } visa().ifPresent { it.validate() } validated = true } @@ -12790,6 +12842,7 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (category.asKnown().getOrNull()?.validity() ?: 0) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + (visa.asKnown().getOrNull()?.validity() ?: 0) /** The payment network used to process this card authorization. */ @@ -12934,6 +12987,115 @@ private constructor( override fun toString() = value.toString() } + /** Fields specific to the `pulse` network. */ + class Pulse + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + /** Fields specific to the `visa` network. */ class Visa @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -47714,6 +47876,115 @@ private constructor( "InternalSource{amount=$amount, currency=$currency, reason=$reason, additionalProperties=$additionalProperties}" } + /** + * If the category of this Transaction source is equal to `other`, this field will contain + * an empty object, otherwise it will contain null. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @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 [Other]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + additionalProperties = other.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 [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Other = Other(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + 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 = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Other{additionalProperties=$additionalProperties}" + } + /** * A Real-Time Payments Transfer Acknowledgement object. This field will be present in the * JSON response if and only if `category` is equal to diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt index ede600b58..8dead8032 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeCreateParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.carddisputes -import com.increase.api.core.JsonValue import java.time.LocalDate import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -64,7 +63,11 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise.NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -159,8 +162,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -191,7 +202,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise .ReturnAttempted @@ -242,7 +258,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation .ReturnAttempted @@ -363,7 +384,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived .Delayed @@ -397,10 +424,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa.ConsumerOriginalCreditTransactionNotAccepted .builder() @@ -428,7 +462,11 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise.NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -594,7 +632,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -702,7 +745,12 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -802,8 +850,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -837,7 +893,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -893,7 +955,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -1018,7 +1086,14 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -1056,10 +1131,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -1088,7 +1170,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -1255,7 +1342,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -1363,7 +1455,11 @@ internal class CardDisputeCreateParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise.NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -1458,8 +1554,16 @@ internal class CardDisputeCreateParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1490,7 +1594,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerDamagedOrDefectiveMerchandise .ReturnAttempted @@ -1541,7 +1650,12 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseMisrepresentation .ReturnAttempted @@ -1662,7 +1776,13 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived .Delayed @@ -1696,10 +1816,17 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder().build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa.ConsumerOriginalCreditTransactionNotAccepted .builder() @@ -1727,7 +1854,11 @@ internal class CardDisputeCreateParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise.NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -1893,7 +2024,12 @@ internal class CardDisputeCreateParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt index a83b17476..9b87a2a8c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.carddisputes import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -47,15 +46,30 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted + .builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted + .builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut + .builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent @@ -165,7 +179,10 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -206,7 +223,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -244,21 +266,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() ) .userWithdrawalSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) .build() ) @@ -335,7 +372,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -488,7 +530,14 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission @@ -498,7 +547,12 @@ internal class CardDisputeListPageResponseTest { .GUARANTEED_RESERVATION ) .timeshare( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() ) .build() ) @@ -540,7 +594,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -621,7 +680,12 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -788,9 +852,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from( - mapOf() - ) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -873,14 +941,24 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -908,7 +986,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission @@ -1174,7 +1257,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -1340,15 +1428,27 @@ internal class CardDisputeListPageResponseTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -1457,7 +1557,9 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -1497,7 +1599,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -1535,20 +1642,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) .build() ) .requiredUserSubmissionCategory(null) @@ -1618,7 +1741,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -1757,7 +1884,13 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -1765,7 +1898,13 @@ internal class CardDisputeListPageResponseTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1803,7 +1942,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -1878,7 +2021,11 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -2031,7 +2178,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -2110,14 +2263,23 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2143,7 +2305,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback @@ -2390,7 +2556,11 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -2553,15 +2723,30 @@ internal class CardDisputeListPageResponseTest { CardDispute.Visa.NetworkEvent.Category .CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted + .builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted + .builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut + .builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId( "dispute_financial_transaction_id" ) .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent @@ -2671,7 +2856,10 @@ internal class CardDisputeListPageResponseTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -2712,7 +2900,12 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2750,21 +2943,36 @@ internal class CardDisputeListPageResponseTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut + .builder() + .build() + ) .userPrearbitrationAccepted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() ) .userPrearbitrationDeclined( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() ) .userPrearbitrationSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .UserPrearbitrationSubmitted + .builder() + .build() ) .userPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() ) .userWithdrawalSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted + .builder() + .build() ) .build() ) @@ -2841,7 +3049,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt( @@ -2994,7 +3207,14 @@ internal class CardDisputeListPageResponseTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission @@ -3004,7 +3224,12 @@ internal class CardDisputeListPageResponseTest { .GUARANTEED_RESERVATION ) .timeshare( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() ) .build() ) @@ -3046,7 +3271,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() ) .orderAndIssueExplanation( "order_and_issue_explanation" @@ -3127,7 +3357,12 @@ internal class CardDisputeListPageResponseTest { "misrepresentation_explanation" ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) @@ -3294,9 +3529,13 @@ internal class CardDisputeListPageResponseTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from( - mapOf() - ) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -3379,14 +3618,24 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -3414,7 +3663,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() ) .ongoingNegotiations( CardDispute.Visa.UserSubmission @@ -3680,7 +3934,12 @@ internal class CardDisputeListPageResponseTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt index 168e4d71b..1e6673c95 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeSubmitUserSubmissionParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.carddisputes -import com.increase.api.core.JsonValue import java.time.LocalDate import kotlin.jvm.optionals.getOrNull import org.assertj.core.api.Assertions.assertThat @@ -87,7 +86,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -204,8 +209,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -244,7 +261,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -303,7 +326,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -446,7 +475,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -488,10 +525,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -524,7 +572,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -724,7 +778,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -913,7 +973,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -1034,8 +1100,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1074,7 +1152,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -1135,7 +1219,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -1282,7 +1372,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1324,10 +1422,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1360,7 +1469,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -1566,7 +1681,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -1740,7 +1861,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerCanceledMerchandise @@ -1857,8 +1984,20 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1897,7 +2036,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerDamagedOrDefectiveMerchandise @@ -1956,7 +2101,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerMerchandiseMisrepresentation @@ -2099,7 +2250,15 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -2141,10 +2300,21 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2177,7 +2347,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerQualityMerchandise @@ -2377,7 +2553,13 @@ internal class CardDisputeSubmitUserSubmissionParamsTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt index 9c1e82b54..35a842b36 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/carddisputes/CardDisputeTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.carddisputes import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -44,13 +43,25 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -159,7 +170,9 @@ internal class CardDisputeTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -198,7 +211,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -235,12 +253,34 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -306,7 +346,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -434,7 +480,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -442,7 +494,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -473,7 +531,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation( "order_and_issue_explanation" ) @@ -540,7 +604,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -678,7 +748,13 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -749,14 +825,23 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -781,7 +866,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -1005,7 +1096,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" @@ -1147,13 +1242,21 @@ internal class CardDisputeTest { .build() ) .category(CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder().build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder().build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder().build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -1252,7 +1355,11 @@ internal class CardDisputeTest { ) .build() ) - .merchantPrearbitrationTimedOut(JsonValue.from(mapOf())) + .merchantPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() + ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() .cardholderNoLongerDisputes( @@ -1290,7 +1397,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -1327,12 +1439,30 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted.builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined.builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted.builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut.builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -1395,7 +1525,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1519,7 +1655,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -1527,7 +1669,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1558,7 +1706,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation("order_and_issue_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1621,7 +1775,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -1755,7 +1915,12 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission.Chargeback @@ -1820,13 +1985,24 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1851,7 +2027,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -2067,7 +2249,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) @@ -2210,13 +2398,25 @@ internal class CardDisputeTest { .category( CardDispute.Visa.NetworkEvent.Category.CHARGEBACK_ACCEPTED ) - .chargebackAccepted(JsonValue.from(mapOf())) - .chargebackSubmitted(JsonValue.from(mapOf())) - .chargebackTimedOut(JsonValue.from(mapOf())) + .chargebackAccepted( + CardDispute.Visa.NetworkEvent.ChargebackAccepted.builder() + .build() + ) + .chargebackSubmitted( + CardDispute.Visa.NetworkEvent.ChargebackSubmitted.builder() + .build() + ) + .chargebackTimedOut( + CardDispute.Visa.NetworkEvent.ChargebackTimedOut.builder() + .build() + ) .createdAt(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .disputeFinancialTransactionId("dispute_financial_transaction_id") .merchantPrearbitrationDeclineSubmitted( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent + .MerchantPrearbitrationDeclineSubmitted + .builder() + .build() ) .merchantPrearbitrationReceived( CardDispute.Visa.NetworkEvent.MerchantPrearbitrationReceived @@ -2325,7 +2525,9 @@ internal class CardDisputeTest { .build() ) .merchantPrearbitrationTimedOut( - JsonValue.from(mapOf()) + CardDispute.Visa.NetworkEvent.MerchantPrearbitrationTimedOut + .builder() + .build() ) .represented( CardDispute.Visa.NetworkEvent.Represented.builder() @@ -2364,7 +2566,12 @@ internal class CardDisputeTest { ) .build() ) - .nonFiatCurrencyOrNonFungibleTokenAsDescribed(null) + .nonFiatCurrencyOrNonFungibleTokenAsDescribed( + CardDispute.Visa.NetworkEvent.Represented + .NonFiatCurrencyOrNonFungibleTokenAsDescribed + .builder() + .build() + ) .nonFiatCurrencyOrNonFungibleTokenReceived( CardDispute.Visa.NetworkEvent.Represented .NonFiatCurrencyOrNonFungibleTokenReceived @@ -2401,12 +2608,34 @@ internal class CardDisputeTest { ) .build() ) - .representmentTimedOut(JsonValue.from(mapOf())) - .userPrearbitrationAccepted(JsonValue.from(mapOf())) - .userPrearbitrationDeclined(JsonValue.from(mapOf())) - .userPrearbitrationSubmitted(JsonValue.from(mapOf())) - .userPrearbitrationTimedOut(JsonValue.from(mapOf())) - .userWithdrawalSubmitted(JsonValue.from(mapOf())) + .representmentTimedOut( + CardDispute.Visa.NetworkEvent.RepresentmentTimedOut.builder() + .build() + ) + .userPrearbitrationAccepted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationAccepted + .builder() + .build() + ) + .userPrearbitrationDeclined( + CardDispute.Visa.NetworkEvent.UserPrearbitrationDeclined + .builder() + .build() + ) + .userPrearbitrationSubmitted( + CardDispute.Visa.NetworkEvent.UserPrearbitrationSubmitted + .builder() + .build() + ) + .userPrearbitrationTimedOut( + CardDispute.Visa.NetworkEvent.UserPrearbitrationTimedOut + .builder() + .build() + ) + .userWithdrawalSubmitted( + CardDispute.Visa.NetworkEvent.UserWithdrawalSubmitted.builder() + .build() + ) .build() ) .requiredUserSubmissionCategory(null) @@ -2472,7 +2701,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedOrExpectedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -2600,7 +2835,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .other(JsonValue.from(mapOf())) + .other( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .serviceType( CardDispute.Visa.UserSubmission.Chargeback @@ -2608,7 +2849,13 @@ internal class CardDisputeTest { .ServiceType .GUARANTEED_RESERVATION ) - .timeshare(JsonValue.from(mapOf())) + .timeshare( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -2639,7 +2886,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .orderAndIssueExplanation( "order_and_issue_explanation" ) @@ -2706,7 +2959,13 @@ internal class CardDisputeTest { .misrepresentationExplanation( "misrepresentation_explanation" ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .purchaseExplanation("purchase_explanation") .receivedAt(LocalDate.parse("2019-12-27")) .returnAttempted( @@ -2844,7 +3103,13 @@ internal class CardDisputeTest { .builder() .explanation("explanation") .notReturned( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDispute.Visa.UserSubmission @@ -2915,14 +3180,23 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" ) .build() ) - .consumerNonReceiptOfCash(null) + .consumerNonReceiptOfCash( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerNonReceiptOfCash + .builder() + .build() + ) .consumerOriginalCreditTransactionNotAccepted( CardDispute.Visa.UserSubmission.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -2947,7 +3221,13 @@ internal class CardDisputeTest { .MerchantResolutionAttempted .ATTEMPTED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDispute.Visa.UserSubmission.Chargeback .ConsumerQualityMerchandise @@ -3171,7 +3451,11 @@ internal class CardDisputeTest { .ATTEMPTED ) .noCancellation( - JsonValue.from(mapOf()) + CardDispute.Visa.UserSubmission.Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() ) .purchaseInfoAndExplanation( "purchase_info_and_explanation" diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 7421ddd9e..669bb9398 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.cardpayments import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -224,7 +223,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -471,7 +476,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -684,7 +695,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -1659,7 +1676,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -1743,7 +1766,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -1944,7 +1967,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -2191,7 +2220,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -2404,7 +2439,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -3379,7 +3420,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -3463,7 +3510,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -3664,7 +3711,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -3911,7 +3964,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -4124,7 +4183,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -5099,7 +5164,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -5183,7 +5254,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -5384,7 +5455,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -5631,7 +5708,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -5844,7 +5927,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -6819,7 +6908,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -6903,7 +6998,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -7129,7 +7224,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -7362,7 +7463,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -7569,7 +7675,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -8487,7 +8598,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -8568,7 +8685,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -8764,7 +8881,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -8997,7 +9120,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -9204,7 +9332,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -10122,7 +10255,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -10203,7 +10342,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -10399,7 +10538,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -10632,7 +10777,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -10839,7 +10989,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -11757,7 +11912,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -11838,7 +11999,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -12034,7 +12195,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -12267,7 +12434,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails .Visa @@ -12474,7 +12646,12 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -13392,7 +13569,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -13473,7 +13656,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -13708,7 +13891,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -13955,7 +14144,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -14168,7 +14363,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -15143,7 +15344,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -15227,7 +15434,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -15428,7 +15635,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -15675,7 +15888,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -15888,7 +16107,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -16863,7 +17088,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -16947,7 +17178,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -17148,7 +17379,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -17395,7 +17632,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -17608,7 +17851,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -18583,7 +18832,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -18667,7 +18922,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -18868,7 +19123,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization .NetworkDetails @@ -19115,7 +19376,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline .NetworkDetails @@ -19328,7 +19595,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial .NetworkDetails @@ -20303,7 +20576,13 @@ internal class CardPaymentListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation .NetworkDetails @@ -20387,7 +20666,7 @@ internal class CardPaymentListPageResponseTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index 279ce852c..6121a0077 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.cardpayments import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -207,7 +206,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -419,7 +423,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -607,7 +615,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -1466,7 +1479,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -1545,7 +1563,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -1731,7 +1749,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -1943,7 +1966,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -2131,7 +2158,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -2990,7 +3022,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -3069,7 +3106,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -3255,7 +3292,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -3467,7 +3509,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -3655,7 +3701,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -4514,7 +4565,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -4593,7 +4649,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -4779,7 +4835,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -4991,7 +5052,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -5179,7 +5244,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -6038,7 +6108,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -6117,7 +6192,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) @@ -6303,7 +6378,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -6490,7 +6569,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -6662,7 +6745,11 @@ internal class CardPaymentTest { CardPayment.Element.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() @@ -7441,7 +7528,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -7511,7 +7602,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -7673,7 +7764,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -7860,7 +7955,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -8032,7 +8131,11 @@ internal class CardPaymentTest { CardPayment.Element.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() @@ -8811,7 +8914,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -8881,7 +8988,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -9043,7 +9150,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -9230,7 +9341,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -9402,7 +9517,11 @@ internal class CardPaymentTest { CardPayment.Element.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() @@ -10181,7 +10300,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -10251,7 +10374,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -10413,7 +10536,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails.Visa .builder() @@ -10600,7 +10727,11 @@ internal class CardPaymentTest { .category( CardPayment.Element.CardDecline.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -10772,7 +10903,11 @@ internal class CardPaymentTest { CardPayment.Element.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails.Visa .builder() @@ -11551,7 +11686,11 @@ internal class CardPaymentTest { CardPayment.Element.CardValidation.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails.Visa .builder() @@ -11621,7 +11760,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) assertThat(cardPayment.physicalCardId()).isEmpty @@ -11836,7 +11975,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -12048,7 +12192,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -12236,7 +12384,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -13095,7 +13248,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -13174,7 +13332,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_AUTHORIZATION) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -13360,7 +13518,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -13572,7 +13735,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -13760,7 +13927,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -14619,7 +14791,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -14698,7 +14875,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_REVERSAL) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -14884,7 +15061,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -15096,7 +15278,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -15284,7 +15470,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -16143,7 +16334,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -16222,7 +16418,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_INCREMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), CardPayment.Element.builder() .cardAuthentication( @@ -16408,7 +16604,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardAuthorization.NetworkDetails .Visa @@ -16620,7 +16821,11 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardDecline.NetworkDetails.Visa .builder() @@ -16808,7 +17013,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardFinancial.NetworkDetails .Visa @@ -17667,7 +17877,12 @@ internal class CardPaymentTest { .Category .VISA ) - .pulse(null) + .pulse( + CardPayment.Element.CardValidation.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( CardPayment.Element.CardValidation.NetworkDetails .Visa @@ -17746,7 +17961,7 @@ internal class CardPaymentTest { ) .category(CardPayment.Element.Category.CARD_SETTLEMENT) .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) - .other(JsonValue.from(mapOf())) + .other(CardPayment.Element.Other.builder().build()) .build(), ) ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt index 8636c8089..e2eaccef2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.declinedtransactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -181,7 +180,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -348,7 +353,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -530,7 +535,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -690,7 +701,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -881,7 +892,13 @@ internal class DeclinedTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1048,7 +1065,7 @@ internal class DeclinedTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt index f0ece0416..d1a90ffac 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransactionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.declinedtransactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -155,7 +154,12 @@ internal class DeclinedTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa @@ -304,7 +308,7 @@ internal class DeclinedTransactionTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -457,7 +461,11 @@ internal class DeclinedTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails.Visa .builder() @@ -593,7 +601,7 @@ internal class DeclinedTransactionTest { .transferId("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr") .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") @@ -754,7 +762,12 @@ internal class DeclinedTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline.NetworkDetails .Visa @@ -903,7 +916,7 @@ internal class DeclinedTransactionTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt index a8ee512ba..363777e84 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/exports/ExportCreateParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.exports -import com.increase.api.core.JsonValue import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -84,7 +83,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() } @@ -163,7 +162,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() val body = params._body() @@ -245,7 +244,7 @@ internal class ExportCreateParamsTest { .programId("program_id") .build() ) - assertThat(body._vendorCsv()).isEqualTo(JsonValue.from(mapOf())) + assertThat(body.vendorCsv()).contains(ExportCreateParams.VendorCsv.builder().build()) } @Test diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt index 9e6ac9444..3cdb94983 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionListPageResponseTest.kt @@ -177,7 +177,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -342,7 +348,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -542,7 +548,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -695,7 +707,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -898,7 +910,13 @@ internal class PendingTransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -1063,7 +1081,7 @@ internal class PendingTransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt index a878ff0ef..c97894eea 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/pendingtransactions/PendingTransactionTest.kt @@ -168,7 +168,13 @@ internal class PendingTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -309,7 +315,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) @@ -491,7 +497,12 @@ internal class PendingTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization.NetworkDetails .Visa @@ -626,7 +637,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) @@ -816,7 +827,13 @@ internal class PendingTransactionTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -957,7 +974,7 @@ internal class PendingTransactionTest { .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0") .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 979293de1..8e4def789 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.realtimedecisions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat @@ -134,7 +133,11 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -183,7 +186,12 @@ internal class RealTimeDecisionTest { ) .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) @@ -375,7 +383,10 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse.builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -422,7 +433,12 @@ internal class RealTimeDecisionTest { .originalCardAuthorizationId("original_card_authorization_id") .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) @@ -622,7 +638,11 @@ internal class RealTimeDecisionTest { .category( RealTimeDecision.CardAuthorization.NetworkDetails.Category.VISA ) - .pulse(null) + .pulse( + RealTimeDecision.CardAuthorization.NetworkDetails.Pulse + .builder() + .build() + ) .visa( RealTimeDecision.CardAuthorization.NetworkDetails.Visa.builder() .electronicCommerceIndicator( @@ -671,7 +691,12 @@ internal class RealTimeDecisionTest { ) .build() ) - .initialAuthorization(JsonValue.from(mapOf())) + .initialAuthorization( + RealTimeDecision.CardAuthorization.RequestDetails + .InitialAuthorization + .builder() + .build() + ) .build() ) .settlementAmount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt index 01515703b..a41cc865b 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/cardauthorizations/CardAuthorizationCreateResponseTest.kt @@ -183,7 +183,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -350,7 +356,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -529,7 +535,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -692,7 +704,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -895,7 +907,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1055,7 +1073,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -1234,7 +1252,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -1387,7 +1411,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() @@ -1597,7 +1621,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + DeclinedTransaction.Source.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( DeclinedTransaction.Source.CardDecline .NetworkDetails @@ -1764,7 +1794,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(DeclinedTransaction.Source.Other.builder().build()) .wireDecline( DeclinedTransaction.Source.WireDecline.builder() .inboundWireTransferId( @@ -1943,7 +1973,13 @@ internal class CardAuthorizationCreateResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + PendingTransaction.Source.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) .visa( PendingTransaction.Source.CardAuthorization .NetworkDetails @@ -2106,7 +2142,7 @@ internal class CardAuthorizationCreateResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(PendingTransaction.Source.Other.builder().build()) .realTimePaymentsTransferInstruction( PendingTransaction.Source.RealTimePaymentsTransferInstruction .builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt index 736fbc976..57ddbcb56 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/simulations/carddisputes/CardDisputeActionParamsTest.kt @@ -2,7 +2,6 @@ package com.increase.api.models.simulations.carddisputes -import com.increase.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -16,20 +15,36 @@ internal class CardDisputeActionParamsTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder().build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder().build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) .build() @@ -57,20 +72,38 @@ internal class CardDisputeActionParamsTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) .build() @@ -82,20 +115,36 @@ internal class CardDisputeActionParamsTest { .contains( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder().build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder().build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder().build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder().build() + ) .build() ) } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt index 2a11ab0ad..722a057c6 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionListPageResponseTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.transactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -232,7 +231,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa @@ -1087,7 +1091,7 @@ internal class TransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement .builder() @@ -1329,7 +1333,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -2138,7 +2147,7 @@ internal class TransactionListPageResponseTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -2401,7 +2410,12 @@ internal class TransactionListPageResponseTest { .Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails + .Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails .Visa @@ -3256,7 +3270,7 @@ internal class TransactionListPageResponseTest { ) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement .builder() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt index a92d8f924..390d1623e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/transactions/TransactionTest.kt @@ -3,7 +3,6 @@ package com.increase.api.models.transactions import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import com.increase.api.core.JsonValue import com.increase.api.core.jsonMapper import java.time.LocalDate import java.time.OffsetDateTime @@ -204,7 +203,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -974,7 +977,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -1193,7 +1196,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -1920,7 +1927,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) @@ -2150,7 +2157,11 @@ internal class TransactionTest { Transaction.Source.CardFinancial.NetworkDetails.Category .VISA ) - .pulse(null) + .pulse( + Transaction.Source.CardFinancial.NetworkDetails.Pulse + .builder() + .build() + ) .visa( Transaction.Source.CardFinancial.NetworkDetails.Visa .builder() @@ -2920,7 +2931,7 @@ internal class TransactionTest { .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS) .build() ) - .other(JsonValue.from(mapOf())) + .other(Transaction.Source.Other.builder().build()) .realTimePaymentsTransferAcknowledgement( Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder() .amount(100L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt index e1f0433b0..274501834 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/CardDisputeServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.carddisputes.CardDisputeCreateParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate @@ -79,7 +78,12 @@ internal class CardDisputeServiceAsyncTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -183,8 +187,17 @@ internal class CardDisputeServiceAsyncTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -219,7 +232,13 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -275,7 +294,13 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -406,7 +431,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -444,10 +476,18 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -476,7 +516,12 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -650,7 +695,12 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -832,7 +882,14 @@ internal class CardDisputeServiceAsyncTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -961,8 +1018,22 @@ internal class CardDisputeServiceAsyncTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -1003,7 +1074,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1068,7 +1146,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1227,7 +1312,13 @@ internal class CardDisputeServiceAsyncTest { .NOT_RETURNED ) .notReturned( - JsonValue.from(mapOf()) + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa @@ -1276,10 +1367,22 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1315,7 +1418,14 @@ internal class CardDisputeServiceAsyncTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1537,7 +1647,14 @@ internal class CardDisputeServiceAsyncTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt index 00fa22cd4..b044e39d9 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/ExportServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.exports.ExportCreateParams import java.time.LocalDate import java.time.OffsetDateTime @@ -97,7 +96,7 @@ internal class ExportServiceAsyncTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt index b24041d51..b5f7f18db 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/simulations/CardDisputeServiceAsyncTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.async.simulations import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClientAsync -import com.increase.api.core.JsonValue import com.increase.api.models.simulations.carddisputes.CardDisputeActionParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -29,20 +28,40 @@ internal class CardDisputeServiceAsyncTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder() + .build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder() + .build() + ) .build() ) .build() diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt index fdb0b5fb7..e4296d8d5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/CardDisputeServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.carddisputes.CardDisputeCreateParams import com.increase.api.models.carddisputes.CardDisputeSubmitUserSubmissionParams import java.time.LocalDate @@ -79,7 +78,12 @@ internal class CardDisputeServiceTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa.ConsumerCanceledMerchandise .ReturnAttempted @@ -183,8 +187,17 @@ internal class CardDisputeServiceTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeCreateParams.Visa.ConsumerCanceledServices.Other + .builder() + .build() + ) + .timeshare( + CardDisputeCreateParams.Visa.ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -219,7 +232,13 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerDamagedOrDefectiveMerchandise @@ -275,7 +294,13 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseMisrepresentation @@ -406,7 +431,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeCreateParams.Visa .ConsumerMerchandiseNotReceived @@ -444,10 +476,18 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeCreateParams.Visa.ConsumerNonReceiptOfCash.builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeCreateParams.Visa .ConsumerOriginalCreditTransactionNotAccepted @@ -476,7 +516,12 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeCreateParams.Visa.ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeCreateParams.Visa.ConsumerQualityMerchandise .OngoingNegotiations @@ -650,7 +695,12 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeCreateParams.Visa.ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( @@ -828,7 +878,14 @@ internal class CardDisputeServiceTest { .reason("x") .build() ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -957,8 +1014,22 @@ internal class CardDisputeServiceTest { ) .build() ) - .other(JsonValue.from(mapOf())) - .timeshare(JsonValue.from(mapOf())) + .other( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Other + .builder() + .build() + ) + .timeshare( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerCanceledServices + .Timeshare + .builder() + .build() + ) .build() ) .consumerCounterfeitMerchandise( @@ -999,7 +1070,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerDamagedOrDefectiveMerchandise + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1064,7 +1142,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseMisrepresentation + .NotReturned + .builder() + .build() + ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1223,7 +1308,13 @@ internal class CardDisputeServiceTest { .NOT_RETURNED ) .notReturned( - JsonValue.from(mapOf()) + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .Delayed + .NotReturned + .builder() + .build() ) .returnAttempted( CardDisputeSubmitUserSubmissionParams.Visa @@ -1272,10 +1363,22 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerMerchandiseNotReceived + .NoCancellation + .builder() + .build() + ) + .build() + ) + .consumerNonReceiptOfCash( + CardDisputeSubmitUserSubmissionParams.Visa.Chargeback + .ConsumerNonReceiptOfCash + .builder() .build() ) - .consumerNonReceiptOfCash(JsonValue.from(mapOf())) .consumerOriginalCreditTransactionNotAccepted( CardDisputeSubmitUserSubmissionParams.Visa.Chargeback .ConsumerOriginalCreditTransactionNotAccepted @@ -1311,7 +1414,14 @@ internal class CardDisputeServiceTest { .ReturnOutcome .NOT_RETURNED ) - .notReturned(JsonValue.from(mapOf())) + .notReturned( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerQualityMerchandise + .NotReturned + .builder() + .build() + ) .ongoingNegotiations( CardDisputeSubmitUserSubmissionParams.Visa .Chargeback @@ -1533,7 +1643,14 @@ internal class CardDisputeServiceTest { .canceledAt(LocalDate.parse("2019-12-27")) .build() ) - .noCancellation(JsonValue.from(mapOf())) + .noCancellation( + CardDisputeSubmitUserSubmissionParams.Visa + .Chargeback + .ConsumerServicesNotReceived + .NoCancellation + .builder() + .build() + ) .build() ) .fraud( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt index 35a5dae1c..c98cd80d1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/ExportServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.exports.ExportCreateParams import java.time.LocalDate import java.time.OffsetDateTime @@ -97,7 +96,7 @@ internal class ExportServiceTest { .programId("program_id") .build() ) - .vendorCsv(JsonValue.from(mapOf())) + .vendorCsv(ExportCreateParams.VendorCsv.builder().build()) .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt index bd0b3101d..fc3b5b8c1 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/simulations/CardDisputeServiceTest.kt @@ -4,7 +4,6 @@ package com.increase.api.services.blocking.simulations import com.increase.api.TestServerExtension import com.increase.api.client.okhttp.IncreaseOkHttpClient -import com.increase.api.core.JsonValue import com.increase.api.models.simulations.carddisputes.CardDisputeActionParams import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith @@ -29,20 +28,40 @@ internal class CardDisputeServiceTest { .visa( CardDisputeActionParams.Visa.builder() .action(CardDisputeActionParams.Visa.Action.ACCEPT_USER_SUBMISSION) - .acceptChargeback(JsonValue.from(mapOf())) - .acceptUserSubmission(JsonValue.from(mapOf())) - .declineUserPrearbitration(JsonValue.from(mapOf())) - .receiveMerchantPrearbitration(JsonValue.from(mapOf())) - .represent(JsonValue.from(mapOf())) + .acceptChargeback( + CardDisputeActionParams.Visa.AcceptChargeback.builder().build() + ) + .acceptUserSubmission( + CardDisputeActionParams.Visa.AcceptUserSubmission.builder().build() + ) + .declineUserPrearbitration( + CardDisputeActionParams.Visa.DeclineUserPrearbitration.builder() + .build() + ) + .receiveMerchantPrearbitration( + CardDisputeActionParams.Visa.ReceiveMerchantPrearbitration.builder() + .build() + ) + .represent(CardDisputeActionParams.Visa.Represent.builder().build()) .requestFurtherInformation( CardDisputeActionParams.Visa.RequestFurtherInformation.builder() .reason("x") .build() ) - .timeOutChargeback(JsonValue.from(mapOf())) - .timeOutMerchantPrearbitration(JsonValue.from(mapOf())) - .timeOutRepresentment(JsonValue.from(mapOf())) - .timeOutUserPrearbitration(JsonValue.from(mapOf())) + .timeOutChargeback( + CardDisputeActionParams.Visa.TimeOutChargeback.builder().build() + ) + .timeOutMerchantPrearbitration( + CardDisputeActionParams.Visa.TimeOutMerchantPrearbitration.builder() + .build() + ) + .timeOutRepresentment( + CardDisputeActionParams.Visa.TimeOutRepresentment.builder().build() + ) + .timeOutUserPrearbitration( + CardDisputeActionParams.Visa.TimeOutUserPrearbitration.builder() + .build() + ) .build() ) .build() From ce9afc5721b0ddcdb66620ac924f83c557982c23 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 31 Oct 2025 17:10:37 +0000 Subject: [PATCH 33/33] release: 0.348.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 37 +++++++++++++++++++++++++++++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 44 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index cb4cd84d3..1a931c1e0 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.347.0" + ".": "0.348.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 129577b90..0d84720d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # Changelog +## 0.348.0 (2025-10-31) + +Full Changelog: [v0.347.0...v0.348.0](https://github.com/Increase/increase-java/compare/v0.347.0...v0.348.0) + +### Features + +* **api:** api update ([5d1526d](https://github.com/Increase/increase-java/commit/5d1526d1629bb1dcbf40e3e09a921746c2927337)) +* **api:** api update ([c4c5a15](https://github.com/Increase/increase-java/commit/c4c5a15738430ba9fbd51e320cdbcd5db3060240)) +* **api:** api update ([d3025b1](https://github.com/Increase/increase-java/commit/d3025b144aa584b898034e04f7fc1cb53f0ed5de)) +* **api:** api update ([3b68ad7](https://github.com/Increase/increase-java/commit/3b68ad78944655bafdafdf3c0323652e11576841)) +* **api:** api update ([945eed1](https://github.com/Increase/increase-java/commit/945eed1c35b0d13b9f75b3a7830d0ead3f366db0)) +* **api:** api update ([d0e687c](https://github.com/Increase/increase-java/commit/d0e687c0f89f2a26f0a93a706ed365a906a1bfb9)) +* **api:** api update ([5803cda](https://github.com/Increase/increase-java/commit/5803cdab7196ff122cf8f9aedfaf89e3d33d231e)) +* **api:** api update ([05fd77e](https://github.com/Increase/increase-java/commit/05fd77ecbab2646bc41fcbde45b746f6c74d4674)) +* **api:** api update ([4082773](https://github.com/Increase/increase-java/commit/408277389cbc77d1a840a57a6ad0694bdef6a5e9)) +* **api:** api update ([9438908](https://github.com/Increase/increase-java/commit/94389080530654e684f60a910d4581f6edc19841)) +* **api:** api update ([e135f5f](https://github.com/Increase/increase-java/commit/e135f5f9de55f04bffdd9bf8cdf432cc185ff7dd)) +* **api:** api update ([26c0a6f](https://github.com/Increase/increase-java/commit/26c0a6f5543f3c6b5800b774c37b49c3efdecad7)) +* **api:** api update ([f7b88d8](https://github.com/Increase/increase-java/commit/f7b88d8b6148ab0f33f8c4f937346b2ef0c670d8)) +* **api:** api update ([a57da18](https://github.com/Increase/increase-java/commit/a57da1835b758b295c18930ead890ab1469997f5)) +* **api:** api update ([a7c29d9](https://github.com/Increase/increase-java/commit/a7c29d9eb1fcd85020ae654163f7a08aa6d606dd)) +* **api:** api update ([ee7968d](https://github.com/Increase/increase-java/commit/ee7968ddfed0a889d9c6cb4a0033d041ed07f751)) +* **api:** api update ([2111373](https://github.com/Increase/increase-java/commit/2111373ba896c63c028db86bc55b4f4cc15ab84c)) +* **api:** api update ([4cc243c](https://github.com/Increase/increase-java/commit/4cc243c53315482c3f0c4e66b83e1a97002075ad)) +* **api:** api update ([627c529](https://github.com/Increase/increase-java/commit/627c5290ea4b54edabb8ac80c45c5c4309ece8a1)) +* **api:** api update ([c2aa9ee](https://github.com/Increase/increase-java/commit/c2aa9ee013d28d1f078de229881f1feb3dfc32b4)) +* **api:** api update ([5bf05d8](https://github.com/Increase/increase-java/commit/5bf05d830f2ce0adeb347c992ae637d2256e2523)) +* **api:** api update ([2049ebb](https://github.com/Increase/increase-java/commit/2049ebb7ae2a221317c692c6b5e66860937e88f5)) +* **api:** api update ([4e3ec15](https://github.com/Increase/increase-java/commit/4e3ec15caa8c049362a17bd5d29c0f1857d6c711)) +* **api:** api update ([dbb50b0](https://github.com/Increase/increase-java/commit/dbb50b0f1b0225cda41b3cb3a2c3e0394be13f09)) +* **api:** api update ([a14bd3d](https://github.com/Increase/increase-java/commit/a14bd3d085793249c465069b89c3260e1b5ccfec)) +* **api:** api update ([a053a21](https://github.com/Increase/increase-java/commit/a053a213225c53d204b741b9c149ac0448aa60f3)) +* **api:** api update ([2344228](https://github.com/Increase/increase-java/commit/2344228fddb443ad50a3c4c0b6b6d8a6054f9125)) +* **api:** api update ([8933f23](https://github.com/Increase/increase-java/commit/8933f23c50360ad105a07d1b885f4a64143830be)) +* **api:** api update ([1c75bae](https://github.com/Increase/increase-java/commit/1c75baeb3991dc02fa1898d0a77c0f662473f610)) +* **api:** api update ([0b6df76](https://github.com/Increase/increase-java/commit/0b6df767c9f4b65cf437e57d55377a258d49c1a4)) + ## 0.347.0 (2025-10-06) Full Changelog: [v0.346.0...v0.347.0](https://github.com/Increase/increase-java/compare/v0.346.0...v0.347.0) diff --git a/README.md b/README.md index 4829dd052..becda8379 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.347.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.347.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.347.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.348.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.348.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.348.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.347.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.348.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.347.0") +implementation("com.increase.api:increase-java:0.348.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.347.0") com.increase.api increase-java - 0.347.0 + 0.348.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 3e6cc96e1..2ef7968f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.347.0" // x-release-please-version + version = "0.348.0" // x-release-please-version } subprojects {