diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 93ed6faef..c1ebe3f9a 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.375.0"
+ ".": "0.376.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 62bd5d7e3..537cdff67 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-56334e000721ba4ee20536271d3acf7231529d7b1f651729e2f4ebe75eb12048.yml
-openapi_spec_hash: 45777c412bcbc1aead50c84f78695203
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-942f7494ee0f14c1634ede0989985359cea633e5eece3d761910e7ffd6ac0fd8.yml
+openapi_spec_hash: d87134899fb29e27832158facf9d67eb
config_hash: b6f365add90e618b2174634df140826e
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c299b9f59..39b949425 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 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)
+
+### Features
+
+* **api:** api update ([76ef438](https://github.com/Increase/increase-java/commit/76ef438085db48829e4f2341e8d0bdfb7874edd6))
+
## 0.375.0 (2025-12-08)
Full Changelog: [v0.374.0...v0.375.0](https://github.com/Increase/increase-java/compare/v0.374.0...v0.375.0)
diff --git a/README.md b/README.md
index 8a1ad7b8a..9c803eea3 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.375.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.375.0)
+[](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)
@@ -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.375.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.376.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.375.0")
+implementation("com.increase.api:increase-java:0.376.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.375.0")
com.increase.api
increase-java
- 0.375.0
+ 0.376.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 521fa4876..8e7f18546 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.375.0" // x-release-please-version
+ version = "0.376.0" // x-release-please-version
}
subprojects {
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt
index 5096a94c5..e33897ad6 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/Event.kt
@@ -670,6 +670,14 @@ private constructor(
val REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED =
of("real_time_decision.card_authorization_requested")
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ @JvmField
+ val REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED =
+ of("real_time_decision.card_balance_inquiry_requested")
+
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -920,6 +928,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1148,6 +1161,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1292,6 +1310,8 @@ private constructor(
Value.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Value.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Value.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Value.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
@@ -1417,6 +1437,8 @@ private constructor(
Known.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Known.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Known.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Known.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt
index 4d602f1f4..ed44749e8 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/events/EventListParams.kt
@@ -683,6 +683,14 @@ private constructor(
val REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED =
of("real_time_decision.card_authorization_requested")
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ @JvmField
+ val REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED =
+ of("real_time_decision.card_balance_inquiry_requested")
+
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -935,6 +943,11 @@ private constructor(
* authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1165,6 +1178,11 @@ private constructor(
* authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1311,6 +1329,8 @@ private constructor(
Value.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Value.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Value.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Value.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
@@ -1437,6 +1457,8 @@ private constructor(
Known.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Known.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Known.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Known.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt
index 9edcb1147..7bfa836a5 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscription.kt
@@ -781,6 +781,14 @@ private constructor(
val REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED =
of("real_time_decision.card_authorization_requested")
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ @JvmField
+ val REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED =
+ of("real_time_decision.card_balance_inquiry_requested")
+
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1031,6 +1039,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1260,6 +1273,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1407,6 +1425,8 @@ private constructor(
Value.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Value.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Value.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Value.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
@@ -1532,6 +1552,8 @@ private constructor(
Known.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Known.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Known.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Known.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt
index 90274b1c6..d8dae45c4 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/eventsubscriptions/EventSubscriptionCreateParams.kt
@@ -1031,6 +1031,14 @@ private constructor(
val REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED =
of("real_time_decision.card_authorization_requested")
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ @JvmField
+ val REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED =
+ of("real_time_decision.card_balance_inquiry_requested")
+
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1281,6 +1289,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1510,6 +1523,11 @@ private constructor(
* Occurs whenever a Real-Time Decision is created in response to a card authorization.
*/
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED,
+ /**
+ * Occurs whenever a Real-Time Decision is created in response to a card balance
+ * inquiry.
+ */
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED,
/**
* Occurs whenever a Real-Time Decision is created in response to a digital wallet
* provisioning attempt.
@@ -1657,6 +1675,8 @@ private constructor(
Value.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Value.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Value.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Value.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
@@ -1782,6 +1802,8 @@ private constructor(
Known.PROOF_OF_AUTHORIZATION_REQUEST_UPDATED
REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED ->
Known.REAL_TIME_DECISION_CARD_AUTHORIZATION_REQUESTED
+ REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED ->
+ Known.REAL_TIME_DECISION_CARD_BALANCE_INQUIRY_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED ->
Known.REAL_TIME_DECISION_DIGITAL_WALLET_TOKEN_REQUESTED
REAL_TIME_DECISION_DIGITAL_WALLET_AUTHENTICATION_REQUESTED ->
diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt
index c45f8777b..299dbf545 100644
--- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt
+++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt
@@ -31,6 +31,7 @@ private constructor(
private val cardAuthentication: JsonField,
private val cardAuthenticationChallenge: JsonField,
private val cardAuthorization: JsonField,
+ private val cardBalanceInquiry: JsonField,
private val category: JsonField,
private val createdAt: JsonField,
private val digitalWalletAuthentication: JsonField,
@@ -53,6 +54,9 @@ private constructor(
@JsonProperty("card_authorization")
@ExcludeMissing
cardAuthorization: JsonField = JsonMissing.of(),
+ @JsonProperty("card_balance_inquiry")
+ @ExcludeMissing
+ cardBalanceInquiry: JsonField = JsonMissing.of(),
@JsonProperty("category") @ExcludeMissing category: JsonField = JsonMissing.of(),
@JsonProperty("created_at")
@ExcludeMissing
@@ -73,6 +77,7 @@ private constructor(
cardAuthentication,
cardAuthenticationChallenge,
cardAuthorization,
+ cardBalanceInquiry,
category,
createdAt,
digitalWalletAuthentication,
@@ -118,6 +123,15 @@ private constructor(
fun cardAuthorization(): Optional =
cardAuthorization.getOptional("card_authorization")
+ /**
+ * Fields related to a card balance inquiry.
+ *
+ * @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")
+
/**
* The category of the Real-Time Decision.
*
@@ -217,6 +231,16 @@ private constructor(
@ExcludeMissing
fun _cardAuthorization(): JsonField = cardAuthorization
+ /**
+ * 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 [category].
*
@@ -300,6 +324,7 @@ private constructor(
* .cardAuthentication()
* .cardAuthenticationChallenge()
* .cardAuthorization()
+ * .cardBalanceInquiry()
* .category()
* .createdAt()
* .digitalWalletAuthentication()
@@ -319,6 +344,7 @@ private constructor(
private var cardAuthentication: JsonField? = null
private var cardAuthenticationChallenge: JsonField? = null
private var cardAuthorization: JsonField? = null
+ private var cardBalanceInquiry: JsonField? = null
private var category: JsonField? = null
private var createdAt: JsonField? = null
private var digitalWalletAuthentication: JsonField? = null
@@ -334,6 +360,7 @@ private constructor(
cardAuthentication = realTimeDecision.cardAuthentication
cardAuthenticationChallenge = realTimeDecision.cardAuthenticationChallenge
cardAuthorization = realTimeDecision.cardAuthorization
+ cardBalanceInquiry = realTimeDecision.cardBalanceInquiry
category = realTimeDecision.category
createdAt = realTimeDecision.createdAt
digitalWalletAuthentication = realTimeDecision.digitalWalletAuthentication
@@ -418,6 +445,27 @@ private constructor(
this.cardAuthorization = cardAuthorization
}
+ /** Fields related to a card balance inquiry. */
+ 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
+ }
+
/** The category of the Real-Time Decision. */
fun category(category: Category) = category(JsonField.of(category))
@@ -559,6 +607,7 @@ private constructor(
* .cardAuthentication()
* .cardAuthenticationChallenge()
* .cardAuthorization()
+ * .cardBalanceInquiry()
* .category()
* .createdAt()
* .digitalWalletAuthentication()
@@ -576,6 +625,7 @@ private constructor(
checkRequired("cardAuthentication", cardAuthentication),
checkRequired("cardAuthenticationChallenge", cardAuthenticationChallenge),
checkRequired("cardAuthorization", cardAuthorization),
+ checkRequired("cardBalanceInquiry", cardBalanceInquiry),
checkRequired("category", category),
checkRequired("createdAt", createdAt),
checkRequired("digitalWalletAuthentication", digitalWalletAuthentication),
@@ -598,6 +648,7 @@ private constructor(
cardAuthentication().ifPresent { it.validate() }
cardAuthenticationChallenge().ifPresent { it.validate() }
cardAuthorization().ifPresent { it.validate() }
+ cardBalanceInquiry().ifPresent { it.validate() }
category().validate()
createdAt()
digitalWalletAuthentication().ifPresent { it.validate() }
@@ -627,6 +678,7 @@ private constructor(
(cardAuthentication.asKnown().getOrNull()?.validity() ?: 0) +
(cardAuthenticationChallenge.asKnown().getOrNull()?.validity() ?: 0) +
(cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) +
+ (cardBalanceInquiry.asKnown().getOrNull()?.validity() ?: 0) +
(category.asKnown().getOrNull()?.validity() ?: 0) +
(if (createdAt.asKnown().isPresent) 1 else 0) +
(digitalWalletAuthentication.asKnown().getOrNull()?.validity() ?: 0) +
@@ -11241,23 +11293,7503 @@ private constructor(
"CardAuthorization{accountId=$accountId, additionalAmounts=$additionalAmounts, approval=$approval, cardId=$cardId, decision=$decision, decline=$decline, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, partialApprovalCapability=$partialApprovalCapability, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, requestDetails=$requestDetails, settlementAmount=$settlementAmount, settlementCurrency=$settlementCurrency, terminalId=$terminalId, upcomingCardPaymentId=$upcomingCardPaymentId, verification=$verification, additionalProperties=$additionalProperties}"
}
- /** The category of the Real-Time Decision. */
- class Category @JsonCreator private constructor(private val value: JsonField) : Enum {
+ /** Fields related to a card balance inquiry. */
+ class CardBalanceInquiry
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val accountId: JsonField,
+ private val additionalAmounts: JsonField,
+ private val approval: JsonField,
+ private val cardId: JsonField,
+ private val decision: JsonField,
+ private val digitalWalletTokenId: 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 terminalId: JsonField,
+ private val upcomingCardPaymentId: JsonField,
+ private val verification: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("account_id")
+ @ExcludeMissing
+ accountId: JsonField = JsonMissing.of(),
+ @JsonProperty("additional_amounts")
+ @ExcludeMissing
+ additionalAmounts: JsonField = JsonMissing.of(),
+ @JsonProperty("approval")
+ @ExcludeMissing
+ approval: JsonField = JsonMissing.of(),
+ @JsonProperty("card_id") @ExcludeMissing cardId: JsonField = JsonMissing.of(),
+ @JsonProperty("decision")
+ @ExcludeMissing
+ decision: JsonField = JsonMissing.of(),
+ @JsonProperty("digital_wallet_token_id")
+ @ExcludeMissing
+ digitalWalletTokenId: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_acceptor_id")
+ @ExcludeMissing
+ merchantAcceptorId: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_category_code")
+ @ExcludeMissing
+ merchantCategoryCode: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_city")
+ @ExcludeMissing
+ merchantCity: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_country")
+ @ExcludeMissing
+ merchantCountry: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_descriptor")
+ @ExcludeMissing
+ merchantDescriptor: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_postal_code")
+ @ExcludeMissing
+ merchantPostalCode: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_state")
+ @ExcludeMissing
+ merchantState: JsonField = JsonMissing.of(),
+ @JsonProperty("network_details")
+ @ExcludeMissing
+ networkDetails: JsonField = JsonMissing.of(),
+ @JsonProperty("network_identifiers")
+ @ExcludeMissing
+ networkIdentifiers: JsonField = JsonMissing.of(),
+ @JsonProperty("network_risk_score")
+ @ExcludeMissing
+ networkRiskScore: JsonField = JsonMissing.of(),
+ @JsonProperty("physical_card_id")
+ @ExcludeMissing
+ physicalCardId: JsonField = JsonMissing.of(),
+ @JsonProperty("terminal_id")
+ @ExcludeMissing
+ terminalId: JsonField = JsonMissing.of(),
+ @JsonProperty("upcoming_card_payment_id")
+ @ExcludeMissing
+ upcomingCardPaymentId: JsonField = JsonMissing.of(),
+ @JsonProperty("verification")
+ @ExcludeMissing
+ verification: JsonField = JsonMissing.of(),
+ ) : this(
+ accountId,
+ additionalAmounts,
+ approval,
+ cardId,
+ decision,
+ digitalWalletTokenId,
+ merchantAcceptorId,
+ merchantCategoryCode,
+ merchantCity,
+ merchantCountry,
+ merchantDescriptor,
+ merchantPostalCode,
+ merchantState,
+ networkDetails,
+ networkIdentifiers,
+ networkRiskScore,
+ physicalCardId,
+ terminalId,
+ upcomingCardPaymentId,
+ verification,
+ mutableMapOf(),
+ )
/**
- * Returns this class instance's raw value.
+ * The identifier of the Account the authorization will debit.
*
- * This is usually only useful if this instance was deserialized from data that doesn't
- * match any known member, and you want to know that value. For example, if the SDK is on an
- * older version than the API, then the API may respond with new members that the SDK is
- * unaware of.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
+ fun accountId(): String = accountId.getRequired("account_id")
- companion object {
+ /**
+ * Additional amounts associated with the card authorization, such as ATM surcharges fees.
+ * These are usually a subset of the `amount` field and are used to provide more detailed
+ * information about the transaction.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun additionalAmounts(): AdditionalAmounts =
+ additionalAmounts.getRequired("additional_amounts")
- /** A card is being authorized. */
- @JvmField val CARD_AUTHORIZATION_REQUESTED = of("card_authorization_requested")
+ /**
+ * Present if and only if `decision` is `approve`. Contains information related to the
+ * approval of the balance inquiry.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun approval(): Optional = approval.getOptional("approval")
+
+ /**
+ * The identifier of the Card that is being authorized.
+ *
+ * @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 cardId(): String = cardId.getRequired("card_id")
+
+ /**
+ * Whether or not the authorization was approved.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun decision(): Optional = decision.getOptional("decision")
+
+ /**
+ * If the authorization was made via a Digital Wallet Token (such as an Apple Pay purchase),
+ * the identifier of the token that was used.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun digitalWalletTokenId(): Optional =
+ digitalWalletTokenId.getOptional("digital_wallet_token_id")
+
+ /**
+ * The merchant identifier (commonly abbreviated as MID) of the merchant the card is
+ * transacting with.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun merchantAcceptorId(): String = merchantAcceptorId.getRequired("merchant_acceptor_id")
+
+ /**
+ * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
+ * transacting with.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun merchantCategoryCode(): String =
+ merchantCategoryCode.getRequired("merchant_category_code")
+
+ /**
+ * The city the merchant resides in.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun merchantCity(): Optional = merchantCity.getOptional("merchant_city")
+
+ /**
+ * The country the merchant resides in.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun merchantCountry(): String = merchantCountry.getRequired("merchant_country")
+
+ /**
+ * The merchant descriptor of the merchant the card is transacting with.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor")
+
+ /**
+ * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP
+ * code, where the first 5 and last 4 are separated by a dash.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun merchantPostalCode(): Optional =
+ merchantPostalCode.getOptional("merchant_postal_code")
+
+ /**
+ * The state the merchant resides in.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun merchantState(): Optional = merchantState.getOptional("merchant_state")
+
+ /**
+ * Fields specific to the `network`.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun networkDetails(): NetworkDetails = networkDetails.getRequired("network_details")
+
+ /**
+ * Network-specific identifiers for a specific request or transaction.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun networkIdentifiers(): NetworkIdentifiers =
+ networkIdentifiers.getRequired("network_identifiers")
+
+ /**
+ * The risk score generated by the card network. For Visa this is the Visa Advanced
+ * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score is
+ * from 0 to 999, where 999 is the riskiest.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun networkRiskScore(): Optional = networkRiskScore.getOptional("network_risk_score")
+
+ /**
+ * If the authorization was made in-person with a physical card, the Physical Card that was
+ * used.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if
+ * the server responded with an unexpected value).
+ */
+ fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id")
+
+ /**
+ * The 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")
+
+ /**
+ * The identifier of the Card Payment this authorization will belong to. Available in the
+ * API once the card authorization has completed.
+ *
+ * @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 upcomingCardPaymentId(): String =
+ upcomingCardPaymentId.getRequired("upcoming_card_payment_id")
+
+ /**
+ * Fields related to verification of cardholder-provided values.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun verification(): Verification = verification.getRequired("verification")
+
+ /**
+ * Returns the raw JSON value of [accountId].
+ *
+ * Unlike [accountId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("account_id") @ExcludeMissing fun _accountId(): JsonField = accountId
+
+ /**
+ * Returns the raw JSON value of [additionalAmounts].
+ *
+ * Unlike [additionalAmounts], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("additional_amounts")
+ @ExcludeMissing
+ fun _additionalAmounts(): JsonField = additionalAmounts
+
+ /**
+ * Returns the raw JSON value of [approval].
+ *
+ * Unlike [approval], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("approval") @ExcludeMissing fun _approval(): JsonField = approval
+
+ /**
+ * Returns the raw JSON value of [cardId].
+ *
+ * Unlike [cardId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("card_id") @ExcludeMissing fun _cardId(): JsonField = cardId
+
+ /**
+ * Returns the raw JSON value of [decision].
+ *
+ * Unlike [decision], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("decision") @ExcludeMissing fun _decision(): JsonField = decision
+
+ /**
+ * Returns the raw JSON value of [digitalWalletTokenId].
+ *
+ * Unlike [digitalWalletTokenId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("digital_wallet_token_id")
+ @ExcludeMissing
+ fun _digitalWalletTokenId(): JsonField = digitalWalletTokenId
+
+ /**
+ * Returns the raw JSON value of [merchantAcceptorId].
+ *
+ * Unlike [merchantAcceptorId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_acceptor_id")
+ @ExcludeMissing
+ fun _merchantAcceptorId(): JsonField = merchantAcceptorId
+
+ /**
+ * Returns the raw JSON value of [merchantCategoryCode].
+ *
+ * Unlike [merchantCategoryCode], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_category_code")
+ @ExcludeMissing
+ fun _merchantCategoryCode(): JsonField = merchantCategoryCode
+
+ /**
+ * Returns the raw JSON value of [merchantCity].
+ *
+ * Unlike [merchantCity], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_city")
+ @ExcludeMissing
+ fun _merchantCity(): JsonField = merchantCity
+
+ /**
+ * Returns the raw JSON value of [merchantCountry].
+ *
+ * Unlike [merchantCountry], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_country")
+ @ExcludeMissing
+ fun _merchantCountry(): JsonField = merchantCountry
+
+ /**
+ * Returns the raw JSON value of [merchantDescriptor].
+ *
+ * Unlike [merchantDescriptor], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_descriptor")
+ @ExcludeMissing
+ fun _merchantDescriptor(): JsonField = merchantDescriptor
+
+ /**
+ * Returns the raw JSON value of [merchantPostalCode].
+ *
+ * Unlike [merchantPostalCode], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("merchant_postal_code")
+ @ExcludeMissing
+ fun _merchantPostalCode(): JsonField = merchantPostalCode
+
+ /**
+ * Returns the raw JSON value of [merchantState].
+ *
+ * Unlike [merchantState], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("merchant_state")
+ @ExcludeMissing
+ fun _merchantState(): JsonField = merchantState
+
+ /**
+ * Returns the raw JSON value of [networkDetails].
+ *
+ * Unlike [networkDetails], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("network_details")
+ @ExcludeMissing
+ fun _networkDetails(): JsonField = networkDetails
+
+ /**
+ * Returns the raw JSON value of [networkIdentifiers].
+ *
+ * Unlike [networkIdentifiers], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("network_identifiers")
+ @ExcludeMissing
+ fun _networkIdentifiers(): JsonField = networkIdentifiers
+
+ /**
+ * Returns the raw JSON value of [networkRiskScore].
+ *
+ * Unlike [networkRiskScore], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("network_risk_score")
+ @ExcludeMissing
+ fun _networkRiskScore(): JsonField = networkRiskScore
+
+ /**
+ * Returns the raw JSON value of [physicalCardId].
+ *
+ * Unlike [physicalCardId], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("physical_card_id")
+ @ExcludeMissing
+ fun _physicalCardId(): JsonField = physicalCardId
+
+ /**
+ * Returns the raw JSON value of [terminalId].
+ *
+ * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("terminal_id")
+ @ExcludeMissing
+ fun _terminalId(): JsonField = terminalId
+
+ /**
+ * Returns the raw JSON value of [upcomingCardPaymentId].
+ *
+ * Unlike [upcomingCardPaymentId], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("upcoming_card_payment_id")
+ @ExcludeMissing
+ fun _upcomingCardPaymentId(): JsonField = upcomingCardPaymentId
+
+ /**
+ * Returns the raw JSON value of [verification].
+ *
+ * Unlike [verification], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("verification")
+ @ExcludeMissing
+ fun _verification(): JsonField = verification
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [CardBalanceInquiry].
+ *
+ * The following fields are required:
+ * ```java
+ * .accountId()
+ * .additionalAmounts()
+ * .approval()
+ * .cardId()
+ * .decision()
+ * .digitalWalletTokenId()
+ * .merchantAcceptorId()
+ * .merchantCategoryCode()
+ * .merchantCity()
+ * .merchantCountry()
+ * .merchantDescriptor()
+ * .merchantPostalCode()
+ * .merchantState()
+ * .networkDetails()
+ * .networkIdentifiers()
+ * .networkRiskScore()
+ * .physicalCardId()
+ * .terminalId()
+ * .upcomingCardPaymentId()
+ * .verification()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [CardBalanceInquiry]. */
+ class Builder internal constructor() {
+
+ private var accountId: JsonField? = null
+ private var additionalAmounts: JsonField? = null
+ private var approval: JsonField? = null
+ private var cardId: JsonField? = null
+ private var decision: JsonField? = null
+ private var digitalWalletTokenId: JsonField? = null
+ private var merchantAcceptorId: JsonField? = null
+ private var merchantCategoryCode: JsonField? = null
+ private var merchantCity: JsonField? = null
+ private var merchantCountry: JsonField? = null
+ private var merchantDescriptor: JsonField? = null
+ private var merchantPostalCode: JsonField? = null
+ private var merchantState: JsonField? = null
+ private var networkDetails: JsonField? = null
+ private var networkIdentifiers: JsonField? = null
+ private var networkRiskScore: JsonField? = null
+ private var physicalCardId: JsonField? = null
+ private var terminalId: JsonField? = null
+ private var upcomingCardPaymentId: JsonField? = null
+ private var verification: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(cardBalanceInquiry: CardBalanceInquiry) = apply {
+ accountId = cardBalanceInquiry.accountId
+ additionalAmounts = cardBalanceInquiry.additionalAmounts
+ approval = cardBalanceInquiry.approval
+ cardId = cardBalanceInquiry.cardId
+ decision = cardBalanceInquiry.decision
+ 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
+ terminalId = cardBalanceInquiry.terminalId
+ upcomingCardPaymentId = cardBalanceInquiry.upcomingCardPaymentId
+ verification = cardBalanceInquiry.verification
+ additionalProperties = cardBalanceInquiry.additionalProperties.toMutableMap()
+ }
+
+ /** The identifier of the Account the authorization will debit. */
+ fun accountId(accountId: String) = accountId(JsonField.of(accountId))
+
+ /**
+ * Sets [Builder.accountId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.accountId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
+
+ /**
+ * Additional amounts associated with the card authorization, such as ATM surcharges
+ * fees. These are usually a subset of the `amount` field and are used to provide more
+ * detailed information about the transaction.
+ */
+ fun additionalAmounts(additionalAmounts: AdditionalAmounts) =
+ additionalAmounts(JsonField.of(additionalAmounts))
+
+ /**
+ * Sets [Builder.additionalAmounts] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.additionalAmounts] with a well-typed
+ * [AdditionalAmounts] value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun additionalAmounts(additionalAmounts: JsonField) = apply {
+ this.additionalAmounts = additionalAmounts
+ }
+
+ /**
+ * Present if and only if `decision` is `approve`. Contains information related to the
+ * approval of the balance inquiry.
+ */
+ fun approval(approval: Approval?) = approval(JsonField.ofNullable(approval))
+
+ /** Alias for calling [Builder.approval] with `approval.orElse(null)`. */
+ fun approval(approval: Optional) = approval(approval.getOrNull())
+
+ /**
+ * Sets [Builder.approval] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.approval] with a well-typed [Approval] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun approval(approval: JsonField) = apply { this.approval = approval }
+
+ /** The identifier of the Card that is being authorized. */
+ fun cardId(cardId: String) = cardId(JsonField.of(cardId))
+
+ /**
+ * Sets [Builder.cardId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.cardId] with a well-typed [String] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun cardId(cardId: JsonField) = apply { this.cardId = cardId }
+
+ /** Whether or not the authorization was approved. */
+ fun decision(decision: Decision?) = decision(JsonField.ofNullable(decision))
+
+ /** Alias for calling [Builder.decision] with `decision.orElse(null)`. */
+ fun decision(decision: Optional) = decision(decision.getOrNull())
+
+ /**
+ * Sets [Builder.decision] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.decision] with a well-typed [Decision] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun decision(decision: JsonField) = apply { this.decision = decision }
+
+ /**
+ * If the authorization was made via a Digital Wallet Token (such as an Apple Pay
+ * purchase), the identifier of the token that was used.
+ */
+ fun digitalWalletTokenId(digitalWalletTokenId: String?) =
+ digitalWalletTokenId(JsonField.ofNullable(digitalWalletTokenId))
+
+ /**
+ * Alias for calling [Builder.digitalWalletTokenId] with
+ * `digitalWalletTokenId.orElse(null)`.
+ */
+ fun digitalWalletTokenId(digitalWalletTokenId: Optional) =
+ digitalWalletTokenId(digitalWalletTokenId.getOrNull())
+
+ /**
+ * Sets [Builder.digitalWalletTokenId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.digitalWalletTokenId] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply {
+ this.digitalWalletTokenId = digitalWalletTokenId
+ }
+
+ /**
+ * The merchant identifier (commonly abbreviated as MID) of the merchant the card is
+ * transacting with.
+ */
+ fun merchantAcceptorId(merchantAcceptorId: String) =
+ merchantAcceptorId(JsonField.of(merchantAcceptorId))
+
+ /**
+ * Sets [Builder.merchantAcceptorId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantAcceptorId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantAcceptorId(merchantAcceptorId: JsonField) = apply {
+ this.merchantAcceptorId = merchantAcceptorId
+ }
+
+ /**
+ * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
+ * transacting with.
+ */
+ fun merchantCategoryCode(merchantCategoryCode: String) =
+ merchantCategoryCode(JsonField.of(merchantCategoryCode))
+
+ /**
+ * Sets [Builder.merchantCategoryCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantCategoryCode] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply {
+ this.merchantCategoryCode = merchantCategoryCode
+ }
+
+ /** The city the merchant resides in. */
+ fun merchantCity(merchantCity: String?) =
+ merchantCity(JsonField.ofNullable(merchantCity))
+
+ /** Alias for calling [Builder.merchantCity] with `merchantCity.orElse(null)`. */
+ fun merchantCity(merchantCity: Optional) =
+ merchantCity(merchantCity.getOrNull())
+
+ /**
+ * Sets [Builder.merchantCity] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantCity] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantCity(merchantCity: JsonField) = apply {
+ this.merchantCity = merchantCity
+ }
+
+ /** The country the merchant resides in. */
+ fun merchantCountry(merchantCountry: String) =
+ merchantCountry(JsonField.of(merchantCountry))
+
+ /**
+ * Sets [Builder.merchantCountry] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantCountry] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantCountry(merchantCountry: JsonField) = apply {
+ this.merchantCountry = merchantCountry
+ }
+
+ /** The merchant descriptor of the merchant the card is transacting with. */
+ fun merchantDescriptor(merchantDescriptor: String) =
+ merchantDescriptor(JsonField.of(merchantDescriptor))
+
+ /**
+ * Sets [Builder.merchantDescriptor] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantDescriptor] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantDescriptor(merchantDescriptor: JsonField) = apply {
+ this.merchantDescriptor = merchantDescriptor
+ }
+
+ /**
+ * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP
+ * code, where the first 5 and last 4 are separated by a dash.
+ */
+ fun merchantPostalCode(merchantPostalCode: String?) =
+ merchantPostalCode(JsonField.ofNullable(merchantPostalCode))
+
+ /**
+ * Alias for calling [Builder.merchantPostalCode] with
+ * `merchantPostalCode.orElse(null)`.
+ */
+ fun merchantPostalCode(merchantPostalCode: Optional) =
+ merchantPostalCode(merchantPostalCode.getOrNull())
+
+ /**
+ * Sets [Builder.merchantPostalCode] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantPostalCode] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantPostalCode(merchantPostalCode: JsonField) = apply {
+ this.merchantPostalCode = merchantPostalCode
+ }
+
+ /** The state the merchant resides in. */
+ fun merchantState(merchantState: String?) =
+ merchantState(JsonField.ofNullable(merchantState))
+
+ /** Alias for calling [Builder.merchantState] with `merchantState.orElse(null)`. */
+ fun merchantState(merchantState: Optional) =
+ merchantState(merchantState.getOrNull())
+
+ /**
+ * Sets [Builder.merchantState] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.merchantState] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun merchantState(merchantState: JsonField) = apply {
+ this.merchantState = merchantState
+ }
+
+ /** Fields specific to the `network`. */
+ fun networkDetails(networkDetails: NetworkDetails) =
+ networkDetails(JsonField.of(networkDetails))
+
+ /**
+ * Sets [Builder.networkDetails] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.networkDetails] with a well-typed [NetworkDetails]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun networkDetails(networkDetails: JsonField) = apply {
+ this.networkDetails = networkDetails
+ }
+
+ /** Network-specific identifiers for a specific request or transaction. */
+ fun networkIdentifiers(networkIdentifiers: NetworkIdentifiers) =
+ networkIdentifiers(JsonField.of(networkIdentifiers))
+
+ /**
+ * Sets [Builder.networkIdentifiers] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.networkIdentifiers] with a well-typed
+ * [NetworkIdentifiers] value instead. This method is primarily for setting the field to
+ * an undocumented or not yet supported value.
+ */
+ fun networkIdentifiers(networkIdentifiers: JsonField) = apply {
+ this.networkIdentifiers = networkIdentifiers
+ }
+
+ /**
+ * The risk score generated by the card network. For Visa this is the Visa Advanced
+ * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score
+ * is from 0 to 999, where 999 is the riskiest.
+ */
+ fun networkRiskScore(networkRiskScore: Long?) =
+ networkRiskScore(JsonField.ofNullable(networkRiskScore))
+
+ /**
+ * Alias for [Builder.networkRiskScore].
+ *
+ * This unboxed primitive overload exists for backwards compatibility.
+ */
+ fun networkRiskScore(networkRiskScore: Long) =
+ networkRiskScore(networkRiskScore as Long?)
+
+ /**
+ * Alias for calling [Builder.networkRiskScore] with `networkRiskScore.orElse(null)`.
+ */
+ fun networkRiskScore(networkRiskScore: Optional) =
+ networkRiskScore(networkRiskScore.getOrNull())
+
+ /**
+ * Sets [Builder.networkRiskScore] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.networkRiskScore] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun networkRiskScore(networkRiskScore: JsonField) = apply {
+ this.networkRiskScore = networkRiskScore
+ }
+
+ /**
+ * If the authorization was made in-person with a physical card, the Physical Card that
+ * was used.
+ */
+ fun physicalCardId(physicalCardId: String?) =
+ physicalCardId(JsonField.ofNullable(physicalCardId))
+
+ /** Alias for calling [Builder.physicalCardId] with `physicalCardId.orElse(null)`. */
+ fun physicalCardId(physicalCardId: Optional) =
+ physicalCardId(physicalCardId.getOrNull())
+
+ /**
+ * Sets [Builder.physicalCardId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.physicalCardId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun physicalCardId(physicalCardId: JsonField) = apply {
+ this.physicalCardId = physicalCardId
+ }
+
+ /**
+ * The terminal identifier (commonly abbreviated as TID) of the terminal the card is
+ * transacting with.
+ */
+ fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId))
+
+ /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */
+ fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull())
+
+ /**
+ * Sets [Builder.terminalId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.terminalId] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun terminalId(terminalId: JsonField) = apply { this.terminalId = terminalId }
+
+ /**
+ * The identifier of the Card Payment this authorization will belong to. Available in
+ * the API once the card authorization has completed.
+ */
+ fun upcomingCardPaymentId(upcomingCardPaymentId: String) =
+ upcomingCardPaymentId(JsonField.of(upcomingCardPaymentId))
+
+ /**
+ * Sets [Builder.upcomingCardPaymentId] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.upcomingCardPaymentId] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun upcomingCardPaymentId(upcomingCardPaymentId: JsonField) = apply {
+ this.upcomingCardPaymentId = upcomingCardPaymentId
+ }
+
+ /** Fields related to verification of cardholder-provided values. */
+ fun verification(verification: Verification) = verification(JsonField.of(verification))
+
+ /**
+ * Sets [Builder.verification] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.verification] with a well-typed [Verification] value
+ * instead. This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
+ */
+ fun verification(verification: JsonField) = apply {
+ this.verification = verification
+ }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [CardBalanceInquiry].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .accountId()
+ * .additionalAmounts()
+ * .approval()
+ * .cardId()
+ * .decision()
+ * .digitalWalletTokenId()
+ * .merchantAcceptorId()
+ * .merchantCategoryCode()
+ * .merchantCity()
+ * .merchantCountry()
+ * .merchantDescriptor()
+ * .merchantPostalCode()
+ * .merchantState()
+ * .networkDetails()
+ * .networkIdentifiers()
+ * .networkRiskScore()
+ * .physicalCardId()
+ * .terminalId()
+ * .upcomingCardPaymentId()
+ * .verification()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): CardBalanceInquiry =
+ CardBalanceInquiry(
+ checkRequired("accountId", accountId),
+ checkRequired("additionalAmounts", additionalAmounts),
+ checkRequired("approval", approval),
+ checkRequired("cardId", cardId),
+ checkRequired("decision", decision),
+ checkRequired("digitalWalletTokenId", digitalWalletTokenId),
+ checkRequired("merchantAcceptorId", merchantAcceptorId),
+ checkRequired("merchantCategoryCode", merchantCategoryCode),
+ checkRequired("merchantCity", merchantCity),
+ checkRequired("merchantCountry", merchantCountry),
+ checkRequired("merchantDescriptor", merchantDescriptor),
+ checkRequired("merchantPostalCode", merchantPostalCode),
+ checkRequired("merchantState", merchantState),
+ checkRequired("networkDetails", networkDetails),
+ checkRequired("networkIdentifiers", networkIdentifiers),
+ checkRequired("networkRiskScore", networkRiskScore),
+ checkRequired("physicalCardId", physicalCardId),
+ checkRequired("terminalId", terminalId),
+ checkRequired("upcomingCardPaymentId", upcomingCardPaymentId),
+ checkRequired("verification", verification),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): CardBalanceInquiry = apply {
+ if (validated) {
+ return@apply
+ }
+
+ accountId()
+ additionalAmounts().validate()
+ approval().ifPresent { it.validate() }
+ cardId()
+ decision().ifPresent { it.validate() }
+ digitalWalletTokenId()
+ merchantAcceptorId()
+ merchantCategoryCode()
+ merchantCity()
+ merchantCountry()
+ merchantDescriptor()
+ merchantPostalCode()
+ merchantState()
+ networkDetails().validate()
+ networkIdentifiers().validate()
+ networkRiskScore()
+ physicalCardId()
+ terminalId()
+ upcomingCardPaymentId()
+ verification().validate()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (accountId.asKnown().isPresent) 1 else 0) +
+ (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) +
+ (approval.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (cardId.asKnown().isPresent) 1 else 0) +
+ (decision.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) +
+ (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) +
+ (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) +
+ (if (merchantCity.asKnown().isPresent) 1 else 0) +
+ (if (merchantCountry.asKnown().isPresent) 1 else 0) +
+ (if (merchantDescriptor.asKnown().isPresent) 1 else 0) +
+ (if (merchantPostalCode.asKnown().isPresent) 1 else 0) +
+ (if (merchantState.asKnown().isPresent) 1 else 0) +
+ (networkDetails.asKnown().getOrNull()?.validity() ?: 0) +
+ (networkIdentifiers.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (networkRiskScore.asKnown().isPresent) 1 else 0) +
+ (if (physicalCardId.asKnown().isPresent) 1 else 0) +
+ (if (terminalId.asKnown().isPresent) 1 else 0) +
+ (if (upcomingCardPaymentId.asKnown().isPresent) 1 else 0) +
+ (verification.asKnown().getOrNull()?.validity() ?: 0)
+
+ /**
+ * Additional amounts associated with the card authorization, such as ATM surcharges fees.
+ * These are usually a subset of the `amount` field and are used to provide more detailed
+ * information about the transaction.
+ */
+ class AdditionalAmounts
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val clinic: JsonField,
+ private val dental: JsonField,
+ private val original: JsonField,
+ private val prescription: JsonField,
+ private val surcharge: JsonField,
+ private val totalCumulative: JsonField,
+ private val totalHealthcare: JsonField,
+ private val transit: JsonField,
+ private val unknown: JsonField,
+ private val vision: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("clinic")
+ @ExcludeMissing
+ clinic: JsonField = JsonMissing.of(),
+ @JsonProperty("dental")
+ @ExcludeMissing
+ dental: JsonField = JsonMissing.of(),
+ @JsonProperty("original")
+ @ExcludeMissing
+ original: JsonField = JsonMissing.of(),
+ @JsonProperty("prescription")
+ @ExcludeMissing
+ prescription: JsonField = JsonMissing.of(),
+ @JsonProperty("surcharge")
+ @ExcludeMissing
+ surcharge: JsonField = JsonMissing.of(),
+ @JsonProperty("total_cumulative")
+ @ExcludeMissing
+ totalCumulative: JsonField = JsonMissing.of(),
+ @JsonProperty("total_healthcare")
+ @ExcludeMissing
+ totalHealthcare: JsonField = JsonMissing.of(),
+ @JsonProperty("transit")
+ @ExcludeMissing
+ transit: JsonField = JsonMissing.of(),
+ @JsonProperty("unknown")
+ @ExcludeMissing
+ unknown: JsonField = JsonMissing.of(),
+ @JsonProperty("vision") @ExcludeMissing vision: JsonField = JsonMissing.of(),
+ ) : this(
+ clinic,
+ dental,
+ original,
+ prescription,
+ surcharge,
+ totalCumulative,
+ totalHealthcare,
+ transit,
+ unknown,
+ vision,
+ mutableMapOf(),
+ )
+
+ /**
+ * The part of this transaction amount that was for clinic-related services.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun clinic(): Optional = clinic.getOptional("clinic")
+
+ /**
+ * The part of this transaction amount that was for dental-related services.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun dental(): Optional = dental.getOptional("dental")
+
+ /**
+ * The original pre-authorized amount.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun original(): Optional = original.getOptional("original")
+
+ /**
+ * The part of this transaction amount that was for healthcare prescriptions.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun prescription(): Optional = prescription.getOptional("prescription")
+
+ /**
+ * The surcharge amount charged for this transaction by the merchant.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun surcharge(): Optional = surcharge.getOptional("surcharge")
+
+ /**
+ * The total amount of a series of incremental authorizations, optionally provided.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun totalCumulative(): Optional =
+ totalCumulative.getOptional("total_cumulative")
+
+ /**
+ * The total amount of healthcare-related additional amounts.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun totalHealthcare(): Optional =
+ totalHealthcare.getOptional("total_healthcare")
+
+ /**
+ * The part of this transaction amount that was for transit-related services.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun transit(): Optional = transit.getOptional("transit")
+
+ /**
+ * An unknown additional amount.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun unknown(): Optional = unknown.getOptional("unknown")
+
+ /**
+ * The part of this transaction amount that was for vision-related services.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g.
+ * if the server responded with an unexpected value).
+ */
+ fun vision(): Optional = vision.getOptional("vision")
+
+ /**
+ * Returns the raw JSON value of [clinic].
+ *
+ * Unlike [clinic], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("clinic") @ExcludeMissing fun _clinic(): JsonField = clinic
+
+ /**
+ * Returns the raw JSON value of [dental].
+ *
+ * Unlike [dental], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental
+
+ /**
+ * Returns the raw JSON value of [original].
+ *
+ * Unlike [original], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("original")
+ @ExcludeMissing
+ fun _original(): JsonField = original
+
+ /**
+ * Returns the raw JSON value of [prescription].
+ *
+ * Unlike [prescription], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("prescription")
+ @ExcludeMissing
+ fun _prescription(): JsonField = prescription
+
+ /**
+ * Returns the raw JSON value of [surcharge].
+ *
+ * Unlike [surcharge], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("surcharge")
+ @ExcludeMissing
+ fun _surcharge(): JsonField = surcharge
+
+ /**
+ * Returns the raw JSON value of [totalCumulative].
+ *
+ * Unlike [totalCumulative], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("total_cumulative")
+ @ExcludeMissing
+ fun _totalCumulative(): JsonField = totalCumulative
+
+ /**
+ * Returns the raw JSON value of [totalHealthcare].
+ *
+ * Unlike [totalHealthcare], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("total_healthcare")
+ @ExcludeMissing
+ fun _totalHealthcare(): JsonField = totalHealthcare
+
+ /**
+ * Returns the raw JSON value of [transit].
+ *
+ * Unlike [transit], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("transit") @ExcludeMissing fun _transit(): JsonField = transit
+
+ /**
+ * Returns the raw JSON value of [unknown].
+ *
+ * Unlike [unknown], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("unknown") @ExcludeMissing fun _unknown(): JsonField = unknown
+
+ /**
+ * Returns the raw JSON value of [vision].
+ *
+ * Unlike [vision], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("vision") @ExcludeMissing fun _vision(): JsonField = vision
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [AdditionalAmounts].
+ *
+ * The following fields are required:
+ * ```java
+ * .clinic()
+ * .dental()
+ * .original()
+ * .prescription()
+ * .surcharge()
+ * .totalCumulative()
+ * .totalHealthcare()
+ * .transit()
+ * .unknown()
+ * .vision()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [AdditionalAmounts]. */
+ class Builder internal constructor() {
+
+ private var clinic: JsonField? = null
+ private var dental: JsonField? = null
+ private var original: JsonField? = null
+ private var prescription: JsonField? = null
+ private var surcharge: JsonField? = null
+ private var totalCumulative: JsonField? = null
+ private var totalHealthcare: JsonField? = null
+ private var transit: JsonField? = null
+ private var unknown: JsonField? = null
+ private var vision: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(additionalAmounts: AdditionalAmounts) = apply {
+ clinic = additionalAmounts.clinic
+ dental = additionalAmounts.dental
+ original = additionalAmounts.original
+ prescription = additionalAmounts.prescription
+ surcharge = additionalAmounts.surcharge
+ totalCumulative = additionalAmounts.totalCumulative
+ totalHealthcare = additionalAmounts.totalHealthcare
+ transit = additionalAmounts.transit
+ unknown = additionalAmounts.unknown
+ vision = additionalAmounts.vision
+ additionalProperties = additionalAmounts.additionalProperties.toMutableMap()
+ }
+
+ /** The part of this transaction amount that was for clinic-related services. */
+ fun clinic(clinic: Clinic?) = clinic(JsonField.ofNullable(clinic))
+
+ /** Alias for calling [Builder.clinic] with `clinic.orElse(null)`. */
+ fun clinic(clinic: Optional) = clinic(clinic.getOrNull())
+
+ /**
+ * Sets [Builder.clinic] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.clinic] with a well-typed [Clinic] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun clinic(clinic: JsonField) = apply { this.clinic = clinic }
+
+ /** The part of this transaction amount that was for dental-related services. */
+ fun dental(dental: Dental?) = dental(JsonField.ofNullable(dental))
+
+ /** Alias for calling [Builder.dental] with `dental.orElse(null)`. */
+ fun dental(dental: Optional) = dental(dental.getOrNull())
+
+ /**
+ * Sets [Builder.dental] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.dental] with a well-typed [Dental] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun dental(dental: JsonField) = apply { this.dental = dental }
+
+ /** The original pre-authorized amount. */
+ fun original(original: Original?) = original(JsonField.ofNullable(original))
+
+ /** Alias for calling [Builder.original] with `original.orElse(null)`. */
+ fun original(original: Optional) = original(original.getOrNull())
+
+ /**
+ * Sets [Builder.original] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.original] with a well-typed [Original] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun original(original: JsonField) = apply { this.original = original }
+
+ /** The part of this transaction amount that was for healthcare prescriptions. */
+ fun prescription(prescription: Prescription?) =
+ prescription(JsonField.ofNullable(prescription))
+
+ /** Alias for calling [Builder.prescription] with `prescription.orElse(null)`. */
+ fun prescription(prescription: Optional) =
+ prescription(prescription.getOrNull())
+
+ /**
+ * Sets [Builder.prescription] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.prescription] with a well-typed [Prescription]
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun prescription(prescription: JsonField) = apply {
+ this.prescription = prescription
+ }
+
+ /** The surcharge amount charged for this transaction by the merchant. */
+ fun surcharge(surcharge: Surcharge?) = surcharge(JsonField.ofNullable(surcharge))
+
+ /** Alias for calling [Builder.surcharge] with `surcharge.orElse(null)`. */
+ fun surcharge(surcharge: Optional) = surcharge(surcharge.getOrNull())
+
+ /**
+ * Sets [Builder.surcharge] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.surcharge] with a well-typed [Surcharge] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun surcharge(surcharge: JsonField) = apply {
+ this.surcharge = surcharge
+ }
+
+ /**
+ * The total amount of a series of incremental authorizations, optionally provided.
+ */
+ fun totalCumulative(totalCumulative: TotalCumulative?) =
+ totalCumulative(JsonField.ofNullable(totalCumulative))
+
+ /**
+ * Alias for calling [Builder.totalCumulative] with `totalCumulative.orElse(null)`.
+ */
+ fun totalCumulative(totalCumulative: Optional) =
+ totalCumulative(totalCumulative.getOrNull())
+
+ /**
+ * Sets [Builder.totalCumulative] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.totalCumulative] with a well-typed
+ * [TotalCumulative] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun totalCumulative(totalCumulative: JsonField) = apply {
+ this.totalCumulative = totalCumulative
+ }
+
+ /** The total amount of healthcare-related additional amounts. */
+ fun totalHealthcare(totalHealthcare: TotalHealthcare?) =
+ totalHealthcare(JsonField.ofNullable(totalHealthcare))
+
+ /**
+ * Alias for calling [Builder.totalHealthcare] with `totalHealthcare.orElse(null)`.
+ */
+ fun totalHealthcare(totalHealthcare: Optional) =
+ totalHealthcare(totalHealthcare.getOrNull())
+
+ /**
+ * Sets [Builder.totalHealthcare] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.totalHealthcare] with a well-typed
+ * [TotalHealthcare] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun totalHealthcare(totalHealthcare: JsonField) = apply {
+ this.totalHealthcare = totalHealthcare
+ }
+
+ /** The part of this transaction amount that was for transit-related services. */
+ fun transit(transit: Transit?) = transit(JsonField.ofNullable(transit))
+
+ /** Alias for calling [Builder.transit] with `transit.orElse(null)`. */
+ fun transit(transit: Optional) = transit(transit.getOrNull())
+
+ /**
+ * Sets [Builder.transit] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.transit] with a well-typed [Transit] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun transit(transit: JsonField) = apply { this.transit = transit }
+
+ /** An unknown additional amount. */
+ fun unknown(unknown: Unknown?) = unknown(JsonField.ofNullable(unknown))
+
+ /** Alias for calling [Builder.unknown] with `unknown.orElse(null)`. */
+ fun unknown(unknown: Optional) = unknown(unknown.getOrNull())
+
+ /**
+ * Sets [Builder.unknown] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.unknown] with a well-typed [Unknown] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun unknown(unknown: JsonField) = apply { this.unknown = unknown }
+
+ /** The part of this transaction amount that was for vision-related services. */
+ fun vision(vision: Vision?) = vision(JsonField.ofNullable(vision))
+
+ /** Alias for calling [Builder.vision] with `vision.orElse(null)`. */
+ fun vision(vision: Optional) = vision(vision.getOrNull())
+
+ /**
+ * Sets [Builder.vision] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.vision] with a well-typed [Vision] value
+ * instead. This method is primarily for setting the field to an undocumented or not
+ * yet supported value.
+ */
+ fun vision(vision: JsonField) = apply { this.vision = vision }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [AdditionalAmounts].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .clinic()
+ * .dental()
+ * .original()
+ * .prescription()
+ * .surcharge()
+ * .totalCumulative()
+ * .totalHealthcare()
+ * .transit()
+ * .unknown()
+ * .vision()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): AdditionalAmounts =
+ AdditionalAmounts(
+ checkRequired("clinic", clinic),
+ checkRequired("dental", dental),
+ checkRequired("original", original),
+ checkRequired("prescription", prescription),
+ checkRequired("surcharge", surcharge),
+ checkRequired("totalCumulative", totalCumulative),
+ checkRequired("totalHealthcare", totalHealthcare),
+ checkRequired("transit", transit),
+ checkRequired("unknown", unknown),
+ checkRequired("vision", vision),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): AdditionalAmounts = apply {
+ if (validated) {
+ return@apply
+ }
+
+ clinic().ifPresent { it.validate() }
+ dental().ifPresent { it.validate() }
+ original().ifPresent { it.validate() }
+ prescription().ifPresent { it.validate() }
+ surcharge().ifPresent { it.validate() }
+ totalCumulative().ifPresent { it.validate() }
+ totalHealthcare().ifPresent { it.validate() }
+ transit().ifPresent { it.validate() }
+ unknown().ifPresent { it.validate() }
+ vision().ifPresent { it.validate() }
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (clinic.asKnown().getOrNull()?.validity() ?: 0) +
+ (dental.asKnown().getOrNull()?.validity() ?: 0) +
+ (original.asKnown().getOrNull()?.validity() ?: 0) +
+ (prescription.asKnown().getOrNull()?.validity() ?: 0) +
+ (surcharge.asKnown().getOrNull()?.validity() ?: 0) +
+ (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) +
+ (totalHealthcare.asKnown().getOrNull()?.validity() ?: 0) +
+ (transit.asKnown().getOrNull()?.validity() ?: 0) +
+ (unknown.asKnown().getOrNull()?.validity() ?: 0) +
+ (vision.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** The part of this transaction amount that was for clinic-related services. */
+ class Clinic
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
+
+ /**
+ * The amount in minor units of the `currency` field. The amount is positive if it
+ * is added to the amount (such as an ATM surcharge fee) and negative if it is
+ * subtracted from the amount (such as a discount).
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or
+ * is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
+ * amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or
+ * is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [currency].
+ *
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Clinic].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Clinic]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(clinic: Clinic) = apply {
+ amount = clinic.amount
+ currency = clinic.currency
+ additionalProperties = clinic.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The amount in minor units of the `currency` field. The amount is positive if
+ * it is added to the amount (such as an ATM surcharge fee) and negative if it
+ * is subtracted from the amount (such as a discount).
+ */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ */
+ fun currency(currency: String) = currency(JsonField.of(currency))
+
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [Clinic].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Clinic =
+ Clinic(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
+ private var validated: Boolean = false
+
+ fun validate(): Clinic = apply {
+ if (validated) {
+ return@apply
+ }
+
+ amount()
+ currency()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Clinic &&
+ amount == other.amount &&
+ currency == other.currency &&
+ additionalProperties == other.additionalProperties
+ }
+
+ private val hashCode: Int by lazy {
+ Objects.hash(amount, currency, additionalProperties)
+ }
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
+ }
+
+ /** The part of this transaction amount that was for dental-related services. */
+ class Dental
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
+
+ /**
+ * The amount in minor units of the `currency` field. The amount is positive if it
+ * is added to the amount (such as an ATM surcharge fee) and negative if it is
+ * subtracted from the amount (such as a discount).
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or
+ * is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional
+ * amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or
+ * is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
+
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
+
+ /**
+ * Returns the raw JSON value of [currency].
+ *
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Dental].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Dental]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(dental: Dental) = apply {
+ amount = dental.amount
+ currency = dental.currency
+ additionalProperties = dental.additionalProperties.toMutableMap()
+ }
+
+ /**
+ * The amount in minor units of the `currency` field. The amount is positive if
+ * it is added to the amount (such as an ATM surcharge fee) and negative if it
+ * is subtracted from the amount (such as a discount).
+ */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ */
+ fun currency(currency: String) = currency(JsonField.of(currency))
+
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ fun additionalProperties(additionalProperties: Map