diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 9a47da071..646eee7bd 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.496.0"
+ ".": "0.497.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 46d00e014..d76d554a2 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 236
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-57310f0e57b0996b79f938ef778b40e54f5b62cefb78c3e6405cefacfa704c66.yml
-openapi_spec_hash: c6d65e9ebf76cb81a5395b8ab4251a95
-config_hash: 0997ade8b52ec04e82d5b0c3b61bb51e
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-1537e933795625528b93b601e286a513458f9aad05160ee018383e6b29986956.yml
+openapi_spec_hash: f34d800917618bf012b466c1f88e8eca
+config_hash: 4945e03affdf289484733306e4797f81
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 88e8f23d3..19994dec7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.497.0 (2026-03-30)
+
+Full Changelog: [v0.496.0...v0.497.0](https://github.com/Increase/increase-java/compare/v0.496.0...v0.497.0)
+
+### Features
+
+* **api:** api update ([8fdd517](https://github.com/Increase/increase-java/commit/8fdd5170cbf62b0f697ebeb8bc0c377fd58211b6))
+
## 0.496.0 (2026-03-27)
Full Changelog: [v0.495.0...v0.496.0](https://github.com/Increase/increase-java/compare/v0.495.0...v0.496.0)
diff --git a/README.md b/README.md
index 0292cf3a6..af0fbaf3f 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.496.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.496.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.497.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.497.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.496.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.497.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.496.0")
+implementation("com.increase.api:increase-java:0.497.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.496.0")
com.increase.api
increase-java
- 0.496.0
+ 0.497.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 3899a5179..e16537bdc 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.496.0" // x-release-please-version
+ version = "0.497.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 10c33c762..5553e3244 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
@@ -36,7 +36,6 @@ private constructor(
private val digitalWalletTokenId: JsonField,
private val elements: JsonField>,
private val physicalCardId: JsonField,
- private val schemeFees: JsonField>,
private val state: JsonField,
private val type: JsonField,
private val additionalProperties: MutableMap,
@@ -59,9 +58,6 @@ private constructor(
@JsonProperty("physical_card_id")
@ExcludeMissing
physicalCardId: JsonField = JsonMissing.of(),
- @JsonProperty("scheme_fees")
- @ExcludeMissing
- schemeFees: JsonField> = JsonMissing.of(),
@JsonProperty("state") @ExcludeMissing state: JsonField = JsonMissing.of(),
@JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
) : this(
@@ -72,7 +68,6 @@ private constructor(
digitalWalletTokenId,
elements,
physicalCardId,
- schemeFees,
state,
type,
mutableMapOf(),
@@ -136,14 +131,6 @@ private constructor(
*/
fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id")
- /**
- * The scheme fees associated with this card payment.
- *
- * @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 schemeFees(): List = schemeFees.getRequired("scheme_fees")
-
/**
* The summarized state of this card payment.
*
@@ -217,15 +204,6 @@ private constructor(
@ExcludeMissing
fun _physicalCardId(): JsonField = physicalCardId
- /**
- * Returns the raw JSON value of [schemeFees].
- *
- * Unlike [schemeFees], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("scheme_fees")
- @ExcludeMissing
- fun _schemeFees(): JsonField> = schemeFees
-
/**
* Returns the raw JSON value of [state].
*
@@ -266,7 +244,6 @@ private constructor(
* .digitalWalletTokenId()
* .elements()
* .physicalCardId()
- * .schemeFees()
* .state()
* .type()
* ```
@@ -284,7 +261,6 @@ private constructor(
private var digitalWalletTokenId: JsonField? = null
private var elements: JsonField>? = null
private var physicalCardId: JsonField? = null
- private var schemeFees: JsonField>? = null
private var state: JsonField? = null
private var type: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@@ -298,7 +274,6 @@ private constructor(
digitalWalletTokenId = cardPayment.digitalWalletTokenId
elements = cardPayment.elements.map { it.toMutableList() }
physicalCardId = cardPayment.physicalCardId
- schemeFees = cardPayment.schemeFees.map { it.toMutableList() }
state = cardPayment.state
type = cardPayment.type
additionalProperties = cardPayment.additionalProperties.toMutableMap()
@@ -420,32 +395,6 @@ private constructor(
this.physicalCardId = physicalCardId
}
- /** The scheme fees associated with this card payment. */
- fun schemeFees(schemeFees: List) = schemeFees(JsonField.of(schemeFees))
-
- /**
- * Sets [Builder.schemeFees] to an arbitrary JSON value.
- *
- * You should usually call [Builder.schemeFees] with a well-typed `List` value
- * instead. This method is primarily for setting the field to an undocumented or not yet
- * supported value.
- */
- fun schemeFees(schemeFees: JsonField>) = apply {
- this.schemeFees = schemeFees.map { it.toMutableList() }
- }
-
- /**
- * Adds a single [SchemeFee] to [schemeFees].
- *
- * @throws IllegalStateException if the field was previously set to a non-list.
- */
- fun addSchemeFee(schemeFee: SchemeFee) = apply {
- schemeFees =
- (schemeFees ?: JsonField.of(mutableListOf())).also {
- checkKnown("schemeFees", it).add(schemeFee)
- }
- }
-
/** The summarized state of this card payment. */
fun state(state: State) = state(JsonField.of(state))
@@ -504,7 +453,6 @@ private constructor(
* .digitalWalletTokenId()
* .elements()
* .physicalCardId()
- * .schemeFees()
* .state()
* .type()
* ```
@@ -520,7 +468,6 @@ private constructor(
checkRequired("digitalWalletTokenId", digitalWalletTokenId),
checkRequired("elements", elements).map { it.toImmutable() },
checkRequired("physicalCardId", physicalCardId),
- checkRequired("schemeFees", schemeFees).map { it.toImmutable() },
checkRequired("state", state),
checkRequired("type", type),
additionalProperties.toMutableMap(),
@@ -541,7 +488,6 @@ private constructor(
digitalWalletTokenId()
elements().forEach { it.validate() }
physicalCardId()
- schemeFees().forEach { it.validate() }
state().validate()
type().validate()
validated = true
@@ -569,7 +515,6 @@ private constructor(
(if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) +
(elements.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (physicalCardId.asKnown().isPresent) 1 else 0) +
- (schemeFees.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(state.asKnown().getOrNull()?.validity() ?: 0) +
(type.asKnown().getOrNull()?.validity() ?: 0)
@@ -8524,6 +8469,7 @@ private constructor(
private val presentmentCurrency: JsonField,
private val processingCategory: JsonField,
private val realTimeDecisionId: JsonField,
+ private val schemeFees: JsonField>,
private val terminalId: JsonField,
private val type: JsonField,
private val verification: JsonField,
@@ -8603,6 +8549,9 @@ private constructor(
@JsonProperty("real_time_decision_id")
@ExcludeMissing
realTimeDecisionId: JsonField = JsonMissing.of(),
+ @JsonProperty("scheme_fees")
+ @ExcludeMissing
+ schemeFees: JsonField> = JsonMissing.of(),
@JsonProperty("terminal_id")
@ExcludeMissing
terminalId: JsonField = JsonMissing.of(),
@@ -8636,6 +8585,7 @@ private constructor(
presentmentCurrency,
processingCategory,
realTimeDecisionId,
+ schemeFees,
terminalId,
type,
verification,
@@ -8886,6 +8836,15 @@ private constructor(
fun realTimeDecisionId(): Optional =
realTimeDecisionId.getOptional("real_time_decision_id")
+ /**
+ * The scheme fees associated with this card authorization.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun schemeFees(): List = schemeFees.getRequired("scheme_fees")
+
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
@@ -9158,6 +9117,16 @@ private constructor(
@ExcludeMissing
fun _realTimeDecisionId(): JsonField = realTimeDecisionId
+ /**
+ * Returns the raw JSON value of [schemeFees].
+ *
+ * Unlike [schemeFees], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("scheme_fees")
+ @ExcludeMissing
+ fun _schemeFees(): JsonField> = schemeFees
+
/**
* Returns the raw JSON value of [terminalId].
*
@@ -9229,6 +9198,7 @@ private constructor(
* .presentmentCurrency()
* .processingCategory()
* .realTimeDecisionId()
+ * .schemeFees()
* .terminalId()
* .type()
* .verification()
@@ -9265,6 +9235,7 @@ private constructor(
private var presentmentCurrency: JsonField? = null
private var processingCategory: JsonField? = null
private var realTimeDecisionId: JsonField? = null
+ private var schemeFees: JsonField>? = null
private var terminalId: JsonField? = null
private var type: JsonField? = null
private var verification: JsonField? = null
@@ -9297,6 +9268,7 @@ private constructor(
presentmentCurrency = cardAuthorization.presentmentCurrency
processingCategory = cardAuthorization.processingCategory
realTimeDecisionId = cardAuthorization.realTimeDecisionId
+ schemeFees = cardAuthorization.schemeFees.map { it.toMutableList() }
terminalId = cardAuthorization.terminalId
type = cardAuthorization.type
verification = cardAuthorization.verification
@@ -9770,6 +9742,32 @@ private constructor(
this.realTimeDecisionId = realTimeDecisionId
}
+ /** The scheme fees associated with this card authorization. */
+ fun schemeFees(schemeFees: List) = schemeFees(JsonField.of(schemeFees))
+
+ /**
+ * Sets [Builder.schemeFees] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.schemeFees] with a well-typed `List`
+ * value instead. This method is primarily for setting the field to an undocumented
+ * or not yet supported value.
+ */
+ fun schemeFees(schemeFees: JsonField>) = apply {
+ this.schemeFees = schemeFees.map { it.toMutableList() }
+ }
+
+ /**
+ * Adds a single [SchemeFee] to [schemeFees].
+ *
+ * @throws IllegalStateException if the field was previously set to a non-list.
+ */
+ fun addSchemeFee(schemeFee: SchemeFee) = apply {
+ schemeFees =
+ (schemeFees ?: JsonField.of(mutableListOf())).also {
+ checkKnown("schemeFees", it).add(schemeFee)
+ }
+ }
+
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
@@ -9874,6 +9872,7 @@ private constructor(
* .presentmentCurrency()
* .processingCategory()
* .realTimeDecisionId()
+ * .schemeFees()
* .terminalId()
* .type()
* .verification()
@@ -9908,6 +9907,7 @@ private constructor(
checkRequired("presentmentCurrency", presentmentCurrency),
checkRequired("processingCategory", processingCategory),
checkRequired("realTimeDecisionId", realTimeDecisionId),
+ checkRequired("schemeFees", schemeFees).map { it.toImmutable() },
checkRequired("terminalId", terminalId),
checkRequired("type", type),
checkRequired("verification", verification),
@@ -9947,6 +9947,7 @@ private constructor(
presentmentCurrency()
processingCategory().validate()
realTimeDecisionId()
+ schemeFees().forEach { it.validate() }
terminalId()
type().validate()
verification().validate()
@@ -9994,6 +9995,7 @@ private constructor(
(if (presentmentCurrency.asKnown().isPresent) 1 else 0) +
(processingCategory.asKnown().getOrNull()?.validity() ?: 0) +
(if (realTimeDecisionId.asKnown().isPresent) 1 else 0) +
+ (schemeFees.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) +
(if (terminalId.asKnown().isPresent) 1 else 0) +
(type.asKnown().getOrNull()?.validity() ?: 0) +
(verification.asKnown().getOrNull()?.validity() ?: 0)
@@ -15994,217 +15996,162 @@ private constructor(
override fun toString() = value.toString()
}
- /**
- * A constant representing the object's type. For this resource it will always be
- * `card_authorization`.
- */
- class Type @JsonCreator private constructor(private val value: JsonField) :
- Enum {
+ class SchemeFee
+ @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ private constructor(
+ private val amount: JsonField,
+ private val createdAt: JsonField,
+ private val currency: JsonField,
+ private val feeType: JsonField,
+ private val fixedComponent: JsonField,
+ private val variableRate: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ createdAt: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ @JsonProperty("fee_type")
+ @ExcludeMissing
+ feeType: JsonField = JsonMissing.of(),
+ @JsonProperty("fixed_component")
+ @ExcludeMissing
+ fixedComponent: JsonField = JsonMissing.of(),
+ @JsonProperty("variable_rate")
+ @ExcludeMissing
+ variableRate: JsonField = JsonMissing.of(),
+ ) : this(
+ amount,
+ createdAt,
+ currency,
+ feeType,
+ fixedComponent,
+ variableRate,
+ mutableMapOf(),
+ )
/**
- * Returns this class instance's raw value.
+ * The fee amount given as a string containing a decimal number.
*
- * 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
-
- companion object {
-
- @JvmField val CARD_AUTHORIZATION = of("card_authorization")
-
- @JvmStatic fun of(value: String) = Type(JsonField.of(value))
- }
-
- /** An enum containing [Type]'s known values. */
- enum class Known {
- CARD_AUTHORIZATION
- }
+ fun amount(): String = amount.getRequired("amount")
/**
- * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee was
+ * created.
*
- * 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.
+ * @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).
*/
- enum class Value {
- CARD_AUTHORIZATION,
- /**
- * An enum member indicating that [Type] was instantiated with an unknown value.
- */
- _UNKNOWN,
- }
+ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee
+ * reimbursement.
*
- * Use the [known] method instead if you're certain the value is always known or if
- * you want to throw for the unknown case.
+ * @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 value(): Value =
- when (this) {
- CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION
- else -> Value._UNKNOWN
- }
+ fun currency(): Currency = currency.getRequired("currency")
/**
- * Returns an enum member corresponding to this class instance's value.
+ * The type of fee being assessed.
*
- * 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.
+ * @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 known(): Known =
- when (this) {
- CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION
- else -> throw IncreaseInvalidDataException("Unknown Type: $value")
- }
+ fun feeType(): FeeType = feeType.getRequired("fee_type")
/**
- * 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.
+ * The fixed component of the fee, if applicable, given in major units of the fee
+ * amount.
*
- * @throws IncreaseInvalidDataException if this class instance's value does not have
- * the expected primitive type.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Type = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ fun fixedComponent(): Optional =
+ fixedComponent.getOptional("fixed_component")
/**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
+ * The variable rate component of the fee, if applicable, given as a decimal (e.g.,
+ * 0.015 for 1.5%).
*
- * Used for best match union deserialization.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- @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 cardholderName: 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(),
- @JsonProperty("cardholder_name")
- @ExcludeMissing
- cardholderName: JsonField = JsonMissing.of(),
- ) : this(cardVerificationCode, cardholderAddress, cardholderName, mutableMapOf())
+ fun variableRate(): Optional = variableRate.getOptional("variable_rate")
/**
- * Fields related to verification of the Card Verification Code, a 3-digit code on
- * the back of the card.
+ * Returns the raw JSON value of [amount].
*
- * @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).
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun cardVerificationCode(): CardVerificationCode =
- cardVerificationCode.getRequired("card_verification_code")
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
/**
- * Cardholder address provided in the authorization request and the address on file
- * we verified it against.
+ * Returns the raw JSON value of [createdAt].
*
- * @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).
+ * Unlike [createdAt], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun cardholderAddress(): CardholderAddress =
- cardholderAddress.getRequired("cardholder_address")
+ @JsonProperty("created_at")
+ @ExcludeMissing
+ fun _createdAt(): JsonField = createdAt
/**
- * Cardholder name provided in the authorization request.
+ * Returns the raw JSON value of [currency].
*
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
+ * Unlike [currency], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun cardholderName(): Optional =
- cardholderName.getOptional("cardholder_name")
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
/**
- * Returns the raw JSON value of [cardVerificationCode].
+ * Returns the raw JSON value of [feeType].
*
- * Unlike [cardVerificationCode], this method doesn't throw if the JSON field has an
- * unexpected type.
+ * Unlike [feeType], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- @JsonProperty("card_verification_code")
+ @JsonProperty("fee_type")
@ExcludeMissing
- fun _cardVerificationCode(): JsonField = cardVerificationCode
+ fun _feeType(): JsonField = feeType
/**
- * Returns the raw JSON value of [cardholderAddress].
+ * Returns the raw JSON value of [fixedComponent].
*
- * Unlike [cardholderAddress], this method doesn't throw if the JSON field has an
+ * Unlike [fixedComponent], this method doesn't throw if the JSON field has an
* unexpected type.
*/
- @JsonProperty("cardholder_address")
+ @JsonProperty("fixed_component")
@ExcludeMissing
- fun _cardholderAddress(): JsonField = cardholderAddress
+ fun _fixedComponent(): JsonField = fixedComponent
/**
- * Returns the raw JSON value of [cardholderName].
+ * Returns the raw JSON value of [variableRate].
*
- * Unlike [cardholderName], this method doesn't throw if the JSON field has an
+ * Unlike [variableRate], this method doesn't throw if the JSON field has an
* unexpected type.
*/
- @JsonProperty("cardholder_name")
+ @JsonProperty("variable_rate")
@ExcludeMissing
- fun _cardholderName(): JsonField = cardholderName
+ fun _variableRate(): JsonField = variableRate
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -16221,90 +16168,146 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [Verification].
+ * Returns a mutable builder for constructing an instance of [SchemeFee].
*
* The following fields are required:
* ```java
- * .cardVerificationCode()
- * .cardholderAddress()
- * .cardholderName()
+ * .amount()
+ * .createdAt()
+ * .currency()
+ * .feeType()
+ * .fixedComponent()
+ * .variableRate()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Verification]. */
+ /** A builder for [SchemeFee]. */
class Builder internal constructor() {
- private var cardVerificationCode: JsonField? = null
- private var cardholderAddress: JsonField? = null
- private var cardholderName: JsonField? = null
+ private var amount: JsonField? = null
+ private var createdAt: JsonField? = null
+ private var currency: JsonField? = null
+ private var feeType: JsonField? = null
+ private var fixedComponent: JsonField? = null
+ private var variableRate: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(verification: Verification) = apply {
- cardVerificationCode = verification.cardVerificationCode
- cardholderAddress = verification.cardholderAddress
- cardholderName = verification.cardholderName
- additionalProperties = verification.additionalProperties.toMutableMap()
+ internal fun from(schemeFee: SchemeFee) = apply {
+ amount = schemeFee.amount
+ createdAt = schemeFee.createdAt
+ currency = schemeFee.currency
+ feeType = schemeFee.feeType
+ fixedComponent = schemeFee.fixedComponent
+ variableRate = schemeFee.variableRate
+ additionalProperties = schemeFee.additionalProperties.toMutableMap()
}
+ /** The fee amount given as a string containing a decimal number. */
+ fun amount(amount: String) = amount(JsonField.of(amount))
+
/**
- * Fields related to verification of the Card Verification Code, a 3-digit code
- * on the back of the card.
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [String] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
*/
- fun cardVerificationCode(cardVerificationCode: CardVerificationCode) =
- cardVerificationCode(JsonField.of(cardVerificationCode))
+ fun amount(amount: JsonField) = apply { this.amount = amount }
/**
- * Sets [Builder.cardVerificationCode] to an arbitrary JSON value.
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee
+ * was created.
+ */
+ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
+
+ /**
+ * Sets [Builder.createdAt] 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.
+ * You should usually call [Builder.createdAt] with a well-typed
+ * [OffsetDateTime] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
*/
- fun cardVerificationCode(
- cardVerificationCode: JsonField
- ) = apply { this.cardVerificationCode = cardVerificationCode }
+ fun createdAt(createdAt: JsonField) = apply {
+ this.createdAt = createdAt
+ }
/**
- * Cardholder address provided in the authorization request and the address on
- * file we verified it against.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee
+ * reimbursement.
*/
- fun cardholderAddress(cardholderAddress: CardholderAddress) =
- cardholderAddress(JsonField.of(cardholderAddress))
+ fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
- * Sets [Builder.cardholderAddress] to an arbitrary JSON value.
+ * Sets [Builder.currency] 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.
+ * You should usually call [Builder.currency] with a well-typed [Currency] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
*/
- fun cardholderAddress(cardholderAddress: JsonField) = apply {
- this.cardholderAddress = cardholderAddress
+ fun currency(currency: JsonField) = apply { this.currency = currency }
+
+ /** The type of fee being assessed. */
+ fun feeType(feeType: FeeType) = feeType(JsonField.of(feeType))
+
+ /**
+ * Sets [Builder.feeType] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.feeType] with a well-typed [FeeType] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun feeType(feeType: JsonField) = apply { this.feeType = feeType }
+
+ /**
+ * The fixed component of the fee, if applicable, given in major units of the
+ * fee amount.
+ */
+ fun fixedComponent(fixedComponent: String?) =
+ fixedComponent(JsonField.ofNullable(fixedComponent))
+
+ /**
+ * Alias for calling [Builder.fixedComponent] with
+ * `fixedComponent.orElse(null)`.
+ */
+ fun fixedComponent(fixedComponent: Optional) =
+ fixedComponent(fixedComponent.getOrNull())
+
+ /**
+ * Sets [Builder.fixedComponent] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.fixedComponent] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun fixedComponent(fixedComponent: JsonField) = apply {
+ this.fixedComponent = fixedComponent
}
- /** Cardholder name provided in the authorization request. */
- fun cardholderName(cardholderName: CardholderName?) =
- cardholderName(JsonField.ofNullable(cardholderName))
+ /**
+ * The variable rate component of the fee, if applicable, given as a decimal
+ * (e.g., 0.015 for 1.5%).
+ */
+ fun variableRate(variableRate: String?) =
+ variableRate(JsonField.ofNullable(variableRate))
/**
- * Alias for calling [Builder.cardholderName] with
- * `cardholderName.orElse(null)`.
+ * Alias for calling [Builder.variableRate] with `variableRate.orElse(null)`.
*/
- fun cardholderName(cardholderName: Optional) =
- cardholderName(cardholderName.getOrNull())
+ fun variableRate(variableRate: Optional) =
+ variableRate(variableRate.getOrNull())
/**
- * Sets [Builder.cardholderName] to an arbitrary JSON value.
+ * Sets [Builder.variableRate] to an arbitrary JSON value.
*
- * You should usually call [Builder.cardholderName] with a well-typed
- * [CardholderName] value instead. This method is primarily for setting the
- * field to an undocumented or not yet supported value.
+ * You should usually call [Builder.variableRate] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun cardholderName(cardholderName: JsonField) = apply {
- this.cardholderName = cardholderName
+ fun variableRate(variableRate: JsonField) = apply {
+ this.variableRate = variableRate
}
fun additionalProperties(additionalProperties: Map) = apply {
@@ -16330,38 +16333,47 @@ private constructor(
}
/**
- * Returns an immutable instance of [Verification].
+ * Returns an immutable instance of [SchemeFee].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
- * .cardVerificationCode()
- * .cardholderAddress()
- * .cardholderName()
+ * .amount()
+ * .createdAt()
+ * .currency()
+ * .feeType()
+ * .fixedComponent()
+ * .variableRate()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): Verification =
- Verification(
- checkRequired("cardVerificationCode", cardVerificationCode),
- checkRequired("cardholderAddress", cardholderAddress),
- checkRequired("cardholderName", cardholderName),
+ fun build(): SchemeFee =
+ SchemeFee(
+ checkRequired("amount", amount),
+ checkRequired("createdAt", createdAt),
+ checkRequired("currency", currency),
+ checkRequired("feeType", feeType),
+ checkRequired("fixedComponent", fixedComponent),
+ checkRequired("variableRate", variableRate),
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): Verification = apply {
+ fun validate(): SchemeFee = apply {
if (validated) {
return@apply
}
- cardVerificationCode().validate()
- cardholderAddress().validate()
- cardholderName().ifPresent { it.validate() }
+ amount()
+ createdAt()
+ currency().validate()
+ feeType().validate()
+ fixedComponent()
+ variableRate()
validated = true
}
@@ -16381,148 +16393,116 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (cardVerificationCode.asKnown().getOrNull()?.validity() ?: 0) +
- (cardholderAddress.asKnown().getOrNull()?.validity() ?: 0) +
- (cardholderName.asKnown().getOrNull()?.validity() ?: 0)
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (createdAt.asKnown().isPresent) 1 else 0) +
+ (currency.asKnown().getOrNull()?.validity() ?: 0) +
+ (feeType.asKnown().getOrNull()?.validity() ?: 0) +
+ (if (fixedComponent.asKnown().isPresent) 1 else 0) +
+ (if (variableRate.asKnown().isPresent) 1 else 0)
/**
- * Fields related to verification of the Card Verification Code, a 3-digit code on
- * the back of the card.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee
+ * reimbursement.
*/
- 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")
+ class Currency
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
/**
- * Returns the raw JSON value of [result].
+ * Returns this class instance's raw value.
*
- * Unlike [result], this method doesn't throw if the JSON field has an
- * unexpected type.
+ * 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.
*/
- @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)
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
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()
+ /** US Dollar (USD) */
+ @JvmField val USD = of("USD")
- @JvmSynthetic
- internal fun from(cardVerificationCode: CardVerificationCode) = apply {
- result = cardVerificationCode.result
- additionalProperties =
- cardVerificationCode.additionalProperties.toMutableMap()
- }
+ @JvmStatic fun of(value: String) = Currency(JsonField.of(value))
+ }
- /** The result of verifying the Card Verification Code. */
- fun result(result: Result) = result(JsonField.of(result))
+ /** An enum containing [Currency]'s known values. */
+ enum class Known {
+ /** US Dollar (USD) */
+ USD
+ }
+ /**
+ * An enum containing [Currency]'s known values, as well as an [_UNKNOWN]
+ * member.
+ *
+ * An instance of [Currency] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For
+ * example, if the SDK is on an older version than the API, then the API may
+ * respond with new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ /** US Dollar (USD) */
+ USD,
/**
- * 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.
+ * An enum member indicating that [Currency] was instantiated with an
+ * unknown value.
*/
- fun result(result: JsonField) = apply { this.result = result }
-
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
+ _UNKNOWN,
+ }
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or
+ * if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ USD -> Value.USD
+ else -> Value._UNKNOWN
}
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known
+ * and don't want to throw for the unknown case.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value is a not
+ * a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ USD -> Known.USD
+ else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
}
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for
+ * debugging and generally doesn't throw.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value does not
+ * have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
}
- /**
- * Returns an immutable instance of [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 {
+ fun validate(): Currency = apply {
if (validated) {
return@apply
}
- result().validate()
+ known()
validated = true
}
@@ -16541,537 +16521,730 @@ private constructor(
* Used for best match union deserialization.
*/
@JvmSynthetic
- internal fun validity(): Int = (result.asKnown().getOrNull()?.validity() ?: 0)
+ internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
- /** The result of verifying the Card Verification Code. */
- class Result
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
+
+ return other is Currency && value == other.value
+ }
+
+ override fun hashCode() = value.hashCode()
+
+ override fun toString() = value.toString()
+ }
+
+ /** The type of fee being assessed. */
+ class FeeType
+ @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 {
/**
- * 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.
+ * International Service Assessment (ISA) single-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in the same currency.
*/
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
+ @JvmField
+ val VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY =
+ of("visa_international_service_assessment_single_currency")
- companion object {
+ /**
+ * International Service Assessment (ISA) cross-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in different currencies.
+ */
+ @JvmField
+ val VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY =
+ of("visa_international_service_assessment_cross_currency")
- /**
- * No card verification code was provided in the authorization request.
- */
- @JvmField val NOT_CHECKED = of("not_checked")
+ /**
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) authorization transactions. Authorization is the process
+ * of approving or declining the transaction amount specified. The fee is
+ * assessed to the Issuer.
+ */
+ @JvmField
+ val VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE =
+ of("visa_authorization_domestic_point_of_sale")
- /** The card verification code matched the one on file. */
- @JvmField val MATCH = of("match")
+ /**
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) International authorization transactions. Authorization
+ * is the process of approving or declining the transaction amount
+ * specified. The fee is assessed to the Issuer.
+ */
+ @JvmField
+ val VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE =
+ of("visa_authorization_international_point_of_sale")
- /** The card verification code did not match the one on file. */
- @JvmField val NO_MATCH = of("no_match")
+ /**
+ * Activity and charges for Visa Settlement System processing for Canada
+ * Region POS (Point-of-Sale) authorization transactions. Authorization is
+ * the process of approving or declining the transaction amount specified.
+ */
+ @JvmField
+ val VISA_AUTHORIZATION_CANADA_POINT_OF_SALE =
+ of("visa_authorization_canada_point_of_sale")
- @JvmStatic fun of(value: String) = Result(JsonField.of(value))
- }
+ /**
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) reversal transactions. Authorization reversal represents
+ * a VSS message that undoes the complete or partial actions of a previous
+ * authorization request.
+ */
+ @JvmField
+ val VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE =
+ of("visa_authorization_reversal_point_of_sale")
- /** 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,
- }
+ /**
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) International reversal transactions. Authorization
+ * reversal represents a VSS message that undoes the complete or partial
+ * actions of a previous authorization request.
+ */
+ @JvmField
+ val VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE =
+ of("visa_authorization_reversal_international_point_of_sale")
/**
- * 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.
+ * A per Address Verification Service (AVS) result fee. Applies to all
+ * usable AVS result codes.
*/
- 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,
- }
+ @JvmField
+ val VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE =
+ of("visa_authorization_address_verification_service")
/**
- * 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.
+ * Advanced Authorization is a fraud detection tool that monitors and risk
+ * evaluates 100 percent of US VisaNet authorizations in real-time. Activity
+ * related to Purchase (includes Signature Authenticated Visa and PIN
+ * Authenticated Visa Debit (PAVD) transactions).
*/
- fun value(): Value =
- when (this) {
- NOT_CHECKED -> Value.NOT_CHECKED
- MATCH -> Value.MATCH
- NO_MATCH -> Value.NO_MATCH
- else -> Value._UNKNOWN
- }
+ @JvmField
+ val VISA_ADVANCED_AUTHORIZATION = of("visa_advanced_authorization")
/**
- * 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.
+ * Issuer Transactions Visa represents a charge based on total actual
+ * monthly processing (Visa transactions only) through a VisaNet Access
+ * Point (VAP). Charges are assessed to the processor for each VisaNet
+ * Access Point.
*/
- fun known(): Known =
- when (this) {
- NOT_CHECKED -> Known.NOT_CHECKED
- MATCH -> Known.MATCH
- NO_MATCH -> Known.NO_MATCH
- else -> throw IncreaseInvalidDataException("Unknown Result: $value")
- }
+ @JvmField val VISA_MESSAGE_TRANSMISSION = of("visa_message_transmission")
/**
- * 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.
+ * Activity, per inquiry, related to the domestic Issuer for Account Number
+ * Verification.
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
+ @JvmField
+ val VISA_ACCOUNT_VERIFICATION_DOMESTIC =
+ of("visa_account_verification_domestic")
- private var validated: Boolean = false
+ /**
+ * Activity, per inquiry, related to the international Issuer for Account
+ * Number Verification.
+ */
+ @JvmField
+ val VISA_ACCOUNT_VERIFICATION_INTERNATIONAL =
+ of("visa_account_verification_international")
- fun validate(): Result = apply {
- if (validated) {
- return@apply
- }
+ /**
+ * Activity, per inquiry, related to the US-Canada Issuer for Account Number
+ * Verification.
+ */
+ @JvmField
+ val VISA_ACCOUNT_VERIFICATION_CANADA =
+ of("visa_account_verification_canada")
- known()
- validated = true
- }
+ /**
+ * The Corporate Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Commercial and Government Debit, Prepaid, Credit,
+ * Charge, or Deferred Debit card transactions.
+ */
+ @JvmField
+ val VISA_CORPORATE_ACCEPTANCE_FEE = of("visa_corporate_acceptance_fee")
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ /**
+ * The Consumer Debit Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume of Consumer Debit or Prepaid card transactions.
+ * The cashback portion of a Debit and Prepaid card transaction is excluded
+ * from the sales volume calculation.
+ */
+ @JvmField
+ val VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE =
+ of("visa_consumer_debit_acceptance_fee")
/**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
+ * The Business Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Business Debit, Prepaid, Credit, Charge, or
+ * Deferred Debit card transactions. The cashback portion is included in the
+ * sales volume calculation with the exception of a Debit and Prepaid card
+ * transactions.
*/
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ @JvmField
+ val VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE =
+ of("visa_business_debit_acceptance_fee")
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /**
+ * The Purchasing Card Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume on Commercial and Government Debit, Prepaid,
+ * Credit, Charge, or Deferred Debit card transactions.
+ */
+ @JvmField
+ val VISA_PURCHASING_ACCEPTANCE_FEE = of("visa_purchasing_acceptance_fee")
- return other is Result && value == other.value
- }
+ /**
+ * Activity and fees for the processing of a sales draft original for a
+ * purchase transaction.
+ */
+ @JvmField val VISA_PURCHASE_DOMESTIC = of("visa_purchase_domestic")
- override fun hashCode() = value.hashCode()
+ /**
+ * Activity and fees for the processing of an international sales draft
+ * original for a purchase transaction.
+ */
+ @JvmField
+ val VISA_PURCHASE_INTERNATIONAL = of("visa_purchase_international")
- override fun toString() = value.toString()
- }
+ /**
+ * Apple Pay Credit Product Token Purchase Original Transactions. This fee
+ * is billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ @JvmField val VISA_CREDIT_PURCHASE_TOKEN = of("visa_credit_purchase_token")
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /**
+ * Apple Pay Debit Product Token Purchase Original Transactions. This fee is
+ * billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ @JvmField val VISA_DEBIT_PURCHASE_TOKEN = of("visa_debit_purchase_token")
- return other is CardVerificationCode &&
- result == other.result &&
- additionalProperties == other.additionalProperties
- }
+ /** A per transaction fee assessed for Base II financial draft - Issuer. */
+ @JvmField val VISA_CLEARING_TRANSMISSION = of("visa_clearing_transmission")
- private val hashCode: Int by lazy { Objects.hash(result, additionalProperties) }
+ /**
+ * Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined
+ * Financial OCT/AFT 0200 transactions.
+ */
+ @JvmField val VISA_DIRECT_AUTHORIZATION = of("visa_direct_authorization")
- override fun hashCode(): Int = hashCode
+ /**
+ * Data processing charge for Visa Direct OCTs for all business application
+ * identifiers (BAIs) other than money transfer-bank initiated (BI). BASE II
+ * transactions.
+ */
+ @JvmField
+ val VISA_DIRECT_TRANSACTION_DOMESTIC =
+ of("visa_direct_transaction_domestic")
- override fun toString() =
- "CardVerificationCode{result=$result, additionalProperties=$additionalProperties}"
- }
+ /** Issuer card service fee for Commercial Credit cards. */
+ @JvmField
+ val VISA_SERVICE_COMMERCIAL_CREDIT = of("visa_service_commercial_credit")
- /**
- * 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,
- ) {
+ /** Issuer Advertising Service Fee for Commercial Credit cards. */
+ @JvmField
+ val VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT =
+ of("visa_advertising_service_commercial_credit")
- @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(),
- )
+ /** Issuer Community Growth Acceleration Program Fee. */
+ @JvmField
+ val VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM =
+ of("visa_community_growth_acceleration_program")
- /**
- * 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")
+ /** Issuer Processing Guarantee for Commercial Credit cards. */
+ @JvmField
+ val VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT =
+ of("visa_processing_guarantee_commercial_credit")
- /**
- * 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")
+ /**
+ * Pulse Switch Fee is a fee charged by the Pulse network for processing
+ * transactions on its network.
+ */
+ @JvmField val PULSE_SWITCH_FEE = of("pulse_switch_fee")
- /**
- * 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")
+ @JvmStatic fun of(value: String) = FeeType(JsonField.of(value))
+ }
- /**
- * 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
+ /** An enum containing [FeeType]'s known values. */
+ enum class Known {
+ /**
+ * International Service Assessment (ISA) single-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in the same currency.
+ */
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY,
+ /**
+ * International Service Assessment (ISA) cross-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in different currencies.
+ */
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY,
+ /**
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) authorization transactions. Authorization is the process
+ * of approving or declining the transaction amount specified. The fee is
+ * assessed to the Issuer.
+ */
+ VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE,
+ /**
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) International authorization transactions. Authorization
+ * is the process of approving or declining the transaction amount
+ * specified. The fee is assessed to the Issuer.
+ */
+ VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE,
+ /**
+ * Activity and charges for Visa Settlement System processing for Canada
+ * Region POS (Point-of-Sale) authorization transactions. Authorization is
+ * the process of approving or declining the transaction amount specified.
+ */
+ VISA_AUTHORIZATION_CANADA_POINT_OF_SALE,
+ /**
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) reversal transactions. Authorization reversal represents
+ * a VSS message that undoes the complete or partial actions of a previous
+ * authorization request.
+ */
+ VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE,
+ /**
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) International reversal transactions. Authorization
+ * reversal represents a VSS message that undoes the complete or partial
+ * actions of a previous authorization request.
+ */
+ VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE,
+ /**
+ * A per Address Verification Service (AVS) result fee. Applies to all
+ * usable AVS result codes.
+ */
+ VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE,
+ /**
+ * Advanced Authorization is a fraud detection tool that monitors and risk
+ * evaluates 100 percent of US VisaNet authorizations in real-time. Activity
+ * related to Purchase (includes Signature Authenticated Visa and PIN
+ * Authenticated Visa Debit (PAVD) transactions).
+ */
+ VISA_ADVANCED_AUTHORIZATION,
+ /**
+ * Issuer Transactions Visa represents a charge based on total actual
+ * monthly processing (Visa transactions only) through a VisaNet Access
+ * Point (VAP). Charges are assessed to the processor for each VisaNet
+ * Access Point.
+ */
+ VISA_MESSAGE_TRANSMISSION,
+ /**
+ * Activity, per inquiry, related to the domestic Issuer for Account Number
+ * Verification.
+ */
+ VISA_ACCOUNT_VERIFICATION_DOMESTIC,
+ /**
+ * Activity, per inquiry, related to the international Issuer for Account
+ * Number Verification.
+ */
+ VISA_ACCOUNT_VERIFICATION_INTERNATIONAL,
+ /**
+ * Activity, per inquiry, related to the US-Canada Issuer for Account Number
+ * Verification.
+ */
+ VISA_ACCOUNT_VERIFICATION_CANADA,
+ /**
+ * The Corporate Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Commercial and Government Debit, Prepaid, Credit,
+ * Charge, or Deferred Debit card transactions.
+ */
+ VISA_CORPORATE_ACCEPTANCE_FEE,
+ /**
+ * The Consumer Debit Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume of Consumer Debit or Prepaid card transactions.
+ * The cashback portion of a Debit and Prepaid card transaction is excluded
+ * from the sales volume calculation.
+ */
+ VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE,
+ /**
+ * The Business Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Business Debit, Prepaid, Credit, Charge, or
+ * Deferred Debit card transactions. The cashback portion is included in the
+ * sales volume calculation with the exception of a Debit and Prepaid card
+ * transactions.
+ */
+ VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE,
+ /**
+ * The Purchasing Card Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume on Commercial and Government Debit, Prepaid,
+ * Credit, Charge, or Deferred Debit card transactions.
+ */
+ VISA_PURCHASING_ACCEPTANCE_FEE,
+ /**
+ * Activity and fees for the processing of a sales draft original for a
+ * purchase transaction.
+ */
+ VISA_PURCHASE_DOMESTIC,
+ /**
+ * Activity and fees for the processing of an international sales draft
+ * original for a purchase transaction.
+ */
+ VISA_PURCHASE_INTERNATIONAL,
+ /**
+ * Apple Pay Credit Product Token Purchase Original Transactions. This fee
+ * is billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ VISA_CREDIT_PURCHASE_TOKEN,
+ /**
+ * Apple Pay Debit Product Token Purchase Original Transactions. This fee is
+ * billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ VISA_DEBIT_PURCHASE_TOKEN,
+ /** A per transaction fee assessed for Base II financial draft - Issuer. */
+ VISA_CLEARING_TRANSMISSION,
+ /**
+ * Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined
+ * Financial OCT/AFT 0200 transactions.
+ */
+ VISA_DIRECT_AUTHORIZATION,
+ /**
+ * Data processing charge for Visa Direct OCTs for all business application
+ * identifiers (BAIs) other than money transfer-bank initiated (BI). BASE II
+ * transactions.
+ */
+ VISA_DIRECT_TRANSACTION_DOMESTIC,
+ /** Issuer card service fee for Commercial Credit cards. */
+ VISA_SERVICE_COMMERCIAL_CREDIT,
+ /** Issuer Advertising Service Fee for Commercial Credit cards. */
+ VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT,
+ /** Issuer Community Growth Acceleration Program Fee. */
+ VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM,
+ /** Issuer Processing Guarantee for Commercial Credit cards. */
+ VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT,
+ /**
+ * Pulse Switch Fee is a fee charged by the Pulse network for processing
+ * transactions on its network.
+ */
+ PULSE_SWITCH_FEE,
+ }
/**
- * Returns the raw JSON value of [result].
+ * An enum containing [FeeType]'s known values, as well as an [_UNKNOWN] member.
*
- * Unlike [result], this method doesn't throw if the JSON field has an
- * unexpected type.
+ * An instance of [FeeType] 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.
*/
- @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 {
-
+ enum class Value {
/**
- * Returns a mutable builder for constructing an instance of
- * [CardholderAddress].
- *
- * The following fields are required:
- * ```java
- * .actualLine1()
- * .actualPostalCode()
- * .providedLine1()
- * .providedPostalCode()
- * .result()
- * ```
+ * International Service Assessment (ISA) single-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in the same currency.
*/
- @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))
-
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY,
/**
- * Alias for calling [Builder.actualLine1] with `actualLine1.orElse(null)`.
+ * International Service Assessment (ISA) cross-currency is a fee assessed
+ * by the card network for cross-border transactions presented and settled
+ * in different currencies.
*/
- fun actualLine1(actualLine1: Optional) =
- actualLine1(actualLine1.getOrNull())
-
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY,
/**
- * 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.
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) authorization transactions. Authorization is the process
+ * of approving or declining the transaction amount specified. The fee is
+ * assessed to the Issuer.
*/
- 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))
-
+ VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE,
/**
- * Alias for calling [Builder.actualPostalCode] with
- * `actualPostalCode.orElse(null)`.
+ * Activity and charges for Visa Settlement System processing for POS
+ * (Point-Of-Sale) International authorization transactions. Authorization
+ * is the process of approving or declining the transaction amount
+ * specified. The fee is assessed to the Issuer.
*/
- fun actualPostalCode(actualPostalCode: Optional) =
- actualPostalCode(actualPostalCode.getOrNull())
-
+ VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE,
/**
- * 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.
+ * Activity and charges for Visa Settlement System processing for Canada
+ * Region POS (Point-of-Sale) authorization transactions. Authorization is
+ * the process of approving or declining the transaction amount specified.
*/
- fun actualPostalCode(actualPostalCode: JsonField) = apply {
- this.actualPostalCode = actualPostalCode
- }
-
+ VISA_AUTHORIZATION_CANADA_POINT_OF_SALE,
/**
- * The cardholder address line 1 provided for verification in the
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) reversal transactions. Authorization reversal represents
+ * a VSS message that undoes the complete or partial actions of a previous
* authorization request.
*/
- fun providedLine1(providedLine1: String?) =
- providedLine1(JsonField.ofNullable(providedLine1))
-
+ VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE,
/**
- * Alias for calling [Builder.providedLine1] with
- * `providedLine1.orElse(null)`.
+ * Activity only for Visa Settlement System authorization processing of POS
+ * (Point-Of-Sale) International reversal transactions. Authorization
+ * reversal represents a VSS message that undoes the complete or partial
+ * actions of a previous authorization request.
*/
- fun providedLine1(providedLine1: Optional) =
- providedLine1(providedLine1.getOrNull())
-
+ VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE,
/**
- * 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.
+ * A per Address Verification Service (AVS) result fee. Applies to all
+ * usable AVS result codes.
*/
- fun providedLine1(providedLine1: JsonField) = apply {
- this.providedLine1 = providedLine1
- }
-
+ VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE,
/**
- * The postal code provided for verification in the authorization request.
+ * Advanced Authorization is a fraud detection tool that monitors and risk
+ * evaluates 100 percent of US VisaNet authorizations in real-time. Activity
+ * related to Purchase (includes Signature Authenticated Visa and PIN
+ * Authenticated Visa Debit (PAVD) transactions).
*/
- fun providedPostalCode(providedPostalCode: String?) =
- providedPostalCode(JsonField.ofNullable(providedPostalCode))
-
+ VISA_ADVANCED_AUTHORIZATION,
/**
- * Alias for calling [Builder.providedPostalCode] with
- * `providedPostalCode.orElse(null)`.
+ * Issuer Transactions Visa represents a charge based on total actual
+ * monthly processing (Visa transactions only) through a VisaNet Access
+ * Point (VAP). Charges are assessed to the processor for each VisaNet
+ * Access Point.
*/
- fun providedPostalCode(providedPostalCode: Optional) =
- providedPostalCode(providedPostalCode.getOrNull())
-
+ VISA_MESSAGE_TRANSMISSION,
/**
- * 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.
+ * Activity, per inquiry, related to the domestic Issuer for Account Number
+ * Verification.
*/
- 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))
-
+ VISA_ACCOUNT_VERIFICATION_DOMESTIC,
/**
- * 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.
+ * Activity, per inquiry, related to the international Issuer for Account
+ * Number Verification.
*/
- fun result(result: JsonField) = apply { this.result = result }
-
- fun additionalProperties(additionalProperties: Map) =
- apply {
- this.additionalProperties.clear()
- putAllAdditionalProperties(additionalProperties)
- }
+ VISA_ACCOUNT_VERIFICATION_INTERNATIONAL,
+ /**
+ * Activity, per inquiry, related to the US-Canada Issuer for Account Number
+ * Verification.
+ */
+ VISA_ACCOUNT_VERIFICATION_CANADA,
+ /**
+ * The Corporate Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Commercial and Government Debit, Prepaid, Credit,
+ * Charge, or Deferred Debit card transactions.
+ */
+ VISA_CORPORATE_ACCEPTANCE_FEE,
+ /**
+ * The Consumer Debit Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume of Consumer Debit or Prepaid card transactions.
+ * The cashback portion of a Debit and Prepaid card transaction is excluded
+ * from the sales volume calculation.
+ */
+ VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE,
+ /**
+ * The Business Acceptance Fee is charged to issuers and is based on the
+ * monthly sales volume on Business Debit, Prepaid, Credit, Charge, or
+ * Deferred Debit card transactions. The cashback portion is included in the
+ * sales volume calculation with the exception of a Debit and Prepaid card
+ * transactions.
+ */
+ VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE,
+ /**
+ * The Purchasing Card Acceptance Fee is charged to issuers and is based on
+ * the monthly sales volume on Commercial and Government Debit, Prepaid,
+ * Credit, Charge, or Deferred Debit card transactions.
+ */
+ VISA_PURCHASING_ACCEPTANCE_FEE,
+ /**
+ * Activity and fees for the processing of a sales draft original for a
+ * purchase transaction.
+ */
+ VISA_PURCHASE_DOMESTIC,
+ /**
+ * Activity and fees for the processing of an international sales draft
+ * original for a purchase transaction.
+ */
+ VISA_PURCHASE_INTERNATIONAL,
+ /**
+ * Apple Pay Credit Product Token Purchase Original Transactions. This fee
+ * is billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ VISA_CREDIT_PURCHASE_TOKEN,
+ /**
+ * Apple Pay Debit Product Token Purchase Original Transactions. This fee is
+ * billed by Visa on behalf of Apple Inc. for Apple Pay transactions.
+ */
+ VISA_DEBIT_PURCHASE_TOKEN,
+ /** A per transaction fee assessed for Base II financial draft - Issuer. */
+ VISA_CLEARING_TRANSMISSION,
+ /**
+ * Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined
+ * Financial OCT/AFT 0200 transactions.
+ */
+ VISA_DIRECT_AUTHORIZATION,
+ /**
+ * Data processing charge for Visa Direct OCTs for all business application
+ * identifiers (BAIs) other than money transfer-bank initiated (BI). BASE II
+ * transactions.
+ */
+ VISA_DIRECT_TRANSACTION_DOMESTIC,
+ /** Issuer card service fee for Commercial Credit cards. */
+ VISA_SERVICE_COMMERCIAL_CREDIT,
+ /** Issuer Advertising Service Fee for Commercial Credit cards. */
+ VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT,
+ /** Issuer Community Growth Acceleration Program Fee. */
+ VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM,
+ /** Issuer Processing Guarantee for Commercial Credit cards. */
+ VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT,
+ /**
+ * Pulse Switch Fee is a fee charged by the Pulse network for processing
+ * transactions on its network.
+ */
+ PULSE_SWITCH_FEE,
+ /**
+ * An enum member indicating that [FeeType] was instantiated with an unknown
+ * value.
+ */
+ _UNKNOWN,
+ }
- fun putAdditionalProperty(key: String, value: JsonValue) = apply {
- additionalProperties.put(key, value)
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or
+ * if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY ->
+ Value.VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY ->
+ Value.VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY
+ VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE ->
+ Value.VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE
+ VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE ->
+ Value.VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_CANADA_POINT_OF_SALE ->
+ Value.VISA_AUTHORIZATION_CANADA_POINT_OF_SALE
+ VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE ->
+ Value.VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE ->
+ Value.VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE ->
+ Value.VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE
+ VISA_ADVANCED_AUTHORIZATION -> Value.VISA_ADVANCED_AUTHORIZATION
+ VISA_MESSAGE_TRANSMISSION -> Value.VISA_MESSAGE_TRANSMISSION
+ VISA_ACCOUNT_VERIFICATION_DOMESTIC ->
+ Value.VISA_ACCOUNT_VERIFICATION_DOMESTIC
+ VISA_ACCOUNT_VERIFICATION_INTERNATIONAL ->
+ Value.VISA_ACCOUNT_VERIFICATION_INTERNATIONAL
+ VISA_ACCOUNT_VERIFICATION_CANADA ->
+ Value.VISA_ACCOUNT_VERIFICATION_CANADA
+ VISA_CORPORATE_ACCEPTANCE_FEE -> Value.VISA_CORPORATE_ACCEPTANCE_FEE
+ VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE ->
+ Value.VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE
+ VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE ->
+ Value.VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE
+ VISA_PURCHASING_ACCEPTANCE_FEE -> Value.VISA_PURCHASING_ACCEPTANCE_FEE
+ VISA_PURCHASE_DOMESTIC -> Value.VISA_PURCHASE_DOMESTIC
+ VISA_PURCHASE_INTERNATIONAL -> Value.VISA_PURCHASE_INTERNATIONAL
+ VISA_CREDIT_PURCHASE_TOKEN -> Value.VISA_CREDIT_PURCHASE_TOKEN
+ VISA_DEBIT_PURCHASE_TOKEN -> Value.VISA_DEBIT_PURCHASE_TOKEN
+ VISA_CLEARING_TRANSMISSION -> Value.VISA_CLEARING_TRANSMISSION
+ VISA_DIRECT_AUTHORIZATION -> Value.VISA_DIRECT_AUTHORIZATION
+ VISA_DIRECT_TRANSACTION_DOMESTIC ->
+ Value.VISA_DIRECT_TRANSACTION_DOMESTIC
+ VISA_SERVICE_COMMERCIAL_CREDIT -> Value.VISA_SERVICE_COMMERCIAL_CREDIT
+ VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT ->
+ Value.VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT
+ VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM ->
+ Value.VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM
+ VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT ->
+ Value.VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT
+ PULSE_SWITCH_FEE -> Value.PULSE_SWITCH_FEE
+ else -> Value._UNKNOWN
}
- fun putAllAdditionalProperties(
- additionalProperties: Map
- ) = apply { this.additionalProperties.putAll(additionalProperties) }
-
- fun removeAdditionalProperty(key: String) = apply {
- additionalProperties.remove(key)
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known
+ * and don't want to throw for the unknown case.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value is a not
+ * a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY ->
+ Known.VISA_INTERNATIONAL_SERVICE_ASSESSMENT_SINGLE_CURRENCY
+ VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY ->
+ Known.VISA_INTERNATIONAL_SERVICE_ASSESSMENT_CROSS_CURRENCY
+ VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE ->
+ Known.VISA_AUTHORIZATION_DOMESTIC_POINT_OF_SALE
+ VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE ->
+ Known.VISA_AUTHORIZATION_INTERNATIONAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_CANADA_POINT_OF_SALE ->
+ Known.VISA_AUTHORIZATION_CANADA_POINT_OF_SALE
+ VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE ->
+ Known.VISA_AUTHORIZATION_REVERSAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE ->
+ Known.VISA_AUTHORIZATION_REVERSAL_INTERNATIONAL_POINT_OF_SALE
+ VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE ->
+ Known.VISA_AUTHORIZATION_ADDRESS_VERIFICATION_SERVICE
+ VISA_ADVANCED_AUTHORIZATION -> Known.VISA_ADVANCED_AUTHORIZATION
+ VISA_MESSAGE_TRANSMISSION -> Known.VISA_MESSAGE_TRANSMISSION
+ VISA_ACCOUNT_VERIFICATION_DOMESTIC ->
+ Known.VISA_ACCOUNT_VERIFICATION_DOMESTIC
+ VISA_ACCOUNT_VERIFICATION_INTERNATIONAL ->
+ Known.VISA_ACCOUNT_VERIFICATION_INTERNATIONAL
+ VISA_ACCOUNT_VERIFICATION_CANADA ->
+ Known.VISA_ACCOUNT_VERIFICATION_CANADA
+ VISA_CORPORATE_ACCEPTANCE_FEE -> Known.VISA_CORPORATE_ACCEPTANCE_FEE
+ VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE ->
+ Known.VISA_CONSUMER_DEBIT_ACCEPTANCE_FEE
+ VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE ->
+ Known.VISA_BUSINESS_DEBIT_ACCEPTANCE_FEE
+ VISA_PURCHASING_ACCEPTANCE_FEE -> Known.VISA_PURCHASING_ACCEPTANCE_FEE
+ VISA_PURCHASE_DOMESTIC -> Known.VISA_PURCHASE_DOMESTIC
+ VISA_PURCHASE_INTERNATIONAL -> Known.VISA_PURCHASE_INTERNATIONAL
+ VISA_CREDIT_PURCHASE_TOKEN -> Known.VISA_CREDIT_PURCHASE_TOKEN
+ VISA_DEBIT_PURCHASE_TOKEN -> Known.VISA_DEBIT_PURCHASE_TOKEN
+ VISA_CLEARING_TRANSMISSION -> Known.VISA_CLEARING_TRANSMISSION
+ VISA_DIRECT_AUTHORIZATION -> Known.VISA_DIRECT_AUTHORIZATION
+ VISA_DIRECT_TRANSACTION_DOMESTIC ->
+ Known.VISA_DIRECT_TRANSACTION_DOMESTIC
+ VISA_SERVICE_COMMERCIAL_CREDIT -> Known.VISA_SERVICE_COMMERCIAL_CREDIT
+ VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT ->
+ Known.VISA_ADVERTISING_SERVICE_COMMERCIAL_CREDIT
+ VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM ->
+ Known.VISA_COMMUNITY_GROWTH_ACCELERATION_PROGRAM
+ VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT ->
+ Known.VISA_PROCESSING_GUARANTEE_COMMERCIAL_CREDIT
+ PULSE_SWITCH_FEE -> Known.PULSE_SWITCH_FEE
+ else -> throw IncreaseInvalidDataException("Unknown FeeType: $value")
}
- fun removeAllAdditionalProperties(keys: Set) = apply {
- keys.forEach(::removeAdditionalProperty)
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for
+ * debugging and generally doesn't throw.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value does not
+ * have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
}
- /**
- * Returns an immutable instance of [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 {
+ fun validate(): FeeType = apply {
if (validated) {
return@apply
}
- actualLine1()
- actualPostalCode()
- providedLine1()
- providedPostalCode()
- result().validate()
+ known()
validated = true
}
@@ -17090,462 +17263,533 @@ private constructor(
* 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)
+ internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
- /** The address verification result returned to the card network. */
- class Result
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data
- * that doesn't match any known member, and you want to know that value. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
+ return other is FeeType && value == other.value
+ }
- companion object {
+ override fun hashCode() = value.hashCode()
- /** No address information was provided in the authorization request. */
- @JvmField val NOT_CHECKED = of("not_checked")
+ override fun toString() = value.toString()
+ }
- /**
- * 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")
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- /**
- * 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")
+ return other is SchemeFee &&
+ amount == other.amount &&
+ createdAt == other.createdAt &&
+ currency == other.currency &&
+ feeType == other.feeType &&
+ fixedComponent == other.fixedComponent &&
+ variableRate == other.variableRate &&
+ additionalProperties == other.additionalProperties
+ }
- /** Postal code and street address match. */
- @JvmField val MATCH = of("match")
+ private val hashCode: Int by lazy {
+ Objects.hash(
+ amount,
+ createdAt,
+ currency,
+ feeType,
+ fixedComponent,
+ variableRate,
+ additionalProperties,
+ )
+ }
- /** Postal code and street address do not match. */
- @JvmField val NO_MATCH = of("no_match")
+ override fun hashCode(): Int = hashCode
- /**
- * 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")
+ override fun toString() =
+ "SchemeFee{amount=$amount, createdAt=$createdAt, currency=$currency, feeType=$feeType, fixedComponent=$fixedComponent, variableRate=$variableRate, additionalProperties=$additionalProperties}"
+ }
- @JvmStatic fun of(value: String) = Result(JsonField.of(value))
- }
+ /**
+ * A constant representing the object's type. For this resource it will always be
+ * `card_authorization`.
+ */
+ class Type @JsonCreator private constructor(private val value: JsonField) :
+ Enum {
- /** 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,
- }
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data that
+ * doesn't match any known member, and you want to know that value. For example, if
+ * the SDK is on an older version than the API, then the API may respond with new
+ * members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
- /**
- * An enum containing [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,
- }
+ companion object {
- /**
- * 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")
- }
+ @JvmField val CARD_AUTHORIZATION = of("card_authorization")
- /**
- * 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")
- }
+ @JvmStatic fun of(value: String) = Type(JsonField.of(value))
+ }
- private var validated: Boolean = false
+ /** An enum containing [Type]'s known values. */
+ enum class Known {
+ CARD_AUTHORIZATION
+ }
- fun validate(): Result = apply {
- if (validated) {
- return@apply
- }
+ /**
+ * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member.
+ *
+ * An instance of [Type] can contain an unknown value in a couple of cases:
+ * - It was deserialized from data that doesn't match any known member. For example,
+ * if the SDK is on an older version than the API, then the API may respond with
+ * new members that the SDK is unaware of.
+ * - It was constructed with an arbitrary value using the [of] method.
+ */
+ enum class Value {
+ CARD_AUTHORIZATION,
+ /**
+ * An enum member indicating that [Type] was instantiated with an unknown value.
+ */
+ _UNKNOWN,
+ }
- known()
- validated = true
- }
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always known or if
+ * you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION
+ else -> Value._UNKNOWN
+ }
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always known and
+ * don't want to throw for the unknown case.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value is a not a
+ * known member.
+ */
+ fun known(): Known =
+ when (this) {
+ CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION
+ else -> throw IncreaseInvalidDataException("Unknown Type: $value")
+ }
- /**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
- *
- * Used for best match union deserialization.
- */
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily for
+ * debugging and generally doesn't throw.
+ *
+ * @throws 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")
+ }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ private var validated: Boolean = false
- return other is Result && value == other.value
- }
+ fun validate(): Type = apply {
+ if (validated) {
+ return@apply
+ }
- override fun hashCode() = value.hashCode()
+ known()
+ validated = true
+ }
- override fun toString() = value.toString()
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
}
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /**
+ * 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
- return other is CardholderAddress &&
- actualLine1 == other.actualLine1 &&
- actualPostalCode == other.actualPostalCode &&
- providedLine1 == other.providedLine1 &&
- providedPostalCode == other.providedPostalCode &&
- result == other.result &&
- additionalProperties == other.additionalProperties
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
}
- private val hashCode: Int by lazy {
- Objects.hash(
- actualLine1,
- actualPostalCode,
- providedLine1,
- providedPostalCode,
- result,
- additionalProperties,
- )
- }
+ return other is Type && value == other.value
+ }
- override fun hashCode(): Int = hashCode
+ override fun hashCode() = value.hashCode()
- override fun toString() =
- "CardholderAddress{actualLine1=$actualLine1, actualPostalCode=$actualPostalCode, providedLine1=$providedLine1, providedPostalCode=$providedPostalCode, result=$result, additionalProperties=$additionalProperties}"
- }
+ override fun toString() = value.toString()
+ }
- /** Cardholder name provided in the authorization request. */
- class CardholderName
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
+ /** 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 cardholderName: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
private constructor(
- private val providedFirstName: JsonField,
- private val providedLastName: JsonField,
- private val providedMiddleName: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ @JsonProperty("card_verification_code")
+ @ExcludeMissing
+ cardVerificationCode: JsonField = JsonMissing.of(),
+ @JsonProperty("cardholder_address")
+ @ExcludeMissing
+ cardholderAddress: JsonField = JsonMissing.of(),
+ @JsonProperty("cardholder_name")
+ @ExcludeMissing
+ cardholderName: JsonField = JsonMissing.of(),
+ ) : this(cardVerificationCode, cardholderAddress, cardholderName, mutableMapOf())
- @JsonCreator
- private constructor(
- @JsonProperty("provided_first_name")
- @ExcludeMissing
- providedFirstName: JsonField = JsonMissing.of(),
- @JsonProperty("provided_last_name")
- @ExcludeMissing
- providedLastName: JsonField = JsonMissing.of(),
- @JsonProperty("provided_middle_name")
- @ExcludeMissing
- providedMiddleName: JsonField = JsonMissing.of(),
- ) : this(
- providedFirstName,
- providedLastName,
- providedMiddleName,
- 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")
+
+ /**
+ * Cardholder name provided 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 cardholderName(): Optional =
+ cardholderName.getOptional("cardholder_name")
+
+ /**
+ * 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
+
+ /**
+ * Returns the raw JSON value of [cardholderName].
+ *
+ * Unlike [cardholderName], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("cardholder_name")
+ @ExcludeMissing
+ fun _cardholderName(): JsonField = cardholderName
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
/**
- * The first name provided for verification in the authorization request.
+ * Returns a mutable builder for constructing an instance of [Verification].
*
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
+ * The following fields are required:
+ * ```java
+ * .cardVerificationCode()
+ * .cardholderAddress()
+ * .cardholderName()
+ * ```
*/
- fun providedFirstName(): Optional =
- providedFirstName.getOptional("provided_first_name")
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Verification]. */
+ class Builder internal constructor() {
+
+ private var cardVerificationCode: JsonField? = null
+ private var cardholderAddress: JsonField? = null
+ private var cardholderName: JsonField? = null
+ private var additionalProperties: MutableMap = mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(verification: Verification) = apply {
+ cardVerificationCode = verification.cardVerificationCode
+ cardholderAddress = verification.cardholderAddress
+ cardholderName = verification.cardholderName
+ additionalProperties = verification.additionalProperties.toMutableMap()
+ }
/**
- * The last name 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).
+ * Fields related to verification of the Card Verification Code, a 3-digit code
+ * on the back of the card.
*/
- fun providedLastName(): Optional =
- providedLastName.getOptional("provided_last_name")
+ fun cardVerificationCode(cardVerificationCode: CardVerificationCode) =
+ cardVerificationCode(JsonField.of(cardVerificationCode))
/**
- * The middle name provided for verification in the authorization request.
+ * Sets [Builder.cardVerificationCode] to an arbitrary JSON value.
*
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected 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 providedMiddleName(): Optional =
- providedMiddleName.getOptional("provided_middle_name")
+ fun cardVerificationCode(
+ cardVerificationCode: JsonField
+ ) = apply { this.cardVerificationCode = cardVerificationCode }
/**
- * Returns the raw JSON value of [providedFirstName].
- *
- * Unlike [providedFirstName], this method doesn't throw if the JSON field has
- * an unexpected type.
+ * Cardholder address provided in the authorization request and the address on
+ * file we verified it against.
*/
- @JsonProperty("provided_first_name")
- @ExcludeMissing
- fun _providedFirstName(): JsonField = providedFirstName
+ fun cardholderAddress(cardholderAddress: CardholderAddress) =
+ cardholderAddress(JsonField.of(cardholderAddress))
/**
- * Returns the raw JSON value of [providedLastName].
+ * Sets [Builder.cardholderAddress] to an arbitrary JSON value.
*
- * Unlike [providedLastName], this method doesn't throw if the JSON field has an
- * unexpected type.
+ * 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.
*/
- @JsonProperty("provided_last_name")
- @ExcludeMissing
- fun _providedLastName(): JsonField = providedLastName
+ fun cardholderAddress(cardholderAddress: JsonField) = apply {
+ this.cardholderAddress = cardholderAddress
+ }
+
+ /** Cardholder name provided in the authorization request. */
+ fun cardholderName(cardholderName: CardholderName?) =
+ cardholderName(JsonField.ofNullable(cardholderName))
/**
- * Returns the raw JSON value of [providedMiddleName].
+ * Alias for calling [Builder.cardholderName] with
+ * `cardholderName.orElse(null)`.
+ */
+ fun cardholderName(cardholderName: Optional) =
+ cardholderName(cardholderName.getOrNull())
+
+ /**
+ * Sets [Builder.cardholderName] to an arbitrary JSON value.
*
- * Unlike [providedMiddleName], this method doesn't throw if the JSON field has
- * an unexpected type.
+ * You should usually call [Builder.cardholderName] with a well-typed
+ * [CardholderName] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
*/
- @JsonProperty("provided_middle_name")
- @ExcludeMissing
- fun _providedMiddleName(): JsonField = providedMiddleName
+ fun cardholderName(cardholderName: JsonField) = apply {
+ this.cardholderName = cardholderName
+ }
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
+ fun additionalProperties(additionalProperties: Map) = apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
}
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
- fun toBuilder() = Builder().from(this)
+ fun putAllAdditionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.putAll(additionalProperties)
+ }
- companion object {
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
- /**
- * Returns a mutable builder for constructing an instance of
- * [CardholderName].
- *
- * The following fields are required:
- * ```java
- * .providedFirstName()
- * .providedLastName()
- * .providedMiddleName()
- * ```
- */
- @JvmStatic fun builder() = Builder()
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
}
- /** A builder for [CardholderName]. */
- class Builder internal constructor() {
+ /**
+ * 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()
+ * .cardholderName()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Verification =
+ Verification(
+ checkRequired("cardVerificationCode", cardVerificationCode),
+ checkRequired("cardholderAddress", cardholderAddress),
+ checkRequired("cardholderName", cardholderName),
+ additionalProperties.toMutableMap(),
+ )
+ }
- private var providedFirstName: JsonField? = null
- private var providedLastName: JsonField? = null
- private var providedMiddleName: JsonField? = null
- private var additionalProperties: MutableMap =
- mutableMapOf()
+ private var validated: Boolean = false
- @JvmSynthetic
- internal fun from(cardholderName: CardholderName) = apply {
- providedFirstName = cardholderName.providedFirstName
- providedLastName = cardholderName.providedLastName
- providedMiddleName = cardholderName.providedMiddleName
- additionalProperties =
- cardholderName.additionalProperties.toMutableMap()
- }
+ fun validate(): Verification = apply {
+ if (validated) {
+ return@apply
+ }
- /**
- * The first name provided for verification in the authorization request.
- */
- fun providedFirstName(providedFirstName: String?) =
- providedFirstName(JsonField.ofNullable(providedFirstName))
+ cardVerificationCode().validate()
+ cardholderAddress().validate()
+ cardholderName().ifPresent { it.validate() }
+ validated = true
+ }
- /**
- * Alias for calling [Builder.providedFirstName] with
- * `providedFirstName.orElse(null)`.
- */
- fun providedFirstName(providedFirstName: Optional) =
- providedFirstName(providedFirstName.getOrNull())
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
- /**
- * Sets [Builder.providedFirstName] to an arbitrary JSON value.
- *
- * You should usually call [Builder.providedFirstName] with a well-typed
- * [String] value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
- */
- fun providedFirstName(providedFirstName: JsonField) = apply {
- this.providedFirstName = providedFirstName
- }
+ /**
+ * 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) +
+ (cardholderName.asKnown().getOrNull()?.validity() ?: 0)
- /** The last name provided for verification in the authorization request. */
- fun providedLastName(providedLastName: String?) =
- providedLastName(JsonField.ofNullable(providedLastName))
+ /**
+ * 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,
+ ) {
- /**
- * Alias for calling [Builder.providedLastName] with
- * `providedLastName.orElse(null)`.
- */
- fun providedLastName(providedLastName: Optional) =
- providedLastName(providedLastName.getOrNull())
+ @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 {
/**
- * Sets [Builder.providedLastName] to an arbitrary JSON value.
+ * Returns a mutable builder for constructing an instance of
+ * [CardVerificationCode].
*
- * You should usually call [Builder.providedLastName] with a well-typed
- * [String] value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
+ * The following fields are required:
+ * ```java
+ * .result()
+ * ```
*/
- fun providedLastName(providedLastName: JsonField) = apply {
- this.providedLastName = providedLastName
- }
+ @JvmStatic fun builder() = Builder()
+ }
- /**
- * The middle name provided for verification in the authorization request.
- */
- fun providedMiddleName(providedMiddleName: String?) =
- providedMiddleName(JsonField.ofNullable(providedMiddleName))
+ /** A builder for [CardVerificationCode]. */
+ class Builder internal constructor() {
- /**
- * Alias for calling [Builder.providedMiddleName] with
- * `providedMiddleName.orElse(null)`.
- */
- fun providedMiddleName(providedMiddleName: Optional) =
- providedMiddleName(providedMiddleName.getOrNull())
+ 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.providedMiddleName] to an arbitrary JSON value.
+ * Sets [Builder.result] to an arbitrary JSON value.
*
- * You should usually call [Builder.providedMiddleName] with a well-typed
- * [String] value instead. This method is primarily for setting the field to
- * an undocumented or not yet supported value.
+ * You should usually call [Builder.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 providedMiddleName(providedMiddleName: JsonField) = apply {
- this.providedMiddleName = providedMiddleName
- }
+ fun result(result: JsonField) = apply { this.result = result }
fun additionalProperties(additionalProperties: Map) =
apply {
@@ -17570,38 +17814,32 @@ private constructor(
}
/**
- * Returns an immutable instance of [CardholderName].
+ * Returns an immutable instance of [CardVerificationCode].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
- * .providedFirstName()
- * .providedLastName()
- * .providedMiddleName()
+ * .result()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): CardholderName =
- CardholderName(
- checkRequired("providedFirstName", providedFirstName),
- checkRequired("providedLastName", providedLastName),
- checkRequired("providedMiddleName", providedMiddleName),
+ fun build(): CardVerificationCode =
+ CardVerificationCode(
+ checkRequired("result", result),
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): CardholderName = apply {
+ fun validate(): CardVerificationCode = apply {
if (validated) {
return@apply
}
- providedFirstName()
- providedLastName()
- providedMiddleName()
+ result().validate()
validated = true
}
@@ -17620,922 +17858,1142 @@ private constructor(
* Used for best match union deserialization.
*/
@JvmSynthetic
- internal fun validity(): Int =
- (if (providedFirstName.asKnown().isPresent) 1 else 0) +
- (if (providedLastName.asKnown().isPresent) 1 else 0) +
- (if (providedMiddleName.asKnown().isPresent) 1 else 0)
+ internal fun validity(): Int = (result.asKnown().getOrNull()?.validity() ?: 0)
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /** The result of verifying the Card Verification Code. */
+ class Result
+ @JsonCreator
+ private constructor(private val value: JsonField) : Enum {
- return other is CardholderName &&
- providedFirstName == other.providedFirstName &&
- providedLastName == other.providedLastName &&
- providedMiddleName == other.providedMiddleName &&
- additionalProperties == other.additionalProperties
- }
+ /**
+ * Returns this class instance's raw value.
+ *
+ * This is usually only useful if this instance was deserialized from data
+ * that doesn't match any known member, and you want to know that value. For
+ * example, if the SDK is on an older version than the API, then the API may
+ * respond with new members that the SDK is unaware of.
+ */
+ @com.fasterxml.jackson.annotation.JsonValue
+ fun _value(): JsonField = value
- private val hashCode: Int by lazy {
- Objects.hash(
- providedFirstName,
- providedLastName,
- providedMiddleName,
- additionalProperties,
- )
- }
+ companion object {
- override fun hashCode(): Int = hashCode
+ /**
+ * No card verification code was provided in the authorization request.
+ */
+ @JvmField val NOT_CHECKED = of("not_checked")
- override fun toString() =
- "CardholderName{providedFirstName=$providedFirstName, providedLastName=$providedLastName, providedMiddleName=$providedMiddleName, additionalProperties=$additionalProperties}"
- }
+ /** The card verification code matched the one on file. */
+ @JvmField val MATCH = of("match")
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /** The card verification code did not match the one on file. */
+ @JvmField val NO_MATCH = of("no_match")
- return other is Verification &&
- cardVerificationCode == other.cardVerificationCode &&
- cardholderAddress == other.cardholderAddress &&
- cardholderName == other.cardholderName &&
- additionalProperties == other.additionalProperties
- }
+ @JvmStatic fun of(value: String) = Result(JsonField.of(value))
+ }
- private val hashCode: Int by lazy {
- Objects.hash(
- cardVerificationCode,
- cardholderAddress,
- cardholderName,
- additionalProperties,
- )
- }
+ /** 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,
+ }
- override fun hashCode(): Int = hashCode
+ /**
+ * 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,
+ }
- override fun toString() =
- "Verification{cardVerificationCode=$cardVerificationCode, cardholderAddress=$cardholderAddress, cardholderName=$cardholderName, additionalProperties=$additionalProperties}"
- }
+ /**
+ * Returns an enum member corresponding to this class instance's value, or
+ * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ *
+ * Use the [known] method instead if you're certain the value is always
+ * known or if you want to throw for the unknown case.
+ */
+ fun value(): Value =
+ when (this) {
+ NOT_CHECKED -> Value.NOT_CHECKED
+ MATCH -> Value.MATCH
+ NO_MATCH -> Value.NO_MATCH
+ else -> Value._UNKNOWN
+ }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ /**
+ * Returns an enum member corresponding to this class instance's value.
+ *
+ * Use the [value] method instead if you're uncertain the value is always
+ * known and don't want to throw for the unknown case.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value is a
+ * not a known member.
+ */
+ fun known(): Known =
+ when (this) {
+ NOT_CHECKED -> Known.NOT_CHECKED
+ MATCH -> Known.MATCH
+ NO_MATCH -> Known.NO_MATCH
+ else -> throw IncreaseInvalidDataException("Unknown Result: $value")
+ }
- return other is CardAuthorization &&
- id == other.id &&
- actioner == other.actioner &&
- additionalAmounts == other.additionalAmounts &&
- amount == other.amount &&
- cardPaymentId == other.cardPaymentId &&
- currency == other.currency &&
- digitalWalletTokenId == other.digitalWalletTokenId &&
- direction == other.direction &&
- expiresAt == other.expiresAt &&
- 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 &&
- pendingTransactionId == other.pendingTransactionId &&
- physicalCardId == other.physicalCardId &&
- presentmentAmount == other.presentmentAmount &&
- presentmentCurrency == other.presentmentCurrency &&
- processingCategory == other.processingCategory &&
- realTimeDecisionId == other.realTimeDecisionId &&
- terminalId == other.terminalId &&
- type == other.type &&
- verification == other.verification &&
- additionalProperties == other.additionalProperties
- }
+ /**
+ * Returns this class instance's primitive wire representation.
+ *
+ * This differs from the [toString] method because that method is primarily
+ * for debugging and generally doesn't throw.
+ *
+ * @throws IncreaseInvalidDataException if this class instance's value does
+ * not have the expected primitive type.
+ */
+ fun asString(): String =
+ _value().asString().orElseThrow {
+ IncreaseInvalidDataException("Value is not a String")
+ }
- private val hashCode: Int by lazy {
- Objects.hash(
- id,
- actioner,
- additionalAmounts,
- amount,
- cardPaymentId,
- currency,
- digitalWalletTokenId,
- direction,
- expiresAt,
- merchantAcceptorId,
- merchantCategoryCode,
- merchantCity,
- merchantCountry,
- merchantDescriptor,
- merchantPostalCode,
- merchantState,
- networkDetails,
- networkIdentifiers,
- networkRiskScore,
- pendingTransactionId,
- physicalCardId,
- presentmentAmount,
- presentmentCurrency,
- processingCategory,
- realTimeDecisionId,
- terminalId,
- type,
- verification,
- additionalProperties,
- )
- }
+ private var validated: Boolean = false
- override fun hashCode(): Int = hashCode
+ fun validate(): Result = apply {
+ if (validated) {
+ return@apply
+ }
- override fun toString() =
- "CardAuthorization{id=$id, actioner=$actioner, additionalAmounts=$additionalAmounts, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, expiresAt=$expiresAt, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, pendingTransactionId=$pendingTransactionId, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}"
- }
+ known()
+ validated = true
+ }
- /**
- * A Card Authorization Expiration object. This field will be present in the JSON response
- * if and only if `category` is equal to `card_authorization_expiration`. Card Authorization
- * Expirations are cancellations of authorizations that were never settled by the acquirer.
- */
- class CardAuthorizationExpiration
- @JsonCreator(mode = JsonCreator.Mode.DISABLED)
- private constructor(
- private val id: JsonField,
- private val cardAuthorizationId: JsonField,
- private val currency: JsonField,
- private val expiredAmount: JsonField,
- private val network: JsonField,
- private val type: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
- @JsonCreator
- private constructor(
- @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(),
- @JsonProperty("card_authorization_id")
- @ExcludeMissing
- cardAuthorizationId: JsonField = JsonMissing.of(),
- @JsonProperty("currency")
- @ExcludeMissing
- currency: JsonField = JsonMissing.of(),
- @JsonProperty("expired_amount")
- @ExcludeMissing
- expiredAmount: JsonField = JsonMissing.of(),
- @JsonProperty("network")
- @ExcludeMissing
- network: JsonField = JsonMissing.of(),
- @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(),
- ) : this(
- id,
- cardAuthorizationId,
- currency,
- expiredAmount,
- network,
- type,
- mutableMapOf(),
- )
+ /**
+ * 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
- /**
- * The Card Authorization Expiration identifier.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun id(): String = id.getRequired("id")
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- /**
- * The identifier for the Card Authorization this reverses.
- *
- * @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 cardAuthorizationId(): String =
- cardAuthorizationId.getRequired("card_authorization_id")
+ return other is Result && value == other.value
+ }
- /**
- * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's
- * currency.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun currency(): Currency = currency.getRequired("currency")
+ override fun hashCode() = value.hashCode()
- /**
- * The amount of this authorization expiration in the minor unit of the transaction's
- * currency. For dollars, for example, this is cents.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun expiredAmount(): Long = expiredAmount.getRequired("expired_amount")
+ override fun toString() = value.toString()
+ }
- /**
- * The card network used to process this card authorization.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun network(): Network = network.getRequired("network")
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- /**
- * A constant representing the object's type. For this resource it will always be
- * `card_authorization_expiration`.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected
- * value).
- */
- fun type(): Type = type.getRequired("type")
+ return other is CardVerificationCode &&
+ result == other.result &&
+ additionalProperties == other.additionalProperties
+ }
- /**
- * Returns the raw JSON value of [id].
- *
- * Unlike [id], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id
+ private val hashCode: Int by lazy { Objects.hash(result, additionalProperties) }
- /**
- * Returns the raw JSON value of [cardAuthorizationId].
- *
- * Unlike [cardAuthorizationId], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("card_authorization_id")
- @ExcludeMissing
- fun _cardAuthorizationId(): JsonField = cardAuthorizationId
+ override fun hashCode(): Int = hashCode
- /**
- * 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
+ override fun toString() =
+ "CardVerificationCode{result=$result, additionalProperties=$additionalProperties}"
+ }
- /**
- * Returns the raw JSON value of [expiredAmount].
- *
- * Unlike [expiredAmount], this method doesn't throw if the JSON field has an unexpected
- * type.
- */
- @JsonProperty("expired_amount")
- @ExcludeMissing
- fun _expiredAmount(): JsonField = expiredAmount
+ /**
+ * 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,
+ ) {
- /**
- * Returns the raw JSON value of [network].
- *
- * Unlike [network], this method doesn't throw if the JSON field has an unexpected type.
- */
- @JsonProperty("network") @ExcludeMissing fun _network(): JsonField = network
+ @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(),
+ )
- /**
- * 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
+ /**
+ * 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