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.toUnmodifiable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.OffsetDateTime
import java.util.Objects
import java.util.Optional
/**
* 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
private var hashCode: Int = 0
/** 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(): Optional = Optional.ofNullable(routeId.getNullable("route_id"))
/** The type of the route this Declined Transaction came through. */
fun routeType(): Optional = Optional.ofNullable(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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is DeclinedTransaction &&
this.accountId == other.accountId &&
this.amount == other.amount &&
this.createdAt == other.createdAt &&
this.currency == other.currency &&
this.description == other.description &&
this.id == other.id &&
this.routeId == other.routeId &&
this.routeType == other.routeType &&
this.source == other.source &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountId,
amount,
createdAt,
currency,
description,
id,
routeId,
routeType,
source,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"DeclinedTransaction{accountId=$accountId, amount=$amount, createdAt=$createdAt, currency=$currency, description=$description, id=$id, routeId=$routeId, routeType=$routeType, source=$source, type=$type, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Currency && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val CAD = Currency(JsonField.of("CAD"))
@JvmField val CHF = Currency(JsonField.of("CHF"))
@JvmField val EUR = Currency(JsonField.of("EUR"))
@JvmField val GBP = Currency(JsonField.of("GBP"))
@JvmField val JPY = Currency(JsonField.of("JPY"))
@JvmField val USD = Currency(JsonField.of("USD"))
@JvmStatic 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 other is RouteType && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val ACCOUNT_NUMBER = RouteType(JsonField.of("account_number"))
@JvmField val CARD = RouteType(JsonField.of("card"))
@JvmField val LOCKBOX = RouteType(JsonField.of("lockbox"))
@JvmStatic 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
private var hashCode: Int = 0
/**
* 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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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():
Optional =
Optional.ofNullable(
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(): Optional =
Optional.ofNullable(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().map { it.validate() }
cardDecline().map { it.validate() }
category()
checkDecline().map { it.validate() }
checkDepositRejection().map { it.validate() }
inboundRealTimePaymentsTransferDecline().map { it.validate() }
wireDecline().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Source &&
this.achDecline == other.achDecline &&
this.cardDecline == other.cardDecline &&
this.category == other.category &&
this.checkDecline == other.checkDecline &&
this.checkDepositRejection == other.checkDepositRejection &&
this.inboundRealTimePaymentsTransferDecline ==
other.inboundRealTimePaymentsTransferDecline &&
this.other == other.other &&
this.wireDecline == other.wireDecline &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
achDecline,
cardDecline,
category,
checkDecline,
checkDepositRejection,
inboundRealTimePaymentsTransferDecline,
other,
wireDecline,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Source{achDecline=$achDecline, cardDecline=$cardDecline, category=$category, checkDecline=$checkDecline, checkDepositRejection=$checkDepositRejection, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, other=$other, wireDecline=$wireDecline, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
/**
* 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
private var hashCode: Int = 0
/**
* 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 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(): Optional =
Optional.ofNullable(
originatorCompanyDescriptiveDate.getNullable(
"originator_company_descriptive_date"
)
)
/** The additional information included with the transfer. */
fun originatorCompanyDiscretionaryData(): Optional =
Optional.ofNullable(
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(): Optional =
Optional.ofNullable(receiverIdNumber.getNullable("receiver_id_number"))
/** The name of the receiver of the transfer. */
fun receiverName(): Optional =
Optional.ofNullable(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 the minor unit of the destination account currency. For
* dollars, for example, this is 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
id,
inboundAchTransferId,
originatorCompanyDescriptiveDate,
originatorCompanyDiscretionaryData,
originatorCompanyId,
originatorCompanyName,
reason,
receiverIdNumber,
receiverName,
traceNumber,
type,
additionalProperties,
)
}
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}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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 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 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.toUnmodifiable(),
)
}
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 other is Reason && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val ACH_ROUTE_CANCELED = Reason(JsonField.of("ach_route_canceled"))
@JvmField val ACH_ROUTE_DISABLED = Reason(JsonField.of("ach_route_disabled"))
@JvmField val BREACHES_LIMIT = Reason(JsonField.of("breaches_limit"))
@JvmField val ENTITY_NOT_ACTIVE = Reason(JsonField.of("entity_not_active"))
@JvmField val GROUP_LOCKED = Reason(JsonField.of("group_locked"))
@JvmField val INSUFFICIENT_FUNDS = Reason(JsonField.of("insufficient_funds"))
@JvmField
val TRANSACTION_NOT_ALLOWED = Reason(JsonField.of("transaction_not_allowed"))
@JvmField val USER_INITIATED = Reason(JsonField.of("user_initiated"))
@JvmStatic fun of(value: String) = Reason(JsonField.of(value))
}
enum class Known {
ACH_ROUTE_CANCELED,
ACH_ROUTE_DISABLED,
BREACHES_LIMIT,
ENTITY_NOT_ACTIVE,
GROUP_LOCKED,
INSUFFICIENT_FUNDS,
TRANSACTION_NOT_ALLOWED,
USER_INITIATED,
}
enum class Value {
ACH_ROUTE_CANCELED,
ACH_ROUTE_DISABLED,
BREACHES_LIMIT,
ENTITY_NOT_ACTIVE,
GROUP_LOCKED,
INSUFFICIENT_FUNDS,
TRANSACTION_NOT_ALLOWED,
USER_INITIATED,
_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
INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS
TRANSACTION_NOT_ALLOWED -> Value.TRANSACTION_NOT_ALLOWED
USER_INITIATED -> Value.USER_INITIATED
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
INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS
TRANSACTION_NOT_ALLOWED -> Known.TRANSACTION_NOT_ALLOWED
USER_INITIATED -> Known.USER_INITIATED
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 other is Type && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val ACH_DECLINE = Type(JsonField.of("ach_decline"))
@JvmStatic 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()
}
}
/**
* 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 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 reason: JsonField,
private val verification: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
fun actioner(): Actioner = actioner.getRequired("actioner")
/**
* The 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(): Optional =
Optional.ofNullable(digitalWalletTokenId.getNullable("digital_wallet_token_id"))
/** 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(): Optional =
Optional.ofNullable(merchantCategoryCode.getNullable("merchant_category_code"))
/** The city the merchant resides in. */
fun merchantCity(): Optional =
Optional.ofNullable(merchantCity.getNullable("merchant_city"))
/** The country the merchant resides in. */
fun merchantCountry(): Optional =
Optional.ofNullable(merchantCountry.getNullable("merchant_country"))
/** The merchant descriptor of the merchant the card is transacting with. */
fun merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor")
/**
* The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP
* code, where the first 5 and last 4 are separated by a dash.
*/
fun merchantPostalCode(): Optional =
Optional.ofNullable(merchantPostalCode.getNullable("merchant_postal_code"))
/** The state the merchant resides in. */
fun merchantState(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(networkRiskScore.getNullable("network_risk_score"))
/**
* If the authorization was made in-person with a physical card, the Physical Card that
* was used.
*/
fun physicalCardId(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(realTimeDecisionId.getNullable("real_time_decision_id"))
/** Why the transaction was declined. */
fun reason(): Reason = reason.getRequired("reason")
/** 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 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
/** Why the transaction was declined. */
@JsonProperty("reason") @ExcludeMissing fun _reason() = reason
/** 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()
id()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
merchantCountry()
merchantDescriptor()
merchantPostalCode()
merchantState()
networkDetails().validate()
networkIdentifiers().validate()
networkRiskScore()
physicalCardId()
presentmentAmount()
presentmentCurrency()
processingCategory()
realTimeDecisionId()
reason()
verification().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardDecline &&
this.actioner == other.actioner &&
this.amount == other.amount &&
this.cardPaymentId == other.cardPaymentId &&
this.currency == other.currency &&
this.declinedTransactionId == other.declinedTransactionId &&
this.digitalWalletTokenId == other.digitalWalletTokenId &&
this.id == other.id &&
this.merchantAcceptorId == other.merchantAcceptorId &&
this.merchantCategoryCode == other.merchantCategoryCode &&
this.merchantCity == other.merchantCity &&
this.merchantCountry == other.merchantCountry &&
this.merchantDescriptor == other.merchantDescriptor &&
this.merchantPostalCode == other.merchantPostalCode &&
this.merchantState == other.merchantState &&
this.networkDetails == other.networkDetails &&
this.networkIdentifiers == other.networkIdentifiers &&
this.networkRiskScore == other.networkRiskScore &&
this.physicalCardId == other.physicalCardId &&
this.presentmentAmount == other.presentmentAmount &&
this.presentmentCurrency == other.presentmentCurrency &&
this.processingCategory == other.processingCategory &&
this.realTimeDecisionId == other.realTimeDecisionId &&
this.reason == other.reason &&
this.verification == other.verification &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
actioner,
amount,
cardPaymentId,
currency,
declinedTransactionId,
digitalWalletTokenId,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
reason,
verification,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardDecline{actioner=$actioner, amount=$amount, cardPaymentId=$cardPaymentId, currency=$currency, declinedTransactionId=$declinedTransactionId, digitalWalletTokenId=$digitalWalletTokenId, id=$id, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, realTimeDecisionId=$realTimeDecisionId, reason=$reason, verification=$verification, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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 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 reason: JsonField = JsonMissing.of()
private var verification: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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.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.reason = cardDecline.reason
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 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
}
/** 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 }
/** 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,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
reason,
verification,
additionalProperties.toUnmodifiable(),
)
}
class Actioner
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Actioner && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val USER = Actioner(JsonField.of("user"))
@JvmField val INCREASE = Actioner(JsonField.of("increase"))
@JvmField val NETWORK = Actioner(JsonField.of("network"))
@JvmStatic fun of(value: String) = Actioner(JsonField.of(value))
}
enum class Known {
USER,
INCREASE,
NETWORK,
}
enum class Value {
USER,
INCREASE,
NETWORK,
_UNKNOWN,
}
fun value(): Value =
when (this) {
USER -> Value.USER
INCREASE -> Value.INCREASE
NETWORK -> Value.NETWORK
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
USER -> Known.USER
INCREASE -> Known.INCREASE
NETWORK -> Known.NETWORK
else -> throw IncreaseInvalidDataException("Unknown Actioner: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Currency && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val CAD = Currency(JsonField.of("CAD"))
@JvmField val CHF = Currency(JsonField.of("CHF"))
@JvmField val EUR = Currency(JsonField.of("EUR"))
@JvmField val GBP = Currency(JsonField.of("GBP"))
@JvmField val JPY = Currency(JsonField.of("JPY"))
@JvmField val USD = Currency(JsonField.of("USD"))
@JvmStatic 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()
}
/** Fields specific to the `network`. */
@JsonDeserialize(builder = NetworkDetails.Builder::class)
@NoAutoDetect
class NetworkDetails
private constructor(
private val category: JsonField,
private val visa: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The payment network used to process this card authorization. */
fun category(): Category = category.getRequired("category")
/** Fields specific to the `visa` network. */
fun visa(): Optional = Optional.ofNullable(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().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is NetworkDetails &&
this.category == other.category &&
this.visa == other.visa &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
category,
visa,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var category: JsonField = JsonMissing.of()
private var visa: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(networkDetails: NetworkDetails) = apply {
this.category = networkDetails.category
this.visa = networkDetails.visa
additionalProperties(networkDetails.additionalProperties)
}
/** The payment network used to process this card authorization. */
fun category(category: Category) = category(JsonField.of(category))
/** The payment network used to process this card authorization. */
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/** Fields specific to the `visa` network. */
fun visa(visa: Visa) = visa(JsonField.of(visa))
/** Fields specific to the `visa` network. */
@JsonProperty("visa")
@ExcludeMissing
fun visa(visa: JsonField) = apply { this.visa = visa }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): NetworkDetails =
NetworkDetails(
category,
visa,
additionalProperties.toUnmodifiable(),
)
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Category && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val VISA = Category(JsonField.of("visa"))
@JvmStatic fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
VISA,
}
enum class Value {
VISA,
_UNKNOWN,
}
fun value(): Value =
when (this) {
VISA -> Value.VISA
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
VISA -> Known.VISA
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields specific to the `visa` network. */
@JsonDeserialize(builder = Visa.Builder::class)
@NoAutoDetect
class Visa
private constructor(
private val electronicCommerceIndicator: JsonField,
private val pointOfServiceEntryMode: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* For electronic commerce transactions, this identifies the level of security
* used in obtaining the customer's payment credential. For mail or telephone
* order transactions, identifies the type of mail or telephone order.
*/
fun electronicCommerceIndicator(): Optional =
Optional.ofNullable(
electronicCommerceIndicator.getNullable("electronic_commerce_indicator")
)
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
fun pointOfServiceEntryMode(): Optional =
Optional.ofNullable(
pointOfServiceEntryMode.getNullable("point_of_service_entry_mode")
)
/**
* For electronic commerce transactions, this identifies the level of security
* used in obtaining the customer's payment credential. For mail or telephone
* order transactions, identifies the type of mail or telephone order.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
fun _electronicCommerceIndicator() = electronicCommerceIndicator
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
fun _pointOfServiceEntryMode() = pointOfServiceEntryMode
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Visa = apply {
if (!validated) {
electronicCommerceIndicator()
pointOfServiceEntryMode()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Visa &&
this.electronicCommerceIndicator == other.electronicCommerceIndicator &&
this.pointOfServiceEntryMode == other.pointOfServiceEntryMode &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
electronicCommerceIndicator,
pointOfServiceEntryMode,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var electronicCommerceIndicator:
JsonField =
JsonMissing.of()
private var pointOfServiceEntryMode: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
@JvmSynthetic
internal fun from(visa: Visa) = apply {
this.electronicCommerceIndicator = visa.electronicCommerceIndicator
this.pointOfServiceEntryMode = visa.pointOfServiceEntryMode
additionalProperties(visa.additionalProperties)
}
/**
* For electronic commerce transactions, this identifies the level of
* security used in obtaining the customer's payment credential. For mail or
* telephone order transactions, identifies the type of mail or telephone
* order.
*/
fun electronicCommerceIndicator(
electronicCommerceIndicator: ElectronicCommerceIndicator
) = electronicCommerceIndicator(JsonField.of(electronicCommerceIndicator))
/**
* For electronic commerce transactions, this identifies the level of
* security used in obtaining the customer's payment credential. For mail or
* telephone order transactions, identifies the type of mail or telephone
* order.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
fun electronicCommerceIndicator(
electronicCommerceIndicator: JsonField
) = apply { this.electronicCommerceIndicator = electronicCommerceIndicator }
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
fun pointOfServiceEntryMode(
pointOfServiceEntryMode: PointOfServiceEntryMode
) = pointOfServiceEntryMode(JsonField.of(pointOfServiceEntryMode))
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
fun pointOfServiceEntryMode(
pointOfServiceEntryMode: JsonField
) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): Visa =
Visa(
electronicCommerceIndicator,
pointOfServiceEntryMode,
additionalProperties.toUnmodifiable(),
)
}
class ElectronicCommerceIndicator
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is ElectronicCommerceIndicator && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField
val MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(JsonField.of("mail_phone_order"))
@JvmField
val RECURRING = ElectronicCommerceIndicator(JsonField.of("recurring"))
@JvmField
val INSTALLMENT =
ElectronicCommerceIndicator(JsonField.of("installment"))
@JvmField
val UNKNOWN_MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(
JsonField.of("unknown_mail_phone_order")
)
@JvmField
val SECURE_ELECTRONIC_COMMERCE =
ElectronicCommerceIndicator(
JsonField.of("secure_electronic_commerce")
)
@JvmField
val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT =
ElectronicCommerceIndicator(
JsonField.of(
"non_authenticated_security_transaction_at_3ds_capable_merchant"
)
)
@JvmField
val NON_AUTHENTICATED_SECURITY_TRANSACTION =
ElectronicCommerceIndicator(
JsonField.of("non_authenticated_security_transaction")
)
@JvmField
val NON_SECURE_TRANSACTION =
ElectronicCommerceIndicator(JsonField.of("non_secure_transaction"))
@JvmStatic
fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value))
}
enum class Known {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
}
enum class Value {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
_UNKNOWN,
}
fun value(): Value =
when (this) {
MAIL_PHONE_ORDER -> Value.MAIL_PHONE_ORDER
RECURRING -> Value.RECURRING
INSTALLMENT -> Value.INSTALLMENT
UNKNOWN_MAIL_PHONE_ORDER -> Value.UNKNOWN_MAIL_PHONE_ORDER
SECURE_ELECTRONIC_COMMERCE -> Value.SECURE_ELECTRONIC_COMMERCE
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT ->
Value
.NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT
NON_AUTHENTICATED_SECURITY_TRANSACTION ->
Value.NON_AUTHENTICATED_SECURITY_TRANSACTION
NON_SECURE_TRANSACTION -> Value.NON_SECURE_TRANSACTION
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
MAIL_PHONE_ORDER -> Known.MAIL_PHONE_ORDER
RECURRING -> Known.RECURRING
INSTALLMENT -> Known.INSTALLMENT
UNKNOWN_MAIL_PHONE_ORDER -> Known.UNKNOWN_MAIL_PHONE_ORDER
SECURE_ELECTRONIC_COMMERCE -> Known.SECURE_ELECTRONIC_COMMERCE
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT ->
Known
.NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT
NON_AUTHENTICATED_SECURITY_TRANSACTION ->
Known.NON_AUTHENTICATED_SECURITY_TRANSACTION
NON_SECURE_TRANSACTION -> Known.NON_SECURE_TRANSACTION
else ->
throw IncreaseInvalidDataException(
"Unknown ElectronicCommerceIndicator: $value"
)
}
fun asString(): String = _value().asStringOrThrow()
}
class PointOfServiceEntryMode
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is PointOfServiceEntryMode && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val UNKNOWN = PointOfServiceEntryMode(JsonField.of("unknown"))
@JvmField val MANUAL = PointOfServiceEntryMode(JsonField.of("manual"))
@JvmField
val MAGNETIC_STRIPE_NO_CVV =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe_no_cvv"))
@JvmField
val OPTICAL_CODE = PointOfServiceEntryMode(JsonField.of("optical_code"))
@JvmField
val INTEGRATED_CIRCUIT_CARD =
PointOfServiceEntryMode(JsonField.of("integrated_circuit_card"))
@JvmField
val CONTACTLESS = PointOfServiceEntryMode(JsonField.of("contactless"))
@JvmField
val CREDENTIAL_ON_FILE =
PointOfServiceEntryMode(JsonField.of("credential_on_file"))
@JvmField
val MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe"))
@JvmField
val CONTACTLESS_MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("contactless_magnetic_stripe"))
@JvmField
val INTEGRATED_CIRCUIT_CARD_NO_CVV =
PointOfServiceEntryMode(
JsonField.of("integrated_circuit_card_no_cvv")
)
@JvmStatic
fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value))
}
enum class Known {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
}
enum class Value {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
_UNKNOWN,
}
fun value(): Value =
when (this) {
UNKNOWN -> Value.UNKNOWN
MANUAL -> Value.MANUAL
MAGNETIC_STRIPE_NO_CVV -> Value.MAGNETIC_STRIPE_NO_CVV
OPTICAL_CODE -> Value.OPTICAL_CODE
INTEGRATED_CIRCUIT_CARD -> Value.INTEGRATED_CIRCUIT_CARD
CONTACTLESS -> Value.CONTACTLESS
CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE
MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE
CONTACTLESS_MAGNETIC_STRIPE -> Value.CONTACTLESS_MAGNETIC_STRIPE
INTEGRATED_CIRCUIT_CARD_NO_CVV ->
Value.INTEGRATED_CIRCUIT_CARD_NO_CVV
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
UNKNOWN -> Known.UNKNOWN
MANUAL -> Known.MANUAL
MAGNETIC_STRIPE_NO_CVV -> Known.MAGNETIC_STRIPE_NO_CVV
OPTICAL_CODE -> Known.OPTICAL_CODE
INTEGRATED_CIRCUIT_CARD -> Known.INTEGRATED_CIRCUIT_CARD
CONTACTLESS -> Known.CONTACTLESS
CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE
MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE
CONTACTLESS_MAGNETIC_STRIPE -> Known.CONTACTLESS_MAGNETIC_STRIPE
INTEGRATED_CIRCUIT_CARD_NO_CVV ->
Known.INTEGRATED_CIRCUIT_CARD_NO_CVV
else ->
throw IncreaseInvalidDataException(
"Unknown PointOfServiceEntryMode: $value"
)
}
fun asString(): String = _value().asStringOrThrow()
}
}
}
/** Network-specific identifiers for a specific request or transaction. */
@JsonDeserialize(builder = NetworkIdentifiers.Builder::class)
@NoAutoDetect
class NetworkIdentifiers
private constructor(
private val retrievalReferenceNumber: JsonField,
private val traceNumber: JsonField,
private val transactionId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* A life-cycle identifier used across e.g., an authorization and a reversal.
* Expected to be unique per acquirer within a window of time. For some card
* networks the retrieval reference number includes the trace counter.
*/
fun retrievalReferenceNumber(): Optional =
Optional.ofNullable(
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(): Optional =
Optional.ofNullable(traceNumber.getNullable("trace_number"))
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
fun transactionId(): Optional =
Optional.ofNullable(transactionId.getNullable("transaction_id"))
/**
* A life-cycle identifier used across e.g., an authorization and a reversal.
* Expected to be unique per acquirer within a window of time. For some card
* networks the retrieval reference number includes the trace counter.
*/
@JsonProperty("retrieval_reference_number")
@ExcludeMissing
fun _retrievalReferenceNumber() = retrievalReferenceNumber
/**
* A counter used to verify an individual authorization. Expected to be unique per
* acquirer within a window of time.
*/
@JsonProperty("trace_number") @ExcludeMissing fun _traceNumber() = traceNumber
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): NetworkIdentifiers = apply {
if (!validated) {
retrievalReferenceNumber()
traceNumber()
transactionId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is NetworkIdentifiers &&
this.retrievalReferenceNumber == other.retrievalReferenceNumber &&
this.traceNumber == other.traceNumber &&
this.transactionId == other.transactionId &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
retrievalReferenceNumber,
traceNumber,
transactionId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var retrievalReferenceNumber: JsonField