diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index c1ebe3f9a..0243314d8 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.376.0"
+ ".": "0.377.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 537cdff67..f5d26caa7 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 229
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-942f7494ee0f14c1634ede0989985359cea633e5eece3d761910e7ffd6ac0fd8.yml
-openapi_spec_hash: d87134899fb29e27832158facf9d67eb
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-79f55910f087930ab5447372ef856ab63fe18f08d2151c59b8aebcccd6f41700.yml
+openapi_spec_hash: 5b6d915106e3361863168d9b084a570c
config_hash: b6f365add90e618b2174634df140826e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 39b949425..59ca49b4a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.377.0 (2025-12-08)
+
+Full Changelog: [v0.376.0...v0.377.0](https://github.com/Increase/increase-java/compare/v0.376.0...v0.377.0)
+
+### Features
+
+* **api:** api update ([5875a12](https://github.com/Increase/increase-java/commit/5875a125f07087e38563e9d65810b96586eb4b64))
+
## 0.376.0 (2025-12-08)
Full Changelog: [v0.375.0...v0.376.0](https://github.com/Increase/increase-java/compare/v0.375.0...v0.376.0)
diff --git a/README.md b/README.md
index 9c803eea3..03587477e 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.376.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.376.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.377.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.377.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.376.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.377.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.376.0")
+implementation("com.increase.api:increase-java:0.377.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.376.0")
com.increase.api
increase-java
- 0.376.0
+ 0.377.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 8e7f18546..a0d9f6782 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.376.0" // x-release-please-version
+ version = "0.377.0" // x-release-please-version
}
subprojects {
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 19aa8825f..1b7f4a7b9 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
@@ -524,6 +524,7 @@ private constructor(
private val cardAuthentication: JsonField,
private val cardAuthorization: JsonField,
private val cardAuthorizationExpiration: JsonField,
+ private val cardBalanceInquiry: JsonField,
private val cardDecline: JsonField,
private val cardFinancial: JsonField,
private val cardFuelConfirmation: JsonField,
@@ -549,6 +550,9 @@ private constructor(
@JsonProperty("card_authorization_expiration")
@ExcludeMissing
cardAuthorizationExpiration: JsonField = JsonMissing.of(),
+ @JsonProperty("card_balance_inquiry")
+ @ExcludeMissing
+ cardBalanceInquiry: JsonField = JsonMissing.of(),
@JsonProperty("card_decline")
@ExcludeMissing
cardDecline: JsonField = JsonMissing.of(),
@@ -584,6 +588,7 @@ private constructor(
cardAuthentication,
cardAuthorization,
cardAuthorizationExpiration,
+ cardBalanceInquiry,
cardDecline,
cardFinancial,
cardFuelConfirmation,
@@ -631,6 +636,18 @@ private constructor(
fun cardAuthorizationExpiration(): Optional =
cardAuthorizationExpiration.getOptional("card_authorization_expiration")
+ /**
+ * A Card Balance Inquiry object. This field will be present in the JSON response if and
+ * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are
+ * transactions that allow merchants to check the available balance on a card without
+ * placing a hold on funds, commonly used when a customer requests their balance at an ATM.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun cardBalanceInquiry(): Optional =
+ cardBalanceInquiry.getOptional("card_balance_inquiry")
+
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
@@ -774,6 +791,16 @@ private constructor(
fun _cardAuthorizationExpiration(): JsonField =
cardAuthorizationExpiration
+ /**
+ * Returns the raw JSON value of [cardBalanceInquiry].
+ *
+ * Unlike [cardBalanceInquiry], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("card_balance_inquiry")
+ @ExcludeMissing
+ fun _cardBalanceInquiry(): JsonField = cardBalanceInquiry
+
/**
* Returns the raw JSON value of [cardDecline].
*
@@ -897,6 +924,7 @@ private constructor(
* .cardAuthentication()
* .cardAuthorization()
* .cardAuthorizationExpiration()
+ * .cardBalanceInquiry()
* .cardDecline()
* .cardFinancial()
* .cardFuelConfirmation()
@@ -919,6 +947,7 @@ private constructor(
private var cardAuthentication: JsonField? = null
private var cardAuthorization: JsonField? = null
private var cardAuthorizationExpiration: JsonField? = null
+ private var cardBalanceInquiry: JsonField? = null
private var cardDecline: JsonField? = null
private var cardFinancial: JsonField? = null
private var cardFuelConfirmation: JsonField? = null
@@ -937,6 +966,7 @@ private constructor(
cardAuthentication = element.cardAuthentication
cardAuthorization = element.cardAuthorization
cardAuthorizationExpiration = element.cardAuthorizationExpiration
+ cardBalanceInquiry = element.cardBalanceInquiry
cardDecline = element.cardDecline
cardFinancial = element.cardFinancial
cardFuelConfirmation = element.cardFuelConfirmation
@@ -1032,6 +1062,34 @@ private constructor(
cardAuthorizationExpiration: JsonField
) = apply { this.cardAuthorizationExpiration = cardAuthorizationExpiration }
+ /**
+ * A Card Balance Inquiry object. This field will be present in the JSON response if and
+ * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are
+ * transactions that allow merchants to check the available balance on a card without
+ * placing a hold on funds, commonly used when a customer requests their balance at an
+ * ATM.
+ */
+ fun cardBalanceInquiry(cardBalanceInquiry: CardBalanceInquiry?) =
+ cardBalanceInquiry(JsonField.ofNullable(cardBalanceInquiry))
+
+ /**
+ * Alias for calling [Builder.cardBalanceInquiry] with
+ * `cardBalanceInquiry.orElse(null)`.
+ */
+ fun cardBalanceInquiry(cardBalanceInquiry: Optional) =
+ cardBalanceInquiry(cardBalanceInquiry.getOrNull())
+
+ /**
+ * Sets [Builder.cardBalanceInquiry] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardBalanceInquiry] with a well-typed
+ * [CardBalanceInquiry] value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun cardBalanceInquiry(cardBalanceInquiry: JsonField) = apply {
+ this.cardBalanceInquiry = cardBalanceInquiry
+ }
+
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
@@ -1300,6 +1358,7 @@ private constructor(
* .cardAuthentication()
* .cardAuthorization()
* .cardAuthorizationExpiration()
+ * .cardBalanceInquiry()
* .cardDecline()
* .cardFinancial()
* .cardFuelConfirmation()
@@ -1320,6 +1379,7 @@ private constructor(
checkRequired("cardAuthentication", cardAuthentication),
checkRequired("cardAuthorization", cardAuthorization),
checkRequired("cardAuthorizationExpiration", cardAuthorizationExpiration),
+ checkRequired("cardBalanceInquiry", cardBalanceInquiry),
checkRequired("cardDecline", cardDecline),
checkRequired("cardFinancial", cardFinancial),
checkRequired("cardFuelConfirmation", cardFuelConfirmation),
@@ -1345,6 +1405,7 @@ private constructor(
cardAuthentication().ifPresent { it.validate() }
cardAuthorization().ifPresent { it.validate() }
cardAuthorizationExpiration().ifPresent { it.validate() }
+ cardBalanceInquiry().ifPresent { it.validate() }
cardDecline().ifPresent { it.validate() }
cardFinancial().ifPresent { it.validate() }
cardFuelConfirmation().ifPresent { it.validate() }
@@ -1378,6 +1439,7 @@ private constructor(
(cardAuthentication.asKnown().getOrNull()?.validity() ?: 0) +
(cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) +
(cardAuthorizationExpiration.asKnown().getOrNull()?.validity() ?: 0) +
+ (cardBalanceInquiry.asKnown().getOrNull()?.validity() ?: 0) +
(cardDecline.asKnown().getOrNull()?.validity() ?: 0) +
(cardFinancial.asKnown().getOrNull()?.validity() ?: 0) +
(cardFuelConfirmation.asKnown().getOrNull()?.validity() ?: 0) +
@@ -13477,22 +13539,20 @@ private constructor(
}
/**
- * A Card Decline object. This field will be present in the JSON response if and only if
- * `category` is equal to `card_decline`.
+ * A Card Balance Inquiry object. This field will be present in the JSON response if and
+ * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are
+ * transactions that allow merchants to check the available balance on a card without
+ * placing a hold on funds, commonly used when a customer requests their balance at an ATM.
*/
- class CardDecline
+ class CardBalanceInquiry
@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 balance: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
- private val declinedTransactionId: JsonField,
private val digitalWalletTokenId: JsonField,
- private val direction: JsonField,
- private val incrementedCardAuthorizationId: JsonField,
private val merchantAcceptorId: JsonField,
private val merchantCategoryCode: JsonField,
private val merchantCity: JsonField,
@@ -13504,13 +13564,9 @@ private constructor(
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 realTimeDecisionReason: JsonField,
- private val reason: JsonField,
private val terminalId: JsonField,
+ private val type: JsonField,
private val verification: JsonField,
private val additionalProperties: MutableMap,
) {
@@ -13518,31 +13574,21 @@ private constructor(
@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("balance")
+ @ExcludeMissing
+ balance: JsonField = JsonMissing.of(),
@JsonProperty("card_payment_id")
@ExcludeMissing
cardPaymentId: JsonField = JsonMissing.of(),
@JsonProperty("currency")
@ExcludeMissing
currency: JsonField = JsonMissing.of(),
- @JsonProperty("declined_transaction_id")
- @ExcludeMissing
- declinedTransactionId: JsonField = JsonMissing.of(),
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
digitalWalletTokenId: JsonField = JsonMissing.of(),
- @JsonProperty("direction")
- @ExcludeMissing
- direction: JsonField = JsonMissing.of(),
- @JsonProperty("incremented_card_authorization_id")
- @ExcludeMissing
- incrementedCardAuthorizationId: JsonField = JsonMissing.of(),
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
merchantAcceptorId: JsonField = JsonMissing.of(),
@@ -13576,41 +13622,23 @@ private constructor(
@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("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("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
@JsonProperty("verification")
@ExcludeMissing
verification: JsonField = JsonMissing.of(),
) : this(
id,
- actioner,
additionalAmounts,
- amount,
+ balance,
cardPaymentId,
currency,
- declinedTransactionId,
digitalWalletTokenId,
- direction,
- incrementedCardAuthorizationId,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
@@ -13622,19 +13650,15 @@ private constructor(
networkIdentifiers,
networkRiskScore,
physicalCardId,
- presentmentAmount,
- presentmentCurrency,
- processingCategory,
realTimeDecisionId,
- realTimeDecisionReason,
- reason,
terminalId,
+ type,
verification,
mutableMapOf(),
)
/**
- * The Card Decline identifier.
+ * The Card Balance Inquiry 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
@@ -13642,16 +13666,6 @@ 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.
- *
- * @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
@@ -13665,14 +13679,14 @@ 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 balance amount in the minor unit of the account'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 amount(): Long = amount.getRequired("amount")
+ fun balance(): Long = balance.getRequired("balance")
/**
* The ID of the Card Payment this transaction belongs to.
@@ -13684,8 +13698,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 account'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
@@ -13693,16 +13707,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.
@@ -13713,26 +13717,6 @@ private constructor(
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.
@@ -13838,37 +13822,6 @@ private constructor(
*/
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.
*
@@ -13879,31 +13832,23 @@ 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.
+ * A constant representing the object's type. For this resource it will always be
+ * `card_balance_inquiry`.
*
* @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")
+ fun type(): Type = type.getRequired("type")
/**
* Fields related to verification of cardholder-provided values.
@@ -13921,16 +13866,6 @@ private constructor(
*/
@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].
*
@@ -13942,11 +13877,11 @@ private constructor(
fun _additionalAmounts(): JsonField = additionalAmounts
/**
- * Returns the raw JSON value of [amount].
+ * Returns the raw JSON value of [balance].
*
- * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+ @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance
/**
* Returns the raw JSON value of [cardPaymentId].
@@ -13968,16 +13903,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].
*
@@ -13988,27 +13913,6 @@ private constructor(
@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].
*
@@ -14119,36 +14023,6 @@ private constructor(
@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].
*
@@ -14159,24 +14033,6 @@ private constructor(
@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].
*
@@ -14187,6 +14043,13 @@ private constructor(
@ExcludeMissing
fun _terminalId(): JsonField = terminalId
+ /**
+ * 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 [verification].
*
@@ -14212,20 +14075,16 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [CardDecline].
+ * Returns a mutable builder for constructing an instance of [CardBalanceInquiry].
*
* The following fields are required:
* ```java
* .id()
- * .actioner()
* .additionalAmounts()
- * .amount()
+ * .balance()
* .cardPaymentId()
* .currency()
- * .declinedTransactionId()
* .digitalWalletTokenId()
- * .direction()
- * .incrementedCardAuthorizationId()
* .merchantAcceptorId()
* .merchantCategoryCode()
* .merchantCity()
@@ -14237,32 +14096,24 @@ private constructor(
* .networkIdentifiers()
* .networkRiskScore()
* .physicalCardId()
- * .presentmentAmount()
- * .presentmentCurrency()
- * .processingCategory()
* .realTimeDecisionId()
- * .realTimeDecisionReason()
- * .reason()
* .terminalId()
+ * .type()
* .verification()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [CardDecline]. */
+ /** A builder for [CardBalanceInquiry]. */
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 balance: 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
@@ -14274,51 +14125,39 @@ private constructor(
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 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(cardBalanceInquiry: CardBalanceInquiry) = apply {
+ id = cardBalanceInquiry.id
+ additionalAmounts = cardBalanceInquiry.additionalAmounts
+ balance = cardBalanceInquiry.balance
+ cardPaymentId = cardBalanceInquiry.cardPaymentId
+ currency = cardBalanceInquiry.currency
+ digitalWalletTokenId = cardBalanceInquiry.digitalWalletTokenId
+ merchantAcceptorId = cardBalanceInquiry.merchantAcceptorId
+ merchantCategoryCode = cardBalanceInquiry.merchantCategoryCode
+ merchantCity = cardBalanceInquiry.merchantCity
+ merchantCountry = cardBalanceInquiry.merchantCountry
+ merchantDescriptor = cardBalanceInquiry.merchantDescriptor
+ merchantPostalCode = cardBalanceInquiry.merchantPostalCode
+ merchantState = cardBalanceInquiry.merchantState
+ networkDetails = cardBalanceInquiry.networkDetails
+ networkIdentifiers = cardBalanceInquiry.networkIdentifiers
+ networkRiskScore = cardBalanceInquiry.networkRiskScore
+ physicalCardId = cardBalanceInquiry.physicalCardId
+ realTimeDecisionId = cardBalanceInquiry.realTimeDecisionId
+ terminalId = cardBalanceInquiry.terminalId
+ type = cardBalanceInquiry.type
+ verification = cardBalanceInquiry.verification
+ additionalProperties = cardBalanceInquiry.additionalProperties.toMutableMap()
+ }
+
+ /** The Card Balance Inquiry identifier. */
fun id(id: String) = id(JsonField.of(id))
/**
@@ -14330,21 +14169,6 @@ private constructor(
*/
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
@@ -14365,19 +14189,19 @@ private constructor(
}
/**
- * The declined amount in the minor unit of the destination account currency. For
- * dollars, for example, this is cents.
+ * The balance amount in the minor unit of the account's currency. For dollars, for
+ * example, this is cents.
*/
- fun amount(amount: Long) = amount(JsonField.of(amount))
+ fun balance(balance: Long) = balance(JsonField.of(balance))
/**
- * Sets [Builder.amount] to an arbitrary JSON value.
+ * Sets [Builder.balance] to an arbitrary JSON value.
*
- * You should usually call [Builder.amount] with a well-typed [Long] value instead.
+ * You should usually call [Builder.balance] 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 }
+ fun balance(balance: JsonField) = apply { this.balance = balance }
/** The ID of the Card Payment this transaction belongs to. */
fun cardPaymentId(cardPaymentId: String) =
@@ -14395,8 +14219,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 account's
+ * currency.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
@@ -14409,21 +14233,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.
@@ -14449,51 +14258,6 @@ private constructor(
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.
@@ -14711,59 +14475,6 @@ private constructor(
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.
@@ -14789,43 +14500,6 @@ private constructor(
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.
@@ -14846,6 +14520,21 @@ private constructor(
this.terminalId = terminalId
}
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_balance_inquiry`.
+ */
+ 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 }
+
/** Fields related to verification of cardholder-provided values. */
fun verification(verification: Verification) =
verification(JsonField.of(verification))
@@ -14884,22 +14573,18 @@ private constructor(
}
/**
- * Returns an immutable instance of [CardDecline].
+ * Returns an immutable instance of [CardBalanceInquiry].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
* .id()
- * .actioner()
* .additionalAmounts()
- * .amount()
+ * .balance()
* .cardPaymentId()
* .currency()
- * .declinedTransactionId()
* .digitalWalletTokenId()
- * .direction()
- * .incrementedCardAuthorizationId()
* .merchantAcceptorId()
* .merchantCategoryCode()
* .merchantCity()
@@ -14911,33 +14596,22 @@ private constructor(
* .networkIdentifiers()
* .networkRiskScore()
* .physicalCardId()
- * .presentmentAmount()
- * .presentmentCurrency()
- * .processingCategory()
* .realTimeDecisionId()
- * .realTimeDecisionReason()
- * .reason()
* .terminalId()
+ * .type()
* .verification()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): CardDecline =
- CardDecline(
+ fun build(): CardBalanceInquiry =
+ CardBalanceInquiry(
checkRequired("id", id),
- checkRequired("actioner", actioner),
checkRequired("additionalAmounts", additionalAmounts),
- checkRequired("amount", amount),
+ checkRequired("balance", balance),
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),
@@ -14949,13 +14623,9 @@ private constructor(
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("type", type),
checkRequired("verification", verification),
additionalProperties.toMutableMap(),
)
@@ -14963,21 +14633,17 @@ private constructor(
private var validated: Boolean = false
- fun validate(): CardDecline = apply {
+ fun validate(): CardBalanceInquiry = apply {
if (validated) {
return@apply
}
id()
- actioner().validate()
additionalAmounts().validate()
- amount()
+ balance()
cardPaymentId()
currency().validate()
- declinedTransactionId()
digitalWalletTokenId()
- direction().validate()
- incrementedCardAuthorizationId()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
@@ -14989,13 +14655,9 @@ private constructor(
networkIdentifiers().validate()
networkRiskScore()
physicalCardId()
- presentmentAmount()
- presentmentCurrency()
- processingCategory().validate()
realTimeDecisionId()
- realTimeDecisionReason().ifPresent { it.validate() }
- reason().validate()
terminalId()
+ type().validate()
verification().validate()
validated = true
}
@@ -15017,15 +14679,11 @@ private constructor(
@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 (balance.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) +
@@ -15037,165 +14695,11 @@ private constructor(
(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) +
+ (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.
- */
- 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
@@ -18109,8 +17613,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 account's
+ * currency.
*/
class Currency @JsonCreator private constructor(private val value: JsonField) :
Enum {
@@ -18240,156 +17744,6 @@ private constructor(
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)
@@ -20442,12 +19796,11 @@ 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.
+ * A constant representing the object's type. For this resource it will always be
+ * `card_balance_inquiry`.
*/
- class ProcessingCategory
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ class Type @JsonCreator private constructor(private val value: JsonField) :
+ Enum {
/**
* Returns this class instance's raw value.
@@ -20461,155 +19814,29 @@ private constructor(
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")
+ @JvmField val CARD_BALANCE_INQUIRY = of("card_balance_inquiry")
- /**
- * 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")
-
- /**
- * A balance inquiry transaction is used to check the balance of an account
- * associated with a card.
- */
- @JvmField val BALANCE_INQUIRY = of("balance_inquiry")
-
- /** The processing category is unknown. */
- @JvmField val UNKNOWN = of("unknown")
-
- @JvmStatic fun of(value: String) = ProcessingCategory(JsonField.of(value))
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
}
- /** An enum containing [ProcessingCategory]'s known values. */
+ /** An enum containing [Type]'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,
- /**
- * A balance inquiry transaction is used to check the balance of an account
- * associated with a card.
- */
- BALANCE_INQUIRY,
- /** The processing category is unknown. */
- UNKNOWN,
+ CARD_BALANCE_INQUIRY
}
/**
- * An enum containing [ProcessingCategory]'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 [ProcessingCategory] 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 {
+ CARD_BALANCE_INQUIRY,
/**
- * 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,
- /**
- * A balance inquiry transaction is used to check the balance of an account
- * associated with a card.
- */
- BALANCE_INQUIRY,
- /** The processing category is unknown. */
- UNKNOWN,
- /**
- * An enum member indicating that [ProcessingCategory] was instantiated with an
- * unknown value.
+ * An enum member indicating that [Type] was instantiated with an unknown value.
*/
_UNKNOWN,
}
@@ -20623,16 +19850,7 @@ private constructor(
*/
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
- BALANCE_INQUIRY -> Value.BALANCE_INQUIRY
- UNKNOWN -> Value.UNKNOWN
+ CARD_BALANCE_INQUIRY -> Value.CARD_BALANCE_INQUIRY
else -> Value._UNKNOWN
}
@@ -20647,18 +19865,8 @@ private constructor(
*/
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
- BALANCE_INQUIRY -> Known.BALANCE_INQUIRY
- UNKNOWN -> Known.UNKNOWN
- else ->
- throw IncreaseInvalidDataException("Unknown ProcessingCategory: $value")
+ CARD_BALANCE_INQUIRY -> Known.CARD_BALANCE_INQUIRY
+ else -> throw IncreaseInvalidDataException("Unknown Type: $value")
}
/**
@@ -20677,7 +19885,8502 @@ private constructor(
private var validated: Boolean = false
- fun validate(): ProcessingCategory = apply {
+ 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()
+ }
+
+ /** 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 CardBalanceInquiry &&
+ id == other.id &&
+ additionalAmounts == other.additionalAmounts &&
+ balance == other.balance &&
+ cardPaymentId == other.cardPaymentId &&
+ currency == other.currency &&
+ digitalWalletTokenId == other.digitalWalletTokenId &&
+ 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 &&
+ realTimeDecisionId == other.realTimeDecisionId &&
+ terminalId == other.terminalId &&
+ type == other.type &&
+ verification == other.verification &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ id,
+ additionalAmounts,
+ balance,
+ cardPaymentId,
+ currency,
+ digitalWalletTokenId,
+ merchantAcceptorId,
+ merchantCategoryCode,
+ merchantCity,
+ merchantCountry,
+ merchantDescriptor,
+ merchantPostalCode,
+ merchantState,
+ networkDetails,
+ networkIdentifiers,
+ networkRiskScore,
+ physicalCardId,
+ realTimeDecisionId,
+ terminalId,
+ type,
+ verification,
+ additionalProperties,
+ )
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "CardBalanceInquiry{id=$id, additionalAmounts=$additionalAmounts, balance=$balance, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}"
+ }
+
+ /**
+ * A Card Decline object. This field will be present in the JSON response if and only if
+ * `category` is equal to `card_decline`.
+ */
+ class CardDecline
+ @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 declinedTransactionId: JsonField,
+ private val digitalWalletTokenId: JsonField,
+ private val direction: JsonField,
+ private val incrementedCardAuthorizationId: 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 realTimeDecisionReason: JsonField,
+ private val reason: JsonField,
+ private val terminalId: 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("declined_transaction_id")
+ @ExcludeMissing
+ declinedTransactionId: JsonField