Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
com.increase.api.models.DeclinedTransaction.kt Maven / Gradle / Ivy
// 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.toImmutable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.OffsetDateTime
import java.util.Objects
/**
* Declined Transactions are refused additions and removals of money from your bank account. For
* example, Declined Transactions are caused when your Account has an insufficient balance or your
* Limits are triggered.
*/
@JsonDeserialize(builder = DeclinedTransaction.Builder::class)
@NoAutoDetect
class DeclinedTransaction
private constructor(
private val accountId: JsonField,
private val amount: JsonField,
private val createdAt: JsonField,
private val currency: JsonField,
private val description: JsonField,
private val id: JsonField,
private val routeId: JsonField,
private val routeType: JsonField,
private val source: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The identifier for the Account the Declined Transaction belongs to. */
fun accountId(): String = accountId.getRequired("account_id")
/**
* The Declined Transaction amount in the minor unit of its currency. For dollars, for example,
* this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Transaction
* occurred.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined Transaction's
* currency. This will match the currency on the Declined Transaction's Account.
*/
fun currency(): Currency = currency.getRequired("currency")
/** This is the description the vendor provides. */
fun description(): String = description.getRequired("description")
/** The Declined Transaction identifier. */
fun id(): String = id.getRequired("id")
/**
* The identifier for the route this Declined Transaction came through. Routes are things like
* cards and ACH details.
*/
fun routeId(): String? = routeId.getNullable("route_id")
/** The type of the route this Declined Transaction came through. */
fun routeType(): RouteType? = routeType.getNullable("route_type")
/**
* This is an object giving more details on the network-level event that caused the Declined
* Transaction. For example, for a card transaction this lists the merchant's industry and
* location. Note that for backwards compatibility reasons, additional undocumented keys may
* appear in this object. These should be treated as deprecated and will be removed in the
* future.
*/
fun source(): Source = source.getRequired("source")
/**
* A constant representing the object's type. For this resource it will always be
* `declined_transaction`.
*/
fun type(): Type = type.getRequired("type")
/** The identifier for the Account the Declined Transaction belongs to. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/**
* The Declined Transaction amount in the minor unit of its currency. For dollars, for example,
* this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Transaction
* occurred.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined Transaction's
* currency. This will match the currency on the Declined Transaction's Account.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** This is the description the vendor provides. */
@JsonProperty("description") @ExcludeMissing fun _description() = description
/** The Declined Transaction identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The identifier for the route this Declined Transaction came through. Routes are things like
* cards and ACH details.
*/
@JsonProperty("route_id") @ExcludeMissing fun _routeId() = routeId
/** The type of the route this Declined Transaction came through. */
@JsonProperty("route_type") @ExcludeMissing fun _routeType() = routeType
/**
* This is an object giving more details on the network-level event that caused the Declined
* Transaction. For example, for a card transaction this lists the merchant's industry and
* location. Note that for backwards compatibility reasons, additional undocumented keys may
* appear in this object. These should be treated as deprecated and will be removed in the
* future.
*/
@JsonProperty("source") @ExcludeMissing fun _source() = source
/**
* A constant representing the object's type. For this resource it will always be
* `declined_transaction`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): DeclinedTransaction = apply {
if (!validated) {
accountId()
amount()
createdAt()
currency()
description()
id()
routeId()
routeType()
source().validate()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var description: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var routeId: JsonField = JsonMissing.of()
private var routeType: JsonField = JsonMissing.of()
private var source: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(declinedTransaction: DeclinedTransaction) = apply {
this.accountId = declinedTransaction.accountId
this.amount = declinedTransaction.amount
this.createdAt = declinedTransaction.createdAt
this.currency = declinedTransaction.currency
this.description = declinedTransaction.description
this.id = declinedTransaction.id
this.routeId = declinedTransaction.routeId
this.routeType = declinedTransaction.routeType
this.source = declinedTransaction.source
this.type = declinedTransaction.type
additionalProperties(declinedTransaction.additionalProperties)
}
/** The identifier for the Account the Declined Transaction belongs to. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The identifier for the Account the Declined Transaction belongs to. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/**
* The Declined Transaction amount in the minor unit of its currency. For dollars, for
* example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The Declined Transaction amount in the minor unit of its currency. For dollars, for
* example, this is cents.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Transaction
* occurred.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the Transaction
* occurred.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined
* Transaction's currency. This will match the currency on the Declined Transaction's
* Account.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Declined
* Transaction's currency. This will match the currency on the Declined Transaction's
* Account.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/** This is the description the vendor provides. */
fun description(description: String) = description(JsonField.of(description))
/** This is the description the vendor provides. */
@JsonProperty("description")
@ExcludeMissing
fun description(description: JsonField) = apply { this.description = description }
/** The Declined Transaction identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Declined Transaction identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/**
* The identifier for the route this Declined Transaction came through. Routes are things
* like cards and ACH details.
*/
fun routeId(routeId: String) = routeId(JsonField.of(routeId))
/**
* The identifier for the route this Declined Transaction came through. Routes are things
* like cards and ACH details.
*/
@JsonProperty("route_id")
@ExcludeMissing
fun routeId(routeId: JsonField) = apply { this.routeId = routeId }
/** The type of the route this Declined Transaction came through. */
fun routeType(routeType: RouteType) = routeType(JsonField.of(routeType))
/** The type of the route this Declined Transaction came through. */
@JsonProperty("route_type")
@ExcludeMissing
fun routeType(routeType: JsonField) = apply { this.routeType = routeType }
/**
* This is an object giving more details on the network-level event that caused the Declined
* Transaction. For example, for a card transaction this lists the merchant's industry and
* location. Note that for backwards compatibility reasons, additional undocumented keys may
* appear in this object. These should be treated as deprecated and will be removed in the
* future.
*/
fun source(source: Source) = source(JsonField.of(source))
/**
* This is an object giving more details on the network-level event that caused the Declined
* Transaction. For example, for a card transaction this lists the merchant's industry and
* location. Note that for backwards compatibility reasons, additional undocumented keys may
* appear in this object. These should be treated as deprecated and will be removed in the
* future.
*/
@JsonProperty("source")
@ExcludeMissing
fun source(source: JsonField) = apply { this.source = source }
/**
* A constant representing the object's type. For this resource it will always be
* `declined_transaction`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `declined_transaction`.
*/
@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(): DeclinedTransaction =
DeclinedTransaction(
accountId,
amount,
createdAt,
currency,
description,
id,
routeId,
routeType,
source,
type,
additionalProperties.toImmutable(),
)
}
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 /* spotless:off */ other is Currency && this.value == other.value /* spotless:on */
}
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 RouteType
@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 /* spotless:off */ other is RouteType && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACCOUNT_NUMBER = RouteType(JsonField.of("account_number"))
val CARD = RouteType(JsonField.of("card"))
val LOCKBOX = RouteType(JsonField.of("lockbox"))
fun of(value: String) = RouteType(JsonField.of(value))
}
enum class Known {
ACCOUNT_NUMBER,
CARD,
LOCKBOX,
}
enum class Value {
ACCOUNT_NUMBER,
CARD,
LOCKBOX,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACCOUNT_NUMBER -> Value.ACCOUNT_NUMBER
CARD -> Value.CARD
LOCKBOX -> Value.LOCKBOX
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACCOUNT_NUMBER -> Known.ACCOUNT_NUMBER
CARD -> Known.CARD
LOCKBOX -> Known.LOCKBOX
else -> throw IncreaseInvalidDataException("Unknown RouteType: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/**
* This is an object giving more details on the network-level event that caused the Declined
* Transaction. For example, for a card transaction this lists the merchant's industry and
* location. Note that for backwards compatibility reasons, additional undocumented keys may
* appear in this object. These should be treated as deprecated and will be removed in the
* future.
*/
@JsonDeserialize(builder = Source.Builder::class)
@NoAutoDetect
class Source
private constructor(
private val achDecline: JsonField,
private val cardDecline: JsonField,
private val category: JsonField,
private val checkDecline: JsonField,
private val checkDepositRejection: JsonField,
private val inboundRealTimePaymentsTransferDecline:
JsonField,
private val other: JsonValue,
private val wireDecline: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* An ACH Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `ach_decline`.
*/
fun achDecline(): AchDecline? = achDecline.getNullable("ach_decline")
/**
* 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")
/**
* 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")
/**
* A Check Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `check_decline`.
*/
fun checkDecline(): CheckDecline? = checkDecline.getNullable("check_decline")
/**
* A Check Deposit Rejection object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_rejection`.
*/
fun checkDepositRejection(): CheckDepositRejection? =
checkDepositRejection.getNullable("check_deposit_rejection")
/**
* An Inbound Real-Time Payments Transfer Decline object. This field will be present in the
* JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_decline`.
*/
fun inboundRealTimePaymentsTransferDecline(): InboundRealTimePaymentsTransferDecline? =
inboundRealTimePaymentsTransferDecline.getNullable(
"inbound_real_time_payments_transfer_decline"
)
/**
* A Wire Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `wire_decline`.
*/
fun wireDecline(): WireDecline? = wireDecline.getNullable("wire_decline")
/**
* An ACH Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `ach_decline`.
*/
@JsonProperty("ach_decline") @ExcludeMissing fun _achDecline() = achDecline
/**
* 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
/**
* 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
/**
* A Check Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `check_decline`.
*/
@JsonProperty("check_decline") @ExcludeMissing fun _checkDecline() = checkDecline
/**
* A Check Deposit Rejection object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_rejection`.
*/
@JsonProperty("check_deposit_rejection")
@ExcludeMissing
fun _checkDepositRejection() = checkDepositRejection
/**
* An Inbound Real-Time Payments Transfer Decline object. This field will be present in the
* JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_decline`.
*/
@JsonProperty("inbound_real_time_payments_transfer_decline")
@ExcludeMissing
fun _inboundRealTimePaymentsTransferDecline() = inboundRealTimePaymentsTransferDecline
/**
* 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
/**
* A Wire Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `wire_decline`.
*/
@JsonProperty("wire_decline") @ExcludeMissing fun _wireDecline() = wireDecline
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Source = apply {
if (!validated) {
achDecline()?.validate()
cardDecline()?.validate()
category()
checkDecline()?.validate()
checkDepositRejection()?.validate()
inboundRealTimePaymentsTransferDecline()?.validate()
wireDecline()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var achDecline: JsonField = JsonMissing.of()
private var cardDecline: JsonField = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var checkDecline: JsonField = JsonMissing.of()
private var checkDepositRejection: JsonField = JsonMissing.of()
private var inboundRealTimePaymentsTransferDecline:
JsonField =
JsonMissing.of()
private var other: JsonValue = JsonMissing.of()
private var wireDecline: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(source: Source) = apply {
this.achDecline = source.achDecline
this.cardDecline = source.cardDecline
this.category = source.category
this.checkDecline = source.checkDecline
this.checkDepositRejection = source.checkDepositRejection
this.inboundRealTimePaymentsTransferDecline =
source.inboundRealTimePaymentsTransferDecline
this.other = source.other
this.wireDecline = source.wireDecline
additionalProperties(source.additionalProperties)
}
/**
* An ACH Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `ach_decline`.
*/
fun achDecline(achDecline: AchDecline) = achDecline(JsonField.of(achDecline))
/**
* An ACH Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `ach_decline`.
*/
@JsonProperty("ach_decline")
@ExcludeMissing
fun achDecline(achDecline: JsonField) = apply {
this.achDecline = achDecline
}
/**
* 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
}
/**
* 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 }
/**
* A Check Decline object. This field will be present in the JSON response if and only
* if `category` is equal to `check_decline`.
*/
fun checkDecline(checkDecline: CheckDecline) = checkDecline(JsonField.of(checkDecline))
/**
* A Check Decline object. This field will be present in the JSON response if and only
* if `category` is equal to `check_decline`.
*/
@JsonProperty("check_decline")
@ExcludeMissing
fun checkDecline(checkDecline: JsonField) = apply {
this.checkDecline = checkDecline
}
/**
* A Check Deposit Rejection object. This field will be present in the JSON response if
* and only if `category` is equal to `check_deposit_rejection`.
*/
fun checkDepositRejection(checkDepositRejection: CheckDepositRejection) =
checkDepositRejection(JsonField.of(checkDepositRejection))
/**
* A Check Deposit Rejection object. This field will be present in the JSON response if
* and only if `category` is equal to `check_deposit_rejection`.
*/
@JsonProperty("check_deposit_rejection")
@ExcludeMissing
fun checkDepositRejection(checkDepositRejection: JsonField) =
apply {
this.checkDepositRejection = checkDepositRejection
}
/**
* An Inbound Real-Time Payments Transfer Decline object. This field will be present in
* the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_decline`.
*/
fun inboundRealTimePaymentsTransferDecline(
inboundRealTimePaymentsTransferDecline: InboundRealTimePaymentsTransferDecline
) =
inboundRealTimePaymentsTransferDecline(
JsonField.of(inboundRealTimePaymentsTransferDecline)
)
/**
* An Inbound Real-Time Payments Transfer Decline object. This field will be present in
* the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_decline`.
*/
@JsonProperty("inbound_real_time_payments_transfer_decline")
@ExcludeMissing
fun inboundRealTimePaymentsTransferDecline(
inboundRealTimePaymentsTransferDecline:
JsonField
) = apply {
this.inboundRealTimePaymentsTransferDecline = inboundRealTimePaymentsTransferDecline
}
/**
* 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 }
/**
* A Wire Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `wire_decline`.
*/
fun wireDecline(wireDecline: WireDecline) = wireDecline(JsonField.of(wireDecline))
/**
* A Wire Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `wire_decline`.
*/
@JsonProperty("wire_decline")
@ExcludeMissing
fun wireDecline(wireDecline: JsonField) = apply {
this.wireDecline = wireDecline
}
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(): Source =
Source(
achDecline,
cardDecline,
category,
checkDecline,
checkDepositRejection,
inboundRealTimePaymentsTransferDecline,
other,
wireDecline,
additionalProperties.toImmutable(),
)
}
/**
* An ACH Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `ach_decline`.
*/
@JsonDeserialize(builder = AchDecline.Builder::class)
@NoAutoDetect
class AchDecline
private constructor(
private val amount: JsonField,
private val id: JsonField,
private val inboundAchTransferId: JsonField,
private val originatorCompanyDescriptiveDate: JsonField,
private val originatorCompanyDiscretionaryData: JsonField,
private val originatorCompanyId: JsonField,
private val originatorCompanyName: JsonField,
private val reason: JsonField,
private val receiverIdNumber: JsonField,
private val receiverName: JsonField,
private val traceNumber: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The declined amount in USD cents. */
fun amount(): Long = amount.getRequired("amount")
/** The ACH Decline's identifier. */
fun id(): String = id.getRequired("id")
/** The identifier of the Inbound ACH Transfer object associated with this decline. */
fun inboundAchTransferId(): String =
inboundAchTransferId.getRequired("inbound_ach_transfer_id")
/** The descriptive date of the transfer. */
fun originatorCompanyDescriptiveDate(): String? =
originatorCompanyDescriptiveDate.getNullable("originator_company_descriptive_date")
/** The additional information included with the transfer. */
fun originatorCompanyDiscretionaryData(): String? =
originatorCompanyDiscretionaryData.getNullable(
"originator_company_discretionary_data"
)
/** The identifier of the company that initiated the transfer. */
fun originatorCompanyId(): String =
originatorCompanyId.getRequired("originator_company_id")
/** The name of the company that initiated the transfer. */
fun originatorCompanyName(): String =
originatorCompanyName.getRequired("originator_company_name")
/** Why the ACH transfer was declined. */
fun reason(): Reason = reason.getRequired("reason")
/** The id of the receiver of the transfer. */
fun receiverIdNumber(): String? = receiverIdNumber.getNullable("receiver_id_number")
/** The name of the receiver of the transfer. */
fun receiverName(): String? = receiverName.getNullable("receiver_name")
/** The trace number of the transfer. */
fun traceNumber(): String = traceNumber.getRequired("trace_number")
/**
* A constant representing the object's type. For this resource it will always be
* `ach_decline`.
*/
fun type(): Type = type.getRequired("type")
/** The declined amount in USD cents. */
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/** The ACH Decline's identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/** The identifier of the Inbound ACH Transfer object associated with this decline. */
@JsonProperty("inbound_ach_transfer_id")
@ExcludeMissing
fun _inboundAchTransferId() = inboundAchTransferId
/** The descriptive date of the transfer. */
@JsonProperty("originator_company_descriptive_date")
@ExcludeMissing
fun _originatorCompanyDescriptiveDate() = originatorCompanyDescriptiveDate
/** The additional information included with the transfer. */
@JsonProperty("originator_company_discretionary_data")
@ExcludeMissing
fun _originatorCompanyDiscretionaryData() = originatorCompanyDiscretionaryData
/** The identifier of the company that initiated the transfer. */
@JsonProperty("originator_company_id")
@ExcludeMissing
fun _originatorCompanyId() = originatorCompanyId
/** The name of the company that initiated the transfer. */
@JsonProperty("originator_company_name")
@ExcludeMissing
fun _originatorCompanyName() = originatorCompanyName
/** Why the ACH transfer was declined. */
@JsonProperty("reason") @ExcludeMissing fun _reason() = reason
/** The id of the receiver of the transfer. */
@JsonProperty("receiver_id_number")
@ExcludeMissing
fun _receiverIdNumber() = receiverIdNumber
/** The name of the receiver of the transfer. */
@JsonProperty("receiver_name") @ExcludeMissing fun _receiverName() = receiverName
/** The trace number of the transfer. */
@JsonProperty("trace_number") @ExcludeMissing fun _traceNumber() = traceNumber
/**
* A constant representing the object's type. For this resource it will always be
* `ach_decline`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AchDecline = apply {
if (!validated) {
amount()
id()
inboundAchTransferId()
originatorCompanyDescriptiveDate()
originatorCompanyDiscretionaryData()
originatorCompanyId()
originatorCompanyName()
reason()
receiverIdNumber()
receiverName()
traceNumber()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var inboundAchTransferId: JsonField = JsonMissing.of()
private var originatorCompanyDescriptiveDate: JsonField = JsonMissing.of()
private var originatorCompanyDiscretionaryData: JsonField = JsonMissing.of()
private var originatorCompanyId: JsonField = JsonMissing.of()
private var originatorCompanyName: JsonField = JsonMissing.of()
private var reason: JsonField = JsonMissing.of()
private var receiverIdNumber: JsonField = JsonMissing.of()
private var receiverName: JsonField = JsonMissing.of()
private var traceNumber: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(achDecline: AchDecline) = apply {
this.amount = achDecline.amount
this.id = achDecline.id
this.inboundAchTransferId = achDecline.inboundAchTransferId
this.originatorCompanyDescriptiveDate =
achDecline.originatorCompanyDescriptiveDate
this.originatorCompanyDiscretionaryData =
achDecline.originatorCompanyDiscretionaryData
this.originatorCompanyId = achDecline.originatorCompanyId
this.originatorCompanyName = achDecline.originatorCompanyName
this.reason = achDecline.reason
this.receiverIdNumber = achDecline.receiverIdNumber
this.receiverName = achDecline.receiverName
this.traceNumber = achDecline.traceNumber
this.type = achDecline.type
additionalProperties(achDecline.additionalProperties)
}
/** The declined amount in USD cents. */
fun amount(amount: Long) = amount(JsonField.of(amount))
/** The declined amount in USD cents. */
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/** The ACH Decline's identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The ACH Decline's identifier. */
@JsonProperty("id")
@ExcludeMissing
fun id(id: JsonField) = apply { this.id = id }
/**
* The identifier of the Inbound ACH Transfer object associated with this decline.
*/
fun inboundAchTransferId(inboundAchTransferId: String) =
inboundAchTransferId(JsonField.of(inboundAchTransferId))
/**
* The identifier of the Inbound ACH Transfer object associated with this decline.
*/
@JsonProperty("inbound_ach_transfer_id")
@ExcludeMissing
fun inboundAchTransferId(inboundAchTransferId: JsonField) = apply {
this.inboundAchTransferId = inboundAchTransferId
}
/** The descriptive date of the transfer. */
fun originatorCompanyDescriptiveDate(originatorCompanyDescriptiveDate: String) =
originatorCompanyDescriptiveDate(JsonField.of(originatorCompanyDescriptiveDate))
/** The descriptive date of the transfer. */
@JsonProperty("originator_company_descriptive_date")
@ExcludeMissing
fun originatorCompanyDescriptiveDate(
originatorCompanyDescriptiveDate: JsonField
) = apply {
this.originatorCompanyDescriptiveDate = originatorCompanyDescriptiveDate
}
/** The additional information included with the transfer. */
fun originatorCompanyDiscretionaryData(originatorCompanyDiscretionaryData: String) =
originatorCompanyDiscretionaryData(
JsonField.of(originatorCompanyDiscretionaryData)
)
/** The additional information included with the transfer. */
@JsonProperty("originator_company_discretionary_data")
@ExcludeMissing
fun originatorCompanyDiscretionaryData(
originatorCompanyDiscretionaryData: JsonField
) = apply {
this.originatorCompanyDiscretionaryData = originatorCompanyDiscretionaryData
}
/** The identifier of the company that initiated the transfer. */
fun originatorCompanyId(originatorCompanyId: String) =
originatorCompanyId(JsonField.of(originatorCompanyId))
/** The identifier of the company that initiated the transfer. */
@JsonProperty("originator_company_id")
@ExcludeMissing
fun originatorCompanyId(originatorCompanyId: JsonField) = apply {
this.originatorCompanyId = originatorCompanyId
}
/** The name of the company that initiated the transfer. */
fun originatorCompanyName(originatorCompanyName: String) =
originatorCompanyName(JsonField.of(originatorCompanyName))
/** The name of the company that initiated the transfer. */
@JsonProperty("originator_company_name")
@ExcludeMissing
fun originatorCompanyName(originatorCompanyName: JsonField) = apply {
this.originatorCompanyName = originatorCompanyName
}
/** Why the ACH transfer was declined. */
fun reason(reason: Reason) = reason(JsonField.of(reason))
/** Why the ACH transfer was declined. */
@JsonProperty("reason")
@ExcludeMissing
fun reason(reason: JsonField) = apply { this.reason = reason }
/** The id of the receiver of the transfer. */
fun receiverIdNumber(receiverIdNumber: String) =
receiverIdNumber(JsonField.of(receiverIdNumber))
/** The id of the receiver of the transfer. */
@JsonProperty("receiver_id_number")
@ExcludeMissing
fun receiverIdNumber(receiverIdNumber: JsonField) = apply {
this.receiverIdNumber = receiverIdNumber
}
/** The name of the receiver of the transfer. */
fun receiverName(receiverName: String) = receiverName(JsonField.of(receiverName))
/** The name of the receiver of the transfer. */
@JsonProperty("receiver_name")
@ExcludeMissing
fun receiverName(receiverName: JsonField) = apply {
this.receiverName = receiverName
}
/** The trace number of the transfer. */
fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber))
/** The trace number of the transfer. */
@JsonProperty("trace_number")
@ExcludeMissing
fun traceNumber(traceNumber: JsonField) = apply {
this.traceNumber = traceNumber
}
/**
* A constant representing the object's type. For this resource it will always be
* `ach_decline`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `ach_decline`.
*/
@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(): AchDecline =
AchDecline(
amount,
id,
inboundAchTransferId,
originatorCompanyDescriptiveDate,
originatorCompanyDiscretionaryData,
originatorCompanyId,
originatorCompanyName,
reason,
receiverIdNumber,
receiverName,
traceNumber,
type,
additionalProperties.toImmutable(),
)
}
class Reason
@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 /* spotless:off */ other is Reason && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACH_ROUTE_CANCELED = Reason(JsonField.of("ach_route_canceled"))
val ACH_ROUTE_DISABLED = Reason(JsonField.of("ach_route_disabled"))
val BREACHES_LIMIT = Reason(JsonField.of("breaches_limit"))
val ENTITY_NOT_ACTIVE = Reason(JsonField.of("entity_not_active"))
val GROUP_LOCKED = Reason(JsonField.of("group_locked"))
val TRANSACTION_NOT_ALLOWED = Reason(JsonField.of("transaction_not_allowed"))
val USER_INITIATED = Reason(JsonField.of("user_initiated"))
val INSUFFICIENT_FUNDS = Reason(JsonField.of("insufficient_funds"))
val RETURNED_PER_ODFI_REQUEST =
Reason(JsonField.of("returned_per_odfi_request"))
val AUTHORIZATION_REVOKED_BY_CUSTOMER =
Reason(JsonField.of("authorization_revoked_by_customer"))
val PAYMENT_STOPPED = Reason(JsonField.of("payment_stopped"))
val CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE =
Reason(
JsonField.of(
"customer_advised_unauthorized_improper_ineligible_or_incomplete"
)
)
val REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY =
Reason(
JsonField.of(
"representative_payee_deceased_or_unable_to_continue_in_that_capacity"
)
)
val BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED =
Reason(JsonField.of("beneficiary_or_account_holder_deceased"))
val CREDIT_ENTRY_REFUSED_BY_RECEIVER =
Reason(JsonField.of("credit_entry_refused_by_receiver"))
val DUPLICATE_ENTRY = Reason(JsonField.of("duplicate_entry"))
val CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED =
Reason(JsonField.of("corporate_customer_advised_not_authorized"))
fun of(value: String) = Reason(JsonField.of(value))
}
enum class Known {
ACH_ROUTE_CANCELED,
ACH_ROUTE_DISABLED,
BREACHES_LIMIT,
ENTITY_NOT_ACTIVE,
GROUP_LOCKED,
TRANSACTION_NOT_ALLOWED,
USER_INITIATED,
INSUFFICIENT_FUNDS,
RETURNED_PER_ODFI_REQUEST,
AUTHORIZATION_REVOKED_BY_CUSTOMER,
PAYMENT_STOPPED,
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE,
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY,
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED,
CREDIT_ENTRY_REFUSED_BY_RECEIVER,
DUPLICATE_ENTRY,
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED,
}
enum class Value {
ACH_ROUTE_CANCELED,
ACH_ROUTE_DISABLED,
BREACHES_LIMIT,
ENTITY_NOT_ACTIVE,
GROUP_LOCKED,
TRANSACTION_NOT_ALLOWED,
USER_INITIATED,
INSUFFICIENT_FUNDS,
RETURNED_PER_ODFI_REQUEST,
AUTHORIZATION_REVOKED_BY_CUSTOMER,
PAYMENT_STOPPED,
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE,
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY,
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED,
CREDIT_ENTRY_REFUSED_BY_RECEIVER,
DUPLICATE_ENTRY,
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACH_ROUTE_CANCELED -> Value.ACH_ROUTE_CANCELED
ACH_ROUTE_DISABLED -> Value.ACH_ROUTE_DISABLED
BREACHES_LIMIT -> Value.BREACHES_LIMIT
ENTITY_NOT_ACTIVE -> Value.ENTITY_NOT_ACTIVE
GROUP_LOCKED -> Value.GROUP_LOCKED
TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED
USER_INITIATED -> Value.USER_INITIATED
INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS
RETURNED_PER_ODFI_REQUEST -> Value.RETURNED_PER_ODFI_REQUEST
AUTHORIZATION_REVOKED_BY_CUSTOMER -> Value.AUTHORIZATION_REVOKED_BY_CUSTOMER
PAYMENT_STOPPED -> Value.PAYMENT_STOPPED
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE ->
Value.CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY ->
Value
.REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED ->
Value.BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED
CREDIT_ENTRY_REFUSED_BY_RECEIVER -> Value.CREDIT_ENTRY_REFUSED_BY_RECEIVER
DUPLICATE_ENTRY -> Value.DUPLICATE_ENTRY
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED ->
Value.CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACH_ROUTE_CANCELED -> Known.ACH_ROUTE_CANCELED
ACH_ROUTE_DISABLED -> Known.ACH_ROUTE_DISABLED
BREACHES_LIMIT -> Known.BREACHES_LIMIT
ENTITY_NOT_ACTIVE -> Known.ENTITY_NOT_ACTIVE
GROUP_LOCKED -> Known.GROUP_LOCKED
TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED
USER_INITIATED -> Known.USER_INITIATED
INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS
RETURNED_PER_ODFI_REQUEST -> Known.RETURNED_PER_ODFI_REQUEST
AUTHORIZATION_REVOKED_BY_CUSTOMER -> Known.AUTHORIZATION_REVOKED_BY_CUSTOMER
PAYMENT_STOPPED -> Known.PAYMENT_STOPPED
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE ->
Known.CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY ->
Known
.REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED ->
Known.BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED
CREDIT_ENTRY_REFUSED_BY_RECEIVER -> Known.CREDIT_ENTRY_REFUSED_BY_RECEIVER
DUPLICATE_ENTRY -> Known.DUPLICATE_ENTRY
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED ->
Known.CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED
else -> throw IncreaseInvalidDataException("Unknown Reason: $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 /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACH_DECLINE = Type(JsonField.of("ach_decline"))
fun of(value: String) = Type(JsonField.of(value))
}
enum class Known {
ACH_DECLINE,
}
enum class Value {
ACH_DECLINE,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACH_DECLINE -> Value.ACH_DECLINE
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACH_DECLINE -> Known.ACH_DECLINE
else -> throw IncreaseInvalidDataException("Unknown Type: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AchDecline && this.amount == other.amount && this.id == other.id && this.inboundAchTransferId == other.inboundAchTransferId && this.originatorCompanyDescriptiveDate == other.originatorCompanyDescriptiveDate && this.originatorCompanyDiscretionaryData == other.originatorCompanyDiscretionaryData && this.originatorCompanyId == other.originatorCompanyId && this.originatorCompanyName == other.originatorCompanyName && this.reason == other.reason && this.receiverIdNumber == other.receiverIdNumber && this.receiverName == other.receiverName && this.traceNumber == other.traceNumber && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(amount, id, inboundAchTransferId, originatorCompanyDescriptiveDate, originatorCompanyDiscretionaryData, originatorCompanyId, originatorCompanyName, reason, receiverIdNumber, receiverName, traceNumber, type, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AchDecline{amount=$amount, id=$id, inboundAchTransferId=$inboundAchTransferId, originatorCompanyDescriptiveDate=$originatorCompanyDescriptiveDate, originatorCompanyDiscretionaryData=$originatorCompanyDiscretionaryData, originatorCompanyId=$originatorCompanyId, originatorCompanyName=$originatorCompanyName, reason=$reason, receiverIdNumber=$receiverIdNumber, receiverName=$receiverName, traceNumber=$traceNumber, type=$type, additionalProperties=$additionalProperties}"
}
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
@JsonDeserialize(builder = CardDecline.Builder::class)
@NoAutoDetect
class CardDecline
private constructor(
private val actioner: JsonField,
private val amount: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
private val declinedTransactionId: JsonField,
private val digitalWalletTokenId: JsonField,
private val direction: JsonField,
private val 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 physicalCardId: JsonField,
private val presentmentAmount: JsonField,
private val presentmentCurrency: JsonField,
private val processingCategory: JsonField,
private val realTimeDecisionId: JsonField,
private val realTimeDecisionReason: JsonField,
private val reason: JsonField,
private val terminalId: JsonField,
private val verification: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* 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 declined amount in the minor unit of the destination account 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 destination
* account currency.
*/
fun currency(): Currency = currency.getRequired("currency")
/** The identifier of the declined transaction created for this Card Decline. */
fun declinedTransactionId(): String =
declinedTransactionId.getRequired("declined_transaction_id")
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
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 Card Decline 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.getRequired("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.getRequired("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")
/**
* 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 declined 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")
/** This is present if a specific decline reason was given in the real-time decision. */
fun realTimeDecisionReason(): RealTimeDecisionReason? =
realTimeDecisionReason.getNullable("real_time_decision_reason")
/** Why the transaction was declined. */
fun reason(): Reason = reason.getRequired("reason")
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
fun terminalId(): String? = terminalId.getNullable("terminal_id")
/** 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 declined amount in the minor unit of the destination account 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 destination
* account currency.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** The identifier of the declined transaction created for this Card Decline. */
@JsonProperty("declined_transaction_id")
@ExcludeMissing
fun _declinedTransactionId() = declinedTransactionId
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
@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 Card Decline 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
/**
* 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 declined 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
/** This is present if a specific decline reason was given in the real-time decision. */
@JsonProperty("real_time_decision_reason")
@ExcludeMissing
fun _realTimeDecisionReason() = realTimeDecisionReason
/** Why the transaction was declined. */
@JsonProperty("reason") @ExcludeMissing fun _reason() = reason
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
@JsonProperty("terminal_id") @ExcludeMissing fun _terminalId() = terminalId
/** Fields related to verification of cardholder-provided values. */
@JsonProperty("verification") @ExcludeMissing fun _verification() = verification
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardDecline = apply {
if (!validated) {
actioner()
amount()
cardPaymentId()
currency()
declinedTransactionId()
digitalWalletTokenId()
direction()
id()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
merchantCountry()
merchantDescriptor()
merchantPostalCode()
merchantState()
networkDetails().validate()
networkIdentifiers().validate()
networkRiskScore()
physicalCardId()
presentmentAmount()
presentmentCurrency()
processingCategory()
realTimeDecisionId()
realTimeDecisionReason()
reason()
terminalId()
verification().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
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 declinedTransactionId: JsonField = JsonMissing.of()
private var digitalWalletTokenId: JsonField = JsonMissing.of()
private var direction: 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 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 realTimeDecisionReason: JsonField =
JsonMissing.of()
private var reason: JsonField = JsonMissing.of()
private var terminalId: JsonField = JsonMissing.of()
private var verification: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardDecline: CardDecline) = apply {
this.actioner = cardDecline.actioner
this.amount = cardDecline.amount
this.cardPaymentId = cardDecline.cardPaymentId
this.currency = cardDecline.currency
this.declinedTransactionId = cardDecline.declinedTransactionId
this.digitalWalletTokenId = cardDecline.digitalWalletTokenId
this.direction = cardDecline.direction
this.id = cardDecline.id
this.merchantAcceptorId = cardDecline.merchantAcceptorId
this.merchantCategoryCode = cardDecline.merchantCategoryCode
this.merchantCity = cardDecline.merchantCity
this.merchantCountry = cardDecline.merchantCountry
this.merchantDescriptor = cardDecline.merchantDescriptor
this.merchantPostalCode = cardDecline.merchantPostalCode
this.merchantState = cardDecline.merchantState
this.networkDetails = cardDecline.networkDetails
this.networkIdentifiers = cardDecline.networkIdentifiers
this.networkRiskScore = cardDecline.networkRiskScore
this.physicalCardId = cardDecline.physicalCardId
this.presentmentAmount = cardDecline.presentmentAmount
this.presentmentCurrency = cardDecline.presentmentCurrency
this.processingCategory = cardDecline.processingCategory
this.realTimeDecisionId = cardDecline.realTimeDecisionId
this.realTimeDecisionReason = cardDecline.realTimeDecisionReason
this.reason = cardDecline.reason
this.terminalId = cardDecline.terminalId
this.verification = cardDecline.verification
additionalProperties(cardDecline.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 declined amount in the minor unit of the destination account currency. For
* dollars, for example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The declined amount in the minor unit of the destination account 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 destination
* account currency.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
* account currency.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/** The identifier of the declined transaction created for this Card Decline. */
fun declinedTransactionId(declinedTransactionId: String) =
declinedTransactionId(JsonField.of(declinedTransactionId))
/** The identifier of the declined transaction created for this Card Decline. */
@JsonProperty("declined_transaction_id")
@ExcludeMissing
fun declinedTransactionId(declinedTransactionId: JsonField) = apply {
this.declinedTransactionId = declinedTransactionId
}
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
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 Card Decline identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Card Decline 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
}
/**
* 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 declined amount in the minor unit of the transaction's presentment currency.
*/
fun presentmentAmount(presentmentAmount: Long) =
presentmentAmount(JsonField.of(presentmentAmount))
/**
* The declined 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
}
/**
* This is present if a specific decline reason was given in the real-time decision.
*/
fun realTimeDecisionReason(realTimeDecisionReason: RealTimeDecisionReason) =
realTimeDecisionReason(JsonField.of(realTimeDecisionReason))
/**
* This is present if a specific decline reason was given in the real-time decision.
*/
@JsonProperty("real_time_decision_reason")
@ExcludeMissing
fun realTimeDecisionReason(
realTimeDecisionReason: JsonField
) = apply { this.realTimeDecisionReason = realTimeDecisionReason }
/** Why the transaction was declined. */
fun reason(reason: Reason) = reason(JsonField.of(reason))
/** Why the transaction was declined. */
@JsonProperty("reason")
@ExcludeMissing
fun reason(reason: JsonField) = apply { this.reason = reason }
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
fun terminalId(terminalId: String) = terminalId(JsonField.of(terminalId))
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
@JsonProperty("terminal_id")
@ExcludeMissing
fun terminalId(terminalId: JsonField) = apply {
this.terminalId = terminalId
}
/** 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(): CardDecline =
CardDecline(
actioner,
amount,
cardPaymentId,
currency,
declinedTransactionId,
digitalWalletTokenId,
direction,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
realTimeDecisionReason,
reason,
terminalId,
verification,
additionalProperties.toImmutable(),
)
}
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 /* spotless:off */ other is Actioner && this.value == other.value /* spotless:on */
}
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 /* spotless:off */ other is Currency && this.value == other.value /* spotless:on */
}
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 /* spotless:off */ other is Direction && this.value == other.value /* spotless:on */
}
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
/** 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)
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.toImmutable(),
)
}
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 /* spotless:off */ other is Category && this.value == other.value /* spotless:on */
}
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 standInProcessingReason: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* 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")
/**
* Only present when `actioner: network`. Describes why a card authorization was
* approved or declined by Visa through stand-in processing.
*/
fun standInProcessingReason(): StandInProcessingReason? =
standInProcessingReason.getNullable("stand_in_processing_reason")
/**
* 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
/**
* Only present when `actioner: network`. Describes why a card authorization was
* approved or declined by Visa through stand-in processing.
*/
@JsonProperty("stand_in_processing_reason")
@ExcludeMissing
fun _standInProcessingReason() = standInProcessingReason
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Visa = apply {
if (!validated) {
electronicCommerceIndicator()
pointOfServiceEntryMode()
standInProcessingReason()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var electronicCommerceIndicator:
JsonField =
JsonMissing.of()
private var pointOfServiceEntryMode: JsonField =
JsonMissing.of()
private var standInProcessingReason: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(visa: Visa) = apply {
this.electronicCommerceIndicator = visa.electronicCommerceIndicator
this.pointOfServiceEntryMode = visa.pointOfServiceEntryMode
this.standInProcessingReason = visa.standInProcessingReason
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 }
/**
* Only present when `actioner: network`. Describes why a card authorization
* was approved or declined by Visa through stand-in processing.
*/
fun standInProcessingReason(
standInProcessingReason: StandInProcessingReason
) = standInProcessingReason(JsonField.of(standInProcessingReason))
/**
* Only present when `actioner: network`. Describes why a card authorization
* was approved or declined by Visa through stand-in processing.
*/
@JsonProperty("stand_in_processing_reason")
@ExcludeMissing
fun standInProcessingReason(
standInProcessingReason: JsonField
) = apply { this.standInProcessingReason = standInProcessingReason }
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,
standInProcessingReason,
additionalProperties.toImmutable(),
)
}
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 /* spotless:off */ other is ElectronicCommerceIndicator && this.value == other.value /* spotless:on */
}
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 /* spotless:off */ other is PointOfServiceEntryMode && this.value == other.value /* spotless:on */
}
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()
}
class StandInProcessingReason
@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 /* spotless:off */ other is StandInProcessingReason && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ISSUER_ERROR = StandInProcessingReason(JsonField.of("issuer_error"))
val INVALID_PHYSICAL_CARD =
StandInProcessingReason(JsonField.of("invalid_physical_card"))
val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE =
StandInProcessingReason(
JsonField.of(
"invalid_cardholder_authentication_verification_value"
)
)
val INTERNAL_VISA_ERROR =
StandInProcessingReason(JsonField.of("internal_visa_error"))
val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED =
StandInProcessingReason(
JsonField.of(
"merchant_transaction_advisory_service_authentication_required"
)
)
val OTHER = StandInProcessingReason(JsonField.of("other"))
fun of(value: String) = StandInProcessingReason(JsonField.of(value))
}
enum class Known {
ISSUER_ERROR,
INVALID_PHYSICAL_CARD,
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
INTERNAL_VISA_ERROR,
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
OTHER,
}
enum class Value {
ISSUER_ERROR,
INVALID_PHYSICAL_CARD,
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
INTERNAL_VISA_ERROR,
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
OTHER,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ISSUER_ERROR -> Value.ISSUER_ERROR
INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE ->
Value.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE
INTERNAL_VISA_ERROR -> Value.INTERNAL_VISA_ERROR
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED ->
Value
.MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED
OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ISSUER_ERROR -> Known.ISSUER_ERROR
INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE ->
Known.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE
INTERNAL_VISA_ERROR -> Known.INTERNAL_VISA_ERROR
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED ->
Known
.MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED
OTHER -> Known.OTHER
else ->
throw IncreaseInvalidDataException(
"Unknown StandInProcessingReason: $value"
)
}
fun asString(): String = _value().asStringOrThrow()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Visa && this.electronicCommerceIndicator == other.electronicCommerceIndicator && this.pointOfServiceEntryMode == other.pointOfServiceEntryMode && this.standInProcessingReason == other.standInProcessingReason && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(electronicCommerceIndicator, pointOfServiceEntryMode, standInProcessingReason, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, standInProcessingReason=$standInProcessingReason, additionalProperties=$additionalProperties}"
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is NetworkDetails && this.category == other.category && this.visa == other.visa && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(category, visa, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}"
}
/** 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
/**
* 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)
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.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is NetworkIdentifiers && this.retrievalReferenceNumber == other.retrievalReferenceNumber && this.traceNumber == other.traceNumber && this.transactionId == other.transactionId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(retrievalReferenceNumber, traceNumber, transactionId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}"
}
class ProcessingCategory
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField