com.increase.api.models.CardPayment.kt Maven / Gradle / Ivy
The newest version!
// File generated from our OpenAPI spec by Stainless.
package com.increase.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.Enum
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonField
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toUnmodifiable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
/**
* Card Payments group together interactions related to a single card payment, such as an
* authorization and its corresponding settlement.
*/
@JsonDeserialize(builder = CardPayment.Builder::class)
@NoAutoDetect
class CardPayment
private constructor(
private val accountId: JsonField,
private val cardId: JsonField,
private val createdAt: JsonField,
private val digitalWalletTokenId: JsonField,
private val elements: JsonField>,
private val id: JsonField,
private val physicalCardId: JsonField,
private val state: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The identifier for the Account the Transaction belongs to. */
fun accountId(): String = accountId.getRequired("account_id")
/** The Card identifier for this payment. */
fun cardId(): String = cardId.getRequired("card_id")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/** The Digital Wallet Token identifier for this payment. */
fun digitalWalletTokenId(): String? =
digitalWalletTokenId.getNullable("digital_wallet_token_id")
/** The interactions related to this card payment. */
fun elements(): List = elements.getRequired("elements")
/** The Card Payment identifier. */
fun id(): String = id.getRequired("id")
/** The Physical Card identifier for this payment. */
fun physicalCardId(): String? = physicalCardId.getNullable("physical_card_id")
/** The summarized state of this card payment. */
fun state(): State = state.getRequired("state")
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
fun type(): Type = type.getRequired("type")
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/** The Card identifier for this payment. */
@JsonProperty("card_id") @ExcludeMissing fun _cardId() = cardId
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/** The Digital Wallet Token identifier for this payment. */
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun _digitalWalletTokenId() = digitalWalletTokenId
/** The interactions related to this card payment. */
@JsonProperty("elements") @ExcludeMissing fun _elements() = elements
/** The Card Payment identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/** The Physical Card identifier for this payment. */
@JsonProperty("physical_card_id") @ExcludeMissing fun _physicalCardId() = physicalCardId
/** The summarized state of this card payment. */
@JsonProperty("state") @ExcludeMissing fun _state() = state
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardPayment = apply {
if (!validated) {
accountId()
cardId()
createdAt()
digitalWalletTokenId()
elements().forEach { it.validate() }
id()
physicalCardId()
state().validate()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardPayment &&
this.accountId == other.accountId &&
this.cardId == other.cardId &&
this.createdAt == other.createdAt &&
this.digitalWalletTokenId == other.digitalWalletTokenId &&
this.elements == other.elements &&
this.id == other.id &&
this.physicalCardId == other.physicalCardId &&
this.state == other.state &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountId,
cardId,
createdAt,
digitalWalletTokenId,
elements,
id,
physicalCardId,
state,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardPayment{accountId=$accountId, cardId=$cardId, createdAt=$createdAt, digitalWalletTokenId=$digitalWalletTokenId, elements=$elements, id=$id, physicalCardId=$physicalCardId, state=$state, type=$type, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var cardId: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var digitalWalletTokenId: JsonField = JsonMissing.of()
private var elements: JsonField> = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var physicalCardId: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardPayment: CardPayment) = apply {
this.accountId = cardPayment.accountId
this.cardId = cardPayment.cardId
this.createdAt = cardPayment.createdAt
this.digitalWalletTokenId = cardPayment.digitalWalletTokenId
this.elements = cardPayment.elements
this.id = cardPayment.id
this.physicalCardId = cardPayment.physicalCardId
this.state = cardPayment.state
this.type = cardPayment.type
additionalProperties(cardPayment.additionalProperties)
}
/** The identifier for the Account the Transaction belongs to. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/** The Card identifier for this payment. */
fun cardId(cardId: String) = cardId(JsonField.of(cardId))
/** The Card identifier for this payment. */
@JsonProperty("card_id")
@ExcludeMissing
fun cardId(cardId: JsonField) = apply { this.cardId = cardId }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
/** The Digital Wallet Token identifier for this payment. */
fun digitalWalletTokenId(digitalWalletTokenId: String) =
digitalWalletTokenId(JsonField.of(digitalWalletTokenId))
/** The Digital Wallet Token identifier for this payment. */
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply {
this.digitalWalletTokenId = digitalWalletTokenId
}
/** The interactions related to this card payment. */
fun elements(elements: List) = elements(JsonField.of(elements))
/** The interactions related to this card payment. */
@JsonProperty("elements")
@ExcludeMissing
fun elements(elements: JsonField>) = apply { this.elements = elements }
/** The Card Payment identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Card Payment identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/** The Physical Card identifier for this payment. */
fun physicalCardId(physicalCardId: String) = physicalCardId(JsonField.of(physicalCardId))
/** The Physical Card identifier for this payment. */
@JsonProperty("physical_card_id")
@ExcludeMissing
fun physicalCardId(physicalCardId: JsonField) = apply {
this.physicalCardId = physicalCardId
}
/** The summarized state of this card payment. */
fun state(state: State) = state(JsonField.of(state))
/** The summarized state of this card payment. */
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): CardPayment =
CardPayment(
accountId,
cardId,
createdAt,
digitalWalletTokenId,
elements.map { it.toUnmodifiable() },
id,
physicalCardId,
state,
type,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = Element.Builder::class)
@NoAutoDetect
class Element
private constructor(
private val cardAuthorization: JsonField,
private val cardAuthorizationExpiration: JsonField,
private val cardDecline: JsonField,
private val cardFuelConfirmation: JsonField,
private val cardIncrement: JsonField,
private val cardRefund: JsonField,
private val cardReversal: JsonField,
private val cardSettlement: JsonField,
private val cardValidation: JsonField,
private val category: JsonField,
private val createdAt: JsonField,
private val other: JsonValue,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
fun cardAuthorization(): CardAuthorization? =
cardAuthorization.getNullable("card_authorization")
/**
* A Card Authorization Expiration object. This field will be present in the JSON response
* if and only if `category` is equal to `card_authorization_expiration`.
*/
fun cardAuthorizationExpiration(): CardAuthorizationExpiration? =
cardAuthorizationExpiration.getNullable("card_authorization_expiration")
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
fun cardDecline(): CardDecline? = cardDecline.getNullable("card_decline")
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if and
* only if `category` is equal to `card_fuel_confirmation`.
*/
fun cardFuelConfirmation(): CardFuelConfirmation? =
cardFuelConfirmation.getNullable("card_fuel_confirmation")
/**
* A Card Increment object. This field will be present in the JSON response if and only if
* `category` is equal to `card_increment`.
*/
fun cardIncrement(): CardIncrement? = cardIncrement.getNullable("card_increment")
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(): CardRefund? = cardRefund.getNullable("card_refund")
/**
* A Card Reversal object. This field will be present in the JSON response if and only if
* `category` is equal to `card_reversal`.
*/
fun cardReversal(): CardReversal? = cardReversal.getNullable("card_reversal")
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
fun cardSettlement(): CardSettlement? = cardSettlement.getNullable("card_settlement")
/**
* A Card Validation object. This field will be present in the JSON response if and only if
* `category` is equal to `card_validation`.
*/
fun cardValidation(): CardValidation? = cardValidation.getNullable("card_validation")
/**
* The type of the resource. We may add additional possible values for this enum over time;
* your application should be able to handle such additions gracefully.
*/
fun category(): Category = category.getRequired("category")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card
* payment element was created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
@JsonProperty("card_authorization")
@ExcludeMissing
fun _cardAuthorization() = cardAuthorization
/**
* A Card Authorization Expiration object. This field will be present in the JSON response
* if and only if `category` is equal to `card_authorization_expiration`.
*/
@JsonProperty("card_authorization_expiration")
@ExcludeMissing
fun _cardAuthorizationExpiration() = cardAuthorizationExpiration
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
@JsonProperty("card_decline") @ExcludeMissing fun _cardDecline() = cardDecline
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if and
* only if `category` is equal to `card_fuel_confirmation`.
*/
@JsonProperty("card_fuel_confirmation")
@ExcludeMissing
fun _cardFuelConfirmation() = cardFuelConfirmation
/**
* A Card Increment object. This field will be present in the JSON response if and only if
* `category` is equal to `card_increment`.
*/
@JsonProperty("card_increment") @ExcludeMissing fun _cardIncrement() = cardIncrement
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund") @ExcludeMissing fun _cardRefund() = cardRefund
/**
* A Card Reversal object. This field will be present in the JSON response if and only if
* `category` is equal to `card_reversal`.
*/
@JsonProperty("card_reversal") @ExcludeMissing fun _cardReversal() = cardReversal
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement") @ExcludeMissing fun _cardSettlement() = cardSettlement
/**
* A Card Validation object. This field will be present in the JSON response if and only if
* `category` is equal to `card_validation`.
*/
@JsonProperty("card_validation") @ExcludeMissing fun _cardValidation() = cardValidation
/**
* The type of the resource. We may add additional possible values for this enum over time;
* your application should be able to handle such additions gracefully.
*/
@JsonProperty("category") @ExcludeMissing fun _category() = category
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card
* payment element was created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/**
* If the category of this Transaction source is equal to `other`, this field will contain
* an empty object, otherwise it will contain null.
*/
@JsonProperty("other") @ExcludeMissing fun _other() = other
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Element = apply {
if (!validated) {
cardAuthorization()?.validate()
cardAuthorizationExpiration()?.validate()
cardDecline()?.validate()
cardFuelConfirmation()?.validate()
cardIncrement()?.validate()
cardRefund()?.validate()
cardReversal()?.validate()
cardSettlement()?.validate()
cardValidation()?.validate()
category()
createdAt()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Element &&
this.cardAuthorization == other.cardAuthorization &&
this.cardAuthorizationExpiration == other.cardAuthorizationExpiration &&
this.cardDecline == other.cardDecline &&
this.cardFuelConfirmation == other.cardFuelConfirmation &&
this.cardIncrement == other.cardIncrement &&
this.cardRefund == other.cardRefund &&
this.cardReversal == other.cardReversal &&
this.cardSettlement == other.cardSettlement &&
this.cardValidation == other.cardValidation &&
this.category == other.category &&
this.createdAt == other.createdAt &&
this.other == other.other &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
cardAuthorization,
cardAuthorizationExpiration,
cardDecline,
cardFuelConfirmation,
cardIncrement,
cardRefund,
cardReversal,
cardSettlement,
cardValidation,
category,
createdAt,
other,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Element{cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var cardAuthorization: JsonField = JsonMissing.of()
private var cardAuthorizationExpiration: JsonField =
JsonMissing.of()
private var cardDecline: JsonField = JsonMissing.of()
private var cardFuelConfirmation: JsonField = JsonMissing.of()
private var cardIncrement: JsonField = JsonMissing.of()
private var cardRefund: JsonField = JsonMissing.of()
private var cardReversal: JsonField = JsonMissing.of()
private var cardSettlement: JsonField = JsonMissing.of()
private var cardValidation: JsonField = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var other: JsonValue = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(element: Element) = apply {
this.cardAuthorization = element.cardAuthorization
this.cardAuthorizationExpiration = element.cardAuthorizationExpiration
this.cardDecline = element.cardDecline
this.cardFuelConfirmation = element.cardFuelConfirmation
this.cardIncrement = element.cardIncrement
this.cardRefund = element.cardRefund
this.cardReversal = element.cardReversal
this.cardSettlement = element.cardSettlement
this.cardValidation = element.cardValidation
this.category = element.category
this.createdAt = element.createdAt
this.other = element.other
additionalProperties(element.additionalProperties)
}
/**
* A Card Authorization object. This field will be present in the JSON response if and
* only if `category` is equal to `card_authorization`.
*/
fun cardAuthorization(cardAuthorization: CardAuthorization) =
cardAuthorization(JsonField.of(cardAuthorization))
/**
* A Card Authorization object. This field will be present in the JSON response if and
* only if `category` is equal to `card_authorization`.
*/
@JsonProperty("card_authorization")
@ExcludeMissing
fun cardAuthorization(cardAuthorization: JsonField) = apply {
this.cardAuthorization = cardAuthorization
}
/**
* A Card Authorization Expiration object. This field will be present in the JSON
* response if and only if `category` is equal to `card_authorization_expiration`.
*/
fun cardAuthorizationExpiration(
cardAuthorizationExpiration: CardAuthorizationExpiration
) = cardAuthorizationExpiration(JsonField.of(cardAuthorizationExpiration))
/**
* A Card Authorization Expiration object. This field will be present in the JSON
* response if and only if `category` is equal to `card_authorization_expiration`.
*/
@JsonProperty("card_authorization_expiration")
@ExcludeMissing
fun cardAuthorizationExpiration(
cardAuthorizationExpiration: JsonField
) = apply { this.cardAuthorizationExpiration = cardAuthorizationExpiration }
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
fun cardDecline(cardDecline: CardDecline) = cardDecline(JsonField.of(cardDecline))
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
@JsonProperty("card_decline")
@ExcludeMissing
fun cardDecline(cardDecline: JsonField) = apply {
this.cardDecline = cardDecline
}
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if
* and only if `category` is equal to `card_fuel_confirmation`.
*/
fun cardFuelConfirmation(cardFuelConfirmation: CardFuelConfirmation) =
cardFuelConfirmation(JsonField.of(cardFuelConfirmation))
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if
* and only if `category` is equal to `card_fuel_confirmation`.
*/
@JsonProperty("card_fuel_confirmation")
@ExcludeMissing
fun cardFuelConfirmation(cardFuelConfirmation: JsonField) =
apply {
this.cardFuelConfirmation = cardFuelConfirmation
}
/**
* A Card Increment object. This field will be present in the JSON response if and only
* if `category` is equal to `card_increment`.
*/
fun cardIncrement(cardIncrement: CardIncrement) =
cardIncrement(JsonField.of(cardIncrement))
/**
* A Card Increment object. This field will be present in the JSON response if and only
* if `category` is equal to `card_increment`.
*/
@JsonProperty("card_increment")
@ExcludeMissing
fun cardIncrement(cardIncrement: JsonField) = apply {
this.cardIncrement = cardIncrement
}
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(cardRefund: CardRefund) = cardRefund(JsonField.of(cardRefund))
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund")
@ExcludeMissing
fun cardRefund(cardRefund: JsonField) = apply {
this.cardRefund = cardRefund
}
/**
* A Card Reversal object. This field will be present in the JSON response if and only
* if `category` is equal to `card_reversal`.
*/
fun cardReversal(cardReversal: CardReversal) = cardReversal(JsonField.of(cardReversal))
/**
* A Card Reversal object. This field will be present in the JSON response if and only
* if `category` is equal to `card_reversal`.
*/
@JsonProperty("card_reversal")
@ExcludeMissing
fun cardReversal(cardReversal: JsonField) = apply {
this.cardReversal = cardReversal
}
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
fun cardSettlement(cardSettlement: CardSettlement) =
cardSettlement(JsonField.of(cardSettlement))
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement")
@ExcludeMissing
fun cardSettlement(cardSettlement: JsonField) = apply {
this.cardSettlement = cardSettlement
}
/**
* A Card Validation object. This field will be present in the JSON response if and only
* if `category` is equal to `card_validation`.
*/
fun cardValidation(cardValidation: CardValidation) =
cardValidation(JsonField.of(cardValidation))
/**
* A Card Validation object. This field will be present in the JSON response if and only
* if `category` is equal to `card_validation`.
*/
@JsonProperty("card_validation")
@ExcludeMissing
fun cardValidation(cardValidation: JsonField) = apply {
this.cardValidation = cardValidation
}
/**
* The type of the resource. We may add additional possible values for this enum over
* time; your application should be able to handle such additions gracefully.
*/
fun category(category: Category) = category(JsonField.of(category))
/**
* The type of the resource. We may add additional possible values for this enum over
* time; your application should be able to handle such additions gracefully.
*/
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* card payment element was created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* card payment element was created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply {
this.createdAt = createdAt
}
/**
* If the category of this Transaction source is equal to `other`, this field will
* contain an empty object, otherwise it will contain null.
*/
@JsonProperty("other")
@ExcludeMissing
fun other(other: JsonValue) = apply { this.other = other }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): Element =
Element(
cardAuthorization,
cardAuthorizationExpiration,
cardDecline,
cardFuelConfirmation,
cardIncrement,
cardRefund,
cardReversal,
cardSettlement,
cardValidation,
category,
createdAt,
other,
additionalProperties.toUnmodifiable(),
)
}
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
@JsonDeserialize(builder = CardAuthorization.Builder::class)
@NoAutoDetect
class CardAuthorization
private constructor(
private val actioner: JsonField,
private val amount: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
private val digitalWalletTokenId: JsonField,
private val direction: JsonField,
private val expiresAt: JsonField,
private val id: JsonField,
private val merchantAcceptorId: JsonField,
private val merchantCategoryCode: JsonField,
private val merchantCity: JsonField,
private val merchantCountry: JsonField,
private val merchantDescriptor: JsonField,
private val merchantPostalCode: JsonField,
private val merchantState: JsonField,
private val networkDetails: JsonField,
private val networkIdentifiers: JsonField,
private val networkRiskScore: JsonField,
private val pendingTransactionId: JsonField,
private val physicalCardId: JsonField,
private val presentmentAmount: JsonField,
private val presentmentCurrency: JsonField,
private val processingCategory: JsonField,
private val realTimeDecisionId: JsonField,
private val type: JsonField,
private val verification: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
fun actioner(): Actioner = actioner.getRequired("actioner")
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/** The ID of the Card Payment this transaction belongs to. */
fun cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
fun currency(): Currency = currency.getRequired("currency")
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
fun digitalWalletTokenId(): String? =
digitalWalletTokenId.getNullable("digital_wallet_token_id")
/**
* The direction describes the direction the funds will move, either from the cardholder
* to the merchant or from the merchant to the cardholder.
*/
fun direction(): Direction = direction.getRequired("direction")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization will
* expire and the pending transaction will be released.
*/
fun expiresAt(): OffsetDateTime = expiresAt.getRequired("expires_at")
/** The Card Authorization identifier. */
fun id(): String = id.getRequired("id")
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
fun merchantAcceptorId(): String =
merchantAcceptorId.getRequired("merchant_acceptor_id")
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
* transacting with.
*/
fun merchantCategoryCode(): String? =
merchantCategoryCode.getNullable("merchant_category_code")
/** The city the merchant resides in. */
fun merchantCity(): String? = merchantCity.getNullable("merchant_city")
/** The country the merchant resides in. */
fun merchantCountry(): String? = merchantCountry.getNullable("merchant_country")
/** The merchant descriptor of the merchant the card is transacting with. */
fun merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor")
/**
* The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP
* code, where the first 5 and last 4 are separated by a dash.
*/
fun merchantPostalCode(): String? =
merchantPostalCode.getNullable("merchant_postal_code")
/** The state the merchant resides in. */
fun merchantState(): String? = merchantState.getNullable("merchant_state")
/** Fields specific to the `network`. */
fun networkDetails(): NetworkDetails = networkDetails.getRequired("network_details")
/** Network-specific identifiers for a specific request or transaction. */
fun networkIdentifiers(): NetworkIdentifiers =
networkIdentifiers.getRequired("network_identifiers")
/**
* The risk score generated by the card network. For Visa this is the Visa Advanced
* Authorization risk score, from 0 to 99, where 99 is the riskiest.
*/
fun networkRiskScore(): Long? = networkRiskScore.getNullable("network_risk_score")
/** The identifier of the Pending Transaction associated with this Transaction. */
fun pendingTransactionId(): String? =
pendingTransactionId.getNullable("pending_transaction_id")
/**
* If the authorization was made in-person with a physical card, the Physical Card that
* was used.
*/
fun physicalCardId(): String? = physicalCardId.getNullable("physical_card_id")
/** The pending amount in the minor unit of the transaction's presentment currency. */
fun presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
fun presentmentCurrency(): String =
presentmentCurrency.getRequired("presentment_currency")
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*/
fun processingCategory(): ProcessingCategory =
processingCategory.getRequired("processing_category")
/**
* The identifier of the Real-Time Decision sent to approve or decline this transaction.
*/
fun realTimeDecisionId(): String? =
realTimeDecisionId.getNullable("real_time_decision_id")
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
fun type(): Type = type.getRequired("type")
/** Fields related to verification of cardholder-provided values. */
fun verification(): Verification = verification.getRequired("verification")
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
@JsonProperty("actioner") @ExcludeMissing fun _actioner() = actioner
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/** The ID of the Card Payment this transaction belongs to. */
@JsonProperty("card_payment_id") @ExcludeMissing fun _cardPaymentId() = cardPaymentId
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun _digitalWalletTokenId() = digitalWalletTokenId
/**
* The direction describes the direction the funds will move, either from the cardholder
* to the merchant or from the merchant to the cardholder.
*/
@JsonProperty("direction") @ExcludeMissing fun _direction() = direction
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization will
* expire and the pending transaction will be released.
*/
@JsonProperty("expires_at") @ExcludeMissing fun _expiresAt() = expiresAt
/** The Card Authorization identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
fun _merchantAcceptorId() = merchantAcceptorId
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_category_code")
@ExcludeMissing
fun _merchantCategoryCode() = merchantCategoryCode
/** The city the merchant resides in. */
@JsonProperty("merchant_city") @ExcludeMissing fun _merchantCity() = merchantCity
/** The country the merchant resides in. */
@JsonProperty("merchant_country")
@ExcludeMissing
fun _merchantCountry() = merchantCountry
/** The merchant descriptor of the merchant the card is transacting with. */
@JsonProperty("merchant_descriptor")
@ExcludeMissing
fun _merchantDescriptor() = merchantDescriptor
/**
* The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP
* code, where the first 5 and last 4 are separated by a dash.
*/
@JsonProperty("merchant_postal_code")
@ExcludeMissing
fun _merchantPostalCode() = merchantPostalCode
/** The state the merchant resides in. */
@JsonProperty("merchant_state") @ExcludeMissing fun _merchantState() = merchantState
/** Fields specific to the `network`. */
@JsonProperty("network_details") @ExcludeMissing fun _networkDetails() = networkDetails
/** Network-specific identifiers for a specific request or transaction. */
@JsonProperty("network_identifiers")
@ExcludeMissing
fun _networkIdentifiers() = networkIdentifiers
/**
* The risk score generated by the card network. For Visa this is the Visa Advanced
* Authorization risk score, from 0 to 99, where 99 is the riskiest.
*/
@JsonProperty("network_risk_score")
@ExcludeMissing
fun _networkRiskScore() = networkRiskScore
/** The identifier of the Pending Transaction associated with this Transaction. */
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun _pendingTransactionId() = pendingTransactionId
/**
* If the authorization was made in-person with a physical card, the Physical Card that
* was used.
*/
@JsonProperty("physical_card_id") @ExcludeMissing fun _physicalCardId() = physicalCardId
/** The pending amount in the minor unit of the transaction's presentment currency. */
@JsonProperty("presentment_amount")
@ExcludeMissing
fun _presentmentAmount() = presentmentAmount
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
@JsonProperty("presentment_currency")
@ExcludeMissing
fun _presentmentCurrency() = presentmentCurrency
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*/
@JsonProperty("processing_category")
@ExcludeMissing
fun _processingCategory() = processingCategory
/**
* The identifier of the Real-Time Decision sent to approve or decline this transaction.
*/
@JsonProperty("real_time_decision_id")
@ExcludeMissing
fun _realTimeDecisionId() = realTimeDecisionId
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
/** Fields related to verification of cardholder-provided values. */
@JsonProperty("verification") @ExcludeMissing fun _verification() = verification
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardAuthorization = apply {
if (!validated) {
actioner()
amount()
cardPaymentId()
currency()
digitalWalletTokenId()
direction()
expiresAt()
id()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
merchantCountry()
merchantDescriptor()
merchantPostalCode()
merchantState()
networkDetails().validate()
networkIdentifiers().validate()
networkRiskScore()
pendingTransactionId()
physicalCardId()
presentmentAmount()
presentmentCurrency()
processingCategory()
realTimeDecisionId()
type()
verification().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardAuthorization &&
this.actioner == other.actioner &&
this.amount == other.amount &&
this.cardPaymentId == other.cardPaymentId &&
this.currency == other.currency &&
this.digitalWalletTokenId == other.digitalWalletTokenId &&
this.direction == other.direction &&
this.expiresAt == other.expiresAt &&
this.id == other.id &&
this.merchantAcceptorId == other.merchantAcceptorId &&
this.merchantCategoryCode == other.merchantCategoryCode &&
this.merchantCity == other.merchantCity &&
this.merchantCountry == other.merchantCountry &&
this.merchantDescriptor == other.merchantDescriptor &&
this.merchantPostalCode == other.merchantPostalCode &&
this.merchantState == other.merchantState &&
this.networkDetails == other.networkDetails &&
this.networkIdentifiers == other.networkIdentifiers &&
this.networkRiskScore == other.networkRiskScore &&
this.pendingTransactionId == other.pendingTransactionId &&
this.physicalCardId == other.physicalCardId &&
this.presentmentAmount == other.presentmentAmount &&
this.presentmentCurrency == other.presentmentCurrency &&
this.processingCategory == other.processingCategory &&
this.realTimeDecisionId == other.realTimeDecisionId &&
this.type == other.type &&
this.verification == other.verification &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
actioner,
amount,
cardPaymentId,
currency,
digitalWalletTokenId,
direction,
expiresAt,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
pendingTransactionId,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
type,
verification,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardAuthorization{actioner=$actioner, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, expiresAt=$expiresAt, id=$id, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, pendingTransactionId=$pendingTransactionId, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, type=$type, verification=$verification, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var actioner: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var cardPaymentId: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var digitalWalletTokenId: JsonField = JsonMissing.of()
private var direction: JsonField = JsonMissing.of()
private var expiresAt: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var merchantAcceptorId: JsonField = JsonMissing.of()
private var merchantCategoryCode: JsonField = JsonMissing.of()
private var merchantCity: JsonField = JsonMissing.of()
private var merchantCountry: JsonField = JsonMissing.of()
private var merchantDescriptor: JsonField = JsonMissing.of()
private var merchantPostalCode: JsonField = JsonMissing.of()
private var merchantState: JsonField = JsonMissing.of()
private var networkDetails: JsonField = JsonMissing.of()
private var networkIdentifiers: JsonField = JsonMissing.of()
private var networkRiskScore: JsonField = JsonMissing.of()
private var pendingTransactionId: JsonField = JsonMissing.of()
private var physicalCardId: JsonField = JsonMissing.of()
private var presentmentAmount: JsonField = JsonMissing.of()
private var presentmentCurrency: JsonField = JsonMissing.of()
private var processingCategory: JsonField = JsonMissing.of()
private var realTimeDecisionId: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var verification: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardAuthorization: CardAuthorization) = apply {
this.actioner = cardAuthorization.actioner
this.amount = cardAuthorization.amount
this.cardPaymentId = cardAuthorization.cardPaymentId
this.currency = cardAuthorization.currency
this.digitalWalletTokenId = cardAuthorization.digitalWalletTokenId
this.direction = cardAuthorization.direction
this.expiresAt = cardAuthorization.expiresAt
this.id = cardAuthorization.id
this.merchantAcceptorId = cardAuthorization.merchantAcceptorId
this.merchantCategoryCode = cardAuthorization.merchantCategoryCode
this.merchantCity = cardAuthorization.merchantCity
this.merchantCountry = cardAuthorization.merchantCountry
this.merchantDescriptor = cardAuthorization.merchantDescriptor
this.merchantPostalCode = cardAuthorization.merchantPostalCode
this.merchantState = cardAuthorization.merchantState
this.networkDetails = cardAuthorization.networkDetails
this.networkIdentifiers = cardAuthorization.networkIdentifiers
this.networkRiskScore = cardAuthorization.networkRiskScore
this.pendingTransactionId = cardAuthorization.pendingTransactionId
this.physicalCardId = cardAuthorization.physicalCardId
this.presentmentAmount = cardAuthorization.presentmentAmount
this.presentmentCurrency = cardAuthorization.presentmentCurrency
this.processingCategory = cardAuthorization.processingCategory
this.realTimeDecisionId = cardAuthorization.realTimeDecisionId
this.type = cardAuthorization.type
this.verification = cardAuthorization.verification
additionalProperties(cardAuthorization.additionalProperties)
}
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner))
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
@JsonProperty("actioner")
@ExcludeMissing
fun actioner(actioner: JsonField) = apply { this.actioner = actioner }
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/** The ID of the Card Payment this transaction belongs to. */
fun cardPaymentId(cardPaymentId: String) =
cardPaymentId(JsonField.of(cardPaymentId))
/** The ID of the Card Payment this transaction belongs to. */
@JsonProperty("card_payment_id")
@ExcludeMissing
fun cardPaymentId(cardPaymentId: JsonField) = apply {
this.cardPaymentId = cardPaymentId
}
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
fun digitalWalletTokenId(digitalWalletTokenId: String) =
digitalWalletTokenId(JsonField.of(digitalWalletTokenId))
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply {
this.digitalWalletTokenId = digitalWalletTokenId
}
/**
* The direction describes the direction the funds will move, either from the
* cardholder to the merchant or from the merchant to the cardholder.
*/
fun direction(direction: Direction) = direction(JsonField.of(direction))
/**
* The direction describes the direction the funds will move, either from the
* cardholder to the merchant or from the merchant to the cardholder.
*/
@JsonProperty("direction")
@ExcludeMissing
fun direction(direction: JsonField) = apply {
this.direction = direction
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization
* will expire and the pending transaction will be released.
*/
fun expiresAt(expiresAt: OffsetDateTime) = expiresAt(JsonField.of(expiresAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization
* will expire and the pending transaction will be released.
*/
@JsonProperty("expires_at")
@ExcludeMissing
fun expiresAt(expiresAt: JsonField) = apply {
this.expiresAt = expiresAt
}
/** The Card Authorization identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Card Authorization identifier. */
@JsonProperty("id")
@ExcludeMissing
fun id(id: JsonField) = apply { this.id = id }
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
fun merchantAcceptorId(merchantAcceptorId: String) =
merchantAcceptorId(JsonField.of(merchantAcceptorId))
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
fun merchantAcceptorId(merchantAcceptorId: JsonField) = apply {
this.merchantAcceptorId = merchantAcceptorId
}
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card
* is transacting with.
*/
fun merchantCategoryCode(merchantCategoryCode: String) =
merchantCategoryCode(JsonField.of(merchantCategoryCode))
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card
* is transacting with.
*/
@JsonProperty("merchant_category_code")
@ExcludeMissing
fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply {
this.merchantCategoryCode = merchantCategoryCode
}
/** The city the merchant resides in. */
fun merchantCity(merchantCity: String) = merchantCity(JsonField.of(merchantCity))
/** The city the merchant resides in. */
@JsonProperty("merchant_city")
@ExcludeMissing
fun merchantCity(merchantCity: JsonField) = apply {
this.merchantCity = merchantCity
}
/** The country the merchant resides in. */
fun merchantCountry(merchantCountry: String) =
merchantCountry(JsonField.of(merchantCountry))
/** The country the merchant resides in. */
@JsonProperty("merchant_country")
@ExcludeMissing
fun merchantCountry(merchantCountry: JsonField) = apply {
this.merchantCountry = merchantCountry
}
/** The merchant descriptor of the merchant the card is transacting with. */
fun merchantDescriptor(merchantDescriptor: String) =
merchantDescriptor(JsonField.of(merchantDescriptor))
/** The merchant descriptor of the merchant the card is transacting with. */
@JsonProperty("merchant_descriptor")
@ExcludeMissing
fun merchantDescriptor(merchantDescriptor: JsonField) = apply {
this.merchantDescriptor = merchantDescriptor
}
/**
* The merchant's postal code. For US merchants this is either a 5-digit or 9-digit
* ZIP code, where the first 5 and last 4 are separated by a dash.
*/
fun merchantPostalCode(merchantPostalCode: String) =
merchantPostalCode(JsonField.of(merchantPostalCode))
/**
* The merchant's postal code. For US merchants this is either a 5-digit or 9-digit
* ZIP code, where the first 5 and last 4 are separated by a dash.
*/
@JsonProperty("merchant_postal_code")
@ExcludeMissing
fun merchantPostalCode(merchantPostalCode: JsonField) = apply {
this.merchantPostalCode = merchantPostalCode
}
/** The state the merchant resides in. */
fun merchantState(merchantState: String) =
merchantState(JsonField.of(merchantState))
/** The state the merchant resides in. */
@JsonProperty("merchant_state")
@ExcludeMissing
fun merchantState(merchantState: JsonField) = apply {
this.merchantState = merchantState
}
/** Fields specific to the `network`. */
fun networkDetails(networkDetails: NetworkDetails) =
networkDetails(JsonField.of(networkDetails))
/** Fields specific to the `network`. */
@JsonProperty("network_details")
@ExcludeMissing
fun networkDetails(networkDetails: JsonField) = apply {
this.networkDetails = networkDetails
}
/** Network-specific identifiers for a specific request or transaction. */
fun networkIdentifiers(networkIdentifiers: NetworkIdentifiers) =
networkIdentifiers(JsonField.of(networkIdentifiers))
/** Network-specific identifiers for a specific request or transaction. */
@JsonProperty("network_identifiers")
@ExcludeMissing
fun networkIdentifiers(networkIdentifiers: JsonField) = apply {
this.networkIdentifiers = networkIdentifiers
}
/**
* The risk score generated by the card network. For Visa this is the Visa Advanced
* Authorization risk score, from 0 to 99, where 99 is the riskiest.
*/
fun networkRiskScore(networkRiskScore: Long) =
networkRiskScore(JsonField.of(networkRiskScore))
/**
* The risk score generated by the card network. For Visa this is the Visa Advanced
* Authorization risk score, from 0 to 99, where 99 is the riskiest.
*/
@JsonProperty("network_risk_score")
@ExcludeMissing
fun networkRiskScore(networkRiskScore: JsonField) = apply {
this.networkRiskScore = networkRiskScore
}
/** The identifier of the Pending Transaction associated with this Transaction. */
fun pendingTransactionId(pendingTransactionId: String) =
pendingTransactionId(JsonField.of(pendingTransactionId))
/** The identifier of the Pending Transaction associated with this Transaction. */
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun pendingTransactionId(pendingTransactionId: JsonField) = apply {
this.pendingTransactionId = pendingTransactionId
}
/**
* If the authorization was made in-person with a physical card, the Physical Card
* that was used.
*/
fun physicalCardId(physicalCardId: String) =
physicalCardId(JsonField.of(physicalCardId))
/**
* If the authorization was made in-person with a physical card, the Physical Card
* that was used.
*/
@JsonProperty("physical_card_id")
@ExcludeMissing
fun physicalCardId(physicalCardId: JsonField) = apply {
this.physicalCardId = physicalCardId
}
/**
* The pending amount in the minor unit of the transaction's presentment currency.
*/
fun presentmentAmount(presentmentAmount: Long) =
presentmentAmount(JsonField.of(presentmentAmount))
/**
* The pending amount in the minor unit of the transaction's presentment currency.
*/
@JsonProperty("presentment_amount")
@ExcludeMissing
fun presentmentAmount(presentmentAmount: JsonField) = apply {
this.presentmentAmount = presentmentAmount
}
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
fun presentmentCurrency(presentmentCurrency: String) =
presentmentCurrency(JsonField.of(presentmentCurrency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
@JsonProperty("presentment_currency")
@ExcludeMissing
fun presentmentCurrency(presentmentCurrency: JsonField) = apply {
this.presentmentCurrency = presentmentCurrency
}
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*/
fun processingCategory(processingCategory: ProcessingCategory) =
processingCategory(JsonField.of(processingCategory))
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*/
@JsonProperty("processing_category")
@ExcludeMissing
fun processingCategory(processingCategory: JsonField) = apply {
this.processingCategory = processingCategory
}
/**
* The identifier of the Real-Time Decision sent to approve or decline this
* transaction.
*/
fun realTimeDecisionId(realTimeDecisionId: String) =
realTimeDecisionId(JsonField.of(realTimeDecisionId))
/**
* The identifier of the Real-Time Decision sent to approve or decline this
* transaction.
*/
@JsonProperty("real_time_decision_id")
@ExcludeMissing
fun realTimeDecisionId(realTimeDecisionId: JsonField) = apply {
this.realTimeDecisionId = realTimeDecisionId
}
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
/** Fields related to verification of cardholder-provided values. */
fun verification(verification: Verification) =
verification(JsonField.of(verification))
/** Fields related to verification of cardholder-provided values. */
@JsonProperty("verification")
@ExcludeMissing
fun verification(verification: JsonField) = apply {
this.verification = verification
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): CardAuthorization =
CardAuthorization(
actioner,
amount,
cardPaymentId,
currency,
digitalWalletTokenId,
direction,
expiresAt,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
pendingTransactionId,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
type,
verification,
additionalProperties.toUnmodifiable(),
)
}
class Actioner
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Actioner && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val USER = Actioner(JsonField.of("user"))
val INCREASE = Actioner(JsonField.of("increase"))
val NETWORK = Actioner(JsonField.of("network"))
fun of(value: String) = Actioner(JsonField.of(value))
}
enum class Known {
USER,
INCREASE,
NETWORK,
}
enum class Value {
USER,
INCREASE,
NETWORK,
_UNKNOWN,
}
fun value(): Value =
when (this) {
USER -> Value.USER
INCREASE -> Value.INCREASE
NETWORK -> Value.NETWORK
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
USER -> Known.USER
INCREASE -> Known.INCREASE
NETWORK -> Known.NETWORK
else -> throw IncreaseInvalidDataException("Unknown Actioner: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Currency && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CAD = Currency(JsonField.of("CAD"))
val CHF = Currency(JsonField.of("CHF"))
val EUR = Currency(JsonField.of("EUR"))
val GBP = Currency(JsonField.of("GBP"))
val JPY = Currency(JsonField.of("JPY"))
val USD = Currency(JsonField.of("USD"))
fun of(value: String) = Currency(JsonField.of(value))
}
enum class Known {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
}
enum class Value {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
_UNKNOWN,
}
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 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 asString(): String = _value().asStringOrThrow()
}
class Direction
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Direction && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val SETTLEMENT = Direction(JsonField.of("settlement"))
val REFUND = Direction(JsonField.of("refund"))
fun of(value: String) = Direction(JsonField.of(value))
}
enum class Known {
SETTLEMENT,
REFUND,
}
enum class Value {
SETTLEMENT,
REFUND,
_UNKNOWN,
}
fun value(): Value =
when (this) {
SETTLEMENT -> Value.SETTLEMENT
REFUND -> Value.REFUND
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
SETTLEMENT -> Known.SETTLEMENT
REFUND -> Known.REFUND
else -> throw IncreaseInvalidDataException("Unknown Direction: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields specific to the `network`. */
@JsonDeserialize(builder = NetworkDetails.Builder::class)
@NoAutoDetect
class NetworkDetails
private constructor(
private val category: JsonField,
private val visa: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The payment network used to process this card authorization. */
fun category(): Category = category.getRequired("category")
/** Fields specific to the `visa` network. */
fun visa(): Visa? = visa.getNullable("visa")
/** The payment network used to process this card authorization. */
@JsonProperty("category") @ExcludeMissing fun _category() = category
/** Fields specific to the `visa` network. */
@JsonProperty("visa") @ExcludeMissing fun _visa() = visa
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): NetworkDetails = apply {
if (!validated) {
category()
visa()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is NetworkDetails &&
this.category == other.category &&
this.visa == other.visa &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
category,
visa,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var category: JsonField = JsonMissing.of()
private var visa: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(networkDetails: NetworkDetails) = apply {
this.category = networkDetails.category
this.visa = networkDetails.visa
additionalProperties(networkDetails.additionalProperties)
}
/** The payment network used to process this card authorization. */
fun category(category: Category) = category(JsonField.of(category))
/** The payment network used to process this card authorization. */
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/** Fields specific to the `visa` network. */
fun visa(visa: Visa) = visa(JsonField.of(visa))
/** Fields specific to the `visa` network. */
@JsonProperty("visa")
@ExcludeMissing
fun visa(visa: JsonField) = apply { this.visa = visa }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): NetworkDetails =
NetworkDetails(
category,
visa,
additionalProperties.toUnmodifiable(),
)
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Category && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val VISA = Category(JsonField.of("visa"))
fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
VISA,
}
enum class Value {
VISA,
_UNKNOWN,
}
fun value(): Value =
when (this) {
VISA -> Value.VISA
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
VISA -> Known.VISA
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields specific to the `visa` network. */
@JsonDeserialize(builder = Visa.Builder::class)
@NoAutoDetect
class Visa
private constructor(
private val electronicCommerceIndicator: JsonField,
private val pointOfServiceEntryMode: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 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.
*/
fun electronicCommerceIndicator(): ElectronicCommerceIndicator? =
electronicCommerceIndicator.getNullable("electronic_commerce_indicator")
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
fun pointOfServiceEntryMode(): PointOfServiceEntryMode? =
pointOfServiceEntryMode.getNullable("point_of_service_entry_mode")
/**
* 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.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
fun _electronicCommerceIndicator() = electronicCommerceIndicator
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
fun _pointOfServiceEntryMode() = pointOfServiceEntryMode
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Visa = apply {
if (!validated) {
electronicCommerceIndicator()
pointOfServiceEntryMode()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Visa &&
this.electronicCommerceIndicator == other.electronicCommerceIndicator &&
this.pointOfServiceEntryMode == other.pointOfServiceEntryMode &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
electronicCommerceIndicator,
pointOfServiceEntryMode,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var electronicCommerceIndicator:
JsonField =
JsonMissing.of()
private var pointOfServiceEntryMode: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(visa: Visa) = apply {
this.electronicCommerceIndicator = visa.electronicCommerceIndicator
this.pointOfServiceEntryMode = visa.pointOfServiceEntryMode
additionalProperties(visa.additionalProperties)
}
/**
* 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.of(electronicCommerceIndicator))
/**
* 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.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
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.of(pointOfServiceEntryMode))
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
fun pointOfServiceEntryMode(
pointOfServiceEntryMode: JsonField
) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): Visa =
Visa(
electronicCommerceIndicator,
pointOfServiceEntryMode,
additionalProperties.toUnmodifiable(),
)
}
class ElectronicCommerceIndicator
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is ElectronicCommerceIndicator && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(JsonField.of("mail_phone_order"))
val RECURRING = ElectronicCommerceIndicator(JsonField.of("recurring"))
val INSTALLMENT =
ElectronicCommerceIndicator(JsonField.of("installment"))
val UNKNOWN_MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(
JsonField.of("unknown_mail_phone_order")
)
val SECURE_ELECTRONIC_COMMERCE =
ElectronicCommerceIndicator(
JsonField.of("secure_electronic_commerce")
)
val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT =
ElectronicCommerceIndicator(
JsonField.of(
"non_authenticated_security_transaction_at_3ds_capable_merchant"
)
)
val NON_AUTHENTICATED_SECURITY_TRANSACTION =
ElectronicCommerceIndicator(
JsonField.of("non_authenticated_security_transaction")
)
val NON_SECURE_TRANSACTION =
ElectronicCommerceIndicator(JsonField.of("non_secure_transaction"))
fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value))
}
enum class Known {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
}
enum class Value {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
_UNKNOWN,
}
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 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 asString(): String = _value().asStringOrThrow()
}
class PointOfServiceEntryMode
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is PointOfServiceEntryMode && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val UNKNOWN = PointOfServiceEntryMode(JsonField.of("unknown"))
val MANUAL = PointOfServiceEntryMode(JsonField.of("manual"))
val MAGNETIC_STRIPE_NO_CVV =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe_no_cvv"))
val OPTICAL_CODE = PointOfServiceEntryMode(JsonField.of("optical_code"))
val INTEGRATED_CIRCUIT_CARD =
PointOfServiceEntryMode(JsonField.of("integrated_circuit_card"))
val CONTACTLESS = PointOfServiceEntryMode(JsonField.of("contactless"))
val CREDENTIAL_ON_FILE =
PointOfServiceEntryMode(JsonField.of("credential_on_file"))
val MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe"))
val CONTACTLESS_MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("contactless_magnetic_stripe"))
val INTEGRATED_CIRCUIT_CARD_NO_CVV =
PointOfServiceEntryMode(
JsonField.of("integrated_circuit_card_no_cvv")
)
fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value))
}
enum class Known {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
}
enum class Value {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
_UNKNOWN,
}
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 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 asString(): String = _value().asStringOrThrow()
}
}
}
/** Network-specific identifiers for a specific request or transaction. */
@JsonDeserialize(builder = NetworkIdentifiers.Builder::class)
@NoAutoDetect
class NetworkIdentifiers
private constructor(
private val retrievalReferenceNumber: JsonField,
private val traceNumber: JsonField,
private val transactionId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* 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(): String? =
retrievalReferenceNumber.getNullable("retrieval_reference_number")
/**
* A counter used to verify an individual authorization. Expected to be unique per
* acquirer within a window of time.
*/
fun traceNumber(): String? = traceNumber.getNullable("trace_number")
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
fun transactionId(): String? = transactionId.getNullable("transaction_id")
/**
* 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.
*/
@JsonProperty("retrieval_reference_number")
@ExcludeMissing
fun _retrievalReferenceNumber() = retrievalReferenceNumber
/**
* A counter used to verify an individual authorization. Expected to be unique per
* acquirer within a window of time.
*/
@JsonProperty("trace_number") @ExcludeMissing fun _traceNumber() = traceNumber
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): NetworkIdentifiers = apply {
if (!validated) {
retrievalReferenceNumber()
traceNumber()
transactionId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is NetworkIdentifiers &&
this.retrievalReferenceNumber == other.retrievalReferenceNumber &&
this.traceNumber == other.traceNumber &&
this.transactionId == other.transactionId &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
retrievalReferenceNumber,
traceNumber,
transactionId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var retrievalReferenceNumber: JsonField = JsonMissing.of()
private var traceNumber: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(networkIdentifiers: NetworkIdentifiers) = apply {
this.retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber
this.traceNumber = networkIdentifiers.traceNumber
this.transactionId = networkIdentifiers.transactionId
additionalProperties(networkIdentifiers.additionalProperties)
}
/**
* 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.of(retrievalReferenceNumber))
/**
* 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.
*/
@JsonProperty("retrieval_reference_number")
@ExcludeMissing
fun retrievalReferenceNumber(retrievalReferenceNumber: JsonField) =
apply {
this.retrievalReferenceNumber = retrievalReferenceNumber
}
/**
* A counter used to verify an individual authorization. Expected to be unique
* per acquirer within a window of time.
*/
fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber))
/**
* A counter used to verify an individual authorization. Expected to be unique
* per acquirer within a window of time.
*/
@JsonProperty("trace_number")
@ExcludeMissing
fun traceNumber(traceNumber: JsonField) = apply {
this.traceNumber = traceNumber
}
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
fun transactionId(transactionId: String) =
transactionId(JsonField.of(transactionId))
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
@JsonProperty("transaction_id")
@ExcludeMissing
fun transactionId(transactionId: JsonField) = apply {
this.transactionId = transactionId
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): NetworkIdentifiers =
NetworkIdentifiers(
retrievalReferenceNumber,
traceNumber,
transactionId,
additionalProperties.toUnmodifiable(),
)
}
}
class ProcessingCategory
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is ProcessingCategory && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACCOUNT_FUNDING = ProcessingCategory(JsonField.of("account_funding"))
val AUTOMATIC_FUEL_DISPENSER =
ProcessingCategory(JsonField.of("automatic_fuel_dispenser"))
val BILL_PAYMENT = ProcessingCategory(JsonField.of("bill_payment"))
val PURCHASE = ProcessingCategory(JsonField.of("purchase"))
val QUASI_CASH = ProcessingCategory(JsonField.of("quasi_cash"))
val REFUND = ProcessingCategory(JsonField.of("refund"))
fun of(value: String) = ProcessingCategory(JsonField.of(value))
}
enum class Known {
ACCOUNT_FUNDING,
AUTOMATIC_FUEL_DISPENSER,
BILL_PAYMENT,
PURCHASE,
QUASI_CASH,
REFUND,
}
enum class Value {
ACCOUNT_FUNDING,
AUTOMATIC_FUEL_DISPENSER,
BILL_PAYMENT,
PURCHASE,
QUASI_CASH,
REFUND,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING
AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER
BILL_PAYMENT -> Value.BILL_PAYMENT
PURCHASE -> Value.PURCHASE
QUASI_CASH -> Value.QUASI_CASH
REFUND -> Value.REFUND
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING
AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER
BILL_PAYMENT -> Known.BILL_PAYMENT
PURCHASE -> Known.PURCHASE
QUASI_CASH -> Known.QUASI_CASH
REFUND -> Known.REFUND
else ->
throw IncreaseInvalidDataException("Unknown ProcessingCategory: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Type
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Type && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CARD_AUTHORIZATION = Type(JsonField.of("card_authorization"))
fun of(value: String) = Type(JsonField.of(value))
}
enum class Known {
CARD_AUTHORIZATION,
}
enum class Value {
CARD_AUTHORIZATION,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION
else -> throw IncreaseInvalidDataException("Unknown Type: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields related to verification of cardholder-provided values. */
@JsonDeserialize(builder = Verification.Builder::class)
@NoAutoDetect
class Verification
private constructor(
private val cardVerificationCode: JsonField,
private val cardholderAddress: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
fun cardVerificationCode(): CardVerificationCode =
cardVerificationCode.getRequired("card_verification_code")
/**
* Cardholder address provided in the authorization request and the address on file
* we verified it against.
*/
fun cardholderAddress(): CardholderAddress =
cardholderAddress.getRequired("cardholder_address")
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
@JsonProperty("card_verification_code")
@ExcludeMissing
fun _cardVerificationCode() = cardVerificationCode
/**
* Cardholder address provided in the authorization request and the address on file
* we verified it against.
*/
@JsonProperty("cardholder_address")
@ExcludeMissing
fun _cardholderAddress() = cardholderAddress
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Verification = apply {
if (!validated) {
cardVerificationCode().validate()
cardholderAddress().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Verification &&
this.cardVerificationCode == other.cardVerificationCode &&
this.cardholderAddress == other.cardholderAddress &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
cardVerificationCode,
cardholderAddress,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Verification{cardVerificationCode=$cardVerificationCode, cardholderAddress=$cardholderAddress, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var cardVerificationCode: JsonField =
JsonMissing.of()
private var cardholderAddress: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(verification: Verification) = apply {
this.cardVerificationCode = verification.cardVerificationCode
this.cardholderAddress = verification.cardholderAddress
additionalProperties(verification.additionalProperties)
}
/**
* Fields related to verification of the Card Verification Code, a 3-digit code
* on the back of the card.
*/
fun cardVerificationCode(cardVerificationCode: CardVerificationCode) =
cardVerificationCode(JsonField.of(cardVerificationCode))
/**
* Fields related to verification of the Card Verification Code, a 3-digit code
* on the back of the card.
*/
@JsonProperty("card_verification_code")
@ExcludeMissing
fun cardVerificationCode(
cardVerificationCode: JsonField
) = apply { this.cardVerificationCode = cardVerificationCode }
/**
* Cardholder address provided in the authorization request and the address on
* file we verified it against.
*/
fun cardholderAddress(cardholderAddress: CardholderAddress) =
cardholderAddress(JsonField.of(cardholderAddress))
/**
* Cardholder address provided in the authorization request and the address on
* file we verified it against.
*/
@JsonProperty("cardholder_address")
@ExcludeMissing
fun cardholderAddress(cardholderAddress: JsonField) = apply {
this.cardholderAddress = cardholderAddress
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): Verification =
Verification(
cardVerificationCode,
cardholderAddress,
additionalProperties.toUnmodifiable(),
)
}
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
@JsonDeserialize(builder = CardVerificationCode.Builder::class)
@NoAutoDetect
class CardVerificationCode
private constructor(
private val result: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The result of verifying the Card Verification Code. */
fun result(): Result = result.getRequired("result")
/** The result of verifying the Card Verification Code. */
@JsonProperty("result") @ExcludeMissing fun _result() = result
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardVerificationCode = apply {
if (!validated) {
result()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardVerificationCode &&
this.result == other.result &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(result, additionalProperties)
}
return hashCode
}
override fun toString() =
"CardVerificationCode{result=$result, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var result: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(cardVerificationCode: CardVerificationCode) = apply {
this.result = cardVerificationCode.result
additionalProperties(cardVerificationCode.additionalProperties)
}
/** The result of verifying the Card Verification Code. */
fun result(result: Result) = result(JsonField.of(result))
/** The result of verifying the Card Verification Code. */
@JsonProperty("result")
@ExcludeMissing
fun result(result: JsonField) = apply { this.result = result }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): CardVerificationCode =
CardVerificationCode(result, additionalProperties.toUnmodifiable())
}
class Result
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Result && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val NOT_CHECKED = Result(JsonField.of("not_checked"))
val MATCH = Result(JsonField.of("match"))
val NO_MATCH = Result(JsonField.of("no_match"))
fun of(value: String) = Result(JsonField.of(value))
}
enum class Known {
NOT_CHECKED,
MATCH,
NO_MATCH,
}
enum class Value {
NOT_CHECKED,
MATCH,
NO_MATCH,
_UNKNOWN,
}
fun value(): Value =
when (this) {
NOT_CHECKED -> Value.NOT_CHECKED
MATCH -> Value.MATCH
NO_MATCH -> Value.NO_MATCH
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
NOT_CHECKED -> Known.NOT_CHECKED
MATCH -> Known.MATCH
NO_MATCH -> Known.NO_MATCH
else -> throw IncreaseInvalidDataException("Unknown Result: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
/**
* Cardholder address provided in the authorization request and the address on file
* we verified it against.
*/
@JsonDeserialize(builder = CardholderAddress.Builder::class)
@NoAutoDetect
class CardholderAddress
private constructor(
private val actualLine1: JsonField,
private val actualPostalCode: JsonField,
private val providedLine1: JsonField,
private val providedPostalCode: JsonField,
private val result: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Line 1 of the address on file for the cardholder. */
fun actualLine1(): String? = actualLine1.getNullable("actual_line1")
/** The postal code of the address on file for the cardholder. */
fun actualPostalCode(): String? =
actualPostalCode.getNullable("actual_postal_code")
/**
* The cardholder address line 1 provided for verification in the authorization
* request.
*/
fun providedLine1(): String? = providedLine1.getNullable("provided_line1")
/** The postal code provided for verification in the authorization request. */
fun providedPostalCode(): String? =
providedPostalCode.getNullable("provided_postal_code")
/** The address verification result returned to the card network. */
fun result(): Result = result.getRequired("result")
/** Line 1 of the address on file for the cardholder. */
@JsonProperty("actual_line1") @ExcludeMissing fun _actualLine1() = actualLine1
/** The postal code of the address on file for the cardholder. */
@JsonProperty("actual_postal_code")
@ExcludeMissing
fun _actualPostalCode() = actualPostalCode
/**
* The cardholder address line 1 provided for verification in the authorization
* request.
*/
@JsonProperty("provided_line1")
@ExcludeMissing
fun _providedLine1() = providedLine1
/** The postal code provided for verification in the authorization request. */
@JsonProperty("provided_postal_code")
@ExcludeMissing
fun _providedPostalCode() = providedPostalCode
/** The address verification result returned to the card network. */
@JsonProperty("result") @ExcludeMissing fun _result() = result
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardholderAddress = apply {
if (!validated) {
actualLine1()
actualPostalCode()
providedLine1()
providedPostalCode()
result()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardholderAddress &&
this.actualLine1 == other.actualLine1 &&
this.actualPostalCode == other.actualPostalCode &&
this.providedLine1 == other.providedLine1 &&
this.providedPostalCode == other.providedPostalCode &&
this.result == other.result &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
actualLine1,
actualPostalCode,
providedLine1,
providedPostalCode,
result,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardholderAddress{actualLine1=$actualLine1, actualPostalCode=$actualPostalCode, providedLine1=$providedLine1, providedPostalCode=$providedPostalCode, result=$result, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var actualLine1: JsonField = JsonMissing.of()
private var actualPostalCode: JsonField = JsonMissing.of()
private var providedLine1: JsonField = JsonMissing.of()
private var providedPostalCode: JsonField = JsonMissing.of()
private var result: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(cardholderAddress: CardholderAddress) = apply {
this.actualLine1 = cardholderAddress.actualLine1
this.actualPostalCode = cardholderAddress.actualPostalCode
this.providedLine1 = cardholderAddress.providedLine1
this.providedPostalCode = cardholderAddress.providedPostalCode
this.result = cardholderAddress.result
additionalProperties(cardholderAddress.additionalProperties)
}
/** Line 1 of the address on file for the cardholder. */
fun actualLine1(actualLine1: String) =
actualLine1(JsonField.of(actualLine1))
/** Line 1 of the address on file for the cardholder. */
@JsonProperty("actual_line1")
@ExcludeMissing
fun actualLine1(actualLine1: JsonField) = apply {
this.actualLine1 = actualLine1
}
/** The postal code of the address on file for the cardholder. */
fun actualPostalCode(actualPostalCode: String) =
actualPostalCode(JsonField.of(actualPostalCode))
/** The postal code of the address on file for the cardholder. */
@JsonProperty("actual_postal_code")
@ExcludeMissing
fun actualPostalCode(actualPostalCode: JsonField) = apply {
this.actualPostalCode = actualPostalCode
}
/**
* The cardholder address line 1 provided for verification in the
* authorization request.
*/
fun providedLine1(providedLine1: String) =
providedLine1(JsonField.of(providedLine1))
/**
* The cardholder address line 1 provided for verification in the
* authorization request.
*/
@JsonProperty("provided_line1")
@ExcludeMissing
fun providedLine1(providedLine1: JsonField) = apply {
this.providedLine1 = providedLine1
}
/**
* The postal code provided for verification in the authorization request.
*/
fun providedPostalCode(providedPostalCode: String) =
providedPostalCode(JsonField.of(providedPostalCode))
/**
* The postal code provided for verification in the authorization request.
*/
@JsonProperty("provided_postal_code")
@ExcludeMissing
fun providedPostalCode(providedPostalCode: JsonField) = apply {
this.providedPostalCode = providedPostalCode
}
/** The address verification result returned to the card network. */
fun result(result: Result) = result(JsonField.of(result))
/** The address verification result returned to the card network. */
@JsonProperty("result")
@ExcludeMissing
fun result(result: JsonField) = apply { this.result = result }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): CardholderAddress =
CardholderAddress(
actualLine1,
actualPostalCode,
providedLine1,
providedPostalCode,
result,
additionalProperties.toUnmodifiable(),
)
}
class Result
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Result && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val NOT_CHECKED = Result(JsonField.of("not_checked"))
val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED =
Result(JsonField.of("postal_code_match_address_not_checked"))
val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH =
Result(JsonField.of("postal_code_match_address_no_match"))
val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH =
Result(JsonField.of("postal_code_no_match_address_match"))
val MATCH = Result(JsonField.of("match"))
val NO_MATCH = Result(JsonField.of("no_match"))
fun of(value: String) = Result(JsonField.of(value))
}
enum class Known {
NOT_CHECKED,
POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED,
POSTAL_CODE_MATCH_ADDRESS_NO_MATCH,
POSTAL_CODE_NO_MATCH_ADDRESS_MATCH,
MATCH,
NO_MATCH,
}
enum class Value {
NOT_CHECKED,
POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED,
POSTAL_CODE_MATCH_ADDRESS_NO_MATCH,
POSTAL_CODE_NO_MATCH_ADDRESS_MATCH,
MATCH,
NO_MATCH,
_UNKNOWN,
}
fun value(): Value =
when (this) {
NOT_CHECKED -> Value.NOT_CHECKED
POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED ->
Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED
POSTAL_CODE_MATCH_ADDRESS_NO_MATCH ->
Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH
POSTAL_CODE_NO_MATCH_ADDRESS_MATCH ->
Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
MATCH -> Value.MATCH
NO_MATCH -> Value.NO_MATCH
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
NOT_CHECKED -> Known.NOT_CHECKED
POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED ->
Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED
POSTAL_CODE_MATCH_ADDRESS_NO_MATCH ->
Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH
POSTAL_CODE_NO_MATCH_ADDRESS_MATCH ->
Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
MATCH -> Known.MATCH
NO_MATCH -> Known.NO_MATCH
else -> throw IncreaseInvalidDataException("Unknown Result: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
}
}
/**
* A Card Authorization Expiration object. This field will be present in the JSON response
* if and only if `category` is equal to `card_authorization_expiration`.
*/
@JsonDeserialize(builder = CardAuthorizationExpiration.Builder::class)
@NoAutoDetect
class CardAuthorizationExpiration
private constructor(
private val cardAuthorizationId: JsonField,
private val currency: JsonField