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.Transaction.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.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
/**
* Transactions are the immutable additions and removals of money from your bank account. They're
* the equivalent of line items on your bank statement.
*/
@JsonDeserialize(builder = Transaction.Builder::class)
@NoAutoDetect
class Transaction
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 Transaction belongs to. */
fun accountId(): String = accountId.getRequired("account_id")
/**
* The 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 Transaction's currency.
* This will match the currency on the Transaction's Account.
*/
fun currency(): Currency = currency.getRequired("currency")
/**
* An informational message describing this transaction. Use the fields in `source` to get more
* detailed information. This field appears as the line-item on the statement.
*/
fun description(): String = description.getRequired("description")
/** The Transaction identifier. */
fun id(): String = id.getRequired("id")
/**
* The identifier for the route this Transaction came through. Routes are things like cards and
* ACH details.
*/
fun routeId(): String? = routeId.getNullable("route_id")
/** The type of the route this 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 Transaction.
* 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 `transaction`.
*/
fun type(): Type = type.getRequired("type")
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/**
* The 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 Transaction's currency.
* This will match the currency on the Transaction's Account.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/**
* An informational message describing this transaction. Use the fields in `source` to get more
* detailed information. This field appears as the line-item on the statement.
*/
@JsonProperty("description") @ExcludeMissing fun _description() = description
/** The Transaction identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The identifier for the route this Transaction came through. Routes are things like cards and
* ACH details.
*/
@JsonProperty("route_id") @ExcludeMissing fun _routeId() = routeId
/** The type of the route this 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 Transaction.
* 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 `transaction`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Transaction = 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(transaction: Transaction) = apply {
this.accountId = transaction.accountId
this.amount = transaction.amount
this.createdAt = transaction.createdAt
this.currency = transaction.currency
this.description = transaction.description
this.id = transaction.id
this.routeId = transaction.routeId
this.routeType = transaction.routeType
this.source = transaction.source
this.type = transaction.type
additionalProperties(transaction.additionalProperties)
}
/** The identifier for the Account the Transaction belongs to. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/**
* The 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 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 Transaction's
* currency. This will match the currency on the Transaction's Account.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the Transaction's
* currency. This will match the currency on the Transaction's Account.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/**
* An informational message describing this transaction. Use the fields in `source` to get
* more detailed information. This field appears as the line-item on the statement.
*/
fun description(description: String) = description(JsonField.of(description))
/**
* An informational message describing this transaction. Use the fields in `source` to get
* more detailed information. This field appears as the line-item on the statement.
*/
@JsonProperty("description")
@ExcludeMissing
fun description(description: JsonField) = apply { this.description = description }
/** The Transaction identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Transaction identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/**
* The identifier for the route this 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 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 Transaction came through. */
fun routeType(routeType: RouteType) = routeType(JsonField.of(routeType))
/** The type of the route this 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
* Transaction. 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
* Transaction. 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
* `transaction`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `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(): Transaction =
Transaction(
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 Transaction.
* 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 accountTransferIntention: JsonField,
private val achTransferIntention: JsonField,
private val achTransferRejection: JsonField,
private val achTransferReturn: JsonField,
private val cardDisputeAcceptance: JsonField,
private val cardDisputeLoss: JsonField,
private val cardRefund: JsonField,
private val cardRevenuePayment: JsonField,
private val cardSettlement: JsonField,
private val cashbackPayment: JsonField,
private val category: JsonField,
private val checkDepositAcceptance: JsonField,
private val checkDepositReturn: JsonField,
private val checkTransferDeposit: JsonField,
private val feePayment: JsonField,
private val inboundAchTransfer: JsonField,
private val inboundRealTimePaymentsTransferConfirmation:
JsonField,
private val inboundRealTimePaymentsTransferDecline:
JsonField,
private val inboundWireReversal: JsonField,
private val inboundWireTransfer: JsonField,
private val interestPayment: JsonField,
private val internalSource: JsonField,
private val other: JsonValue,
private val realTimePaymentsTransferAcknowledgement:
JsonField,
private val sampleFunds: JsonField,
private val wireTransferIntention: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* An Account Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `account_transfer_intention`.
*/
fun accountTransferIntention(): AccountTransferIntention? =
accountTransferIntention.getNullable("account_transfer_intention")
/**
* An ACH Transfer Intention object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_intention`.
*/
fun achTransferIntention(): AchTransferIntention? =
achTransferIntention.getNullable("ach_transfer_intention")
/**
* An ACH Transfer Rejection object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_rejection`.
*/
fun achTransferRejection(): AchTransferRejection? =
achTransferRejection.getNullable("ach_transfer_rejection")
/**
* An ACH Transfer Return object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_return`.
*/
fun achTransferReturn(): AchTransferReturn? =
achTransferReturn.getNullable("ach_transfer_return")
/**
* A Card Dispute Acceptance object. This field will be present in the JSON response if and
* only if `category` is equal to `card_dispute_acceptance`.
*/
fun cardDisputeAcceptance(): CardDisputeAcceptance? =
cardDisputeAcceptance.getNullable("card_dispute_acceptance")
/**
* A Card Dispute Loss object. This field will be present in the JSON response if and only
* if `category` is equal to `card_dispute_loss`.
*/
fun cardDisputeLoss(): CardDisputeLoss? = cardDisputeLoss.getNullable("card_dispute_loss")
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(): CardRefund? = cardRefund.getNullable("card_refund")
/**
* A Card Revenue Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `card_revenue_payment`.
*/
fun cardRevenuePayment(): CardRevenuePayment? =
cardRevenuePayment.getNullable("card_revenue_payment")
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
fun cardSettlement(): CardSettlement? = cardSettlement.getNullable("card_settlement")
/**
* A Cashback Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `cashback_payment`.
*/
fun cashbackPayment(): CashbackPayment? = cashbackPayment.getNullable("cashback_payment")
/**
* 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 Deposit Acceptance object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_acceptance`.
*/
fun checkDepositAcceptance(): CheckDepositAcceptance? =
checkDepositAcceptance.getNullable("check_deposit_acceptance")
/**
* A Check Deposit Return object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_return`.
*/
fun checkDepositReturn(): CheckDepositReturn? =
checkDepositReturn.getNullable("check_deposit_return")
/**
* A Check Transfer Deposit object. This field will be present in the JSON response if and
* only if `category` is equal to `check_transfer_deposit`.
*/
fun checkTransferDeposit(): CheckTransferDeposit? =
checkTransferDeposit.getNullable("check_transfer_deposit")
/**
* A Fee Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `fee_payment`.
*/
fun feePayment(): FeePayment? = feePayment.getNullable("fee_payment")
/**
* An Inbound ACH Transfer Intention object. This field will be present in the JSON response
* if and only if `category` is equal to `inbound_ach_transfer`.
*/
fun inboundAchTransfer(): InboundAchTransfer? =
inboundAchTransfer.getNullable("inbound_ach_transfer")
/**
* An Inbound Real-Time Payments Transfer Confirmation object. This field will be present in
* the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_confirmation`.
*/
fun inboundRealTimePaymentsTransferConfirmation():
InboundRealTimePaymentsTransferConfirmation? =
inboundRealTimePaymentsTransferConfirmation.getNullable(
"inbound_real_time_payments_transfer_confirmation"
)
/**
* 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"
)
/**
* An Inbound Wire Reversal object. This field will be present in the JSON response if and
* only if `category` is equal to `inbound_wire_reversal`.
*/
fun inboundWireReversal(): InboundWireReversal? =
inboundWireReversal.getNullable("inbound_wire_reversal")
/**
* An Inbound Wire Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_wire_transfer`.
*/
fun inboundWireTransfer(): InboundWireTransfer? =
inboundWireTransfer.getNullable("inbound_wire_transfer")
/**
* An Interest Payment object. This field will be present in the JSON response if and only
* if `category` is equal to `interest_payment`.
*/
fun interestPayment(): InterestPayment? = interestPayment.getNullable("interest_payment")
/**
* An Internal Source object. This field will be present in the JSON response if and only if
* `category` is equal to `internal_source`.
*/
fun internalSource(): InternalSource? = internalSource.getNullable("internal_source")
/**
* A Real-Time Payments Transfer Acknowledgement object. This field will be present in the
* JSON response if and only if `category` is equal to
* `real_time_payments_transfer_acknowledgement`.
*/
fun realTimePaymentsTransferAcknowledgement(): RealTimePaymentsTransferAcknowledgement? =
realTimePaymentsTransferAcknowledgement.getNullable(
"real_time_payments_transfer_acknowledgement"
)
/**
* A Sample Funds object. This field will be present in the JSON response if and only if
* `category` is equal to `sample_funds`.
*/
fun sampleFunds(): SampleFunds? = sampleFunds.getNullable("sample_funds")
/**
* A Wire Transfer Intention object. This field will be present in the JSON response if and
* only if `category` is equal to `wire_transfer_intention`.
*/
fun wireTransferIntention(): WireTransferIntention? =
wireTransferIntention.getNullable("wire_transfer_intention")
/**
* An Account Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `account_transfer_intention`.
*/
@JsonProperty("account_transfer_intention")
@ExcludeMissing
fun _accountTransferIntention() = accountTransferIntention
/**
* An ACH Transfer Intention object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_intention`.
*/
@JsonProperty("ach_transfer_intention")
@ExcludeMissing
fun _achTransferIntention() = achTransferIntention
/**
* An ACH Transfer Rejection object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_rejection`.
*/
@JsonProperty("ach_transfer_rejection")
@ExcludeMissing
fun _achTransferRejection() = achTransferRejection
/**
* An ACH Transfer Return object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_return`.
*/
@JsonProperty("ach_transfer_return")
@ExcludeMissing
fun _achTransferReturn() = achTransferReturn
/**
* A Card Dispute Acceptance object. This field will be present in the JSON response if and
* only if `category` is equal to `card_dispute_acceptance`.
*/
@JsonProperty("card_dispute_acceptance")
@ExcludeMissing
fun _cardDisputeAcceptance() = cardDisputeAcceptance
/**
* A Card Dispute Loss object. This field will be present in the JSON response if and only
* if `category` is equal to `card_dispute_loss`.
*/
@JsonProperty("card_dispute_loss") @ExcludeMissing fun _cardDisputeLoss() = cardDisputeLoss
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund") @ExcludeMissing fun _cardRefund() = cardRefund
/**
* A Card Revenue Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `card_revenue_payment`.
*/
@JsonProperty("card_revenue_payment")
@ExcludeMissing
fun _cardRevenuePayment() = cardRevenuePayment
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement") @ExcludeMissing fun _cardSettlement() = cardSettlement
/**
* A Cashback Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `cashback_payment`.
*/
@JsonProperty("cashback_payment") @ExcludeMissing fun _cashbackPayment() = cashbackPayment
/**
* 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 Deposit Acceptance object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_acceptance`.
*/
@JsonProperty("check_deposit_acceptance")
@ExcludeMissing
fun _checkDepositAcceptance() = checkDepositAcceptance
/**
* A Check Deposit Return object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_return`.
*/
@JsonProperty("check_deposit_return")
@ExcludeMissing
fun _checkDepositReturn() = checkDepositReturn
/**
* A Check Transfer Deposit object. This field will be present in the JSON response if and
* only if `category` is equal to `check_transfer_deposit`.
*/
@JsonProperty("check_transfer_deposit")
@ExcludeMissing
fun _checkTransferDeposit() = checkTransferDeposit
/**
* A Fee Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `fee_payment`.
*/
@JsonProperty("fee_payment") @ExcludeMissing fun _feePayment() = feePayment
/**
* An Inbound ACH Transfer Intention object. This field will be present in the JSON response
* if and only if `category` is equal to `inbound_ach_transfer`.
*/
@JsonProperty("inbound_ach_transfer")
@ExcludeMissing
fun _inboundAchTransfer() = inboundAchTransfer
/**
* An Inbound Real-Time Payments Transfer Confirmation object. This field will be present in
* the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_confirmation`.
*/
@JsonProperty("inbound_real_time_payments_transfer_confirmation")
@ExcludeMissing
fun _inboundRealTimePaymentsTransferConfirmation() =
inboundRealTimePaymentsTransferConfirmation
/**
* 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
/**
* An Inbound Wire Reversal object. This field will be present in the JSON response if and
* only if `category` is equal to `inbound_wire_reversal`.
*/
@JsonProperty("inbound_wire_reversal")
@ExcludeMissing
fun _inboundWireReversal() = inboundWireReversal
/**
* An Inbound Wire Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_wire_transfer`.
*/
@JsonProperty("inbound_wire_transfer")
@ExcludeMissing
fun _inboundWireTransfer() = inboundWireTransfer
/**
* An Interest Payment object. This field will be present in the JSON response if and only
* if `category` is equal to `interest_payment`.
*/
@JsonProperty("interest_payment") @ExcludeMissing fun _interestPayment() = interestPayment
/**
* An Internal Source object. This field will be present in the JSON response if and only if
* `category` is equal to `internal_source`.
*/
@JsonProperty("internal_source") @ExcludeMissing fun _internalSource() = internalSource
/**
* 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 Real-Time Payments Transfer Acknowledgement object. This field will be present in the
* JSON response if and only if `category` is equal to
* `real_time_payments_transfer_acknowledgement`.
*/
@JsonProperty("real_time_payments_transfer_acknowledgement")
@ExcludeMissing
fun _realTimePaymentsTransferAcknowledgement() = realTimePaymentsTransferAcknowledgement
/**
* A Sample Funds object. This field will be present in the JSON response if and only if
* `category` is equal to `sample_funds`.
*/
@JsonProperty("sample_funds") @ExcludeMissing fun _sampleFunds() = sampleFunds
/**
* A Wire Transfer Intention object. This field will be present in the JSON response if and
* only if `category` is equal to `wire_transfer_intention`.
*/
@JsonProperty("wire_transfer_intention")
@ExcludeMissing
fun _wireTransferIntention() = wireTransferIntention
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Source = apply {
if (!validated) {
accountTransferIntention()?.validate()
achTransferIntention()?.validate()
achTransferRejection()?.validate()
achTransferReturn()?.validate()
cardDisputeAcceptance()?.validate()
cardDisputeLoss()?.validate()
cardRefund()?.validate()
cardRevenuePayment()?.validate()
cardSettlement()?.validate()
cashbackPayment()?.validate()
category()
checkDepositAcceptance()?.validate()
checkDepositReturn()?.validate()
checkTransferDeposit()?.validate()
feePayment()?.validate()
inboundAchTransfer()?.validate()
inboundRealTimePaymentsTransferConfirmation()?.validate()
inboundRealTimePaymentsTransferDecline()?.validate()
inboundWireReversal()?.validate()
inboundWireTransfer()?.validate()
interestPayment()?.validate()
internalSource()?.validate()
realTimePaymentsTransferAcknowledgement()?.validate()
sampleFunds()?.validate()
wireTransferIntention()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var accountTransferIntention: JsonField =
JsonMissing.of()
private var achTransferIntention: JsonField = JsonMissing.of()
private var achTransferRejection: JsonField = JsonMissing.of()
private var achTransferReturn: JsonField = JsonMissing.of()
private var cardDisputeAcceptance: JsonField = JsonMissing.of()
private var cardDisputeLoss: JsonField = JsonMissing.of()
private var cardRefund: JsonField = JsonMissing.of()
private var cardRevenuePayment: JsonField = JsonMissing.of()
private var cardSettlement: JsonField = JsonMissing.of()
private var cashbackPayment: JsonField = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var checkDepositAcceptance: JsonField = JsonMissing.of()
private var checkDepositReturn: JsonField = JsonMissing.of()
private var checkTransferDeposit: JsonField = JsonMissing.of()
private var feePayment: JsonField = JsonMissing.of()
private var inboundAchTransfer: JsonField = JsonMissing.of()
private var inboundRealTimePaymentsTransferConfirmation:
JsonField =
JsonMissing.of()
private var inboundRealTimePaymentsTransferDecline:
JsonField =
JsonMissing.of()
private var inboundWireReversal: JsonField = JsonMissing.of()
private var inboundWireTransfer: JsonField = JsonMissing.of()
private var interestPayment: JsonField = JsonMissing.of()
private var internalSource: JsonField = JsonMissing.of()
private var other: JsonValue = JsonMissing.of()
private var realTimePaymentsTransferAcknowledgement:
JsonField =
JsonMissing.of()
private var sampleFunds: JsonField = JsonMissing.of()
private var wireTransferIntention: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(source: Source) = apply {
this.accountTransferIntention = source.accountTransferIntention
this.achTransferIntention = source.achTransferIntention
this.achTransferRejection = source.achTransferRejection
this.achTransferReturn = source.achTransferReturn
this.cardDisputeAcceptance = source.cardDisputeAcceptance
this.cardDisputeLoss = source.cardDisputeLoss
this.cardRefund = source.cardRefund
this.cardRevenuePayment = source.cardRevenuePayment
this.cardSettlement = source.cardSettlement
this.cashbackPayment = source.cashbackPayment
this.category = source.category
this.checkDepositAcceptance = source.checkDepositAcceptance
this.checkDepositReturn = source.checkDepositReturn
this.checkTransferDeposit = source.checkTransferDeposit
this.feePayment = source.feePayment
this.inboundAchTransfer = source.inboundAchTransfer
this.inboundRealTimePaymentsTransferConfirmation =
source.inboundRealTimePaymentsTransferConfirmation
this.inboundRealTimePaymentsTransferDecline =
source.inboundRealTimePaymentsTransferDecline
this.inboundWireReversal = source.inboundWireReversal
this.inboundWireTransfer = source.inboundWireTransfer
this.interestPayment = source.interestPayment
this.internalSource = source.internalSource
this.other = source.other
this.realTimePaymentsTransferAcknowledgement =
source.realTimePaymentsTransferAcknowledgement
this.sampleFunds = source.sampleFunds
this.wireTransferIntention = source.wireTransferIntention
additionalProperties(source.additionalProperties)
}
/**
* An Account Transfer Intention object. This field will be present in the JSON response
* if and only if `category` is equal to `account_transfer_intention`.
*/
fun accountTransferIntention(accountTransferIntention: AccountTransferIntention) =
accountTransferIntention(JsonField.of(accountTransferIntention))
/**
* An Account Transfer Intention object. This field will be present in the JSON response
* if and only if `category` is equal to `account_transfer_intention`.
*/
@JsonProperty("account_transfer_intention")
@ExcludeMissing
fun accountTransferIntention(
accountTransferIntention: JsonField
) = apply { this.accountTransferIntention = accountTransferIntention }
/**
* An ACH Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `ach_transfer_intention`.
*/
fun achTransferIntention(achTransferIntention: AchTransferIntention) =
achTransferIntention(JsonField.of(achTransferIntention))
/**
* An ACH Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `ach_transfer_intention`.
*/
@JsonProperty("ach_transfer_intention")
@ExcludeMissing
fun achTransferIntention(achTransferIntention: JsonField) =
apply {
this.achTransferIntention = achTransferIntention
}
/**
* An ACH Transfer Rejection object. This field will be present in the JSON response if
* and only if `category` is equal to `ach_transfer_rejection`.
*/
fun achTransferRejection(achTransferRejection: AchTransferRejection) =
achTransferRejection(JsonField.of(achTransferRejection))
/**
* An ACH Transfer Rejection object. This field will be present in the JSON response if
* and only if `category` is equal to `ach_transfer_rejection`.
*/
@JsonProperty("ach_transfer_rejection")
@ExcludeMissing
fun achTransferRejection(achTransferRejection: JsonField) =
apply {
this.achTransferRejection = achTransferRejection
}
/**
* An ACH Transfer Return object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_return`.
*/
fun achTransferReturn(achTransferReturn: AchTransferReturn) =
achTransferReturn(JsonField.of(achTransferReturn))
/**
* An ACH Transfer Return object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_return`.
*/
@JsonProperty("ach_transfer_return")
@ExcludeMissing
fun achTransferReturn(achTransferReturn: JsonField) = apply {
this.achTransferReturn = achTransferReturn
}
/**
* A Card Dispute Acceptance object. This field will be present in the JSON response if
* and only if `category` is equal to `card_dispute_acceptance`.
*/
fun cardDisputeAcceptance(cardDisputeAcceptance: CardDisputeAcceptance) =
cardDisputeAcceptance(JsonField.of(cardDisputeAcceptance))
/**
* A Card Dispute Acceptance object. This field will be present in the JSON response if
* and only if `category` is equal to `card_dispute_acceptance`.
*/
@JsonProperty("card_dispute_acceptance")
@ExcludeMissing
fun cardDisputeAcceptance(cardDisputeAcceptance: JsonField) =
apply {
this.cardDisputeAcceptance = cardDisputeAcceptance
}
/**
* A Card Dispute Loss object. This field will be present in the JSON response if and
* only if `category` is equal to `card_dispute_loss`.
*/
fun cardDisputeLoss(cardDisputeLoss: CardDisputeLoss) =
cardDisputeLoss(JsonField.of(cardDisputeLoss))
/**
* A Card Dispute Loss object. This field will be present in the JSON response if and
* only if `category` is equal to `card_dispute_loss`.
*/
@JsonProperty("card_dispute_loss")
@ExcludeMissing
fun cardDisputeLoss(cardDisputeLoss: JsonField) = apply {
this.cardDisputeLoss = cardDisputeLoss
}
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(cardRefund: CardRefund) = cardRefund(JsonField.of(cardRefund))
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund")
@ExcludeMissing
fun cardRefund(cardRefund: JsonField) = apply {
this.cardRefund = cardRefund
}
/**
* A Card Revenue Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `card_revenue_payment`.
*/
fun cardRevenuePayment(cardRevenuePayment: CardRevenuePayment) =
cardRevenuePayment(JsonField.of(cardRevenuePayment))
/**
* A Card Revenue Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `card_revenue_payment`.
*/
@JsonProperty("card_revenue_payment")
@ExcludeMissing
fun cardRevenuePayment(cardRevenuePayment: JsonField) = apply {
this.cardRevenuePayment = cardRevenuePayment
}
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
fun cardSettlement(cardSettlement: CardSettlement) =
cardSettlement(JsonField.of(cardSettlement))
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement")
@ExcludeMissing
fun cardSettlement(cardSettlement: JsonField) = apply {
this.cardSettlement = cardSettlement
}
/**
* A Cashback Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `cashback_payment`.
*/
fun cashbackPayment(cashbackPayment: CashbackPayment) =
cashbackPayment(JsonField.of(cashbackPayment))
/**
* A Cashback Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `cashback_payment`.
*/
@JsonProperty("cashback_payment")
@ExcludeMissing
fun cashbackPayment(cashbackPayment: JsonField) = apply {
this.cashbackPayment = cashbackPayment
}
/**
* 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 Deposit Acceptance object. This field will be present in the JSON response if
* and only if `category` is equal to `check_deposit_acceptance`.
*/
fun checkDepositAcceptance(checkDepositAcceptance: CheckDepositAcceptance) =
checkDepositAcceptance(JsonField.of(checkDepositAcceptance))
/**
* A Check Deposit Acceptance object. This field will be present in the JSON response if
* and only if `category` is equal to `check_deposit_acceptance`.
*/
@JsonProperty("check_deposit_acceptance")
@ExcludeMissing
fun checkDepositAcceptance(checkDepositAcceptance: JsonField) =
apply {
this.checkDepositAcceptance = checkDepositAcceptance
}
/**
* A Check Deposit Return object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_return`.
*/
fun checkDepositReturn(checkDepositReturn: CheckDepositReturn) =
checkDepositReturn(JsonField.of(checkDepositReturn))
/**
* A Check Deposit Return object. This field will be present in the JSON response if and
* only if `category` is equal to `check_deposit_return`.
*/
@JsonProperty("check_deposit_return")
@ExcludeMissing
fun checkDepositReturn(checkDepositReturn: JsonField) = apply {
this.checkDepositReturn = checkDepositReturn
}
/**
* A Check Transfer Deposit object. This field will be present in the JSON response if
* and only if `category` is equal to `check_transfer_deposit`.
*/
fun checkTransferDeposit(checkTransferDeposit: CheckTransferDeposit) =
checkTransferDeposit(JsonField.of(checkTransferDeposit))
/**
* A Check Transfer Deposit object. This field will be present in the JSON response if
* and only if `category` is equal to `check_transfer_deposit`.
*/
@JsonProperty("check_transfer_deposit")
@ExcludeMissing
fun checkTransferDeposit(checkTransferDeposit: JsonField) =
apply {
this.checkTransferDeposit = checkTransferDeposit
}
/**
* A Fee Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `fee_payment`.
*/
fun feePayment(feePayment: FeePayment) = feePayment(JsonField.of(feePayment))
/**
* A Fee Payment object. This field will be present in the JSON response if and only if
* `category` is equal to `fee_payment`.
*/
@JsonProperty("fee_payment")
@ExcludeMissing
fun feePayment(feePayment: JsonField) = apply {
this.feePayment = feePayment
}
/**
* An Inbound ACH Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_ach_transfer`.
*/
fun inboundAchTransfer(inboundAchTransfer: InboundAchTransfer) =
inboundAchTransfer(JsonField.of(inboundAchTransfer))
/**
* An Inbound ACH Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_ach_transfer`.
*/
@JsonProperty("inbound_ach_transfer")
@ExcludeMissing
fun inboundAchTransfer(inboundAchTransfer: JsonField) = apply {
this.inboundAchTransfer = inboundAchTransfer
}
/**
* An Inbound Real-Time Payments Transfer Confirmation object. This field will be
* present in the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_confirmation`.
*/
fun inboundRealTimePaymentsTransferConfirmation(
inboundRealTimePaymentsTransferConfirmation:
InboundRealTimePaymentsTransferConfirmation
) =
inboundRealTimePaymentsTransferConfirmation(
JsonField.of(inboundRealTimePaymentsTransferConfirmation)
)
/**
* An Inbound Real-Time Payments Transfer Confirmation object. This field will be
* present in the JSON response if and only if `category` is equal to
* `inbound_real_time_payments_transfer_confirmation`.
*/
@JsonProperty("inbound_real_time_payments_transfer_confirmation")
@ExcludeMissing
fun inboundRealTimePaymentsTransferConfirmation(
inboundRealTimePaymentsTransferConfirmation:
JsonField
) = apply {
this.inboundRealTimePaymentsTransferConfirmation =
inboundRealTimePaymentsTransferConfirmation
}
/**
* 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
}
/**
* An Inbound Wire Reversal object. This field will be present in the JSON response if
* and only if `category` is equal to `inbound_wire_reversal`.
*/
fun inboundWireReversal(inboundWireReversal: InboundWireReversal) =
inboundWireReversal(JsonField.of(inboundWireReversal))
/**
* An Inbound Wire Reversal object. This field will be present in the JSON response if
* and only if `category` is equal to `inbound_wire_reversal`.
*/
@JsonProperty("inbound_wire_reversal")
@ExcludeMissing
fun inboundWireReversal(inboundWireReversal: JsonField) = apply {
this.inboundWireReversal = inboundWireReversal
}
/**
* An Inbound Wire Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_wire_transfer`.
*/
fun inboundWireTransfer(inboundWireTransfer: InboundWireTransfer) =
inboundWireTransfer(JsonField.of(inboundWireTransfer))
/**
* An Inbound Wire Transfer Intention object. This field will be present in the JSON
* response if and only if `category` is equal to `inbound_wire_transfer`.
*/
@JsonProperty("inbound_wire_transfer")
@ExcludeMissing
fun inboundWireTransfer(inboundWireTransfer: JsonField) = apply {
this.inboundWireTransfer = inboundWireTransfer
}
/**
* An Interest Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `interest_payment`.
*/
fun interestPayment(interestPayment: InterestPayment) =
interestPayment(JsonField.of(interestPayment))
/**
* An Interest Payment object. This field will be present in the JSON response if and
* only if `category` is equal to `interest_payment`.
*/
@JsonProperty("interest_payment")
@ExcludeMissing
fun interestPayment(interestPayment: JsonField) = apply {
this.interestPayment = interestPayment
}
/**
* An Internal Source object. This field will be present in the JSON response if and
* only if `category` is equal to `internal_source`.
*/
fun internalSource(internalSource: InternalSource) =
internalSource(JsonField.of(internalSource))
/**
* An Internal Source object. This field will be present in the JSON response if and
* only if `category` is equal to `internal_source`.
*/
@JsonProperty("internal_source")
@ExcludeMissing
fun internalSource(internalSource: JsonField) = apply {
this.internalSource = internalSource
}
/**
* 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 Real-Time Payments Transfer Acknowledgement object. This field will be present in
* the JSON response if and only if `category` is equal to
* `real_time_payments_transfer_acknowledgement`.
*/
fun realTimePaymentsTransferAcknowledgement(
realTimePaymentsTransferAcknowledgement: RealTimePaymentsTransferAcknowledgement
) =
realTimePaymentsTransferAcknowledgement(
JsonField.of(realTimePaymentsTransferAcknowledgement)
)
/**
* A Real-Time Payments Transfer Acknowledgement object. This field will be present in
* the JSON response if and only if `category` is equal to
* `real_time_payments_transfer_acknowledgement`.
*/
@JsonProperty("real_time_payments_transfer_acknowledgement")
@ExcludeMissing
fun realTimePaymentsTransferAcknowledgement(
realTimePaymentsTransferAcknowledgement:
JsonField
) = apply {
this.realTimePaymentsTransferAcknowledgement =
realTimePaymentsTransferAcknowledgement
}
/**
* A Sample Funds object. This field will be present in the JSON response if and only if
* `category` is equal to `sample_funds`.
*/
fun sampleFunds(sampleFunds: SampleFunds) = sampleFunds(JsonField.of(sampleFunds))
/**
* A Sample Funds object. This field will be present in the JSON response if and only if
* `category` is equal to `sample_funds`.
*/
@JsonProperty("sample_funds")
@ExcludeMissing
fun sampleFunds(sampleFunds: JsonField) = apply {
this.sampleFunds = sampleFunds
}
/**
* A Wire Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `wire_transfer_intention`.
*/
fun wireTransferIntention(wireTransferIntention: WireTransferIntention) =
wireTransferIntention(JsonField.of(wireTransferIntention))
/**
* A Wire Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `wire_transfer_intention`.
*/
@JsonProperty("wire_transfer_intention")
@ExcludeMissing
fun wireTransferIntention(wireTransferIntention: JsonField) =
apply {
this.wireTransferIntention = wireTransferIntention
}
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(
accountTransferIntention,
achTransferIntention,
achTransferRejection,
achTransferReturn,
cardDisputeAcceptance,
cardDisputeLoss,
cardRefund,
cardRevenuePayment,
cardSettlement,
cashbackPayment,
category,
checkDepositAcceptance,
checkDepositReturn,
checkTransferDeposit,
feePayment,
inboundAchTransfer,
inboundRealTimePaymentsTransferConfirmation,
inboundRealTimePaymentsTransferDecline,
inboundWireReversal,
inboundWireTransfer,
interestPayment,
internalSource,
other,
realTimePaymentsTransferAcknowledgement,
sampleFunds,
wireTransferIntention,
additionalProperties.toImmutable(),
)
}
/**
* An Account Transfer Intention object. This field will be present in the JSON response if
* and only if `category` is equal to `account_transfer_intention`.
*/
@JsonDeserialize(builder = AccountTransferIntention.Builder::class)
@NoAutoDetect
class AccountTransferIntention
private constructor(
private val amount: JsonField,
private val currency: JsonField,
private val description: JsonField,
private val destinationAccountId: JsonField,
private val sourceAccountId: JsonField,
private val transferId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
* account currency.
*/
fun currency(): Currency = currency.getRequired("currency")
/** The description you chose to give the transfer. */
fun description(): String = description.getRequired("description")
/** The identifier of the Account to where the Account Transfer was sent. */
fun destinationAccountId(): String =
destinationAccountId.getRequired("destination_account_id")
/** The identifier of the Account from where the Account Transfer was sent. */
fun sourceAccountId(): String = sourceAccountId.getRequired("source_account_id")
/** The identifier of the Account Transfer that led to this Pending Transaction. */
fun transferId(): String = transferId.getRequired("transfer_id")
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination
* account currency.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** The description you chose to give the transfer. */
@JsonProperty("description") @ExcludeMissing fun _description() = description
/** The identifier of the Account to where the Account Transfer was sent. */
@JsonProperty("destination_account_id")
@ExcludeMissing
fun _destinationAccountId() = destinationAccountId
/** The identifier of the Account from where the Account Transfer was sent. */
@JsonProperty("source_account_id")
@ExcludeMissing
fun _sourceAccountId() = sourceAccountId
/** The identifier of the Account Transfer that led to this Pending Transaction. */
@JsonProperty("transfer_id") @ExcludeMissing fun _transferId() = transferId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AccountTransferIntention = apply {
if (!validated) {
amount()
currency()
description()
destinationAccountId()
sourceAccountId()
transferId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var description: JsonField = JsonMissing.of()
private var destinationAccountId: JsonField = JsonMissing.of()
private var sourceAccountId: JsonField = JsonMissing.of()
private var transferId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(accountTransferIntention: AccountTransferIntention) = apply {
this.amount = accountTransferIntention.amount
this.currency = accountTransferIntention.currency
this.description = accountTransferIntention.description
this.destinationAccountId = accountTransferIntention.destinationAccountId
this.sourceAccountId = accountTransferIntention.sourceAccountId
this.transferId = accountTransferIntention.transferId
additionalProperties(accountTransferIntention.additionalProperties)
}
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* The [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 description you chose to give the transfer. */
fun description(description: String) = description(JsonField.of(description))
/** The description you chose to give the transfer. */
@JsonProperty("description")
@ExcludeMissing
fun description(description: JsonField) = apply {
this.description = description
}
/** The identifier of the Account to where the Account Transfer was sent. */
fun destinationAccountId(destinationAccountId: String) =
destinationAccountId(JsonField.of(destinationAccountId))
/** The identifier of the Account to where the Account Transfer was sent. */
@JsonProperty("destination_account_id")
@ExcludeMissing
fun destinationAccountId(destinationAccountId: JsonField) = apply {
this.destinationAccountId = destinationAccountId
}
/** The identifier of the Account from where the Account Transfer was sent. */
fun sourceAccountId(sourceAccountId: String) =
sourceAccountId(JsonField.of(sourceAccountId))
/** The identifier of the Account from where the Account Transfer was sent. */
@JsonProperty("source_account_id")
@ExcludeMissing
fun sourceAccountId(sourceAccountId: JsonField) = apply {
this.sourceAccountId = sourceAccountId
}
/** The identifier of the Account Transfer that led to this Pending Transaction. */
fun transferId(transferId: String) = transferId(JsonField.of(transferId))
/** The identifier of the Account Transfer that led to this Pending Transaction. */
@JsonProperty("transfer_id")
@ExcludeMissing
fun transferId(transferId: JsonField) = apply {
this.transferId = transferId
}
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(): AccountTransferIntention =
AccountTransferIntention(
amount,
currency,
description,
destinationAccountId,
sourceAccountId,
transferId,
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()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AccountTransferIntention && this.amount == other.amount && this.currency == other.currency && this.description == other.description && this.destinationAccountId == other.destinationAccountId && this.sourceAccountId == other.sourceAccountId && this.transferId == other.transferId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(amount, currency, description, destinationAccountId, sourceAccountId, transferId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AccountTransferIntention{amount=$amount, currency=$currency, description=$description, destinationAccountId=$destinationAccountId, sourceAccountId=$sourceAccountId, transferId=$transferId, additionalProperties=$additionalProperties}"
}
/**
* An ACH Transfer Intention object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_intention`.
*/
@JsonDeserialize(builder = AchTransferIntention.Builder::class)
@NoAutoDetect
class AchTransferIntention
private constructor(
private val accountNumber: JsonField,
private val amount: JsonField,
private val routingNumber: JsonField,
private val statementDescriptor: JsonField,
private val transferId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The account number for the destination account. */
fun accountNumber(): String = accountNumber.getRequired("account_number")
/**
* The amount in the minor unit of the transaction's currency. For dollars, for example,
* this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/**
* The American Bankers' Association (ABA) Routing Transit Number (RTN) for the
* destination account.
*/
fun routingNumber(): String = routingNumber.getRequired("routing_number")
/** A description set when the ACH Transfer was created. */
fun statementDescriptor(): String =
statementDescriptor.getRequired("statement_descriptor")
/** The identifier of the ACH Transfer that led to this Transaction. */
fun transferId(): String = transferId.getRequired("transfer_id")
/** The account number for the destination account. */
@JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber
/**
* The amount in the minor unit of the transaction's currency. For dollars, for example,
* this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* The American Bankers' Association (ABA) Routing Transit Number (RTN) for the
* destination account.
*/
@JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber
/** A description set when the ACH Transfer was created. */
@JsonProperty("statement_descriptor")
@ExcludeMissing
fun _statementDescriptor() = statementDescriptor
/** The identifier of the ACH Transfer that led to this Transaction. */
@JsonProperty("transfer_id") @ExcludeMissing fun _transferId() = transferId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AchTransferIntention = apply {
if (!validated) {
accountNumber()
amount()
routingNumber()
statementDescriptor()
transferId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var accountNumber: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var routingNumber: JsonField = JsonMissing.of()
private var statementDescriptor: JsonField = JsonMissing.of()
private var transferId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(achTransferIntention: AchTransferIntention) = apply {
this.accountNumber = achTransferIntention.accountNumber
this.amount = achTransferIntention.amount
this.routingNumber = achTransferIntention.routingNumber
this.statementDescriptor = achTransferIntention.statementDescriptor
this.transferId = achTransferIntention.transferId
additionalProperties(achTransferIntention.additionalProperties)
}
/** The account number for the destination account. */
fun accountNumber(accountNumber: String) =
accountNumber(JsonField.of(accountNumber))
/** The account number for the destination account. */
@JsonProperty("account_number")
@ExcludeMissing
fun accountNumber(accountNumber: JsonField) = apply {
this.accountNumber = accountNumber
}
/**
* The amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* The American Bankers' Association (ABA) Routing Transit Number (RTN) for the
* destination account.
*/
fun routingNumber(routingNumber: String) =
routingNumber(JsonField.of(routingNumber))
/**
* The American Bankers' Association (ABA) Routing Transit Number (RTN) for the
* destination account.
*/
@JsonProperty("routing_number")
@ExcludeMissing
fun routingNumber(routingNumber: JsonField) = apply {
this.routingNumber = routingNumber
}
/** A description set when the ACH Transfer was created. */
fun statementDescriptor(statementDescriptor: String) =
statementDescriptor(JsonField.of(statementDescriptor))
/** A description set when the ACH Transfer was created. */
@JsonProperty("statement_descriptor")
@ExcludeMissing
fun statementDescriptor(statementDescriptor: JsonField) = apply {
this.statementDescriptor = statementDescriptor
}
/** The identifier of the ACH Transfer that led to this Transaction. */
fun transferId(transferId: String) = transferId(JsonField.of(transferId))
/** The identifier of the ACH Transfer that led to this Transaction. */
@JsonProperty("transfer_id")
@ExcludeMissing
fun transferId(transferId: JsonField) = apply {
this.transferId = transferId
}
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(): AchTransferIntention =
AchTransferIntention(
accountNumber,
amount,
routingNumber,
statementDescriptor,
transferId,
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AchTransferIntention && this.accountNumber == other.accountNumber && this.amount == other.amount && this.routingNumber == other.routingNumber && this.statementDescriptor == other.statementDescriptor && this.transferId == other.transferId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(accountNumber, amount, routingNumber, statementDescriptor, transferId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AchTransferIntention{accountNumber=$accountNumber, amount=$amount, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, transferId=$transferId, additionalProperties=$additionalProperties}"
}
/**
* An ACH Transfer Rejection object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_rejection`.
*/
@JsonDeserialize(builder = AchTransferRejection.Builder::class)
@NoAutoDetect
class AchTransferRejection
private constructor(
private val transferId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The identifier of the ACH Transfer that led to this Transaction. */
fun transferId(): String = transferId.getRequired("transfer_id")
/** The identifier of the ACH Transfer that led to this Transaction. */
@JsonProperty("transfer_id") @ExcludeMissing fun _transferId() = transferId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AchTransferRejection = apply {
if (!validated) {
transferId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var transferId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(achTransferRejection: AchTransferRejection) = apply {
this.transferId = achTransferRejection.transferId
additionalProperties(achTransferRejection.additionalProperties)
}
/** The identifier of the ACH Transfer that led to this Transaction. */
fun transferId(transferId: String) = transferId(JsonField.of(transferId))
/** The identifier of the ACH Transfer that led to this Transaction. */
@JsonProperty("transfer_id")
@ExcludeMissing
fun transferId(transferId: JsonField) = apply {
this.transferId = transferId
}
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(): AchTransferRejection =
AchTransferRejection(transferId, additionalProperties.toImmutable())
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AchTransferRejection && this.transferId == other.transferId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(transferId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AchTransferRejection{transferId=$transferId, additionalProperties=$additionalProperties}"
}
/**
* An ACH Transfer Return object. This field will be present in the JSON response if and
* only if `category` is equal to `ach_transfer_return`.
*/
@JsonDeserialize(builder = AchTransferReturn.Builder::class)
@NoAutoDetect
class AchTransferReturn
private constructor(
private val createdAt: JsonField,
private val rawReturnReasonCode: JsonField,
private val returnReasonCode: JsonField,
private val traceNumber: JsonField,
private val transactionId: JsonField,
private val transferId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/** The three character ACH return code, in the range R01 to R85. */
fun rawReturnReasonCode(): String =
rawReturnReasonCode.getRequired("raw_return_reason_code")
/**
* Why the ACH Transfer was returned. This reason code is sent by the receiving bank
* back to Increase.
*/
fun returnReasonCode(): ReturnReasonCode =
returnReasonCode.getRequired("return_reason_code")
/**
* A 15 digit number that was generated by the bank that initiated the return. The trace
* number of the return is different than that of the original transfer. ACH trace
* numbers are not unique, but along with the amount and date this number can be used to
* identify the ACH return at the bank that initiated it.
*/
fun traceNumber(): String = traceNumber.getRequired("trace_number")
/** The identifier of the Transaction associated with this return. */
fun transactionId(): String = transactionId.getRequired("transaction_id")
/** The identifier of the ACH Transfer associated with this return. */
fun transferId(): String = transferId.getRequired("transfer_id")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/** The three character ACH return code, in the range R01 to R85. */
@JsonProperty("raw_return_reason_code")
@ExcludeMissing
fun _rawReturnReasonCode() = rawReturnReasonCode
/**
* Why the ACH Transfer was returned. This reason code is sent by the receiving bank
* back to Increase.
*/
@JsonProperty("return_reason_code")
@ExcludeMissing
fun _returnReasonCode() = returnReasonCode
/**
* A 15 digit number that was generated by the bank that initiated the return. The trace
* number of the return is different than that of the original transfer. ACH trace
* numbers are not unique, but along with the amount and date this number can be used to
* identify the ACH return at the bank that initiated it.
*/
@JsonProperty("trace_number") @ExcludeMissing fun _traceNumber() = traceNumber
/** The identifier of the Transaction associated with this return. */
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
/** The identifier of the ACH Transfer associated with this return. */
@JsonProperty("transfer_id") @ExcludeMissing fun _transferId() = transferId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AchTransferReturn = apply {
if (!validated) {
createdAt()
rawReturnReasonCode()
returnReasonCode()
traceNumber()
transactionId()
transferId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var createdAt: JsonField = JsonMissing.of()
private var rawReturnReasonCode: JsonField = JsonMissing.of()
private var returnReasonCode: JsonField = JsonMissing.of()
private var traceNumber: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var transferId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(achTransferReturn: AchTransferReturn) = apply {
this.createdAt = achTransferReturn.createdAt
this.rawReturnReasonCode = achTransferReturn.rawReturnReasonCode
this.returnReasonCode = achTransferReturn.returnReasonCode
this.traceNumber = achTransferReturn.traceNumber
this.transactionId = achTransferReturn.transactionId
this.transferId = achTransferReturn.transferId
additionalProperties(achTransferReturn.additionalProperties)
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply {
this.createdAt = createdAt
}
/** The three character ACH return code, in the range R01 to R85. */
fun rawReturnReasonCode(rawReturnReasonCode: String) =
rawReturnReasonCode(JsonField.of(rawReturnReasonCode))
/** The three character ACH return code, in the range R01 to R85. */
@JsonProperty("raw_return_reason_code")
@ExcludeMissing
fun rawReturnReasonCode(rawReturnReasonCode: JsonField) = apply {
this.rawReturnReasonCode = rawReturnReasonCode
}
/**
* Why the ACH Transfer was returned. This reason code is sent by the receiving bank
* back to Increase.
*/
fun returnReasonCode(returnReasonCode: ReturnReasonCode) =
returnReasonCode(JsonField.of(returnReasonCode))
/**
* Why the ACH Transfer was returned. This reason code is sent by the receiving bank
* back to Increase.
*/
@JsonProperty("return_reason_code")
@ExcludeMissing
fun returnReasonCode(returnReasonCode: JsonField) = apply {
this.returnReasonCode = returnReasonCode
}
/**
* A 15 digit number that was generated by the bank that initiated the return. The
* trace number of the return is different than that of the original transfer. ACH
* trace numbers are not unique, but along with the amount and date this number can
* be used to identify the ACH return at the bank that initiated it.
*/
fun traceNumber(traceNumber: String) = traceNumber(JsonField.of(traceNumber))
/**
* A 15 digit number that was generated by the bank that initiated the return. The
* trace number of the return is different than that of the original transfer. ACH
* trace numbers are not unique, but along with the amount and date this number can
* be used to identify the ACH return at the bank that initiated it.
*/
@JsonProperty("trace_number")
@ExcludeMissing
fun traceNumber(traceNumber: JsonField) = apply {
this.traceNumber = traceNumber
}
/** The identifier of the Transaction associated with this return. */
fun transactionId(transactionId: String) =
transactionId(JsonField.of(transactionId))
/** The identifier of the Transaction associated with this return. */
@JsonProperty("transaction_id")
@ExcludeMissing
fun transactionId(transactionId: JsonField) = apply {
this.transactionId = transactionId
}
/** The identifier of the ACH Transfer associated with this return. */
fun transferId(transferId: String) = transferId(JsonField.of(transferId))
/** The identifier of the ACH Transfer associated with this return. */
@JsonProperty("transfer_id")
@ExcludeMissing
fun transferId(transferId: JsonField) = apply {
this.transferId = transferId
}
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(): AchTransferReturn =
AchTransferReturn(
createdAt,
rawReturnReasonCode,
returnReasonCode,
traceNumber,
transactionId,
transferId,
additionalProperties.toImmutable(),
)
}
class ReturnReasonCode
@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 ReturnReasonCode && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val INSUFFICIENT_FUND = ReturnReasonCode(JsonField.of("insufficient_fund"))
val NO_ACCOUNT = ReturnReasonCode(JsonField.of("no_account"))
val ACCOUNT_CLOSED = ReturnReasonCode(JsonField.of("account_closed"))
val INVALID_ACCOUNT_NUMBER_STRUCTURE =
ReturnReasonCode(JsonField.of("invalid_account_number_structure"))
val ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION =
ReturnReasonCode(
JsonField.of("account_frozen_entry_returned_per_ofac_instruction")
)
val CREDIT_ENTRY_REFUSED_BY_RECEIVER =
ReturnReasonCode(JsonField.of("credit_entry_refused_by_receiver"))
val UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE =
ReturnReasonCode(
JsonField.of(
"unauthorized_debit_to_consumer_account_using_corporate_sec_code"
)
)
val CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED =
ReturnReasonCode(JsonField.of("corporate_customer_advised_not_authorized"))
val PAYMENT_STOPPED = ReturnReasonCode(JsonField.of("payment_stopped"))
val NON_TRANSACTION_ACCOUNT =
ReturnReasonCode(JsonField.of("non_transaction_account"))
val UNCOLLECTED_FUNDS = ReturnReasonCode(JsonField.of("uncollected_funds"))
val ROUTING_NUMBER_CHECK_DIGIT_ERROR =
ReturnReasonCode(JsonField.of("routing_number_check_digit_error"))
val CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE =
ReturnReasonCode(
JsonField.of(
"customer_advised_unauthorized_improper_ineligible_or_incomplete"
)
)
val AMOUNT_FIELD_ERROR = ReturnReasonCode(JsonField.of("amount_field_error"))
val AUTHORIZATION_REVOKED_BY_CUSTOMER =
ReturnReasonCode(JsonField.of("authorization_revoked_by_customer"))
val INVALID_ACH_ROUTING_NUMBER =
ReturnReasonCode(JsonField.of("invalid_ach_routing_number"))
val FILE_RECORD_EDIT_CRITERIA =
ReturnReasonCode(JsonField.of("file_record_edit_criteria"))
val ENR_INVALID_INDIVIDUAL_NAME =
ReturnReasonCode(JsonField.of("enr_invalid_individual_name"))
val RETURNED_PER_ODFI_REQUEST =
ReturnReasonCode(JsonField.of("returned_per_odfi_request"))
val LIMITED_PARTICIPATION_DFI =
ReturnReasonCode(JsonField.of("limited_participation_dfi"))
val INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT =
ReturnReasonCode(
JsonField.of("incorrectly_coded_outbound_international_payment")
)
val ACCOUNT_SOLD_TO_ANOTHER_DFI =
ReturnReasonCode(JsonField.of("account_sold_to_another_dfi"))
val ADDENDA_ERROR = ReturnReasonCode(JsonField.of("addenda_error"))
val BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED =
ReturnReasonCode(JsonField.of("beneficiary_or_account_holder_deceased"))
val CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS =
ReturnReasonCode(
JsonField.of("customer_advised_not_within_authorization_terms")
)
val CORRECTED_RETURN = ReturnReasonCode(JsonField.of("corrected_return"))
val DUPLICATE_ENTRY = ReturnReasonCode(JsonField.of("duplicate_entry"))
val DUPLICATE_RETURN = ReturnReasonCode(JsonField.of("duplicate_return"))
val ENR_DUPLICATE_ENROLLMENT =
ReturnReasonCode(JsonField.of("enr_duplicate_enrollment"))
val ENR_INVALID_DFI_ACCOUNT_NUMBER =
ReturnReasonCode(JsonField.of("enr_invalid_dfi_account_number"))
val ENR_INVALID_INDIVIDUAL_ID_NUMBER =
ReturnReasonCode(JsonField.of("enr_invalid_individual_id_number"))
val ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR =
ReturnReasonCode(JsonField.of("enr_invalid_representative_payee_indicator"))
val ENR_INVALID_TRANSACTION_CODE =
ReturnReasonCode(JsonField.of("enr_invalid_transaction_code"))
val ENR_RETURN_OF_ENR_ENTRY =
ReturnReasonCode(JsonField.of("enr_return_of_enr_entry"))
val ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR =
ReturnReasonCode(JsonField.of("enr_routing_number_check_digit_error"))
val ENTRY_NOT_PROCESSED_BY_GATEWAY =
ReturnReasonCode(JsonField.of("entry_not_processed_by_gateway"))
val FIELD_ERROR = ReturnReasonCode(JsonField.of("field_error"))
val FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE =
ReturnReasonCode(JsonField.of("foreign_receiving_dfi_unable_to_settle"))
val IAT_ENTRY_CODING_ERROR =
ReturnReasonCode(JsonField.of("iat_entry_coding_error"))
val IMPROPER_EFFECTIVE_ENTRY_DATE =
ReturnReasonCode(JsonField.of("improper_effective_entry_date"))
val IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED =
ReturnReasonCode(
JsonField.of("improper_source_document_source_document_presented")
)
val INVALID_COMPANY_ID = ReturnReasonCode(JsonField.of("invalid_company_id"))
val INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION =
ReturnReasonCode(
JsonField.of("invalid_foreign_receiving_dfi_identification")
)
val INVALID_INDIVIDUAL_ID_NUMBER =
ReturnReasonCode(JsonField.of("invalid_individual_id_number"))
val ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT =
ReturnReasonCode(JsonField.of("item_and_rck_entry_presented_for_payment"))
val ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE =
ReturnReasonCode(JsonField.of("item_related_to_rck_entry_is_ineligible"))
val MANDATORY_FIELD_ERROR =
ReturnReasonCode(JsonField.of("mandatory_field_error"))
val MISROUTED_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("misrouted_dishonored_return"))
val MISROUTED_RETURN = ReturnReasonCode(JsonField.of("misrouted_return"))
val NO_ERRORS_FOUND = ReturnReasonCode(JsonField.of("no_errors_found"))
val NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("non_acceptance_of_r62_dishonored_return"))
val NON_PARTICIPANT_IN_IAT_PROGRAM =
ReturnReasonCode(JsonField.of("non_participant_in_iat_program"))
val PERMISSIBLE_RETURN_ENTRY =
ReturnReasonCode(JsonField.of("permissible_return_entry"))
val PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED =
ReturnReasonCode(JsonField.of("permissible_return_entry_not_accepted"))
val RDFI_NON_SETTLEMENT = ReturnReasonCode(JsonField.of("rdfi_non_settlement"))
val RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM =
ReturnReasonCode(
JsonField.of("rdfi_participant_in_check_truncation_program")
)
val REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY =
ReturnReasonCode(
JsonField.of(
"representative_payee_deceased_or_unable_to_continue_in_that_capacity"
)
)
val RETURN_NOT_A_DUPLICATE =
ReturnReasonCode(JsonField.of("return_not_a_duplicate"))
val RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT =
ReturnReasonCode(JsonField.of("return_of_erroneous_or_reversing_debit"))
val RETURN_OF_IMPROPER_CREDIT_ENTRY =
ReturnReasonCode(JsonField.of("return_of_improper_credit_entry"))
val RETURN_OF_IMPROPER_DEBIT_ENTRY =
ReturnReasonCode(JsonField.of("return_of_improper_debit_entry"))
val RETURN_OF_XCK_ENTRY = ReturnReasonCode(JsonField.of("return_of_xck_entry"))
val SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT =
ReturnReasonCode(JsonField.of("source_document_presented_for_payment"))
val STATE_LAW_AFFECTING_RCK_ACCEPTANCE =
ReturnReasonCode(JsonField.of("state_law_affecting_rck_acceptance"))
val STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY =
ReturnReasonCode(JsonField.of("stop_payment_on_item_related_to_rck_entry"))
val STOP_PAYMENT_ON_SOURCE_DOCUMENT =
ReturnReasonCode(JsonField.of("stop_payment_on_source_document"))
val TIMELY_ORIGINAL_RETURN =
ReturnReasonCode(JsonField.of("timely_original_return"))
val TRACE_NUMBER_ERROR = ReturnReasonCode(JsonField.of("trace_number_error"))
val UNTIMELY_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("untimely_dishonored_return"))
val UNTIMELY_RETURN = ReturnReasonCode(JsonField.of("untimely_return"))
fun of(value: String) = ReturnReasonCode(JsonField.of(value))
}
enum class Known {
INSUFFICIENT_FUND,
NO_ACCOUNT,
ACCOUNT_CLOSED,
INVALID_ACCOUNT_NUMBER_STRUCTURE,
ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION,
CREDIT_ENTRY_REFUSED_BY_RECEIVER,
UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE,
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED,
PAYMENT_STOPPED,
NON_TRANSACTION_ACCOUNT,
UNCOLLECTED_FUNDS,
ROUTING_NUMBER_CHECK_DIGIT_ERROR,
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE,
AMOUNT_FIELD_ERROR,
AUTHORIZATION_REVOKED_BY_CUSTOMER,
INVALID_ACH_ROUTING_NUMBER,
FILE_RECORD_EDIT_CRITERIA,
ENR_INVALID_INDIVIDUAL_NAME,
RETURNED_PER_ODFI_REQUEST,
LIMITED_PARTICIPATION_DFI,
INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT,
ACCOUNT_SOLD_TO_ANOTHER_DFI,
ADDENDA_ERROR,
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED,
CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS,
CORRECTED_RETURN,
DUPLICATE_ENTRY,
DUPLICATE_RETURN,
ENR_DUPLICATE_ENROLLMENT,
ENR_INVALID_DFI_ACCOUNT_NUMBER,
ENR_INVALID_INDIVIDUAL_ID_NUMBER,
ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR,
ENR_INVALID_TRANSACTION_CODE,
ENR_RETURN_OF_ENR_ENTRY,
ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR,
ENTRY_NOT_PROCESSED_BY_GATEWAY,
FIELD_ERROR,
FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE,
IAT_ENTRY_CODING_ERROR,
IMPROPER_EFFECTIVE_ENTRY_DATE,
IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED,
INVALID_COMPANY_ID,
INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION,
INVALID_INDIVIDUAL_ID_NUMBER,
ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT,
ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE,
MANDATORY_FIELD_ERROR,
MISROUTED_DISHONORED_RETURN,
MISROUTED_RETURN,
NO_ERRORS_FOUND,
NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN,
NON_PARTICIPANT_IN_IAT_PROGRAM,
PERMISSIBLE_RETURN_ENTRY,
PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED,
RDFI_NON_SETTLEMENT,
RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM,
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY,
RETURN_NOT_A_DUPLICATE,
RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT,
RETURN_OF_IMPROPER_CREDIT_ENTRY,
RETURN_OF_IMPROPER_DEBIT_ENTRY,
RETURN_OF_XCK_ENTRY,
SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT,
STATE_LAW_AFFECTING_RCK_ACCEPTANCE,
STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY,
STOP_PAYMENT_ON_SOURCE_DOCUMENT,
TIMELY_ORIGINAL_RETURN,
TRACE_NUMBER_ERROR,
UNTIMELY_DISHONORED_RETURN,
UNTIMELY_RETURN,
}
enum class Value {
INSUFFICIENT_FUND,
NO_ACCOUNT,
ACCOUNT_CLOSED,
INVALID_ACCOUNT_NUMBER_STRUCTURE,
ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION,
CREDIT_ENTRY_REFUSED_BY_RECEIVER,
UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE,
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED,
PAYMENT_STOPPED,
NON_TRANSACTION_ACCOUNT,
UNCOLLECTED_FUNDS,
ROUTING_NUMBER_CHECK_DIGIT_ERROR,
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE,
AMOUNT_FIELD_ERROR,
AUTHORIZATION_REVOKED_BY_CUSTOMER,
INVALID_ACH_ROUTING_NUMBER,
FILE_RECORD_EDIT_CRITERIA,
ENR_INVALID_INDIVIDUAL_NAME,
RETURNED_PER_ODFI_REQUEST,
LIMITED_PARTICIPATION_DFI,
INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT,
ACCOUNT_SOLD_TO_ANOTHER_DFI,
ADDENDA_ERROR,
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED,
CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS,
CORRECTED_RETURN,
DUPLICATE_ENTRY,
DUPLICATE_RETURN,
ENR_DUPLICATE_ENROLLMENT,
ENR_INVALID_DFI_ACCOUNT_NUMBER,
ENR_INVALID_INDIVIDUAL_ID_NUMBER,
ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR,
ENR_INVALID_TRANSACTION_CODE,
ENR_RETURN_OF_ENR_ENTRY,
ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR,
ENTRY_NOT_PROCESSED_BY_GATEWAY,
FIELD_ERROR,
FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE,
IAT_ENTRY_CODING_ERROR,
IMPROPER_EFFECTIVE_ENTRY_DATE,
IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED,
INVALID_COMPANY_ID,
INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION,
INVALID_INDIVIDUAL_ID_NUMBER,
ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT,
ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE,
MANDATORY_FIELD_ERROR,
MISROUTED_DISHONORED_RETURN,
MISROUTED_RETURN,
NO_ERRORS_FOUND,
NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN,
NON_PARTICIPANT_IN_IAT_PROGRAM,
PERMISSIBLE_RETURN_ENTRY,
PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED,
RDFI_NON_SETTLEMENT,
RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM,
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY,
RETURN_NOT_A_DUPLICATE,
RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT,
RETURN_OF_IMPROPER_CREDIT_ENTRY,
RETURN_OF_IMPROPER_DEBIT_ENTRY,
RETURN_OF_XCK_ENTRY,
SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT,
STATE_LAW_AFFECTING_RCK_ACCEPTANCE,
STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY,
STOP_PAYMENT_ON_SOURCE_DOCUMENT,
TIMELY_ORIGINAL_RETURN,
TRACE_NUMBER_ERROR,
UNTIMELY_DISHONORED_RETURN,
UNTIMELY_RETURN,
_UNKNOWN,
}
fun value(): Value =
when (this) {
INSUFFICIENT_FUND -> Value.INSUFFICIENT_FUND
NO_ACCOUNT -> Value.NO_ACCOUNT
ACCOUNT_CLOSED -> Value.ACCOUNT_CLOSED
INVALID_ACCOUNT_NUMBER_STRUCTURE -> Value.INVALID_ACCOUNT_NUMBER_STRUCTURE
ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION ->
Value.ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION
CREDIT_ENTRY_REFUSED_BY_RECEIVER -> Value.CREDIT_ENTRY_REFUSED_BY_RECEIVER
UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE ->
Value.UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED ->
Value.CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED
PAYMENT_STOPPED -> Value.PAYMENT_STOPPED
NON_TRANSACTION_ACCOUNT -> Value.NON_TRANSACTION_ACCOUNT
UNCOLLECTED_FUNDS -> Value.UNCOLLECTED_FUNDS
ROUTING_NUMBER_CHECK_DIGIT_ERROR -> Value.ROUTING_NUMBER_CHECK_DIGIT_ERROR
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE ->
Value.CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE
AMOUNT_FIELD_ERROR -> Value.AMOUNT_FIELD_ERROR
AUTHORIZATION_REVOKED_BY_CUSTOMER -> Value.AUTHORIZATION_REVOKED_BY_CUSTOMER
INVALID_ACH_ROUTING_NUMBER -> Value.INVALID_ACH_ROUTING_NUMBER
FILE_RECORD_EDIT_CRITERIA -> Value.FILE_RECORD_EDIT_CRITERIA
ENR_INVALID_INDIVIDUAL_NAME -> Value.ENR_INVALID_INDIVIDUAL_NAME
RETURNED_PER_ODFI_REQUEST -> Value.RETURNED_PER_ODFI_REQUEST
LIMITED_PARTICIPATION_DFI -> Value.LIMITED_PARTICIPATION_DFI
INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT ->
Value.INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT
ACCOUNT_SOLD_TO_ANOTHER_DFI -> Value.ACCOUNT_SOLD_TO_ANOTHER_DFI
ADDENDA_ERROR -> Value.ADDENDA_ERROR
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED ->
Value.BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED
CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS ->
Value.CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS
CORRECTED_RETURN -> Value.CORRECTED_RETURN
DUPLICATE_ENTRY -> Value.DUPLICATE_ENTRY
DUPLICATE_RETURN -> Value.DUPLICATE_RETURN
ENR_DUPLICATE_ENROLLMENT -> Value.ENR_DUPLICATE_ENROLLMENT
ENR_INVALID_DFI_ACCOUNT_NUMBER -> Value.ENR_INVALID_DFI_ACCOUNT_NUMBER
ENR_INVALID_INDIVIDUAL_ID_NUMBER -> Value.ENR_INVALID_INDIVIDUAL_ID_NUMBER
ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR ->
Value.ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR
ENR_INVALID_TRANSACTION_CODE -> Value.ENR_INVALID_TRANSACTION_CODE
ENR_RETURN_OF_ENR_ENTRY -> Value.ENR_RETURN_OF_ENR_ENTRY
ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR ->
Value.ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR
ENTRY_NOT_PROCESSED_BY_GATEWAY -> Value.ENTRY_NOT_PROCESSED_BY_GATEWAY
FIELD_ERROR -> Value.FIELD_ERROR
FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE ->
Value.FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE
IAT_ENTRY_CODING_ERROR -> Value.IAT_ENTRY_CODING_ERROR
IMPROPER_EFFECTIVE_ENTRY_DATE -> Value.IMPROPER_EFFECTIVE_ENTRY_DATE
IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED ->
Value.IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED
INVALID_COMPANY_ID -> Value.INVALID_COMPANY_ID
INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION ->
Value.INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION
INVALID_INDIVIDUAL_ID_NUMBER -> Value.INVALID_INDIVIDUAL_ID_NUMBER
ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT ->
Value.ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT
ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE ->
Value.ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE
MANDATORY_FIELD_ERROR -> Value.MANDATORY_FIELD_ERROR
MISROUTED_DISHONORED_RETURN -> Value.MISROUTED_DISHONORED_RETURN
MISROUTED_RETURN -> Value.MISROUTED_RETURN
NO_ERRORS_FOUND -> Value.NO_ERRORS_FOUND
NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN ->
Value.NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN
NON_PARTICIPANT_IN_IAT_PROGRAM -> Value.NON_PARTICIPANT_IN_IAT_PROGRAM
PERMISSIBLE_RETURN_ENTRY -> Value.PERMISSIBLE_RETURN_ENTRY
PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED ->
Value.PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED
RDFI_NON_SETTLEMENT -> Value.RDFI_NON_SETTLEMENT
RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM ->
Value.RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY ->
Value
.REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY
RETURN_NOT_A_DUPLICATE -> Value.RETURN_NOT_A_DUPLICATE
RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT ->
Value.RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT
RETURN_OF_IMPROPER_CREDIT_ENTRY -> Value.RETURN_OF_IMPROPER_CREDIT_ENTRY
RETURN_OF_IMPROPER_DEBIT_ENTRY -> Value.RETURN_OF_IMPROPER_DEBIT_ENTRY
RETURN_OF_XCK_ENTRY -> Value.RETURN_OF_XCK_ENTRY
SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT ->
Value.SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT
STATE_LAW_AFFECTING_RCK_ACCEPTANCE ->
Value.STATE_LAW_AFFECTING_RCK_ACCEPTANCE
STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY ->
Value.STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY
STOP_PAYMENT_ON_SOURCE_DOCUMENT -> Value.STOP_PAYMENT_ON_SOURCE_DOCUMENT
TIMELY_ORIGINAL_RETURN -> Value.TIMELY_ORIGINAL_RETURN
TRACE_NUMBER_ERROR -> Value.TRACE_NUMBER_ERROR
UNTIMELY_DISHONORED_RETURN -> Value.UNTIMELY_DISHONORED_RETURN
UNTIMELY_RETURN -> Value.UNTIMELY_RETURN
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
INSUFFICIENT_FUND -> Known.INSUFFICIENT_FUND
NO_ACCOUNT -> Known.NO_ACCOUNT
ACCOUNT_CLOSED -> Known.ACCOUNT_CLOSED
INVALID_ACCOUNT_NUMBER_STRUCTURE -> Known.INVALID_ACCOUNT_NUMBER_STRUCTURE
ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION ->
Known.ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION
CREDIT_ENTRY_REFUSED_BY_RECEIVER -> Known.CREDIT_ENTRY_REFUSED_BY_RECEIVER
UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE ->
Known.UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE
CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED ->
Known.CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED
PAYMENT_STOPPED -> Known.PAYMENT_STOPPED
NON_TRANSACTION_ACCOUNT -> Known.NON_TRANSACTION_ACCOUNT
UNCOLLECTED_FUNDS -> Known.UNCOLLECTED_FUNDS
ROUTING_NUMBER_CHECK_DIGIT_ERROR -> Known.ROUTING_NUMBER_CHECK_DIGIT_ERROR
CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE ->
Known.CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE
AMOUNT_FIELD_ERROR -> Known.AMOUNT_FIELD_ERROR
AUTHORIZATION_REVOKED_BY_CUSTOMER -> Known.AUTHORIZATION_REVOKED_BY_CUSTOMER
INVALID_ACH_ROUTING_NUMBER -> Known.INVALID_ACH_ROUTING_NUMBER
FILE_RECORD_EDIT_CRITERIA -> Known.FILE_RECORD_EDIT_CRITERIA
ENR_INVALID_INDIVIDUAL_NAME -> Known.ENR_INVALID_INDIVIDUAL_NAME
RETURNED_PER_ODFI_REQUEST -> Known.RETURNED_PER_ODFI_REQUEST
LIMITED_PARTICIPATION_DFI -> Known.LIMITED_PARTICIPATION_DFI
INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT ->
Known.INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT
ACCOUNT_SOLD_TO_ANOTHER_DFI -> Known.ACCOUNT_SOLD_TO_ANOTHER_DFI
ADDENDA_ERROR -> Known.ADDENDA_ERROR
BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED ->
Known.BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED
CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS ->
Known.CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS
CORRECTED_RETURN -> Known.CORRECTED_RETURN
DUPLICATE_ENTRY -> Known.DUPLICATE_ENTRY
DUPLICATE_RETURN -> Known.DUPLICATE_RETURN
ENR_DUPLICATE_ENROLLMENT -> Known.ENR_DUPLICATE_ENROLLMENT
ENR_INVALID_DFI_ACCOUNT_NUMBER -> Known.ENR_INVALID_DFI_ACCOUNT_NUMBER
ENR_INVALID_INDIVIDUAL_ID_NUMBER -> Known.ENR_INVALID_INDIVIDUAL_ID_NUMBER
ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR ->
Known.ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR
ENR_INVALID_TRANSACTION_CODE -> Known.ENR_INVALID_TRANSACTION_CODE
ENR_RETURN_OF_ENR_ENTRY -> Known.ENR_RETURN_OF_ENR_ENTRY
ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR ->
Known.ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR
ENTRY_NOT_PROCESSED_BY_GATEWAY -> Known.ENTRY_NOT_PROCESSED_BY_GATEWAY
FIELD_ERROR -> Known.FIELD_ERROR
FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE ->
Known.FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE
IAT_ENTRY_CODING_ERROR -> Known.IAT_ENTRY_CODING_ERROR
IMPROPER_EFFECTIVE_ENTRY_DATE -> Known.IMPROPER_EFFECTIVE_ENTRY_DATE
IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED ->
Known.IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED
INVALID_COMPANY_ID -> Known.INVALID_COMPANY_ID
INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION ->
Known.INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION
INVALID_INDIVIDUAL_ID_NUMBER -> Known.INVALID_INDIVIDUAL_ID_NUMBER
ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT ->
Known.ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT
ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE ->
Known.ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE
MANDATORY_FIELD_ERROR -> Known.MANDATORY_FIELD_ERROR
MISROUTED_DISHONORED_RETURN -> Known.MISROUTED_DISHONORED_RETURN
MISROUTED_RETURN -> Known.MISROUTED_RETURN
NO_ERRORS_FOUND -> Known.NO_ERRORS_FOUND
NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN ->
Known.NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN
NON_PARTICIPANT_IN_IAT_PROGRAM -> Known.NON_PARTICIPANT_IN_IAT_PROGRAM
PERMISSIBLE_RETURN_ENTRY -> Known.PERMISSIBLE_RETURN_ENTRY
PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED ->
Known.PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED
RDFI_NON_SETTLEMENT -> Known.RDFI_NON_SETTLEMENT
RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM ->
Known.RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM
REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY ->
Known
.REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY
RETURN_NOT_A_DUPLICATE -> Known.RETURN_NOT_A_DUPLICATE
RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT ->
Known.RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT
RETURN_OF_IMPROPER_CREDIT_ENTRY -> Known.RETURN_OF_IMPROPER_CREDIT_ENTRY
RETURN_OF_IMPROPER_DEBIT_ENTRY -> Known.RETURN_OF_IMPROPER_DEBIT_ENTRY
RETURN_OF_XCK_ENTRY -> Known.RETURN_OF_XCK_ENTRY
SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT ->
Known.SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT
STATE_LAW_AFFECTING_RCK_ACCEPTANCE ->
Known.STATE_LAW_AFFECTING_RCK_ACCEPTANCE
STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY ->
Known.STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY
STOP_PAYMENT_ON_SOURCE_DOCUMENT -> Known.STOP_PAYMENT_ON_SOURCE_DOCUMENT
TIMELY_ORIGINAL_RETURN -> Known.TIMELY_ORIGINAL_RETURN
TRACE_NUMBER_ERROR -> Known.TRACE_NUMBER_ERROR
UNTIMELY_DISHONORED_RETURN -> Known.UNTIMELY_DISHONORED_RETURN
UNTIMELY_RETURN -> Known.UNTIMELY_RETURN
else ->
throw IncreaseInvalidDataException("Unknown ReturnReasonCode: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AchTransferReturn && this.createdAt == other.createdAt && this.rawReturnReasonCode == other.rawReturnReasonCode && this.returnReasonCode == other.returnReasonCode && this.traceNumber == other.traceNumber && this.transactionId == other.transactionId && this.transferId == other.transferId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(createdAt, rawReturnReasonCode, returnReasonCode, traceNumber, transactionId, transferId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AchTransferReturn{createdAt=$createdAt, rawReturnReasonCode=$rawReturnReasonCode, returnReasonCode=$returnReasonCode, traceNumber=$traceNumber, transactionId=$transactionId, transferId=$transferId, additionalProperties=$additionalProperties}"
}
/**
* A Card Dispute Acceptance object. This field will be present in the JSON response if and
* only if `category` is equal to `card_dispute_acceptance`.
*/
@JsonDeserialize(builder = CardDisputeAcceptance.Builder::class)
@NoAutoDetect
class CardDisputeAcceptance
private constructor(
private val acceptedAt: JsonField,
private val cardDisputeId: JsonField,
private val transactionId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was accepted.
*/
fun acceptedAt(): OffsetDateTime = acceptedAt.getRequired("accepted_at")
/** The identifier of the Card Dispute that was accepted. */
fun cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
/**
* The identifier of the Transaction that was created to return the disputed funds to
* your account.
*/
fun transactionId(): String = transactionId.getRequired("transaction_id")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was accepted.
*/
@JsonProperty("accepted_at") @ExcludeMissing fun _acceptedAt() = acceptedAt
/** The identifier of the Card Dispute that was accepted. */
@JsonProperty("card_dispute_id") @ExcludeMissing fun _cardDisputeId() = cardDisputeId
/**
* The identifier of the Transaction that was created to return the disputed funds to
* your account.
*/
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardDisputeAcceptance = apply {
if (!validated) {
acceptedAt()
cardDisputeId()
transactionId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var acceptedAt: JsonField = JsonMissing.of()
private var cardDisputeId: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardDisputeAcceptance: CardDisputeAcceptance) = apply {
this.acceptedAt = cardDisputeAcceptance.acceptedAt
this.cardDisputeId = cardDisputeAcceptance.cardDisputeId
this.transactionId = cardDisputeAcceptance.transactionId
additionalProperties(cardDisputeAcceptance.additionalProperties)
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was accepted.
*/
fun acceptedAt(acceptedAt: OffsetDateTime) = acceptedAt(JsonField.of(acceptedAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was accepted.
*/
@JsonProperty("accepted_at")
@ExcludeMissing
fun acceptedAt(acceptedAt: JsonField) = apply {
this.acceptedAt = acceptedAt
}
/** The identifier of the Card Dispute that was accepted. */
fun cardDisputeId(cardDisputeId: String) =
cardDisputeId(JsonField.of(cardDisputeId))
/** The identifier of the Card Dispute that was accepted. */
@JsonProperty("card_dispute_id")
@ExcludeMissing
fun cardDisputeId(cardDisputeId: JsonField) = apply {
this.cardDisputeId = cardDisputeId
}
/**
* The identifier of the Transaction that was created to return the disputed funds
* to your account.
*/
fun transactionId(transactionId: String) =
transactionId(JsonField.of(transactionId))
/**
* The identifier of the Transaction that was created to return the disputed funds
* to your account.
*/
@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(): CardDisputeAcceptance =
CardDisputeAcceptance(
acceptedAt,
cardDisputeId,
transactionId,
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is CardDisputeAcceptance && this.acceptedAt == other.acceptedAt && this.cardDisputeId == other.cardDisputeId && 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(acceptedAt, cardDisputeId, transactionId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"CardDisputeAcceptance{acceptedAt=$acceptedAt, cardDisputeId=$cardDisputeId, transactionId=$transactionId, additionalProperties=$additionalProperties}"
}
/**
* A Card Dispute Loss object. This field will be present in the JSON response if and only
* if `category` is equal to `card_dispute_loss`.
*/
@JsonDeserialize(builder = CardDisputeLoss.Builder::class)
@NoAutoDetect
class CardDisputeLoss
private constructor(
private val cardDisputeId: JsonField,
private val explanation: JsonField,
private val lostAt: JsonField,
private val transactionId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The identifier of the Card Dispute that was lost. */
fun cardDisputeId(): String = cardDisputeId.getRequired("card_dispute_id")
/** Why the Card Dispute was lost. */
fun explanation(): String = explanation.getRequired("explanation")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was lost.
*/
fun lostAt(): OffsetDateTime = lostAt.getRequired("lost_at")
/**
* The identifier of the Transaction that was created to debit the disputed funds from
* your account.
*/
fun transactionId(): String = transactionId.getRequired("transaction_id")
/** The identifier of the Card Dispute that was lost. */
@JsonProperty("card_dispute_id") @ExcludeMissing fun _cardDisputeId() = cardDisputeId
/** Why the Card Dispute was lost. */
@JsonProperty("explanation") @ExcludeMissing fun _explanation() = explanation
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was lost.
*/
@JsonProperty("lost_at") @ExcludeMissing fun _lostAt() = lostAt
/**
* The identifier of the Transaction that was created to debit the disputed funds from
* your account.
*/
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardDisputeLoss = apply {
if (!validated) {
cardDisputeId()
explanation()
lostAt()
transactionId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var cardDisputeId: JsonField = JsonMissing.of()
private var explanation: JsonField = JsonMissing.of()
private var lostAt: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardDisputeLoss: CardDisputeLoss) = apply {
this.cardDisputeId = cardDisputeLoss.cardDisputeId
this.explanation = cardDisputeLoss.explanation
this.lostAt = cardDisputeLoss.lostAt
this.transactionId = cardDisputeLoss.transactionId
additionalProperties(cardDisputeLoss.additionalProperties)
}
/** The identifier of the Card Dispute that was lost. */
fun cardDisputeId(cardDisputeId: String) =
cardDisputeId(JsonField.of(cardDisputeId))
/** The identifier of the Card Dispute that was lost. */
@JsonProperty("card_dispute_id")
@ExcludeMissing
fun cardDisputeId(cardDisputeId: JsonField) = apply {
this.cardDisputeId = cardDisputeId
}
/** Why the Card Dispute was lost. */
fun explanation(explanation: String) = explanation(JsonField.of(explanation))
/** Why the Card Dispute was lost. */
@JsonProperty("explanation")
@ExcludeMissing
fun explanation(explanation: JsonField) = apply {
this.explanation = explanation
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was lost.
*/
fun lostAt(lostAt: OffsetDateTime) = lostAt(JsonField.of(lostAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Card Dispute was lost.
*/
@JsonProperty("lost_at")
@ExcludeMissing
fun lostAt(lostAt: JsonField) = apply { this.lostAt = lostAt }
/**
* The identifier of the Transaction that was created to debit the disputed funds
* from your account.
*/
fun transactionId(transactionId: String) =
transactionId(JsonField.of(transactionId))
/**
* The identifier of the Transaction that was created to debit the disputed funds
* from your account.
*/
@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(): CardDisputeLoss =
CardDisputeLoss(
cardDisputeId,
explanation,
lostAt,
transactionId,
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is CardDisputeLoss && this.cardDisputeId == other.cardDisputeId && this.explanation == other.explanation && this.lostAt == other.lostAt && 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(cardDisputeId, explanation, lostAt, transactionId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"CardDisputeLoss{cardDisputeId=$cardDisputeId, explanation=$explanation, lostAt=$lostAt, transactionId=$transactionId, additionalProperties=$additionalProperties}"
}
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonDeserialize(builder = CardRefund.Builder::class)
@NoAutoDetect
class CardRefund
private constructor(
private val amount: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
private val id: JsonField,
private val interchange: JsonField,
private val merchantAcceptorId: JsonField,
private val merchantCategoryCode: JsonField,
private val merchantCity: JsonField,
private val merchantCountry: JsonField,
private val merchantName: JsonField,
private val merchantPostalCode: JsonField,
private val merchantState: JsonField,
private val networkIdentifiers: JsonField,
private val presentmentAmount: JsonField,
private val presentmentCurrency: JsonField,
private val purchaseDetails: JsonField,
private val transactionId: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* The amount in the minor unit of the transaction's settlement currency. For dollars,
* for example, this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/** The ID of the Card Payment this transaction belongs to. */
fun cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* settlement currency.
*/
fun currency(): Currency = currency.getRequired("currency")
/** The Card Refund identifier. */
fun id(): String = id.getRequired("id")
/** Interchange assessed as a part of this transaciton. */
fun interchange(): Interchange? = interchange.getNullable("interchange")
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
fun merchantAcceptorId(): String =
merchantAcceptorId.getRequired("merchant_acceptor_id")
/** The 4-digit MCC describing the merchant's business. */
fun merchantCategoryCode(): String =
merchantCategoryCode.getRequired("merchant_category_code")
/** The city the merchant resides in. */
fun merchantCity(): String = merchantCity.getRequired("merchant_city")
/** The country the merchant resides in. */
fun merchantCountry(): String = merchantCountry.getRequired("merchant_country")
/** The name of the merchant. */
fun merchantName(): String = merchantName.getRequired("merchant_name")
/** The merchant's postal code. For US merchants this is always a 5-digit ZIP code. */
fun merchantPostalCode(): String? =
merchantPostalCode.getNullable("merchant_postal_code")
/** The state the merchant resides in. */
fun merchantState(): String? = merchantState.getNullable("merchant_state")
/** Network-specific identifiers for this refund. */
fun networkIdentifiers(): NetworkIdentifiers =
networkIdentifiers.getRequired("network_identifiers")
/** The 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")
/**
* Additional details about the card purchase, such as tax and industry-specific fields.
*/
fun purchaseDetails(): PurchaseDetails? =
purchaseDetails.getNullable("purchase_details")
/** The identifier of the Transaction associated with this Transaction. */
fun transactionId(): String = transactionId.getRequired("transaction_id")
/**
* A constant representing the object's type. For this resource it will always be
* `card_refund`.
*/
fun type(): Type = type.getRequired("type")
/**
* The amount in the minor unit of the transaction's settlement currency. For dollars,
* for example, this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/** The ID of the Card Payment this transaction belongs to. */
@JsonProperty("card_payment_id") @ExcludeMissing fun _cardPaymentId() = cardPaymentId
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* settlement currency.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** The Card Refund identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/** Interchange assessed as a part of this transaciton. */
@JsonProperty("interchange") @ExcludeMissing fun _interchange() = interchange
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
fun _merchantAcceptorId() = merchantAcceptorId
/** The 4-digit MCC describing the merchant's business. */
@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 name of the merchant. */
@JsonProperty("merchant_name") @ExcludeMissing fun _merchantName() = merchantName
/** The merchant's postal code. For US merchants this is always a 5-digit ZIP code. */
@JsonProperty("merchant_postal_code")
@ExcludeMissing
fun _merchantPostalCode() = merchantPostalCode
/** The state the merchant resides in. */
@JsonProperty("merchant_state") @ExcludeMissing fun _merchantState() = merchantState
/** Network-specific identifiers for this refund. */
@JsonProperty("network_identifiers")
@ExcludeMissing
fun _networkIdentifiers() = networkIdentifiers
/** The 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
/**
* Additional details about the card purchase, such as tax and industry-specific fields.
*/
@JsonProperty("purchase_details")
@ExcludeMissing
fun _purchaseDetails() = purchaseDetails
/** The identifier of the Transaction associated with this Transaction. */
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
/**
* A constant representing the object's type. For this resource it will always be
* `card_refund`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardRefund = apply {
if (!validated) {
amount()
cardPaymentId()
currency()
id()
interchange()?.validate()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
merchantCountry()
merchantName()
merchantPostalCode()
merchantState()
networkIdentifiers().validate()
presentmentAmount()
presentmentCurrency()
purchaseDetails()?.validate()
transactionId()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var cardPaymentId: JsonField = JsonMissing.of()
private var currency: JsonField