diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 75b3f25b4..37556d6b0 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.267.0"
+ ".": "0.268.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 093b8c5d0..1cc1a647b 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
configured_endpoints: 202
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-976ae14d2349a3599f9bd33dba52b3c12c265493a8af9e581c71b2e819b8de04.yml
-openapi_spec_hash: d8a9fef4dfe082acdf834ac0339e800c
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-5fa3dfeb071930598ed9243dd96db808cf54d4a455c99b1acceadc3335f1a387.yml
+openapi_spec_hash: 18dfa4d31cd512dcd83b646e40fb2c86
config_hash: a185e9a72778cc4658ea73fb3a7f1354
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3ecf86ef5..ffdd03305 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
# Changelog
+## 0.268.0 (2025-07-29)
+
+Full Changelog: [v0.267.0...v0.268.0](https://github.com/Increase/increase-java/compare/v0.267.0...v0.268.0)
+
+### Features
+
+* **api:** api update ([e7bc58f](https://github.com/Increase/increase-java/commit/e7bc58f92a987c248ec33a71e62fa1ad15e8c40f))
+* **api:** api update ([17a4f0e](https://github.com/Increase/increase-java/commit/17a4f0efa9a6769383a8c6eeff639df17998998c))
+
## 0.267.0 (2025-07-29)
Full Changelog: [v0.266.1...v0.267.0](https://github.com/Increase/increase-java/compare/v0.266.1...v0.267.0)
diff --git a/README.md b/README.md
index 57dbc244e..358670d50 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.267.0)
-[](https://javadoc.io/doc/com.increase.api/increase-java/0.267.0)
+[](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.268.0)
+[](https://javadoc.io/doc/com.increase.api/increase-java/0.268.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.267.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.268.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.267.0")
+implementation("com.increase.api:increase-java:0.268.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.267.0")
com.increase.api
increase-java
- 0.267.0
+ 0.268.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index b513e151e..a2e822248 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.increase.api"
- version = "0.267.0" // x-release-please-version
+ version = "0.268.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 f42167ccd..07f8425aa 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
@@ -3959,6 +3959,7 @@ private constructor(
private constructor(
private val id: JsonField,
private val actioner: JsonField,
+ private val additionalAmounts: JsonField,
private val amount: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
@@ -3993,6 +3994,9 @@ private constructor(
@JsonProperty("actioner")
@ExcludeMissing
actioner: JsonField = JsonMissing.of(),
+ @JsonProperty("additional_amounts")
+ @ExcludeMissing
+ additionalAmounts: JsonField = JsonMissing.of(),
@JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
@JsonProperty("card_payment_id")
@ExcludeMissing
@@ -4067,6 +4071,7 @@ private constructor(
) : this(
id,
actioner,
+ additionalAmounts,
amount,
cardPaymentId,
currency,
@@ -4114,6 +4119,18 @@ private constructor(
*/
fun actioner(): Actioner = actioner.getRequired("actioner")
+ /**
+ * Additional amounts associated with the card authorization, such as ATM surcharges
+ * fees. These are usually a subset of the `amount` field and are used to provide more
+ * detailed information about the transaction.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected
+ * value).
+ */
+ fun additionalAmounts(): AdditionalAmounts =
+ additionalAmounts.getRequired("additional_amounts")
+
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
@@ -4371,6 +4388,16 @@ private constructor(
@ExcludeMissing
fun _actioner(): JsonField = actioner
+ /**
+ * Returns the raw JSON value of [additionalAmounts].
+ *
+ * Unlike [additionalAmounts], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("additional_amounts")
+ @ExcludeMissing
+ fun _additionalAmounts(): JsonField = additionalAmounts
+
/**
* Returns the raw JSON value of [amount].
*
@@ -4636,6 +4663,7 @@ private constructor(
* ```java
* .id()
* .actioner()
+ * .additionalAmounts()
* .amount()
* .cardPaymentId()
* .currency()
@@ -4671,6 +4699,7 @@ private constructor(
private var id: JsonField? = null
private var actioner: JsonField? = null
+ private var additionalAmounts: JsonField? = null
private var amount: JsonField? = null
private var cardPaymentId: JsonField? = null
private var currency: JsonField? = null
@@ -4702,6 +4731,7 @@ private constructor(
internal fun from(cardAuthorization: CardAuthorization) = apply {
id = cardAuthorization.id
actioner = cardAuthorization.actioner
+ additionalAmounts = cardAuthorization.additionalAmounts
amount = cardAuthorization.amount
cardPaymentId = cardAuthorization.cardPaymentId
currency = cardAuthorization.currency
@@ -4757,6 +4787,25 @@ private constructor(
*/
fun actioner(actioner: JsonField) = apply { this.actioner = actioner }
+ /**
+ * Additional amounts associated with the card authorization, such as ATM surcharges
+ * fees. These are usually a subset of the `amount` field and are used to provide
+ * more detailed information about the transaction.
+ */
+ fun additionalAmounts(additionalAmounts: AdditionalAmounts) =
+ additionalAmounts(JsonField.of(additionalAmounts))
+
+ /**
+ * Sets [Builder.additionalAmounts] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.additionalAmounts] with a well-typed
+ * [AdditionalAmounts] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun additionalAmounts(additionalAmounts: JsonField) = apply {
+ this.additionalAmounts = additionalAmounts
+ }
+
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
@@ -5258,6 +5307,7 @@ private constructor(
* ```java
* .id()
* .actioner()
+ * .additionalAmounts()
* .amount()
* .cardPaymentId()
* .currency()
@@ -5291,6 +5341,7 @@ private constructor(
CardAuthorization(
checkRequired("id", id),
checkRequired("actioner", actioner),
+ checkRequired("additionalAmounts", additionalAmounts),
checkRequired("amount", amount),
checkRequired("cardPaymentId", cardPaymentId),
checkRequired("currency", currency),
@@ -5329,6 +5380,7 @@ private constructor(
id()
actioner().validate()
+ additionalAmounts().validate()
amount()
cardPaymentId()
currency().validate()
@@ -5375,6 +5427,7 @@ private constructor(
internal fun validity(): Int =
(if (id.asKnown().isPresent) 1 else 0) +
(actioner.asKnown().getOrNull()?.validity() ?: 0) +
+ (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) +
(if (amount.asKnown().isPresent) 1 else 0) +
(if (cardPaymentId.asKnown().isPresent) 1 else 0) +
(currency.asKnown().getOrNull()?.validity() ?: 0) +
@@ -5552,382 +5605,224 @@ private constructor(
}
/**
- * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
- * currency.
+ * Additional amounts associated with the card authorization, such as ATM surcharges
+ * fees. These are usually a subset of the `amount` field and are used to provide more
+ * detailed information about the transaction.
*/
- class Currency @JsonCreator private constructor(private val value: JsonField) :
- Enum {
+ class AdditionalAmounts
+ private constructor(
+ private val clinic: JsonField,
+ private val dental: JsonField,
+ private val prescription: JsonField,
+ private val surcharge: JsonField,
+ private val totalCumulative: JsonField,
+ private val totalHealthcare: JsonField,
+ private val transit: JsonField,
+ private val unknown: JsonField,
+ private val vision: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("clinic")
+ @ExcludeMissing
+ clinic: JsonField = JsonMissing.of(),
+ @JsonProperty("dental")
+ @ExcludeMissing
+ dental: JsonField = JsonMissing.of(),
+ @JsonProperty("prescription")
+ @ExcludeMissing
+ prescription: JsonField = JsonMissing.of(),
+ @JsonProperty("surcharge")
+ @ExcludeMissing
+ surcharge: JsonField = JsonMissing.of(),
+ @JsonProperty("total_cumulative")
+ @ExcludeMissing
+ totalCumulative: JsonField = JsonMissing.of(),
+ @JsonProperty("total_healthcare")
+ @ExcludeMissing
+ totalHealthcare: JsonField = JsonMissing.of(),
+ @JsonProperty("transit")
+ @ExcludeMissing
+ transit: JsonField = JsonMissing.of(),
+ @JsonProperty("unknown")
+ @ExcludeMissing
+ unknown: JsonField = JsonMissing.of(),
+ @JsonProperty("vision")
+ @ExcludeMissing
+ vision: JsonField = JsonMissing.of(),
+ ) : this(
+ clinic,
+ dental,
+ prescription,
+ surcharge,
+ totalCumulative,
+ totalHealthcare,
+ transit,
+ unknown,
+ vision,
+ mutableMapOf(),
+ )
/**
- * Returns this class instance's raw value.
+ * The part of this transaction amount that was for clinic-related services.
*
- * This is usually only useful if this instance was deserialized from data that
- * doesn't match any known member, and you want to know that value. For example, if
- * the SDK is on an older version than the API, then the API may respond with new
- * members that the SDK is unaware of.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** Canadian Dollar (CAD) */
- @JvmField val CAD = of("CAD")
-
- /** Swiss Franc (CHF) */
- @JvmField val CHF = of("CHF")
-
- /** Euro (EUR) */
- @JvmField val EUR = of("EUR")
-
- /** British Pound (GBP) */
- @JvmField val GBP = of("GBP")
-
- /** Japanese Yen (JPY) */
- @JvmField val JPY = of("JPY")
-
- /** US Dollar (USD) */
- @JvmField val USD = of("USD")
-
- @JvmStatic fun of(value: String) = Currency(JsonField.of(value))
- }
-
- /** An enum containing [Currency]'s known values. */
- enum class Known {
- /** Canadian Dollar (CAD) */
- CAD,
- /** Swiss Franc (CHF) */
- CHF,
- /** Euro (EUR) */
- EUR,
- /** British Pound (GBP) */
- GBP,
- /** Japanese Yen (JPY) */
- JPY,
- /** US Dollar (USD) */
- USD,
- }
+ fun clinic(): Optional = clinic.getOptional("clinic")
/**
- * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member.
+ * The part of this transaction amount that was for dental-related services.
*
- * 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.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- enum class Value {
- /** Canadian Dollar (CAD) */
- CAD,
- /** Swiss Franc (CHF) */
- CHF,
- /** Euro (EUR) */
- EUR,
- /** British Pound (GBP) */
- GBP,
- /** Japanese Yen (JPY) */
- JPY,
- /** US Dollar (USD) */
- USD,
- /**
- * An enum member indicating that [Currency] was instantiated with an unknown
- * value.
- */
- _UNKNOWN,
- }
+ fun dental(): Optional = dental.getOptional("dental")
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * The part of this transaction amount that was for healthcare prescriptions.
*
- * 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
+ * (e.g. if the server responded with an unexpected value).
*/
- fun value(): Value =
- when (this) {
- CAD -> Value.CAD
- CHF -> Value.CHF
- EUR -> Value.EUR
- GBP -> Value.GBP
- JPY -> Value.JPY
- USD -> Value.USD
- else -> Value._UNKNOWN
- }
+ fun prescription(): Optional =
+ prescription.getOptional("prescription")
/**
- * 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.
+ * The surcharge amount charged for this transaction by the merchant.
*
- * @throws IncreaseInvalidDataException if this class instance's value is a not a
- * known member.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- fun known(): Known =
- when (this) {
- CAD -> Known.CAD
- CHF -> Known.CHF
- EUR -> Known.EUR
- GBP -> Known.GBP
- JPY -> Known.JPY
- USD -> Known.USD
- else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
- }
+ fun surcharge(): Optional = surcharge.getOptional("surcharge")
/**
- * 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 total amount of a series of incremental authorizations, optionally provided.
*
- * @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(): Currency = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ fun totalCumulative(): Optional =
+ totalCumulative.getOptional("total_cumulative")
/**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
+ * The total amount of healthcare-related additional amounts.
*
- * 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 /* spotless:off */ other is Currency && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
-
- /**
- * The direction describes the direction the funds will move, either from the cardholder
- * to the merchant or from the merchant to the cardholder.
- */
- class Direction @JsonCreator private constructor(private val value: JsonField) :
- Enum {
+ fun totalHealthcare(): Optional =
+ totalHealthcare.getOptional("total_healthcare")
/**
- * Returns this class instance's raw value.
+ * The part of this transaction amount that was for transit-related services.
*
- * This is usually only useful if this instance was deserialized from data that
- * doesn't match any known member, and you want to know that value. For example, if
- * the SDK is on an older version than the API, then the API may respond with new
- * members that the SDK is unaware of.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
-
- companion object {
-
- /** A regular card authorization where funds are debited from the cardholder. */
- @JvmField val SETTLEMENT = of("settlement")
-
- /**
- * A refund card authorization, sometimes referred to as a credit voucher
- * authorization, where funds are credited to the cardholder.
- */
- @JvmField val REFUND = of("refund")
-
- @JvmStatic fun of(value: String) = Direction(JsonField.of(value))
- }
-
- /** An enum containing [Direction]'s known values. */
- enum class Known {
- /** A regular card authorization where funds are debited from the cardholder. */
- SETTLEMENT,
- /**
- * A refund card authorization, sometimes referred to as a credit voucher
- * authorization, where funds are credited to the cardholder.
- */
- REFUND,
- }
+ fun transit(): Optional = transit.getOptional("transit")
/**
- * An enum containing [Direction]'s known values, as well as an [_UNKNOWN] member.
+ * An unknown additional amount.
*
- * An instance of [Direction] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For example,
- * if the SDK is on an older version than the API, then the API may respond with
- * new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * (e.g. if the server responded with an unexpected value).
*/
- enum class Value {
- /** A regular card authorization where funds are debited from the cardholder. */
- SETTLEMENT,
- /**
- * A refund card authorization, sometimes referred to as a credit voucher
- * authorization, where funds are credited to the cardholder.
- */
- REFUND,
- /**
- * An enum member indicating that [Direction] was instantiated with an unknown
- * value.
- */
- _UNKNOWN,
- }
+ fun unknown(): Optional = unknown.getOptional("unknown")
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * The part of this transaction amount that was for vision-related services.
*
- * 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
+ * (e.g. if the server responded with an unexpected value).
*/
- fun value(): Value =
- when (this) {
- SETTLEMENT -> Value.SETTLEMENT
- REFUND -> Value.REFUND
- else -> Value._UNKNOWN
- }
+ fun vision(): Optional = vision.getOptional("vision")
/**
- * Returns an enum member corresponding to this class instance's value.
+ * Returns the raw JSON value of [clinic].
*
- * 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.
+ * Unlike [clinic], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun known(): Known =
- when (this) {
- SETTLEMENT -> Known.SETTLEMENT
- REFUND -> Known.REFUND
- else -> throw IncreaseInvalidDataException("Unknown Direction: $value")
- }
+ @JsonProperty("clinic") @ExcludeMissing fun _clinic(): JsonField = clinic
/**
- * Returns this class instance's primitive wire representation.
+ * Returns the raw JSON value of [dental].
*
- * 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.
+ * Unlike [dental], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
- }
-
- private var validated: Boolean = false
-
- fun validate(): Direction = apply {
- if (validated) {
- return@apply
- }
-
- known()
- validated = true
- }
-
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental
/**
- * Returns a score indicating how many valid values are contained in this object
- * recursively.
+ * Returns the raw JSON value of [prescription].
*
- * Used for best match union deserialization.
+ * Unlike [prescription], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
-
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is Direction && value == other.value /* spotless:on */
- }
-
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
- }
+ @JsonProperty("prescription")
+ @ExcludeMissing
+ fun _prescription(): JsonField = prescription
- /** Fields specific to the `network`. */
- class NetworkDetails
- private constructor(
- private val category: JsonField,
- private val visa: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ /**
+ * Returns the raw JSON value of [surcharge].
+ *
+ * Unlike [surcharge], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("surcharge")
+ @ExcludeMissing
+ fun _surcharge(): JsonField = surcharge
- @JsonCreator
- private constructor(
- @JsonProperty("category")
- @ExcludeMissing
- category: JsonField = JsonMissing.of(),
- @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(),
- ) : this(category, visa, mutableMapOf())
+ /**
+ * Returns the raw JSON value of [totalCumulative].
+ *
+ * Unlike [totalCumulative], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("total_cumulative")
+ @ExcludeMissing
+ fun _totalCumulative(): JsonField = totalCumulative
/**
- * The payment network used to process this card authorization.
+ * Returns the raw JSON value of [totalHealthcare].
*
- * @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 [totalHealthcare], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- fun category(): Category = category.getRequired("category")
+ @JsonProperty("total_healthcare")
+ @ExcludeMissing
+ fun _totalHealthcare(): JsonField = totalHealthcare
/**
- * Fields specific to the `visa` network.
+ * Returns the raw JSON value of [transit].
*
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
+ * Unlike [transit], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- fun visa(): Optional = visa.getOptional("visa")
+ @JsonProperty("transit")
+ @ExcludeMissing
+ fun _transit(): JsonField = transit
/**
- * Returns the raw JSON value of [category].
+ * Returns the raw JSON value of [unknown].
*
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [unknown], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("category")
+ @JsonProperty("unknown")
@ExcludeMissing
- fun _category(): JsonField = category
+ fun _unknown(): JsonField = unknown
/**
- * Returns the raw JSON value of [visa].
+ * Returns the raw JSON value of [vision].
*
- * Unlike [visa], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [vision], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa
+ @JsonProperty("vision") @ExcludeMissing fun _vision(): JsonField = vision
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -5944,57 +5839,217 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [NetworkDetails].
+ * Returns a mutable builder for constructing an instance of
+ * [AdditionalAmounts].
*
* The following fields are required:
* ```java
- * .category()
- * .visa()
+ * .clinic()
+ * .dental()
+ * .prescription()
+ * .surcharge()
+ * .totalCumulative()
+ * .totalHealthcare()
+ * .transit()
+ * .unknown()
+ * .vision()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [NetworkDetails]. */
+ /** A builder for [AdditionalAmounts]. */
class Builder internal constructor() {
- private var category: JsonField? = null
- private var visa: JsonField? = null
+ private var clinic: JsonField? = null
+ private var dental: JsonField? = null
+ private var prescription: JsonField? = null
+ private var surcharge: JsonField? = null
+ private var totalCumulative: JsonField? = null
+ private var totalHealthcare: JsonField? = null
+ private var transit: JsonField? = null
+ private var unknown: JsonField? = null
+ private var vision: JsonField? = null
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
- internal fun from(networkDetails: NetworkDetails) = apply {
- category = networkDetails.category
- visa = networkDetails.visa
- additionalProperties = networkDetails.additionalProperties.toMutableMap()
+ internal fun from(additionalAmounts: AdditionalAmounts) = apply {
+ clinic = additionalAmounts.clinic
+ dental = additionalAmounts.dental
+ prescription = additionalAmounts.prescription
+ surcharge = additionalAmounts.surcharge
+ totalCumulative = additionalAmounts.totalCumulative
+ totalHealthcare = additionalAmounts.totalHealthcare
+ transit = additionalAmounts.transit
+ unknown = additionalAmounts.unknown
+ vision = additionalAmounts.vision
+ additionalProperties = additionalAmounts.additionalProperties.toMutableMap()
}
- /** The payment network used to process this card authorization. */
- fun category(category: Category) = category(JsonField.of(category))
+ /** The part of this transaction amount that was for clinic-related services. */
+ fun clinic(clinic: Clinic?) = clinic(JsonField.ofNullable(clinic))
+
+ /** Alias for calling [Builder.clinic] with `clinic.orElse(null)`. */
+ fun clinic(clinic: Optional) = clinic(clinic.getOrNull())
/**
- * Sets [Builder.category] to an arbitrary JSON value.
+ * Sets [Builder.clinic] to an arbitrary JSON value.
*
- * You should usually call [Builder.category] with a well-typed [Category] value
+ * You should usually call [Builder.clinic] with a well-typed [Clinic] value
* instead. This method is primarily for setting the field to an undocumented or
* not yet supported value.
*/
- fun category(category: JsonField) = apply { this.category = category }
+ fun clinic(clinic: JsonField) = apply { this.clinic = clinic }
- /** Fields specific to the `visa` network. */
- fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa))
+ /** The part of this transaction amount that was for dental-related services. */
+ fun dental(dental: Dental?) = dental(JsonField.ofNullable(dental))
- /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */
- fun visa(visa: Optional) = visa(visa.getOrNull())
+ /** Alias for calling [Builder.dental] with `dental.orElse(null)`. */
+ fun dental(dental: Optional) = dental(dental.getOrNull())
/**
- * Sets [Builder.visa] to an arbitrary JSON value.
+ * Sets [Builder.dental] to an arbitrary JSON value.
*
- * You should usually call [Builder.visa] with a well-typed [Visa] value
+ * You should usually call [Builder.dental] with a well-typed [Dental] value
* instead. This method is primarily for setting the field to an undocumented or
* not yet supported value.
*/
- fun visa(visa: JsonField) = apply { this.visa = visa }
+ fun dental(dental: JsonField) = apply { this.dental = dental }
+
+ /**
+ * The part of this transaction amount that was for healthcare prescriptions.
+ */
+ fun prescription(prescription: Prescription?) =
+ prescription(JsonField.ofNullable(prescription))
+
+ /**
+ * Alias for calling [Builder.prescription] with `prescription.orElse(null)`.
+ */
+ fun prescription(prescription: Optional) =
+ prescription(prescription.getOrNull())
+
+ /**
+ * Sets [Builder.prescription] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.prescription] with a well-typed
+ * [Prescription] value instead. This method is primarily for setting the field
+ * to an undocumented or not yet supported value.
+ */
+ fun prescription(prescription: JsonField) = apply {
+ this.prescription = prescription
+ }
+
+ /** The surcharge amount charged for this transaction by the merchant. */
+ fun surcharge(surcharge: Surcharge?) =
+ surcharge(JsonField.ofNullable(surcharge))
+
+ /** Alias for calling [Builder.surcharge] with `surcharge.orElse(null)`. */
+ fun surcharge(surcharge: Optional) = surcharge(surcharge.getOrNull())
+
+ /**
+ * Sets [Builder.surcharge] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.surcharge] with a well-typed [Surcharge]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun surcharge(surcharge: JsonField) = apply {
+ this.surcharge = surcharge
+ }
+
+ /**
+ * The total amount of a series of incremental authorizations, optionally
+ * provided.
+ */
+ fun totalCumulative(totalCumulative: TotalCumulative?) =
+ totalCumulative(JsonField.ofNullable(totalCumulative))
+
+ /**
+ * Alias for calling [Builder.totalCumulative] with
+ * `totalCumulative.orElse(null)`.
+ */
+ fun totalCumulative(totalCumulative: Optional) =
+ totalCumulative(totalCumulative.getOrNull())
+
+ /**
+ * Sets [Builder.totalCumulative] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.totalCumulative] with a well-typed
+ * [TotalCumulative] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun totalCumulative(totalCumulative: JsonField) = apply {
+ this.totalCumulative = totalCumulative
+ }
+
+ /** The total amount of healthcare-related additional amounts. */
+ fun totalHealthcare(totalHealthcare: TotalHealthcare?) =
+ totalHealthcare(JsonField.ofNullable(totalHealthcare))
+
+ /**
+ * Alias for calling [Builder.totalHealthcare] with
+ * `totalHealthcare.orElse(null)`.
+ */
+ fun totalHealthcare(totalHealthcare: Optional) =
+ totalHealthcare(totalHealthcare.getOrNull())
+
+ /**
+ * Sets [Builder.totalHealthcare] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.totalHealthcare] with a well-typed
+ * [TotalHealthcare] value instead. This method is primarily for setting the
+ * field to an undocumented or not yet supported value.
+ */
+ fun totalHealthcare(totalHealthcare: JsonField) = apply {
+ this.totalHealthcare = totalHealthcare
+ }
+
+ /**
+ * The part of this transaction amount that was for transit-related services.
+ */
+ fun transit(transit: Transit?) = transit(JsonField.ofNullable(transit))
+
+ /** Alias for calling [Builder.transit] with `transit.orElse(null)`. */
+ fun transit(transit: Optional) = transit(transit.getOrNull())
+
+ /**
+ * Sets [Builder.transit] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.transit] with a well-typed [Transit] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun transit(transit: JsonField) = apply { this.transit = transit }
+
+ /** An unknown additional amount. */
+ fun unknown(unknown: Unknown?) = unknown(JsonField.ofNullable(unknown))
+
+ /** Alias for calling [Builder.unknown] with `unknown.orElse(null)`. */
+ fun unknown(unknown: Optional) = unknown(unknown.getOrNull())
+
+ /**
+ * Sets [Builder.unknown] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.unknown] with a well-typed [Unknown] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun unknown(unknown: JsonField) = apply { this.unknown = unknown }
+
+ /** The part of this transaction amount that was for vision-related services. */
+ fun vision(vision: Vision?) = vision(JsonField.ofNullable(vision))
+
+ /** Alias for calling [Builder.vision] with `vision.orElse(null)`. */
+ fun vision(vision: Optional) = vision(vision.getOrNull())
+
+ /**
+ * Sets [Builder.vision] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.vision] with a well-typed [Vision] value
+ * instead. This method is primarily for setting the field to an undocumented or
+ * not yet supported value.
+ */
+ fun vision(vision: JsonField) = apply { this.vision = vision }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
@@ -6019,35 +6074,56 @@ private constructor(
}
/**
- * Returns an immutable instance of [NetworkDetails].
+ * Returns an immutable instance of [AdditionalAmounts].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
- * .category()
- * .visa()
+ * .clinic()
+ * .dental()
+ * .prescription()
+ * .surcharge()
+ * .totalCumulative()
+ * .totalHealthcare()
+ * .transit()
+ * .unknown()
+ * .vision()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): NetworkDetails =
- NetworkDetails(
- checkRequired("category", category),
- checkRequired("visa", visa),
+ fun build(): AdditionalAmounts =
+ AdditionalAmounts(
+ checkRequired("clinic", clinic),
+ checkRequired("dental", dental),
+ checkRequired("prescription", prescription),
+ checkRequired("surcharge", surcharge),
+ checkRequired("totalCumulative", totalCumulative),
+ checkRequired("totalHealthcare", totalHealthcare),
+ checkRequired("transit", transit),
+ checkRequired("unknown", unknown),
+ checkRequired("vision", vision),
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): NetworkDetails = apply {
+ fun validate(): AdditionalAmounts = apply {
if (validated) {
return@apply
}
- category().validate()
- visa().ifPresent { it.validate() }
+ clinic().ifPresent { it.validate() }
+ dental().ifPresent { it.validate() }
+ prescription().ifPresent { it.validate() }
+ surcharge().ifPresent { it.validate() }
+ totalCumulative().ifPresent { it.validate() }
+ totalHealthcare().ifPresent { it.validate() }
+ transit().ifPresent { it.validate() }
+ unknown().ifPresent { it.validate() }
+ vision().ifPresent { it.validate() }
validated = true
}
@@ -6067,109 +6143,193 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (category.asKnown().getOrNull()?.validity() ?: 0) +
- (visa.asKnown().getOrNull()?.validity() ?: 0)
+ (clinic.asKnown().getOrNull()?.validity() ?: 0) +
+ (dental.asKnown().getOrNull()?.validity() ?: 0) +
+ (prescription.asKnown().getOrNull()?.validity() ?: 0) +
+ (surcharge.asKnown().getOrNull()?.validity() ?: 0) +
+ (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) +
+ (totalHealthcare.asKnown().getOrNull()?.validity() ?: 0) +
+ (transit.asKnown().getOrNull()?.validity() ?: 0) +
+ (unknown.asKnown().getOrNull()?.validity() ?: 0) +
+ (vision.asKnown().getOrNull()?.validity() ?: 0)
+
+ /** The part of this transaction amount that was for clinic-related services. */
+ class Clinic
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /** The payment network used to process this card authorization. */
- class Category
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
/**
- * Returns this class instance's raw value.
+ * The amount in minor units of the `currency` field.
*
- * 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 {
-
- /** Visa */
- @JvmField val VISA = of("visa")
-
- @JvmStatic fun of(value: String) = Category(JsonField.of(value))
- }
-
- /** An enum containing [Category]'s known values. */
- enum class Known {
- /** Visa */
- VISA
- }
+ fun amount(): Long = amount.getRequired("amount")
/**
- * An enum containing [Category]'s known values, as well as an [_UNKNOWN]
- * member.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*
- * An instance of [Category] can contain an unknown value in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
+ * @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 {
- /** Visa */
- VISA,
- /**
- * An enum member indicating that [Category] was instantiated with an
- * unknown value.
- */
- _UNKNOWN,
- }
+ fun currency(): String = currency.getRequired("currency")
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * Returns the raw JSON value of [amount].
*
- * Use the [known] method instead if you're certain the value is always known or
- * if you want to throw for the unknown case.
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- fun value(): Value =
- when (this) {
- VISA -> Value.VISA
- else -> Value._UNKNOWN
- }
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
/**
- * 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.
+ * Returns the raw JSON value of [currency].
*
- * @throws IncreaseInvalidDataException if this class instance's value is a not
- * a known member.
+ * Unlike [currency], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- fun known(): Known =
- when (this) {
- VISA -> Known.VISA
- else -> throw IncreaseInvalidDataException("Unknown Category: $value")
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [Clinic].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Clinic]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(clinic: Clinic) = apply {
+ amount = clinic.amount
+ currency = clinic.currency
+ additionalProperties = clinic.additionalProperties.toMutableMap()
}
- /**
- * 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")
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
+
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ */
+ fun currency(currency: String) = currency(JsonField.of(currency))
+
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
+
+ fun additionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
+
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(
+ additionalProperties: Map
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
}
+ /**
+ * Returns an immutable instance of [Clinic].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): Clinic =
+ Clinic(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
+ }
+
private var validated: Boolean = false
- fun validate(): Category = apply {
+ fun validate(): Clinic = apply {
if (validated) {
return@apply
}
- known()
+ amount()
+ currency()
validated = true
}
@@ -6188,114 +6348,82 @@ private constructor(
* Used for best match union deserialization.
*/
@JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
- return /* spotless:off */ other is Category && value == other.value /* spotless:on */
+ return /* spotless:off */ other is Clinic && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
}
- override fun hashCode() = value.hashCode()
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
+ /* spotless:on */
- override fun toString() = value.toString()
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
}
- /** Fields specific to the `visa` network. */
- class Visa
+ /** The part of this transaction amount that was for dental-related services. */
+ class Dental
private constructor(
- private val electronicCommerceIndicator: JsonField,
- private val pointOfServiceEntryMode: JsonField,
- private val standInProcessingReason: JsonField,
+ private val amount: JsonField,
+ private val currency: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
- @JsonProperty("electronic_commerce_indicator")
- @ExcludeMissing
- electronicCommerceIndicator: JsonField =
- JsonMissing.of(),
- @JsonProperty("point_of_service_entry_mode")
+ @JsonProperty("amount")
@ExcludeMissing
- pointOfServiceEntryMode: JsonField =
- JsonMissing.of(),
- @JsonProperty("stand_in_processing_reason")
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
@ExcludeMissing
- standInProcessingReason: JsonField =
- JsonMissing.of(),
- ) : this(
- electronicCommerceIndicator,
- pointOfServiceEntryMode,
- standInProcessingReason,
- mutableMapOf(),
- )
-
- /**
- * For electronic commerce transactions, this identifies the level of security
- * used in obtaining the customer's payment credential. For mail or telephone
- * order transactions, identifies the type of mail or telephone order.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun electronicCommerceIndicator(): Optional =
- electronicCommerceIndicator.getOptional("electronic_commerce_indicator")
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
/**
- * The method used to enter the cardholder's primary account number and card
- * expiration date.
+ * The amount in minor units of the `currency` field.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
*/
- fun pointOfServiceEntryMode(): Optional =
- pointOfServiceEntryMode.getOptional("point_of_service_entry_mode")
+ fun amount(): Long = amount.getRequired("amount")
/**
- * Only present when `actioner: network`. Describes why a card authorization was
- * approved or declined by Visa through stand-in processing.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*
* @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun standInProcessingReason(): Optional =
- standInProcessingReason.getOptional("stand_in_processing_reason")
-
- /**
- * Returns the raw JSON value of [electronicCommerceIndicator].
- *
- * Unlike [electronicCommerceIndicator], this method doesn't throw if the JSON
- * field has an unexpected type.
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
*/
- @JsonProperty("electronic_commerce_indicator")
- @ExcludeMissing
- fun _electronicCommerceIndicator(): JsonField =
- electronicCommerceIndicator
+ fun currency(): String = currency.getRequired("currency")
/**
- * Returns the raw JSON value of [pointOfServiceEntryMode].
+ * Returns the raw JSON value of [amount].
*
- * Unlike [pointOfServiceEntryMode], this method doesn't throw if the JSON field
- * has an unexpected type.
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- @JsonProperty("point_of_service_entry_mode")
- @ExcludeMissing
- fun _pointOfServiceEntryMode(): JsonField =
- pointOfServiceEntryMode
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
/**
- * Returns the raw JSON value of [standInProcessingReason].
+ * Returns the raw JSON value of [currency].
*
- * Unlike [standInProcessingReason], this method doesn't throw if the JSON field
- * has an unexpected type.
+ * Unlike [currency], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- @JsonProperty("stand_in_processing_reason")
+ @JsonProperty("currency")
@ExcludeMissing
- fun _standInProcessingReason(): JsonField =
- standInProcessingReason
+ fun _currency(): JsonField = currency
@JsonAnySetter
private fun putAdditionalProperty(key: String, value: JsonValue) {
@@ -6312,127 +6440,60 @@ private constructor(
companion object {
/**
- * Returns a mutable builder for constructing an instance of [Visa].
+ * Returns a mutable builder for constructing an instance of [Dental].
*
* The following fields are required:
* ```java
- * .electronicCommerceIndicator()
- * .pointOfServiceEntryMode()
- * .standInProcessingReason()
+ * .amount()
+ * .currency()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [Visa]. */
+ /** A builder for [Dental]. */
class Builder internal constructor() {
- private var electronicCommerceIndicator:
- JsonField? =
- null
- private var pointOfServiceEntryMode: JsonField? =
- null
- private var standInProcessingReason: JsonField? =
- null
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
- internal fun from(visa: Visa) = apply {
- electronicCommerceIndicator = visa.electronicCommerceIndicator
- pointOfServiceEntryMode = visa.pointOfServiceEntryMode
- standInProcessingReason = visa.standInProcessingReason
- additionalProperties = visa.additionalProperties.toMutableMap()
+ internal fun from(dental: Dental) = apply {
+ amount = dental.amount
+ currency = dental.currency
+ additionalProperties = dental.additionalProperties.toMutableMap()
}
- /**
- * For electronic commerce transactions, this identifies the level of
- * security used in obtaining the customer's payment credential. For mail or
- * telephone order transactions, identifies the type of mail or telephone
- * order.
- */
- fun electronicCommerceIndicator(
- electronicCommerceIndicator: ElectronicCommerceIndicator?
- ) =
- electronicCommerceIndicator(
- JsonField.ofNullable(electronicCommerceIndicator)
- )
-
- /**
- * Alias for calling [Builder.electronicCommerceIndicator] with
- * `electronicCommerceIndicator.orElse(null)`.
- */
- fun electronicCommerceIndicator(
- electronicCommerceIndicator: Optional
- ) = electronicCommerceIndicator(electronicCommerceIndicator.getOrNull())
-
- /**
- * Sets [Builder.electronicCommerceIndicator] to an arbitrary JSON value.
- *
- * You should usually call [Builder.electronicCommerceIndicator] with a
- * well-typed [ElectronicCommerceIndicator] value instead. This method is
- * primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun electronicCommerceIndicator(
- electronicCommerceIndicator: JsonField
- ) = apply { this.electronicCommerceIndicator = electronicCommerceIndicator }
-
- /**
- * The method used to enter the cardholder's primary account number and card
- * expiration date.
- */
- fun pointOfServiceEntryMode(
- pointOfServiceEntryMode: PointOfServiceEntryMode?
- ) = pointOfServiceEntryMode(JsonField.ofNullable(pointOfServiceEntryMode))
-
- /**
- * Alias for calling [Builder.pointOfServiceEntryMode] with
- * `pointOfServiceEntryMode.orElse(null)`.
- */
- fun pointOfServiceEntryMode(
- pointOfServiceEntryMode: Optional
- ) = pointOfServiceEntryMode(pointOfServiceEntryMode.getOrNull())
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
/**
- * Sets [Builder.pointOfServiceEntryMode] to an arbitrary JSON value.
+ * Sets [Builder.amount] to an arbitrary JSON value.
*
- * You should usually call [Builder.pointOfServiceEntryMode] with a
- * well-typed [PointOfServiceEntryMode] value instead. This method is
- * primarily for setting the field to an undocumented or not yet supported
- * value.
- */
- fun pointOfServiceEntryMode(
- pointOfServiceEntryMode: JsonField
- ) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode }
-
- /**
- * Only present when `actioner: network`. Describes why a card authorization
- * was approved or declined by Visa through stand-in processing.
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun standInProcessingReason(
- standInProcessingReason: StandInProcessingReason?
- ) = standInProcessingReason(JsonField.ofNullable(standInProcessingReason))
+ fun amount(amount: JsonField) = apply { this.amount = amount }
/**
- * Alias for calling [Builder.standInProcessingReason] with
- * `standInProcessingReason.orElse(null)`.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*/
- fun standInProcessingReason(
- standInProcessingReason: Optional
- ) = standInProcessingReason(standInProcessingReason.getOrNull())
+ fun currency(currency: String) = currency(JsonField.of(currency))
/**
- * Sets [Builder.standInProcessingReason] to an arbitrary JSON value.
+ * Sets [Builder.currency] to an arbitrary JSON value.
*
- * You should usually call [Builder.standInProcessingReason] with a
- * well-typed [StandInProcessingReason] value instead. This method is
- * primarily for setting the field to an undocumented or not yet supported
- * value.
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun standInProcessingReason(
- standInProcessingReason: JsonField
- ) = apply { this.standInProcessingReason = standInProcessingReason }
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
fun additionalProperties(additionalProperties: Map) =
apply {
@@ -6457,41 +6518,35 @@ private constructor(
}
/**
- * Returns an immutable instance of [Visa].
+ * Returns an immutable instance of [Dental].
*
* Further updates to this [Builder] will not mutate the returned instance.
*
* The following fields are required:
* ```java
- * .electronicCommerceIndicator()
- * .pointOfServiceEntryMode()
- * .standInProcessingReason()
+ * .amount()
+ * .currency()
* ```
*
* @throws IllegalStateException if any required field is unset.
*/
- fun build(): Visa =
- Visa(
- checkRequired(
- "electronicCommerceIndicator",
- electronicCommerceIndicator,
- ),
- checkRequired("pointOfServiceEntryMode", pointOfServiceEntryMode),
- checkRequired("standInProcessingReason", standInProcessingReason),
+ fun build(): Dental =
+ Dental(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
additionalProperties.toMutableMap(),
)
}
private var validated: Boolean = false
- fun validate(): Visa = apply {
+ fun validate(): Dental = apply {
if (validated) {
return@apply
}
- electronicCommerceIndicator().ifPresent { it.validate() }
- pointOfServiceEntryMode().ifPresent { it.validate() }
- standInProcessingReason().ifPresent { it.validate() }
+ amount()
+ currency()
validated = true
}
@@ -6511,1308 +6566,1651 @@ private constructor(
*/
@JvmSynthetic
internal fun validity(): Int =
- (electronicCommerceIndicator.asKnown().getOrNull()?.validity() ?: 0) +
- (pointOfServiceEntryMode.asKnown().getOrNull()?.validity() ?: 0) +
- (standInProcessingReason.asKnown().getOrNull()?.validity() ?: 0)
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
- /**
- * For electronic commerce transactions, this identifies the level of security
- * used in obtaining the customer's payment credential. For mail or telephone
- * order transactions, identifies the type of mail or telephone order.
- */
- class ElectronicCommerceIndicator
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ 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 /* spotless:off */ other is Dental && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
+ }
- companion object {
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
+ /* spotless:on */
- /**
- * Single transaction of a mail/phone order: Use to indicate that the
- * transaction is a mail/phone order purchase, not a recurring
- * transaction or installment payment. For domestic transactions in the
- * US region, this value may also indicate one bill payment transaction
- * in the card-present or card-absent environments.
- */
- @JvmField val MAIL_PHONE_ORDER = of("mail_phone_order")
+ override fun hashCode(): Int = hashCode
- /**
- * Recurring transaction: Payment indicator used to indicate a recurring
- * transaction that originates from an acquirer in the US region.
- */
- @JvmField val RECURRING = of("recurring")
+ override fun toString() =
+ "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
+ }
- /**
- * Installment payment: Payment indicator used to indicate one purchase
- * of goods or services that is billed to the account in multiple
- * charges over a period of time agreed upon by the cardholder and
- * merchant from transactions that originate from an acquirer in the US
- * region.
- */
- @JvmField val INSTALLMENT = of("installment")
+ /** The part of this transaction amount that was for healthcare prescriptions. */
+ class Prescription
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /**
- * Unknown classification: other mail order: Use to indicate that the
- * type of mail/telephone order is unknown.
- */
- @JvmField val UNKNOWN_MAIL_PHONE_ORDER = of("unknown_mail_phone_order")
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
- /**
- * Secure electronic commerce transaction: Use to indicate that the
- * electronic commerce transaction has been authenticated using e.g.,
- * 3-D Secure
- */
- @JvmField
- val SECURE_ELECTRONIC_COMMERCE = of("secure_electronic_commerce")
+ /**
+ * The amount in minor units of the `currency` field.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
- /**
- * Non-authenticated security transaction at a 3-D Secure-capable
- * merchant, and merchant attempted to authenticate the cardholder using
- * 3-D Secure: Use to identify an electronic commerce transaction where
- * the merchant attempted to authenticate the cardholder using 3-D
- * Secure, but was unable to complete the authentication because the
- * issuer or cardholder does not participate in the 3-D Secure program.
- */
- @JvmField
- val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT =
- of("non_authenticated_security_transaction_at_3ds_capable_merchant")
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
- /**
- * Non-authenticated security transaction: Use to identify an electronic
- * commerce transaction that uses data encryption for security however ,
- * cardholder authentication is not performed using 3-D Secure.
- */
- @JvmField
- val NON_AUTHENTICATED_SECURITY_TRANSACTION =
- of("non_authenticated_security_transaction")
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
- /**
- * Non-secure transaction: Use to identify an electronic commerce
- * transaction that has no data protection.
- */
- @JvmField val NON_SECURE_TRANSACTION = of("non_secure_transaction")
+ /**
+ * 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
- @JvmStatic
- fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value))
- }
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
- /** An enum containing [ElectronicCommerceIndicator]'s known values. */
- enum class Known {
- /**
- * Single transaction of a mail/phone order: Use to indicate that the
- * transaction is a mail/phone order purchase, not a recurring
- * transaction or installment payment. For domestic transactions in the
- * US region, this value may also indicate one bill payment transaction
- * in the card-present or card-absent environments.
- */
- MAIL_PHONE_ORDER,
- /**
- * Recurring transaction: Payment indicator used to indicate a recurring
- * transaction that originates from an acquirer in the US region.
- */
- RECURRING,
- /**
- * Installment payment: Payment indicator used to indicate one purchase
- * of goods or services that is billed to the account in multiple
- * charges over a period of time agreed upon by the cardholder and
- * merchant from transactions that originate from an acquirer in the US
- * region.
- */
- INSTALLMENT,
- /**
- * Unknown classification: other mail order: Use to indicate that the
- * type of mail/telephone order is unknown.
- */
- UNKNOWN_MAIL_PHONE_ORDER,
- /**
- * Secure electronic commerce transaction: Use to indicate that the
- * electronic commerce transaction has been authenticated using e.g.,
- * 3-D Secure
- */
- SECURE_ELECTRONIC_COMMERCE,
- /**
- * Non-authenticated security transaction at a 3-D Secure-capable
- * merchant, and merchant attempted to authenticate the cardholder using
- * 3-D Secure: Use to identify an electronic commerce transaction where
- * the merchant attempted to authenticate the cardholder using 3-D
- * Secure, but was unable to complete the authentication because the
- * issuer or cardholder does not participate in the 3-D Secure program.
- */
- NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
- /**
- * Non-authenticated security transaction: Use to identify an electronic
- * commerce transaction that uses data encryption for security however ,
- * cardholder authentication is not performed using 3-D Secure.
- */
- NON_AUTHENTICATED_SECURITY_TRANSACTION,
- /**
- * Non-secure transaction: Use to identify an electronic commerce
- * transaction that has no data protection.
- */
- NON_SECURE_TRANSACTION,
- }
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
/**
- * An enum containing [ElectronicCommerceIndicator]'s known values, as well
- * as an [_UNKNOWN] member.
+ * Returns a mutable builder for constructing an instance of [Prescription].
*
- * An instance of [ElectronicCommerceIndicator] can contain an unknown value
- * in a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API
- * may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
*/
- enum class Value {
- /**
- * Single transaction of a mail/phone order: Use to indicate that the
- * transaction is a mail/phone order purchase, not a recurring
- * transaction or installment payment. For domestic transactions in the
- * US region, this value may also indicate one bill payment transaction
- * in the card-present or card-absent environments.
- */
- MAIL_PHONE_ORDER,
- /**
- * Recurring transaction: Payment indicator used to indicate a recurring
- * transaction that originates from an acquirer in the US region.
- */
- RECURRING,
- /**
- * Installment payment: Payment indicator used to indicate one purchase
- * of goods or services that is billed to the account in multiple
- * charges over a period of time agreed upon by the cardholder and
- * merchant from transactions that originate from an acquirer in the US
- * region.
- */
- INSTALLMENT,
- /**
- * Unknown classification: other mail order: Use to indicate that the
- * type of mail/telephone order is unknown.
- */
- UNKNOWN_MAIL_PHONE_ORDER,
- /**
- * Secure electronic commerce transaction: Use to indicate that the
- * electronic commerce transaction has been authenticated using e.g.,
- * 3-D Secure
- */
- SECURE_ELECTRONIC_COMMERCE,
- /**
- * Non-authenticated security transaction at a 3-D Secure-capable
- * merchant, and merchant attempted to authenticate the cardholder using
- * 3-D Secure: Use to identify an electronic commerce transaction where
- * the merchant attempted to authenticate the cardholder using 3-D
- * Secure, but was unable to complete the authentication because the
- * issuer or cardholder does not participate in the 3-D Secure program.
- */
- NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
- /**
- * Non-authenticated security transaction: Use to identify an electronic
- * commerce transaction that uses data encryption for security however ,
- * cardholder authentication is not performed using 3-D Secure.
- */
- NON_AUTHENTICATED_SECURITY_TRANSACTION,
- /**
- * Non-secure transaction: Use to identify an electronic commerce
- * transaction that has no data protection.
- */
- NON_SECURE_TRANSACTION,
- /**
- * An enum member indicating that [ElectronicCommerceIndicator] was
- * instantiated with an unknown value.
- */
- _UNKNOWN,
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Prescription]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(prescription: Prescription) = apply {
+ amount = prescription.amount
+ currency = prescription.currency
+ additionalProperties = prescription.additionalProperties.toMutableMap()
}
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * Sets [Builder.amount] to an arbitrary JSON 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.
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun value(): Value =
- when (this) {
- MAIL_PHONE_ORDER -> Value.MAIL_PHONE_ORDER
- RECURRING -> Value.RECURRING
- INSTALLMENT -> Value.INSTALLMENT
- UNKNOWN_MAIL_PHONE_ORDER -> Value.UNKNOWN_MAIL_PHONE_ORDER
- SECURE_ELECTRONIC_COMMERCE -> Value.SECURE_ELECTRONIC_COMMERCE
- NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT ->
- Value
- .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT
- NON_AUTHENTICATED_SECURITY_TRANSACTION ->
- Value.NON_AUTHENTICATED_SECURITY_TRANSACTION
- NON_SECURE_TRANSACTION -> Value.NON_SECURE_TRANSACTION
- else -> Value._UNKNOWN
- }
+ fun amount(amount: JsonField) = apply { this.amount = amount }
/**
- * 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.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*/
- fun known(): Known =
- when (this) {
- MAIL_PHONE_ORDER -> Known.MAIL_PHONE_ORDER
- RECURRING -> Known.RECURRING
- INSTALLMENT -> Known.INSTALLMENT
- UNKNOWN_MAIL_PHONE_ORDER -> Known.UNKNOWN_MAIL_PHONE_ORDER
- SECURE_ELECTRONIC_COMMERCE -> Known.SECURE_ELECTRONIC_COMMERCE
- NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT ->
- Known
- .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT
- NON_AUTHENTICATED_SECURITY_TRANSACTION ->
- Known.NON_AUTHENTICATED_SECURITY_TRANSACTION
- NON_SECURE_TRANSACTION -> Known.NON_SECURE_TRANSACTION
- else ->
- throw IncreaseInvalidDataException(
- "Unknown ElectronicCommerceIndicator: $value"
- )
- }
+ fun currency(currency: String) = currency(JsonField.of(currency))
/**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily
- * for debugging and generally doesn't throw.
+ * Sets [Builder.currency] to an arbitrary JSON value.
*
- * @throws IncreaseInvalidDataException if this class instance's value does
- * not have the expected primitive type.
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
+
+ fun additionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
}
- private var validated: Boolean = false
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
- fun validate(): ElectronicCommerceIndicator = apply {
- if (validated) {
- return@apply
- }
+ fun putAllAdditionalProperties(
+ additionalProperties: Map
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
- known()
- validated = true
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
}
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
/**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
+ * Returns an immutable instance of [Prescription].
*
- * Used for best match union deserialization.
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ fun build(): Prescription =
+ Prescription(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
+ }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ private var validated: Boolean = false
- return /* spotless:off */ other is ElectronicCommerceIndicator && value == other.value /* spotless:on */
+ fun validate(): Prescription = apply {
+ if (validated) {
+ return@apply
}
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
+ amount()
+ currency()
+ validated = true
}
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
/**
- * The method used to enter the cardholder's primary account number and card
- * expiration date.
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
*/
- class PointOfServiceEntryMode
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data
- * that doesn't match any known member, and you want to know that value. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- companion object {
+ return /* spotless:off */ other is Prescription && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
+ }
- /** Unknown */
- @JvmField val UNKNOWN = of("unknown")
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
+ /* spotless:on */
- /** Manual key entry */
- @JvmField val MANUAL = of("manual")
+ override fun hashCode(): Int = hashCode
- /** Magnetic stripe read, without card verification value */
- @JvmField val MAGNETIC_STRIPE_NO_CVV = of("magnetic_stripe_no_cvv")
+ override fun toString() =
+ "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
+ }
- /** Optical code */
- @JvmField val OPTICAL_CODE = of("optical_code")
+ /** The surcharge amount charged for this transaction by the merchant. */
+ class Surcharge
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /** Contact chip card */
- @JvmField val INTEGRATED_CIRCUIT_CARD = of("integrated_circuit_card")
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
- /** Contactless read of chip card */
- @JvmField val CONTACTLESS = of("contactless")
+ /**
+ * The amount in minor units of the `currency` field.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
- /**
- * Transaction initiated using a credential that has previously been
- * stored on file
- */
- @JvmField val CREDENTIAL_ON_FILE = of("credential_on_file")
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
- /** Magnetic stripe read */
- @JvmField val MAGNETIC_STRIPE = of("magnetic_stripe")
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
- /** Contactless read of magnetic stripe data */
- @JvmField
- val CONTACTLESS_MAGNETIC_STRIPE = of("contactless_magnetic_stripe")
+ /**
+ * 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
- /** Contact chip card, without card verification value */
- @JvmField
- val INTEGRATED_CIRCUIT_CARD_NO_CVV =
- of("integrated_circuit_card_no_cvv")
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
- @JvmStatic
- fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value))
- }
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
- /** An enum containing [PointOfServiceEntryMode]'s known values. */
- enum class Known {
- /** Unknown */
- UNKNOWN,
- /** Manual key entry */
- MANUAL,
- /** Magnetic stripe read, without card verification value */
- MAGNETIC_STRIPE_NO_CVV,
- /** Optical code */
- OPTICAL_CODE,
- /** Contact chip card */
- INTEGRATED_CIRCUIT_CARD,
- /** Contactless read of chip card */
- CONTACTLESS,
- /**
- * Transaction initiated using a credential that has previously been
- * stored on file
- */
- CREDENTIAL_ON_FILE,
- /** Magnetic stripe read */
- MAGNETIC_STRIPE,
- /** Contactless read of magnetic stripe data */
- CONTACTLESS_MAGNETIC_STRIPE,
- /** Contact chip card, without card verification value */
- INTEGRATED_CIRCUIT_CARD_NO_CVV,
- }
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
/**
- * An enum containing [PointOfServiceEntryMode]'s known values, as well as
- * an [_UNKNOWN] member.
+ * Returns a mutable builder for constructing an instance of [Surcharge].
*
- * An instance of [PointOfServiceEntryMode] can contain an unknown value in
- * a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API
- * may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
*/
- enum class Value {
- /** Unknown */
- UNKNOWN,
- /** Manual key entry */
- MANUAL,
- /** Magnetic stripe read, without card verification value */
- MAGNETIC_STRIPE_NO_CVV,
- /** Optical code */
- OPTICAL_CODE,
- /** Contact chip card */
- INTEGRATED_CIRCUIT_CARD,
- /** Contactless read of chip card */
- CONTACTLESS,
- /**
- * Transaction initiated using a credential that has previously been
- * stored on file
- */
- CREDENTIAL_ON_FILE,
- /** Magnetic stripe read */
- MAGNETIC_STRIPE,
- /** Contactless read of magnetic stripe data */
- CONTACTLESS_MAGNETIC_STRIPE,
- /** Contact chip card, without card verification value */
- INTEGRATED_CIRCUIT_CARD_NO_CVV,
- /**
- * An enum member indicating that [PointOfServiceEntryMode] was
- * instantiated with an unknown value.
- */
- _UNKNOWN,
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [Surcharge]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(surcharge: Surcharge) = apply {
+ amount = surcharge.amount
+ currency = surcharge.currency
+ additionalProperties = surcharge.additionalProperties.toMutableMap()
}
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * Sets [Builder.amount] to an arbitrary JSON 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.
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun value(): Value =
- when (this) {
- UNKNOWN -> Value.UNKNOWN
- MANUAL -> Value.MANUAL
- MAGNETIC_STRIPE_NO_CVV -> Value.MAGNETIC_STRIPE_NO_CVV
- OPTICAL_CODE -> Value.OPTICAL_CODE
- INTEGRATED_CIRCUIT_CARD -> Value.INTEGRATED_CIRCUIT_CARD
- CONTACTLESS -> Value.CONTACTLESS
- CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE
- MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE
- CONTACTLESS_MAGNETIC_STRIPE -> Value.CONTACTLESS_MAGNETIC_STRIPE
- INTEGRATED_CIRCUIT_CARD_NO_CVV ->
- Value.INTEGRATED_CIRCUIT_CARD_NO_CVV
- else -> Value._UNKNOWN
- }
+ fun amount(amount: JsonField) = apply { this.amount = amount }
/**
- * 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.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*/
- fun known(): Known =
- when (this) {
- UNKNOWN -> Known.UNKNOWN
- MANUAL -> Known.MANUAL
- MAGNETIC_STRIPE_NO_CVV -> Known.MAGNETIC_STRIPE_NO_CVV
- OPTICAL_CODE -> Known.OPTICAL_CODE
- INTEGRATED_CIRCUIT_CARD -> Known.INTEGRATED_CIRCUIT_CARD
- CONTACTLESS -> Known.CONTACTLESS
- CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE
- MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE
- CONTACTLESS_MAGNETIC_STRIPE -> Known.CONTACTLESS_MAGNETIC_STRIPE
- INTEGRATED_CIRCUIT_CARD_NO_CVV ->
- Known.INTEGRATED_CIRCUIT_CARD_NO_CVV
- else ->
- throw IncreaseInvalidDataException(
- "Unknown PointOfServiceEntryMode: $value"
- )
- }
+ fun currency(currency: String) = currency(JsonField.of(currency))
/**
- * Returns this class instance's primitive wire representation.
+ * Sets [Builder.currency] to an arbitrary JSON value.
*
- * 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.
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
+
+ fun additionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
}
- private var validated: Boolean = false
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
- fun validate(): PointOfServiceEntryMode = apply {
- if (validated) {
- return@apply
- }
+ fun putAllAdditionalProperties(
+ additionalProperties: Map
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
- known()
- validated = true
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
}
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
/**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
+ * Returns an immutable instance of [Surcharge].
*
- * Used for best match union deserialization.
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ fun build(): Surcharge =
+ Surcharge(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
+ }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ private var validated: Boolean = false
- return /* spotless:off */ other is PointOfServiceEntryMode && value == other.value /* spotless:on */
+ fun validate(): Surcharge = apply {
+ if (validated) {
+ return@apply
}
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
+ amount()
+ currency()
+ validated = true
}
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
/**
- * Only present when `actioner: network`. Describes why a card authorization was
- * approved or declined by Visa through stand-in processing.
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
*/
- class StandInProcessingReason
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
- /**
- * Returns this class instance's raw value.
- *
- * This is usually only useful if this instance was deserialized from data
- * that doesn't match any known member, and you want to know that value. For
- * example, if the SDK is on an older version than the API, then the API may
- * respond with new members that the SDK is unaware of.
- */
- @com.fasterxml.jackson.annotation.JsonValue
- fun _value(): JsonField = value
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
+ }
- companion object {
+ return /* spotless:off */ other is Surcharge && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
+ }
- /** Increase failed to process the authorization in a timely manner. */
- @JvmField val ISSUER_ERROR = of("issuer_error")
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
+ /* spotless:on */
- /**
- * The physical card read had an invalid CVV, dCVV, or authorization
- * request cryptogram.
- */
- @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card")
+ override fun hashCode(): Int = hashCode
- /** The 3DS cardholder authentication verification value was invalid. */
- @JvmField
- val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE =
- of("invalid_cardholder_authentication_verification_value")
+ override fun toString() =
+ "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
+ }
- /**
- * An internal Visa error occurred. Visa uses this reason code for
- * certain expected occurrences as well, such as Application Transaction
- * Counter (ATC) replays.
- */
- @JvmField val INTERNAL_VISA_ERROR = of("internal_visa_error")
+ /**
+ * The total amount of a series of incremental authorizations, optionally provided.
+ */
+ class TotalCumulative
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /**
- * The merchant has enabled Visa's Transaction Advisory Service and
- * requires further authentication to perform the transaction. In
- * practice this is often utilized at fuel pumps to tell the cardholder
- * to see the cashier.
- */
- @JvmField
- val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED =
- of("merchant_transaction_advisory_service_authentication_required")
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
- /**
- * The transaction was blocked by Visa's Payment Fraud Disruption
- * service due to fraudulent Acquirer behavior, such as card testing.
- */
- @JvmField
- val PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK =
- of("payment_fraud_disruption_acquirer_block")
+ /**
+ * The amount in minor units of the `currency` field.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
- /** An unspecific reason for stand-in processing. */
- @JvmField val OTHER = of("other")
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
- @JvmStatic
- fun of(value: String) = StandInProcessingReason(JsonField.of(value))
- }
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
- /** An enum containing [StandInProcessingReason]'s known values. */
- enum class Known {
- /** Increase failed to process the authorization in a timely manner. */
- ISSUER_ERROR,
- /**
- * The physical card read had an invalid CVV, dCVV, or authorization
- * request cryptogram.
- */
- INVALID_PHYSICAL_CARD,
- /** The 3DS cardholder authentication verification value was invalid. */
- INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
- /**
- * An internal Visa error occurred. Visa uses this reason code for
- * certain expected occurrences as well, such as Application Transaction
- * Counter (ATC) replays.
- */
- INTERNAL_VISA_ERROR,
- /**
- * The merchant has enabled Visa's Transaction Advisory Service and
- * requires further authentication to perform the transaction. In
- * practice this is often utilized at fuel pumps to tell the cardholder
- * to see the cashier.
- */
- MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
- /**
- * The transaction was blocked by Visa's Payment Fraud Disruption
- * service due to fraudulent Acquirer behavior, such as card testing.
- */
- PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK,
- /** An unspecific reason for stand-in processing. */
- OTHER,
- }
+ /**
+ * Returns the raw JSON value of [currency].
+ *
+ * Unlike [currency], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("currency")
+ @ExcludeMissing
+ fun _currency(): JsonField = currency
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
/**
- * An enum containing [StandInProcessingReason]'s known values, as well as
- * an [_UNKNOWN] member.
+ * Returns a mutable builder for constructing an instance of
+ * [TotalCumulative].
*
- * An instance of [StandInProcessingReason] can contain an unknown value in
- * a couple of cases:
- * - It was deserialized from data that doesn't match any known member. For
- * example, if the SDK is on an older version than the API, then the API
- * may respond with new members that the SDK is unaware of.
- * - It was constructed with an arbitrary value using the [of] method.
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
*/
- enum class Value {
- /** Increase failed to process the authorization in a timely manner. */
- ISSUER_ERROR,
- /**
- * The physical card read had an invalid CVV, dCVV, or authorization
- * request cryptogram.
- */
- INVALID_PHYSICAL_CARD,
- /** The 3DS cardholder authentication verification value was invalid. */
- INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
- /**
- * An internal Visa error occurred. Visa uses this reason code for
- * certain expected occurrences as well, such as Application Transaction
- * Counter (ATC) replays.
- */
- INTERNAL_VISA_ERROR,
- /**
- * The merchant has enabled Visa's Transaction Advisory Service and
- * requires further authentication to perform the transaction. In
- * practice this is often utilized at fuel pumps to tell the cardholder
- * to see the cashier.
- */
- MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
- /**
- * The transaction was blocked by Visa's Payment Fraud Disruption
- * service due to fraudulent Acquirer behavior, such as card testing.
- */
- PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK,
- /** An unspecific reason for stand-in processing. */
- OTHER,
- /**
- * An enum member indicating that [StandInProcessingReason] was
- * instantiated with an unknown value.
- */
- _UNKNOWN,
+ @JvmStatic fun builder() = Builder()
+ }
+
+ /** A builder for [TotalCumulative]. */
+ class Builder internal constructor() {
+
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
+
+ @JvmSynthetic
+ internal fun from(totalCumulative: TotalCumulative) = apply {
+ amount = totalCumulative.amount
+ currency = totalCumulative.currency
+ additionalProperties =
+ totalCumulative.additionalProperties.toMutableMap()
}
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
+
/**
- * Returns an enum member corresponding to this class instance's value, or
- * [Value._UNKNOWN] if the class was instantiated with an unknown value.
+ * Sets [Builder.amount] to an arbitrary JSON 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.
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun value(): Value =
- when (this) {
- ISSUER_ERROR -> Value.ISSUER_ERROR
- INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD
- INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE ->
- Value.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE
- INTERNAL_VISA_ERROR -> Value.INTERNAL_VISA_ERROR
- MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED ->
- Value
- .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED
- PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK ->
- Value.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK
- OTHER -> Value.OTHER
- else -> Value._UNKNOWN
- }
+ fun amount(amount: JsonField) = apply { this.amount = amount }
/**
- * 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.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
*/
- fun known(): Known =
- when (this) {
- ISSUER_ERROR -> Known.ISSUER_ERROR
- INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD
- INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE ->
- Known.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE
- INTERNAL_VISA_ERROR -> Known.INTERNAL_VISA_ERROR
- MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED ->
- Known
- .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED
- PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK ->
- Known.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK
- OTHER -> Known.OTHER
- else ->
- throw IncreaseInvalidDataException(
- "Unknown StandInProcessingReason: $value"
- )
- }
+ fun currency(currency: String) = currency(JsonField.of(currency))
/**
- * Returns this class instance's primitive wire representation.
- *
- * This differs from the [toString] method because that method is primarily
- * for debugging and generally doesn't throw.
+ * Sets [Builder.currency] to an arbitrary JSON value.
*
- * @throws IncreaseInvalidDataException if this class instance's value does
- * not have the expected primitive type.
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
*/
- fun asString(): String =
- _value().asString().orElseThrow {
- IncreaseInvalidDataException("Value is not a String")
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
+
+ fun additionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
}
- private var validated: Boolean = false
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
- fun validate(): StandInProcessingReason = apply {
- if (validated) {
- return@apply
- }
+ fun putAllAdditionalProperties(
+ additionalProperties: Map
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
- known()
- validated = true
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
}
- fun isValid(): Boolean =
- try {
- validate()
- true
- } catch (e: IncreaseInvalidDataException) {
- false
- }
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
/**
- * Returns a score indicating how many valid values are contained in this
- * object recursively.
+ * Returns an immutable instance of [TotalCumulative].
*
- * Used for best match union deserialization.
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
*/
- @JvmSynthetic
- internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1
+ fun build(): TotalCumulative =
+ TotalCumulative(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
+ }
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
+ private var validated: Boolean = false
- return /* spotless:off */ other is StandInProcessingReason && value == other.value /* spotless:on */
+ fun validate(): TotalCumulative = apply {
+ if (validated) {
+ return@apply
}
- override fun hashCode() = value.hashCode()
-
- override fun toString() = value.toString()
+ amount()
+ currency()
+ validated = true
}
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
+
+ /**
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
+ *
+ * Used for best match union deserialization.
+ */
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
+
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
- return /* spotless:off */ other is Visa && electronicCommerceIndicator == other.electronicCommerceIndicator && pointOfServiceEntryMode == other.pointOfServiceEntryMode && standInProcessingReason == other.standInProcessingReason && additionalProperties == other.additionalProperties /* spotless:on */
+ return /* spotless:off */ other is TotalCumulative && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
}
/* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(electronicCommerceIndicator, pointOfServiceEntryMode, standInProcessingReason, additionalProperties) }
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
/* spotless:on */
override fun hashCode(): Int = hashCode
override fun toString() =
- "Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, standInProcessingReason=$standInProcessingReason, additionalProperties=$additionalProperties}"
+ "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
}
- override fun equals(other: Any?): Boolean {
- if (this === other) {
- return true
- }
-
- return /* spotless:off */ other is NetworkDetails && category == other.category && visa == other.visa && additionalProperties == other.additionalProperties /* spotless:on */
- }
+ /** The total amount of healthcare-related additional amounts. */
+ class TotalHealthcare
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
- /* spotless:off */
- private val hashCode: Int by lazy { Objects.hash(category, visa, additionalProperties) }
- /* spotless:on */
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
- override fun hashCode(): Int = hashCode
+ /**
+ * The amount in minor units of the `currency` field.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun amount(): Long = amount.getRequired("amount")
- override fun toString() =
- "NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}"
- }
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
+ */
+ fun currency(): String = currency.getRequired("currency")
- /** Network-specific identifiers for a specific request or transaction. */
- class NetworkIdentifiers
- private constructor(
- private val retrievalReferenceNumber: JsonField,
- private val traceNumber: JsonField,
- private val transactionId: JsonField,
- private val additionalProperties: MutableMap,
- ) {
+ /**
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
- @JsonCreator
- private constructor(
- @JsonProperty("retrieval_reference_number")
- @ExcludeMissing
- retrievalReferenceNumber: JsonField = JsonMissing.of(),
- @JsonProperty("trace_number")
- @ExcludeMissing
- traceNumber: JsonField = JsonMissing.of(),
- @JsonProperty("transaction_id")
+ /**
+ * 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
- transactionId: JsonField = JsonMissing.of(),
- ) : this(retrievalReferenceNumber, traceNumber, transactionId, mutableMapOf())
+ fun _currency(): JsonField = currency
- /**
- * A life-cycle identifier used across e.g., an authorization and a reversal.
- * Expected to be unique per acquirer within a window of time. For some card
- * networks the retrieval reference number includes the trace counter.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun retrievalReferenceNumber(): Optional =
- retrievalReferenceNumber.getOptional("retrieval_reference_number")
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
- /**
- * A counter used to verify an individual authorization. Expected to be unique per
- * acquirer within a window of time.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun traceNumber(): Optional = traceNumber.getOptional("trace_number")
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
- /**
- * A globally unique transaction identifier provided by the card network, used
- * across multiple life-cycle requests.
- *
- * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
- * (e.g. if the server responded with an unexpected value).
- */
- fun transactionId(): Optional = transactionId.getOptional("transaction_id")
+ fun toBuilder() = Builder().from(this)
- /**
- * Returns the raw JSON value of [retrievalReferenceNumber].
- *
- * Unlike [retrievalReferenceNumber], this method doesn't throw if the JSON field
- * has an unexpected type.
- */
- @JsonProperty("retrieval_reference_number")
- @ExcludeMissing
- fun _retrievalReferenceNumber(): JsonField = retrievalReferenceNumber
+ companion object {
- /**
- * Returns the raw JSON value of [traceNumber].
- *
- * Unlike [traceNumber], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("trace_number")
- @ExcludeMissing
- fun _traceNumber(): JsonField = traceNumber
+ /**
+ * Returns a mutable builder for constructing an instance of
+ * [TotalHealthcare].
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ */
+ @JvmStatic fun builder() = Builder()
+ }
- /**
- * Returns the raw JSON value of [transactionId].
- *
- * Unlike [transactionId], this method doesn't throw if the JSON field has an
- * unexpected type.
- */
- @JsonProperty("transaction_id")
- @ExcludeMissing
- fun _transactionId(): JsonField = transactionId
+ /** A builder for [TotalHealthcare]. */
+ class Builder internal constructor() {
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
+ private var amount: JsonField? = null
+ private var currency: JsonField? = null
+ private var additionalProperties: MutableMap =
+ mutableMapOf()
- @JsonAnyGetter
- @ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
+ @JvmSynthetic
+ internal fun from(totalHealthcare: TotalHealthcare) = apply {
+ amount = totalHealthcare.amount
+ currency = totalHealthcare.currency
+ additionalProperties =
+ totalHealthcare.additionalProperties.toMutableMap()
+ }
- fun toBuilder() = Builder().from(this)
+ /** The amount in minor units of the `currency` field. */
+ fun amount(amount: Long) = amount(JsonField.of(amount))
- companion object {
+ /**
+ * Sets [Builder.amount] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.amount] with a well-typed [Long] value
+ * instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun amount(amount: JsonField) = apply { this.amount = amount }
- /**
- * Returns a mutable builder for constructing an instance of
- * [NetworkIdentifiers].
- *
- * The following fields are required:
- * ```java
- * .retrievalReferenceNumber()
- * .traceNumber()
- * .transactionId()
- * ```
- */
- @JvmStatic fun builder() = Builder()
- }
+ /**
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ */
+ fun currency(currency: String) = currency(JsonField.of(currency))
- /** A builder for [NetworkIdentifiers]. */
- class Builder internal constructor() {
+ /**
+ * Sets [Builder.currency] to an arbitrary JSON value.
+ *
+ * You should usually call [Builder.currency] with a well-typed [String]
+ * value instead. This method is primarily for setting the field to an
+ * undocumented or not yet supported value.
+ */
+ fun currency(currency: JsonField) = apply {
+ this.currency = currency
+ }
- private var retrievalReferenceNumber: JsonField? = null
- private var traceNumber: JsonField? = null
- private var transactionId: JsonField? = null
- private var additionalProperties: MutableMap = mutableMapOf()
+ fun additionalProperties(additionalProperties: Map) =
+ apply {
+ this.additionalProperties.clear()
+ putAllAdditionalProperties(additionalProperties)
+ }
- @JvmSynthetic
- internal fun from(networkIdentifiers: NetworkIdentifiers) = apply {
- retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber
- traceNumber = networkIdentifiers.traceNumber
- transactionId = networkIdentifiers.transactionId
- additionalProperties =
- networkIdentifiers.additionalProperties.toMutableMap()
+ fun putAdditionalProperty(key: String, value: JsonValue) = apply {
+ additionalProperties.put(key, value)
+ }
+
+ fun putAllAdditionalProperties(
+ additionalProperties: Map
+ ) = apply { this.additionalProperties.putAll(additionalProperties) }
+
+ fun removeAdditionalProperty(key: String) = apply {
+ additionalProperties.remove(key)
+ }
+
+ fun removeAllAdditionalProperties(keys: Set) = apply {
+ keys.forEach(::removeAdditionalProperty)
+ }
+
+ /**
+ * Returns an immutable instance of [TotalHealthcare].
+ *
+ * Further updates to this [Builder] will not mutate the returned instance.
+ *
+ * The following fields are required:
+ * ```java
+ * .amount()
+ * .currency()
+ * ```
+ *
+ * @throws IllegalStateException if any required field is unset.
+ */
+ fun build(): TotalHealthcare =
+ TotalHealthcare(
+ checkRequired("amount", amount),
+ checkRequired("currency", currency),
+ additionalProperties.toMutableMap(),
+ )
}
- /**
- * A life-cycle identifier used across e.g., an authorization and a reversal.
- * Expected to be unique per acquirer within a window of time. For some card
- * networks the retrieval reference number includes the trace counter.
- */
- fun retrievalReferenceNumber(retrievalReferenceNumber: String?) =
- retrievalReferenceNumber(JsonField.ofNullable(retrievalReferenceNumber))
+ private var validated: Boolean = false
- /**
- * Alias for calling [Builder.retrievalReferenceNumber] with
- * `retrievalReferenceNumber.orElse(null)`.
- */
- fun retrievalReferenceNumber(retrievalReferenceNumber: Optional) =
- retrievalReferenceNumber(retrievalReferenceNumber.getOrNull())
+ fun validate(): TotalHealthcare = apply {
+ if (validated) {
+ return@apply
+ }
+
+ amount()
+ currency()
+ validated = true
+ }
+
+ fun isValid(): Boolean =
+ try {
+ validate()
+ true
+ } catch (e: IncreaseInvalidDataException) {
+ false
+ }
/**
- * Sets [Builder.retrievalReferenceNumber] to an arbitrary JSON value.
+ * Returns a score indicating how many valid values are contained in this object
+ * recursively.
*
- * You should usually call [Builder.retrievalReferenceNumber] with a well-typed
- * [String] value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
+ * Used for best match union deserialization.
*/
- fun retrievalReferenceNumber(retrievalReferenceNumber: JsonField) =
- apply {
- this.retrievalReferenceNumber = retrievalReferenceNumber
+ @JvmSynthetic
+ internal fun validity(): Int =
+ (if (amount.asKnown().isPresent) 1 else 0) +
+ (if (currency.asKnown().isPresent) 1 else 0)
+
+ override fun equals(other: Any?): Boolean {
+ if (this === other) {
+ return true
}
- /**
- * A counter used to verify an individual authorization. Expected to be unique
- * per acquirer within a window of time.
- */
- fun traceNumber(traceNumber: String?) =
- traceNumber(JsonField.ofNullable(traceNumber))
+ return /* spotless:off */ other is TotalHealthcare && amount == other.amount && currency == other.currency && additionalProperties == other.additionalProperties /* spotless:on */
+ }
- /** Alias for calling [Builder.traceNumber] with `traceNumber.orElse(null)`. */
- fun traceNumber(traceNumber: Optional) =
- traceNumber(traceNumber.getOrNull())
+ /* spotless:off */
+ private val hashCode: Int by lazy { Objects.hash(amount, currency, additionalProperties) }
+ /* spotless:on */
+
+ override fun hashCode(): Int = hashCode
+
+ override fun toString() =
+ "TotalHealthcare{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
+ }
+
+ /** The part of this transaction amount that was for transit-related services. */
+ class Transit
+ private constructor(
+ private val amount: JsonField,
+ private val currency: JsonField,
+ private val additionalProperties: MutableMap,
+ ) {
+
+ @JsonCreator
+ private constructor(
+ @JsonProperty("amount")
+ @ExcludeMissing
+ amount: JsonField = JsonMissing.of(),
+ @JsonProperty("currency")
+ @ExcludeMissing
+ currency: JsonField = JsonMissing.of(),
+ ) : this(amount, currency, mutableMapOf())
/**
- * Sets [Builder.traceNumber] to an arbitrary JSON value.
+ * The amount in minor units of the `currency` field.
*
- * You should usually call [Builder.traceNumber] with a well-typed [String]
- * value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
+ * @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 traceNumber(traceNumber: JsonField) = apply {
- this.traceNumber = traceNumber
- }
+ fun amount(): Long = amount.getRequired("amount")
/**
- * A globally unique transaction identifier provided by the card network, used
- * across multiple life-cycle requests.
+ * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the
+ * additional amount's currency.
+ *
+ * @throws IncreaseInvalidDataException if the JSON field has an unexpected type
+ * or is unexpectedly missing or null (e.g. if the server responded with an
+ * unexpected value).
*/
- fun transactionId(transactionId: String?) =
- transactionId(JsonField.ofNullable(transactionId))
+ fun currency(): String = currency.getRequired("currency")
/**
- * Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`.
+ * Returns the raw JSON value of [amount].
+ *
+ * Unlike [amount], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- fun transactionId(transactionId: Optional) =
- transactionId(transactionId.getOrNull())
+ @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount
/**
- * Sets [Builder.transactionId] to an arbitrary JSON value.
+ * Returns the raw JSON value of [currency].
*
- * You should usually call [Builder.transactionId] with a well-typed [String]
- * value instead. This method is primarily for setting the field to an
- * undocumented or not yet supported value.
+ * Unlike [currency], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- fun transactionId(transactionId: JsonField) = apply {
- this.transactionId = transactionId
- }
-
- fun additionalProperties(additionalProperties: Map