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.toUnmodifiable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
import java.util.Optional
/**
* 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
private var hashCode: Int = 0
/** 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(): Optional = Optional.ofNullable(routeId.getNullable("route_id"))
/** The type of the route this Transaction came through. */
fun routeType(): Optional = Optional.ofNullable(routeType.getNullable("route_type"))
/**
* This is an object giving more details on the network-level event that caused the 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Transaction &&
this.accountId == other.accountId &&
this.amount == other.amount &&
this.createdAt == other.createdAt &&
this.currency == other.currency &&
this.description == other.description &&
this.id == other.id &&
this.routeId == other.routeId &&
this.routeType == other.routeType &&
this.source == other.source &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountId,
amount,
createdAt,
currency,
description,
id,
routeId,
routeType,
source,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Transaction{accountId=$accountId, amount=$amount, createdAt=$createdAt, currency=$currency, description=$description, id=$id, routeId=$routeId, routeType=$routeType, source=$source, type=$type, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var description: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var routeId: JsonField = JsonMissing.of()
private var routeType: JsonField = JsonMissing.of()
private var source: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(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.toUnmodifiable(),
)
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Currency && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val CAD = Currency(JsonField.of("CAD"))
@JvmField val CHF = Currency(JsonField.of("CHF"))
@JvmField val EUR = Currency(JsonField.of("EUR"))
@JvmField val GBP = Currency(JsonField.of("GBP"))
@JvmField val JPY = Currency(JsonField.of("JPY"))
@JvmField val USD = Currency(JsonField.of("USD"))
@JvmStatic fun of(value: String) = Currency(JsonField.of(value))
}
enum class Known {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
}
enum class Value {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CAD -> Value.CAD
CHF -> Value.CHF
EUR -> Value.EUR
GBP -> Value.GBP
JPY -> Value.JPY
USD -> Value.USD
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CAD -> Known.CAD
CHF -> Known.CHF
EUR -> Known.EUR
GBP -> Known.GBP
JPY -> Known.JPY
USD -> Known.USD
else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class RouteType
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is RouteType && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val ACCOUNT_NUMBER = RouteType(JsonField.of("account_number"))
@JvmField val CARD = RouteType(JsonField.of("card"))
@JvmField val LOCKBOX = RouteType(JsonField.of("lockbox"))
@JvmStatic fun of(value: String) = RouteType(JsonField.of(value))
}
enum class Known {
ACCOUNT_NUMBER,
CARD,
LOCKBOX,
}
enum class Value {
ACCOUNT_NUMBER,
CARD,
LOCKBOX,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACCOUNT_NUMBER -> Value.ACCOUNT_NUMBER
CARD -> Value.CARD
LOCKBOX -> Value.LOCKBOX
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACCOUNT_NUMBER -> Known.ACCOUNT_NUMBER
CARD -> Known.CARD
LOCKBOX -> Known.LOCKBOX
else -> throw IncreaseInvalidDataException("Unknown RouteType: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/**
* This is an object giving more details on the network-level event that caused the 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
private var hashCode: Int = 0
/**
* 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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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():
Optional =
Optional.ofNullable(
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():
Optional =
Optional.ofNullable(
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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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():
Optional =
Optional.ofNullable(
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(): Optional =
Optional.ofNullable(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(): Optional =
Optional.ofNullable(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().map { it.validate() }
achTransferIntention().map { it.validate() }
achTransferRejection().map { it.validate() }
achTransferReturn().map { it.validate() }
cardDisputeAcceptance().map { it.validate() }
cardDisputeLoss().map { it.validate() }
cardRefund().map { it.validate() }
cardRevenuePayment().map { it.validate() }
cardSettlement().map { it.validate() }
cashbackPayment().map { it.validate() }
category()
checkDepositAcceptance().map { it.validate() }
checkDepositReturn().map { it.validate() }
checkTransferDeposit().map { it.validate() }
feePayment().map { it.validate() }
inboundAchTransfer().map { it.validate() }
inboundRealTimePaymentsTransferConfirmation().map { it.validate() }
inboundRealTimePaymentsTransferDecline().map { it.validate() }
inboundWireReversal().map { it.validate() }
inboundWireTransfer().map { it.validate() }
interestPayment().map { it.validate() }
internalSource().map { it.validate() }
realTimePaymentsTransferAcknowledgement().map { it.validate() }
sampleFunds().map { it.validate() }
wireTransferIntention().map { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Source &&
this.accountTransferIntention == other.accountTransferIntention &&
this.achTransferIntention == other.achTransferIntention &&
this.achTransferRejection == other.achTransferRejection &&
this.achTransferReturn == other.achTransferReturn &&
this.cardDisputeAcceptance == other.cardDisputeAcceptance &&
this.cardDisputeLoss == other.cardDisputeLoss &&
this.cardRefund == other.cardRefund &&
this.cardRevenuePayment == other.cardRevenuePayment &&
this.cardSettlement == other.cardSettlement &&
this.cashbackPayment == other.cashbackPayment &&
this.category == other.category &&
this.checkDepositAcceptance == other.checkDepositAcceptance &&
this.checkDepositReturn == other.checkDepositReturn &&
this.checkTransferDeposit == other.checkTransferDeposit &&
this.feePayment == other.feePayment &&
this.inboundAchTransfer == other.inboundAchTransfer &&
this.inboundRealTimePaymentsTransferConfirmation ==
other.inboundRealTimePaymentsTransferConfirmation &&
this.inboundRealTimePaymentsTransferDecline ==
other.inboundRealTimePaymentsTransferDecline &&
this.inboundWireReversal == other.inboundWireReversal &&
this.inboundWireTransfer == other.inboundWireTransfer &&
this.interestPayment == other.interestPayment &&
this.internalSource == other.internalSource &&
this.other == other.other &&
this.realTimePaymentsTransferAcknowledgement ==
other.realTimePaymentsTransferAcknowledgement &&
this.sampleFunds == other.sampleFunds &&
this.wireTransferIntention == other.wireTransferIntention &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
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,
)
}
return hashCode
}
override fun toString() =
"Source{accountTransferIntention=$accountTransferIntention, achTransferIntention=$achTransferIntention, achTransferRejection=$achTransferRejection, achTransferReturn=$achTransferReturn, cardDisputeAcceptance=$cardDisputeAcceptance, cardDisputeLoss=$cardDisputeLoss, cardRefund=$cardRefund, cardRevenuePayment=$cardRevenuePayment, cardSettlement=$cardSettlement, cashbackPayment=$cashbackPayment, category=$category, checkDepositAcceptance=$checkDepositAcceptance, checkDepositReturn=$checkDepositReturn, checkTransferDeposit=$checkTransferDeposit, feePayment=$feePayment, inboundAchTransfer=$inboundAchTransfer, inboundRealTimePaymentsTransferConfirmation=$inboundRealTimePaymentsTransferConfirmation, inboundRealTimePaymentsTransferDecline=$inboundRealTimePaymentsTransferDecline, inboundWireReversal=$inboundWireReversal, inboundWireTransfer=$inboundWireTransfer, interestPayment=$interestPayment, internalSource=$internalSource, other=$other, realTimePaymentsTransferAcknowledgement=$realTimePaymentsTransferAcknowledgement, sampleFunds=$sampleFunds, wireTransferIntention=$wireTransferIntention, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
/**
* 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
private var hashCode: Int = 0
/**
* 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
currency,
description,
destinationAccountId,
sourceAccountId,
transferId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AccountTransferIntention{amount=$amount, currency=$currency, description=$description, destinationAccountId=$destinationAccountId, sourceAccountId=$sourceAccountId, transferId=$transferId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Currency && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val CAD = Currency(JsonField.of("CAD"))
@JvmField val CHF = Currency(JsonField.of("CHF"))
@JvmField val EUR = Currency(JsonField.of("EUR"))
@JvmField val GBP = Currency(JsonField.of("GBP"))
@JvmField val JPY = Currency(JsonField.of("JPY"))
@JvmField val USD = Currency(JsonField.of("USD"))
@JvmStatic fun of(value: String) = Currency(JsonField.of(value))
}
enum class Known {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
}
enum class Value {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CAD -> Value.CAD
CHF -> Value.CHF
EUR -> Value.EUR
GBP -> Value.GBP
JPY -> Value.JPY
USD -> Value.USD
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CAD -> Known.CAD
CHF -> Known.CHF
EUR -> Known.EUR
GBP -> Known.GBP
JPY -> Known.JPY
USD -> Known.USD
else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
/**
* 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
private var hashCode: Int = 0
/** 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountNumber,
amount,
routingNumber,
statementDescriptor,
transferId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AchTransferIntention{accountNumber=$accountNumber, amount=$amount, routingNumber=$routingNumber, statementDescriptor=$statementDescriptor, transferId=$transferId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
}
/**
* 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
private var hashCode: Int = 0
/** 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AchTransferRejection &&
this.transferId == other.transferId &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(transferId, additionalProperties)
}
return hashCode
}
override fun toString() =
"AchTransferRejection{transferId=$transferId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var transferId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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.toUnmodifiable())
}
}
/**
* 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
private var hashCode: Int = 0
/**
* 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return 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
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
createdAt,
rawReturnReasonCode,
returnReasonCode,
traceNumber,
transactionId,
transferId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AchTransferReturn{createdAt=$createdAt, rawReturnReasonCode=$rawReturnReasonCode, returnReasonCode=$returnReasonCode, traceNumber=$traceNumber, transactionId=$transactionId, transferId=$transferId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
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 other is ReturnReasonCode && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField
val INSUFFICIENT_FUND = ReturnReasonCode(JsonField.of("insufficient_fund"))
@JvmField val NO_ACCOUNT = ReturnReasonCode(JsonField.of("no_account"))
@JvmField val ACCOUNT_CLOSED = ReturnReasonCode(JsonField.of("account_closed"))
@JvmField
val INVALID_ACCOUNT_NUMBER_STRUCTURE =
ReturnReasonCode(JsonField.of("invalid_account_number_structure"))
@JvmField
val ACCOUNT_FROZEN_ENTRY_RETURNED_PER_OFAC_INSTRUCTION =
ReturnReasonCode(
JsonField.of("account_frozen_entry_returned_per_ofac_instruction")
)
@JvmField
val CREDIT_ENTRY_REFUSED_BY_RECEIVER =
ReturnReasonCode(JsonField.of("credit_entry_refused_by_receiver"))
@JvmField
val UNAUTHORIZED_DEBIT_TO_CONSUMER_ACCOUNT_USING_CORPORATE_SEC_CODE =
ReturnReasonCode(
JsonField.of(
"unauthorized_debit_to_consumer_account_using_corporate_sec_code"
)
)
@JvmField
val CORPORATE_CUSTOMER_ADVISED_NOT_AUTHORIZED =
ReturnReasonCode(JsonField.of("corporate_customer_advised_not_authorized"))
@JvmField
val PAYMENT_STOPPED = ReturnReasonCode(JsonField.of("payment_stopped"))
@JvmField
val NON_TRANSACTION_ACCOUNT =
ReturnReasonCode(JsonField.of("non_transaction_account"))
@JvmField
val UNCOLLECTED_FUNDS = ReturnReasonCode(JsonField.of("uncollected_funds"))
@JvmField
val ROUTING_NUMBER_CHECK_DIGIT_ERROR =
ReturnReasonCode(JsonField.of("routing_number_check_digit_error"))
@JvmField
val CUSTOMER_ADVISED_UNAUTHORIZED_IMPROPER_INELIGIBLE_OR_INCOMPLETE =
ReturnReasonCode(
JsonField.of(
"customer_advised_unauthorized_improper_ineligible_or_incomplete"
)
)
@JvmField
val AMOUNT_FIELD_ERROR = ReturnReasonCode(JsonField.of("amount_field_error"))
@JvmField
val AUTHORIZATION_REVOKED_BY_CUSTOMER =
ReturnReasonCode(JsonField.of("authorization_revoked_by_customer"))
@JvmField
val INVALID_ACH_ROUTING_NUMBER =
ReturnReasonCode(JsonField.of("invalid_ach_routing_number"))
@JvmField
val FILE_RECORD_EDIT_CRITERIA =
ReturnReasonCode(JsonField.of("file_record_edit_criteria"))
@JvmField
val ENR_INVALID_INDIVIDUAL_NAME =
ReturnReasonCode(JsonField.of("enr_invalid_individual_name"))
@JvmField
val RETURNED_PER_ODFI_REQUEST =
ReturnReasonCode(JsonField.of("returned_per_odfi_request"))
@JvmField
val LIMITED_PARTICIPATION_DFI =
ReturnReasonCode(JsonField.of("limited_participation_dfi"))
@JvmField
val INCORRECTLY_CODED_OUTBOUND_INTERNATIONAL_PAYMENT =
ReturnReasonCode(
JsonField.of("incorrectly_coded_outbound_international_payment")
)
@JvmField
val ACCOUNT_SOLD_TO_ANOTHER_DFI =
ReturnReasonCode(JsonField.of("account_sold_to_another_dfi"))
@JvmField val ADDENDA_ERROR = ReturnReasonCode(JsonField.of("addenda_error"))
@JvmField
val BENEFICIARY_OR_ACCOUNT_HOLDER_DECEASED =
ReturnReasonCode(JsonField.of("beneficiary_or_account_holder_deceased"))
@JvmField
val CUSTOMER_ADVISED_NOT_WITHIN_AUTHORIZATION_TERMS =
ReturnReasonCode(
JsonField.of("customer_advised_not_within_authorization_terms")
)
@JvmField
val CORRECTED_RETURN = ReturnReasonCode(JsonField.of("corrected_return"))
@JvmField
val DUPLICATE_ENTRY = ReturnReasonCode(JsonField.of("duplicate_entry"))
@JvmField
val DUPLICATE_RETURN = ReturnReasonCode(JsonField.of("duplicate_return"))
@JvmField
val ENR_DUPLICATE_ENROLLMENT =
ReturnReasonCode(JsonField.of("enr_duplicate_enrollment"))
@JvmField
val ENR_INVALID_DFI_ACCOUNT_NUMBER =
ReturnReasonCode(JsonField.of("enr_invalid_dfi_account_number"))
@JvmField
val ENR_INVALID_INDIVIDUAL_ID_NUMBER =
ReturnReasonCode(JsonField.of("enr_invalid_individual_id_number"))
@JvmField
val ENR_INVALID_REPRESENTATIVE_PAYEE_INDICATOR =
ReturnReasonCode(JsonField.of("enr_invalid_representative_payee_indicator"))
@JvmField
val ENR_INVALID_TRANSACTION_CODE =
ReturnReasonCode(JsonField.of("enr_invalid_transaction_code"))
@JvmField
val ENR_RETURN_OF_ENR_ENTRY =
ReturnReasonCode(JsonField.of("enr_return_of_enr_entry"))
@JvmField
val ENR_ROUTING_NUMBER_CHECK_DIGIT_ERROR =
ReturnReasonCode(JsonField.of("enr_routing_number_check_digit_error"))
@JvmField
val ENTRY_NOT_PROCESSED_BY_GATEWAY =
ReturnReasonCode(JsonField.of("entry_not_processed_by_gateway"))
@JvmField val FIELD_ERROR = ReturnReasonCode(JsonField.of("field_error"))
@JvmField
val FOREIGN_RECEIVING_DFI_UNABLE_TO_SETTLE =
ReturnReasonCode(JsonField.of("foreign_receiving_dfi_unable_to_settle"))
@JvmField
val IAT_ENTRY_CODING_ERROR =
ReturnReasonCode(JsonField.of("iat_entry_coding_error"))
@JvmField
val IMPROPER_EFFECTIVE_ENTRY_DATE =
ReturnReasonCode(JsonField.of("improper_effective_entry_date"))
@JvmField
val IMPROPER_SOURCE_DOCUMENT_SOURCE_DOCUMENT_PRESENTED =
ReturnReasonCode(
JsonField.of("improper_source_document_source_document_presented")
)
@JvmField
val INVALID_COMPANY_ID = ReturnReasonCode(JsonField.of("invalid_company_id"))
@JvmField
val INVALID_FOREIGN_RECEIVING_DFI_IDENTIFICATION =
ReturnReasonCode(
JsonField.of("invalid_foreign_receiving_dfi_identification")
)
@JvmField
val INVALID_INDIVIDUAL_ID_NUMBER =
ReturnReasonCode(JsonField.of("invalid_individual_id_number"))
@JvmField
val ITEM_AND_RCK_ENTRY_PRESENTED_FOR_PAYMENT =
ReturnReasonCode(JsonField.of("item_and_rck_entry_presented_for_payment"))
@JvmField
val ITEM_RELATED_TO_RCK_ENTRY_IS_INELIGIBLE =
ReturnReasonCode(JsonField.of("item_related_to_rck_entry_is_ineligible"))
@JvmField
val MANDATORY_FIELD_ERROR =
ReturnReasonCode(JsonField.of("mandatory_field_error"))
@JvmField
val MISROUTED_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("misrouted_dishonored_return"))
@JvmField
val MISROUTED_RETURN = ReturnReasonCode(JsonField.of("misrouted_return"))
@JvmField
val NO_ERRORS_FOUND = ReturnReasonCode(JsonField.of("no_errors_found"))
@JvmField
val NON_ACCEPTANCE_OF_R62_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("non_acceptance_of_r62_dishonored_return"))
@JvmField
val NON_PARTICIPANT_IN_IAT_PROGRAM =
ReturnReasonCode(JsonField.of("non_participant_in_iat_program"))
@JvmField
val PERMISSIBLE_RETURN_ENTRY =
ReturnReasonCode(JsonField.of("permissible_return_entry"))
@JvmField
val PERMISSIBLE_RETURN_ENTRY_NOT_ACCEPTED =
ReturnReasonCode(JsonField.of("permissible_return_entry_not_accepted"))
@JvmField
val RDFI_NON_SETTLEMENT = ReturnReasonCode(JsonField.of("rdfi_non_settlement"))
@JvmField
val RDFI_PARTICIPANT_IN_CHECK_TRUNCATION_PROGRAM =
ReturnReasonCode(
JsonField.of("rdfi_participant_in_check_truncation_program")
)
@JvmField
val REPRESENTATIVE_PAYEE_DECEASED_OR_UNABLE_TO_CONTINUE_IN_THAT_CAPACITY =
ReturnReasonCode(
JsonField.of(
"representative_payee_deceased_or_unable_to_continue_in_that_capacity"
)
)
@JvmField
val RETURN_NOT_A_DUPLICATE =
ReturnReasonCode(JsonField.of("return_not_a_duplicate"))
@JvmField
val RETURN_OF_ERRONEOUS_OR_REVERSING_DEBIT =
ReturnReasonCode(JsonField.of("return_of_erroneous_or_reversing_debit"))
@JvmField
val RETURN_OF_IMPROPER_CREDIT_ENTRY =
ReturnReasonCode(JsonField.of("return_of_improper_credit_entry"))
@JvmField
val RETURN_OF_IMPROPER_DEBIT_ENTRY =
ReturnReasonCode(JsonField.of("return_of_improper_debit_entry"))
@JvmField
val RETURN_OF_XCK_ENTRY = ReturnReasonCode(JsonField.of("return_of_xck_entry"))
@JvmField
val SOURCE_DOCUMENT_PRESENTED_FOR_PAYMENT =
ReturnReasonCode(JsonField.of("source_document_presented_for_payment"))
@JvmField
val STATE_LAW_AFFECTING_RCK_ACCEPTANCE =
ReturnReasonCode(JsonField.of("state_law_affecting_rck_acceptance"))
@JvmField
val STOP_PAYMENT_ON_ITEM_RELATED_TO_RCK_ENTRY =
ReturnReasonCode(JsonField.of("stop_payment_on_item_related_to_rck_entry"))
@JvmField
val STOP_PAYMENT_ON_SOURCE_DOCUMENT =
ReturnReasonCode(JsonField.of("stop_payment_on_source_document"))
@JvmField
val TIMELY_ORIGINAL_RETURN =
ReturnReasonCode(JsonField.of("timely_original_return"))
@JvmField
val TRACE_NUMBER_ERROR = ReturnReasonCode(JsonField.of("trace_number_error"))
@JvmField
val UNTIMELY_DISHONORED_RETURN =
ReturnReasonCode(JsonField.of("untimely_dishonored_return"))
@JvmField
val UNTIMELY_RETURN = ReturnReasonCode(JsonField.of("untimely_return"))
@JvmStatic 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()
}
}
/**
* 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
private var hashCode: Int = 0
/**
* 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardDisputeAcceptance &&
this.acceptedAt == other.acceptedAt &&
this.cardDisputeId == other.cardDisputeId &&
this.transactionId == other.transactionId &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
acceptedAt,
cardDisputeId,
transactionId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardDisputeAcceptance{acceptedAt=$acceptedAt, cardDisputeId=$cardDisputeId, transactionId=$transactionId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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.toUnmodifiable(),
)
}
}
/**
* 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
private var hashCode: Int = 0
/** 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)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardDisputeLoss &&
this.cardDisputeId == other.cardDisputeId &&
this.explanation == other.explanation &&
this.lostAt == other.lostAt &&
this.transactionId == other.transactionId &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
cardDisputeId,
explanation,
lostAt,
transactionId,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardDisputeLoss{cardDisputeId=$cardDisputeId, explanation=$explanation, lostAt=$lostAt, transactionId=$transactionId, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic 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()
@JvmSynthetic
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