com.increase.api.models.AchTransfer.kt Maven / Gradle / Ivy
The newest version!
// File generated from our OpenAPI spec by Stainless.
package com.increase.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.Enum
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonField
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toUnmodifiable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
/**
* ACH transfers move funds between your Increase account and any other account accessible by the
* Automated Clearing House (ACH).
*/
@JsonDeserialize(builder = AchTransfer.Builder::class)
@NoAutoDetect
class AchTransfer
private constructor(
private val accountId: JsonField,
private val accountNumber: JsonField,
private val acknowledgement: JsonField,
private val addenda: JsonField,
private val amount: JsonField,
private val approval: JsonField,
private val cancellation: JsonField,
private val companyDescriptiveDate: JsonField,
private val companyDiscretionaryData: JsonField,
private val companyEntryDescription: JsonField,
private val companyName: JsonField,
private val createdAt: JsonField,
private val createdBy: JsonField,
private val currency: JsonField,
private val destinationAccountHolder: JsonField,
private val externalAccountId: JsonField,
private val funding: JsonField,
private val id: JsonField,
private val idempotencyKey: JsonField,
private val inboundFundsHold: JsonField,
private val individualId: JsonField,
private val individualName: JsonField,
private val network: JsonField,
private val notificationsOfChange: JsonField>,
private val pendingTransactionId: JsonField,
private val preferredEffectiveDate: JsonField,
private val return_: JsonField,
private val routingNumber: JsonField,
private val standardEntryClassCode: JsonField,
private val statementDescriptor: JsonField,
private val status: JsonField,
private val submission: JsonField,
private val transactionId: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The Account to which the transfer belongs. */
fun accountId(): String = accountId.getRequired("account_id")
/** The destination account number. */
fun accountNumber(): String = accountNumber.getRequired("account_number")
/**
* After the transfer is acknowledged by FedACH, this will contain supplemental details. The
* Federal Reserve sends an acknowledgement message for each file that Increase submits.
*/
fun acknowledgement(): Acknowledgement? = acknowledgement.getNullable("acknowledgement")
/** Additional information that will be sent to the recipient. */
fun addenda(): Addenda? = addenda.getNullable("addenda")
/**
* The transfer amount in USD cents. A positive amount indicates a credit transfer pushing funds
* to the receiving account. A negative amount indicates a debit transfer pulling funds from the
* receiving account.
*/
fun amount(): Long = amount.getRequired("amount")
/**
* If your account requires approvals for transfers and the transfer was approved, this will
* contain details of the approval.
*/
fun approval(): Approval? = approval.getNullable("approval")
/**
* If your account requires approvals for transfers and the transfer was not approved, this will
* contain details of the cancellation.
*/
fun cancellation(): Cancellation? = cancellation.getNullable("cancellation")
/** The description of the date of the transfer. */
fun companyDescriptiveDate(): String? =
companyDescriptiveDate.getNullable("company_descriptive_date")
/** The data you chose to associate with the transfer. */
fun companyDiscretionaryData(): String? =
companyDiscretionaryData.getNullable("company_discretionary_data")
/** The description of the transfer you set to be shown to the recipient. */
fun companyEntryDescription(): String? =
companyEntryDescription.getNullable("company_entry_description")
/** The name by which the recipient knows you. */
fun companyName(): String? = companyName.getNullable("company_name")
/**
* 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")
/** What object created the transfer, either via the API or the dashboard. */
fun createdBy(): CreatedBy? = createdBy.getNullable("created_by")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For
* ACH transfers this is always equal to `usd`.
*/
fun currency(): Currency = currency.getRequired("currency")
/** The type of entity that owns the account to which the ACH Transfer is being sent. */
fun destinationAccountHolder(): DestinationAccountHolder =
destinationAccountHolder.getRequired("destination_account_holder")
/** The identifier of the External Account the transfer was made to, if any. */
fun externalAccountId(): String? = externalAccountId.getNullable("external_account_id")
/** The type of the account to which the transfer will be sent. */
fun funding(): Funding = funding.getRequired("funding")
/** The ACH transfer's identifier. */
fun id(): String = id.getRequired("id")
/**
* The idempotency key you chose for this object. This value is unique across Increase and is
* used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
fun idempotencyKey(): String? = idempotencyKey.getNullable("idempotency_key")
/**
* Increase will sometimes hold the funds for ACH debit transfers. If funds are held, this
* sub-object will contain details of the hold.
*/
fun inboundFundsHold(): InboundFundsHold? = inboundFundsHold.getNullable("inbound_funds_hold")
/** Your identifier for the transfer recipient. */
fun individualId(): String? = individualId.getNullable("individual_id")
/**
* The name of the transfer recipient. This value is information and not verified by the
* recipient's bank.
*/
fun individualName(): String? = individualName.getNullable("individual_name")
/** The transfer's network. */
fun network(): Network = network.getRequired("network")
/**
* If the receiving bank accepts the transfer but notifies that future transfers should use
* different details, this will contain those details.
*/
fun notificationsOfChange(): List =
notificationsOfChange.getRequired("notifications_of_change")
/**
* The ID for the pending transaction representing the transfer. A pending transaction is
* created when the transfer
* [requires approval](https://increase.com/documentation/transfer-approvals#transfer-approvals)
* by someone else in your organization.
*/
fun pendingTransactionId(): String? = pendingTransactionId.getNullable("pending_transaction_id")
/**
* Configuration for how the effective date of the transfer will be set. This determines
* same-day vs future-dated settlement timing. If not set, defaults to a `settlement_schedule`
* of `same_day`. If set, exactly one of the child attributes must be set.
*/
fun preferredEffectiveDate(): PreferredEffectiveDate =
preferredEffectiveDate.getRequired("preferred_effective_date")
/** If your transfer is returned, this will contain details of the return. */
fun return_(): Return? = return_.getNullable("return")
/** The American Bankers' Association (ABA) Routing Transit Number (RTN). */
fun routingNumber(): String = routingNumber.getRequired("routing_number")
/** The Standard Entry Class (SEC) code to use for the transfer. */
fun standardEntryClassCode(): StandardEntryClassCode =
standardEntryClassCode.getRequired("standard_entry_class_code")
/** The descriptor that will show on the recipient's bank statement. */
fun statementDescriptor(): String = statementDescriptor.getRequired("statement_descriptor")
/** The lifecycle status of the transfer. */
fun status(): Status = status.getRequired("status")
/**
* After the transfer is submitted to FedACH, this will contain supplemental details. Increase
* batches transfers and submits a file to the Federal Reserve roughly every 30 minutes. The
* Federal Reserve processes ACH transfers during weekdays according to their
* [posted schedule](https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html).
*/
fun submission(): Submission? = submission.getNullable("submission")
/** The ID for the transaction funding the transfer. */
fun transactionId(): String? = transactionId.getNullable("transaction_id")
/**
* A constant representing the object's type. For this resource it will always be
* `ach_transfer`.
*/
fun type(): Type = type.getRequired("type")
/** The Account to which the transfer belongs. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/** The destination account number. */
@JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber
/**
* After the transfer is acknowledged by FedACH, this will contain supplemental details. The
* Federal Reserve sends an acknowledgement message for each file that Increase submits.
*/
@JsonProperty("acknowledgement") @ExcludeMissing fun _acknowledgement() = acknowledgement
/** Additional information that will be sent to the recipient. */
@JsonProperty("addenda") @ExcludeMissing fun _addenda() = addenda
/**
* The transfer amount in USD cents. A positive amount indicates a credit transfer pushing funds
* to the receiving account. A negative amount indicates a debit transfer pulling funds from the
* receiving account.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* If your account requires approvals for transfers and the transfer was approved, this will
* contain details of the approval.
*/
@JsonProperty("approval") @ExcludeMissing fun _approval() = approval
/**
* If your account requires approvals for transfers and the transfer was not approved, this will
* contain details of the cancellation.
*/
@JsonProperty("cancellation") @ExcludeMissing fun _cancellation() = cancellation
/** The description of the date of the transfer. */
@JsonProperty("company_descriptive_date")
@ExcludeMissing
fun _companyDescriptiveDate() = companyDescriptiveDate
/** The data you chose to associate with the transfer. */
@JsonProperty("company_discretionary_data")
@ExcludeMissing
fun _companyDiscretionaryData() = companyDiscretionaryData
/** The description of the transfer you set to be shown to the recipient. */
@JsonProperty("company_entry_description")
@ExcludeMissing
fun _companyEntryDescription() = companyEntryDescription
/** The name by which the recipient knows you. */
@JsonProperty("company_name") @ExcludeMissing fun _companyName() = companyName
/**
* 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
/** What object created the transfer, either via the API or the dashboard. */
@JsonProperty("created_by") @ExcludeMissing fun _createdBy() = createdBy
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency. For
* ACH transfers this is always equal to `usd`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** The type of entity that owns the account to which the ACH Transfer is being sent. */
@JsonProperty("destination_account_holder")
@ExcludeMissing
fun _destinationAccountHolder() = destinationAccountHolder
/** The identifier of the External Account the transfer was made to, if any. */
@JsonProperty("external_account_id")
@ExcludeMissing
fun _externalAccountId() = externalAccountId
/** The type of the account to which the transfer will be sent. */
@JsonProperty("funding") @ExcludeMissing fun _funding() = funding
/** The ACH transfer's identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The idempotency key you chose for this object. This value is unique across Increase and is
* used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
@JsonProperty("idempotency_key") @ExcludeMissing fun _idempotencyKey() = idempotencyKey
/**
* Increase will sometimes hold the funds for ACH debit transfers. If funds are held, this
* sub-object will contain details of the hold.
*/
@JsonProperty("inbound_funds_hold") @ExcludeMissing fun _inboundFundsHold() = inboundFundsHold
/** Your identifier for the transfer recipient. */
@JsonProperty("individual_id") @ExcludeMissing fun _individualId() = individualId
/**
* The name of the transfer recipient. This value is information and not verified by the
* recipient's bank.
*/
@JsonProperty("individual_name") @ExcludeMissing fun _individualName() = individualName
/** The transfer's network. */
@JsonProperty("network") @ExcludeMissing fun _network() = network
/**
* If the receiving bank accepts the transfer but notifies that future transfers should use
* different details, this will contain those details.
*/
@JsonProperty("notifications_of_change")
@ExcludeMissing
fun _notificationsOfChange() = notificationsOfChange
/**
* The ID for the pending transaction representing the transfer. A pending transaction is
* created when the transfer
* [requires approval](https://increase.com/documentation/transfer-approvals#transfer-approvals)
* by someone else in your organization.
*/
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun _pendingTransactionId() = pendingTransactionId
/**
* Configuration for how the effective date of the transfer will be set. This determines
* same-day vs future-dated settlement timing. If not set, defaults to a `settlement_schedule`
* of `same_day`. If set, exactly one of the child attributes must be set.
*/
@JsonProperty("preferred_effective_date")
@ExcludeMissing
fun _preferredEffectiveDate() = preferredEffectiveDate
/** If your transfer is returned, this will contain details of the return. */
@JsonProperty("return") @ExcludeMissing fun _return_() = return_
/** The American Bankers' Association (ABA) Routing Transit Number (RTN). */
@JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber
/** The Standard Entry Class (SEC) code to use for the transfer. */
@JsonProperty("standard_entry_class_code")
@ExcludeMissing
fun _standardEntryClassCode() = standardEntryClassCode
/** The descriptor that will show on the recipient's bank statement. */
@JsonProperty("statement_descriptor")
@ExcludeMissing
fun _statementDescriptor() = statementDescriptor
/** The lifecycle status of the transfer. */
@JsonProperty("status") @ExcludeMissing fun _status() = status
/**
* After the transfer is submitted to FedACH, this will contain supplemental details. Increase
* batches transfers and submits a file to the Federal Reserve roughly every 30 minutes. The
* Federal Reserve processes ACH transfers during weekdays according to their
* [posted schedule](https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html).
*/
@JsonProperty("submission") @ExcludeMissing fun _submission() = submission
/** The ID for the transaction funding the transfer. */
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
/**
* A constant representing the object's type. For this resource it will always be
* `ach_transfer`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): AchTransfer = apply {
if (!validated) {
accountId()
accountNumber()
acknowledgement()?.validate()
addenda()?.validate()
amount()
approval()?.validate()
cancellation()?.validate()
companyDescriptiveDate()
companyDiscretionaryData()
companyEntryDescription()
companyName()
createdAt()
createdBy()?.validate()
currency()
destinationAccountHolder()
externalAccountId()
funding()
id()
idempotencyKey()
inboundFundsHold()?.validate()
individualId()
individualName()
network()
notificationsOfChange().forEach { it.validate() }
pendingTransactionId()
preferredEffectiveDate().validate()
return_()?.validate()
routingNumber()
standardEntryClassCode()
statementDescriptor()
status()
submission()?.validate()
transactionId()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AchTransfer &&
this.accountId == other.accountId &&
this.accountNumber == other.accountNumber &&
this.acknowledgement == other.acknowledgement &&
this.addenda == other.addenda &&
this.amount == other.amount &&
this.approval == other.approval &&
this.cancellation == other.cancellation &&
this.companyDescriptiveDate == other.companyDescriptiveDate &&
this.companyDiscretionaryData == other.companyDiscretionaryData &&
this.companyEntryDescription == other.companyEntryDescription &&
this.companyName == other.companyName &&
this.createdAt == other.createdAt &&
this.createdBy == other.createdBy &&
this.currency == other.currency &&
this.destinationAccountHolder == other.destinationAccountHolder &&
this.externalAccountId == other.externalAccountId &&
this.funding == other.funding &&
this.id == other.id &&
this.idempotencyKey == other.idempotencyKey &&
this.inboundFundsHold == other.inboundFundsHold &&
this.individualId == other.individualId &&
this.individualName == other.individualName &&
this.network == other.network &&
this.notificationsOfChange == other.notificationsOfChange &&
this.pendingTransactionId == other.pendingTransactionId &&
this.preferredEffectiveDate == other.preferredEffectiveDate &&
this.return_ == other.return_ &&
this.routingNumber == other.routingNumber &&
this.standardEntryClassCode == other.standardEntryClassCode &&
this.statementDescriptor == other.statementDescriptor &&
this.status == other.status &&
this.submission == other.submission &&
this.transactionId == other.transactionId &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountId,
accountNumber,
acknowledgement,
addenda,
amount,
approval,
cancellation,
companyDescriptiveDate,
companyDiscretionaryData,
companyEntryDescription,
companyName,
createdAt,
createdBy,
currency,
destinationAccountHolder,
externalAccountId,
funding,
id,
idempotencyKey,
inboundFundsHold,
individualId,
individualName,
network,
notificationsOfChange,
pendingTransactionId,
preferredEffectiveDate,
return_,
routingNumber,
standardEntryClassCode,
statementDescriptor,
status,
submission,
transactionId,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AchTransfer{accountId=$accountId, accountNumber=$accountNumber, acknowledgement=$acknowledgement, addenda=$addenda, amount=$amount, approval=$approval, cancellation=$cancellation, companyDescriptiveDate=$companyDescriptiveDate, companyDiscretionaryData=$companyDiscretionaryData, companyEntryDescription=$companyEntryDescription, companyName=$companyName, createdAt=$createdAt, createdBy=$createdBy, currency=$currency, destinationAccountHolder=$destinationAccountHolder, externalAccountId=$externalAccountId, funding=$funding, id=$id, idempotencyKey=$idempotencyKey, inboundFundsHold=$inboundFundsHold, individualId=$individualId, individualName=$individualName, network=$network, notificationsOfChange=$notificationsOfChange, pendingTransactionId=$pendingTransactionId, preferredEffectiveDate=$preferredEffectiveDate, return_=$return_, routingNumber=$routingNumber, standardEntryClassCode=$standardEntryClassCode, statementDescriptor=$statementDescriptor, status=$status, submission=$submission, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var accountNumber: JsonField = JsonMissing.of()
private var acknowledgement: JsonField = JsonMissing.of()
private var addenda: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var approval: JsonField = JsonMissing.of()
private var cancellation: JsonField = JsonMissing.of()
private var companyDescriptiveDate: JsonField = JsonMissing.of()
private var companyDiscretionaryData: JsonField = JsonMissing.of()
private var companyEntryDescription: JsonField = JsonMissing.of()
private var companyName: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var createdBy: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var destinationAccountHolder: JsonField = JsonMissing.of()
private var externalAccountId: JsonField = JsonMissing.of()
private var funding: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var idempotencyKey: JsonField = JsonMissing.of()
private var inboundFundsHold: JsonField = JsonMissing.of()
private var individualId: JsonField = JsonMissing.of()
private var individualName: JsonField = JsonMissing.of()
private var network: JsonField = JsonMissing.of()
private var notificationsOfChange: JsonField> = JsonMissing.of()
private var pendingTransactionId: JsonField = JsonMissing.of()
private var preferredEffectiveDate: JsonField = JsonMissing.of()
private var return_: JsonField = JsonMissing.of()
private var routingNumber: JsonField = JsonMissing.of()
private var standardEntryClassCode: JsonField = JsonMissing.of()
private var statementDescriptor: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
private var submission: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(achTransfer: AchTransfer) = apply {
this.accountId = achTransfer.accountId
this.accountNumber = achTransfer.accountNumber
this.acknowledgement = achTransfer.acknowledgement
this.addenda = achTransfer.addenda
this.amount = achTransfer.amount
this.approval = achTransfer.approval
this.cancellation = achTransfer.cancellation
this.companyDescriptiveDate = achTransfer.companyDescriptiveDate
this.companyDiscretionaryData = achTransfer.companyDiscretionaryData
this.companyEntryDescription = achTransfer.companyEntryDescription
this.companyName = achTransfer.companyName
this.createdAt = achTransfer.createdAt
this.createdBy = achTransfer.createdBy
this.currency = achTransfer.currency
this.destinationAccountHolder = achTransfer.destinationAccountHolder
this.externalAccountId = achTransfer.externalAccountId
this.funding = achTransfer.funding
this.id = achTransfer.id
this.idempotencyKey = achTransfer.idempotencyKey
this.inboundFundsHold = achTransfer.inboundFundsHold
this.individualId = achTransfer.individualId
this.individualName = achTransfer.individualName
this.network = achTransfer.network
this.notificationsOfChange = achTransfer.notificationsOfChange
this.pendingTransactionId = achTransfer.pendingTransactionId
this.preferredEffectiveDate = achTransfer.preferredEffectiveDate
this.return_ = achTransfer.return_
this.routingNumber = achTransfer.routingNumber
this.standardEntryClassCode = achTransfer.standardEntryClassCode
this.statementDescriptor = achTransfer.statementDescriptor
this.status = achTransfer.status
this.submission = achTransfer.submission
this.transactionId = achTransfer.transactionId
this.type = achTransfer.type
additionalProperties(achTransfer.additionalProperties)
}
/** The Account to which the transfer belongs. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The Account to which the transfer belongs. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/** The destination account number. */
fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber))
/** The destination account number. */
@JsonProperty("account_number")
@ExcludeMissing
fun accountNumber(accountNumber: JsonField) = apply {
this.accountNumber = accountNumber
}
/**
* After the transfer is acknowledged by FedACH, this will contain supplemental details. The
* Federal Reserve sends an acknowledgement message for each file that Increase submits.
*/
fun acknowledgement(acknowledgement: Acknowledgement) =
acknowledgement(JsonField.of(acknowledgement))
/**
* After the transfer is acknowledged by FedACH, this will contain supplemental details. The
* Federal Reserve sends an acknowledgement message for each file that Increase submits.
*/
@JsonProperty("acknowledgement")
@ExcludeMissing
fun acknowledgement(acknowledgement: JsonField) = apply {
this.acknowledgement = acknowledgement
}
/** Additional information that will be sent to the recipient. */
fun addenda(addenda: Addenda) = addenda(JsonField.of(addenda))
/** Additional information that will be sent to the recipient. */
@JsonProperty("addenda")
@ExcludeMissing
fun addenda(addenda: JsonField) = apply { this.addenda = addenda }
/**
* The transfer amount in USD cents. A positive amount indicates a credit transfer pushing
* funds to the receiving account. A negative amount indicates a debit transfer pulling
* funds from the receiving account.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The transfer amount in USD cents. A positive amount indicates a credit transfer pushing
* funds to the receiving account. A negative amount indicates a debit transfer pulling
* funds from the receiving account.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* If your account requires approvals for transfers and the transfer was approved, this will
* contain details of the approval.
*/
fun approval(approval: Approval) = approval(JsonField.of(approval))
/**
* If your account requires approvals for transfers and the transfer was approved, this will
* contain details of the approval.
*/
@JsonProperty("approval")
@ExcludeMissing
fun approval(approval: JsonField) = apply { this.approval = approval }
/**
* If your account requires approvals for transfers and the transfer was not approved, this
* will contain details of the cancellation.
*/
fun cancellation(cancellation: Cancellation) = cancellation(JsonField.of(cancellation))
/**
* If your account requires approvals for transfers and the transfer was not approved, this
* will contain details of the cancellation.
*/
@JsonProperty("cancellation")
@ExcludeMissing
fun cancellation(cancellation: JsonField) = apply {
this.cancellation = cancellation
}
/** The description of the date of the transfer. */
fun companyDescriptiveDate(companyDescriptiveDate: String) =
companyDescriptiveDate(JsonField.of(companyDescriptiveDate))
/** The description of the date of the transfer. */
@JsonProperty("company_descriptive_date")
@ExcludeMissing
fun companyDescriptiveDate(companyDescriptiveDate: JsonField) = apply {
this.companyDescriptiveDate = companyDescriptiveDate
}
/** The data you chose to associate with the transfer. */
fun companyDiscretionaryData(companyDiscretionaryData: String) =
companyDiscretionaryData(JsonField.of(companyDiscretionaryData))
/** The data you chose to associate with the transfer. */
@JsonProperty("company_discretionary_data")
@ExcludeMissing
fun companyDiscretionaryData(companyDiscretionaryData: JsonField) = apply {
this.companyDiscretionaryData = companyDiscretionaryData
}
/** The description of the transfer you set to be shown to the recipient. */
fun companyEntryDescription(companyEntryDescription: String) =
companyEntryDescription(JsonField.of(companyEntryDescription))
/** The description of the transfer you set to be shown to the recipient. */
@JsonProperty("company_entry_description")
@ExcludeMissing
fun companyEntryDescription(companyEntryDescription: JsonField) = apply {
this.companyEntryDescription = companyEntryDescription
}
/** The name by which the recipient knows you. */
fun companyName(companyName: String) = companyName(JsonField.of(companyName))
/** The name by which the recipient knows you. */
@JsonProperty("company_name")
@ExcludeMissing
fun companyName(companyName: JsonField) = apply { this.companyName = companyName }
/**
* 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 }
/** What object created the transfer, either via the API or the dashboard. */
fun createdBy(createdBy: CreatedBy) = createdBy(JsonField.of(createdBy))
/** What object created the transfer, either via the API or the dashboard. */
@JsonProperty("created_by")
@ExcludeMissing
fun createdBy(createdBy: JsonField) = apply { this.createdBy = createdBy }
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency.
* For ACH transfers this is always equal to `usd`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transfer's currency.
* For ACH transfers this is always equal to `usd`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/** The type of entity that owns the account to which the ACH Transfer is being sent. */
fun destinationAccountHolder(destinationAccountHolder: DestinationAccountHolder) =
destinationAccountHolder(JsonField.of(destinationAccountHolder))
/** The type of entity that owns the account to which the ACH Transfer is being sent. */
@JsonProperty("destination_account_holder")
@ExcludeMissing
fun destinationAccountHolder(
destinationAccountHolder: JsonField
) = apply { this.destinationAccountHolder = destinationAccountHolder }
/** The identifier of the External Account the transfer was made to, if any. */
fun externalAccountId(externalAccountId: String) =
externalAccountId(JsonField.of(externalAccountId))
/** The identifier of the External Account the transfer was made to, if any. */
@JsonProperty("external_account_id")
@ExcludeMissing
fun externalAccountId(externalAccountId: JsonField) = apply {
this.externalAccountId = externalAccountId
}
/** The type of the account to which the transfer will be sent. */
fun funding(funding: Funding) = funding(JsonField.of(funding))
/** The type of the account to which the transfer will be sent. */
@JsonProperty("funding")
@ExcludeMissing
fun funding(funding: JsonField) = apply { this.funding = funding }
/** The ACH transfer's identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The ACH transfer's identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/**
* The idempotency key you chose for this object. This value is unique across Increase and
* is used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
fun idempotencyKey(idempotencyKey: String) = idempotencyKey(JsonField.of(idempotencyKey))
/**
* The idempotency key you chose for this object. This value is unique across Increase and
* is used to ensure that a request is only processed once. Learn more about
* [idempotency](https://increase.com/documentation/idempotency-keys).
*/
@JsonProperty("idempotency_key")
@ExcludeMissing
fun idempotencyKey(idempotencyKey: JsonField) = apply {
this.idempotencyKey = idempotencyKey
}
/**
* Increase will sometimes hold the funds for ACH debit transfers. If funds are held, this
* sub-object will contain details of the hold.
*/
fun inboundFundsHold(inboundFundsHold: InboundFundsHold) =
inboundFundsHold(JsonField.of(inboundFundsHold))
/**
* Increase will sometimes hold the funds for ACH debit transfers. If funds are held, this
* sub-object will contain details of the hold.
*/
@JsonProperty("inbound_funds_hold")
@ExcludeMissing
fun inboundFundsHold(inboundFundsHold: JsonField) = apply {
this.inboundFundsHold = inboundFundsHold
}
/** Your identifier for the transfer recipient. */
fun individualId(individualId: String) = individualId(JsonField.of(individualId))
/** Your identifier for the transfer recipient. */
@JsonProperty("individual_id")
@ExcludeMissing
fun individualId(individualId: JsonField) = apply {
this.individualId = individualId
}
/**
* The name of the transfer recipient. This value is information and not verified by the
* recipient's bank.
*/
fun individualName(individualName: String) = individualName(JsonField.of(individualName))
/**
* The name of the transfer recipient. This value is information and not verified by the
* recipient's bank.
*/
@JsonProperty("individual_name")
@ExcludeMissing
fun individualName(individualName: JsonField) = apply {
this.individualName = individualName
}
/** The transfer's network. */
fun network(network: Network) = network(JsonField.of(network))
/** The transfer's network. */
@JsonProperty("network")
@ExcludeMissing
fun network(network: JsonField) = apply { this.network = network }
/**
* If the receiving bank accepts the transfer but notifies that future transfers should use
* different details, this will contain those details.
*/
fun notificationsOfChange(notificationsOfChange: List) =
notificationsOfChange(JsonField.of(notificationsOfChange))
/**
* If the receiving bank accepts the transfer but notifies that future transfers should use
* different details, this will contain those details.
*/
@JsonProperty("notifications_of_change")
@ExcludeMissing
fun notificationsOfChange(notificationsOfChange: JsonField>) =
apply {
this.notificationsOfChange = notificationsOfChange
}
/**
* The ID for the pending transaction representing the transfer. A pending transaction is
* created when the transfer
* [requires approval](https://increase.com/documentation/transfer-approvals#transfer-approvals)
* by someone else in your organization.
*/
fun pendingTransactionId(pendingTransactionId: String) =
pendingTransactionId(JsonField.of(pendingTransactionId))
/**
* The ID for the pending transaction representing the transfer. A pending transaction is
* created when the transfer
* [requires approval](https://increase.com/documentation/transfer-approvals#transfer-approvals)
* by someone else in your organization.
*/
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun pendingTransactionId(pendingTransactionId: JsonField) = apply {
this.pendingTransactionId = pendingTransactionId
}
/**
* Configuration for how the effective date of the transfer will be set. This determines
* same-day vs future-dated settlement timing. If not set, defaults to a
* `settlement_schedule` of `same_day`. If set, exactly one of the child attributes must be
* set.
*/
fun preferredEffectiveDate(preferredEffectiveDate: PreferredEffectiveDate) =
preferredEffectiveDate(JsonField.of(preferredEffectiveDate))
/**
* Configuration for how the effective date of the transfer will be set. This determines
* same-day vs future-dated settlement timing. If not set, defaults to a
* `settlement_schedule` of `same_day`. If set, exactly one of the child attributes must be
* set.
*/
@JsonProperty("preferred_effective_date")
@ExcludeMissing
fun preferredEffectiveDate(preferredEffectiveDate: JsonField) =
apply {
this.preferredEffectiveDate = preferredEffectiveDate
}
/** If your transfer is returned, this will contain details of the return. */
fun return_(return_: Return) = return_(JsonField.of(return_))
/** If your transfer is returned, this will contain details of the return. */
@JsonProperty("return")
@ExcludeMissing
fun return_(return_: JsonField) = apply { this.return_ = return_ }
/** The American Bankers' Association (ABA) Routing Transit Number (RTN). */
fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber))
/** The American Bankers' Association (ABA) Routing Transit Number (RTN). */
@JsonProperty("routing_number")
@ExcludeMissing
fun routingNumber(routingNumber: JsonField) = apply {
this.routingNumber = routingNumber
}
/** The Standard Entry Class (SEC) code to use for the transfer. */
fun standardEntryClassCode(standardEntryClassCode: StandardEntryClassCode) =
standardEntryClassCode(JsonField.of(standardEntryClassCode))
/** The Standard Entry Class (SEC) code to use for the transfer. */
@JsonProperty("standard_entry_class_code")
@ExcludeMissing
fun standardEntryClassCode(standardEntryClassCode: JsonField) =
apply {
this.standardEntryClassCode = standardEntryClassCode
}
/** The descriptor that will show on the recipient's bank statement. */
fun statementDescriptor(statementDescriptor: String) =
statementDescriptor(JsonField.of(statementDescriptor))
/** The descriptor that will show on the recipient's bank statement. */
@JsonProperty("statement_descriptor")
@ExcludeMissing
fun statementDescriptor(statementDescriptor: JsonField) = apply {
this.statementDescriptor = statementDescriptor
}
/** The lifecycle status of the transfer. */
fun status(status: Status) = status(JsonField.of(status))
/** The lifecycle status of the transfer. */
@JsonProperty("status")
@ExcludeMissing
fun status(status: JsonField) = apply { this.status = status }
/**
* After the transfer is submitted to FedACH, this will contain supplemental details.
* Increase batches transfers and submits a file to the Federal Reserve roughly every 30
* minutes. The Federal Reserve processes ACH transfers during weekdays according to their
* [posted schedule](https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html).
*/
fun submission(submission: Submission) = submission(JsonField.of(submission))
/**
* After the transfer is submitted to FedACH, this will contain supplemental details.
* Increase batches transfers and submits a file to the Federal Reserve roughly every 30
* minutes. The Federal Reserve processes ACH transfers during weekdays according to their
* [posted schedule](https://www.frbservices.org/resources/resource-centers/same-day-ach/fedach-processing-schedule.html).
*/
@JsonProperty("submission")
@ExcludeMissing
fun submission(submission: JsonField) = apply { this.submission = submission }
/** The ID for the transaction funding the transfer. */
fun transactionId(transactionId: String) = transactionId(JsonField.of(transactionId))
/** The ID for the transaction funding the transfer. */
@JsonProperty("transaction_id")
@ExcludeMissing
fun transactionId(transactionId: JsonField) = apply {
this.transactionId = transactionId
}
/**
* A constant representing the object's type. For this resource it will always be
* `ach_transfer`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `ach_transfer`.
*/
@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(): AchTransfer =
AchTransfer(
accountId,
accountNumber,
acknowledgement,
addenda,
amount,
approval,
cancellation,
companyDescriptiveDate,
companyDiscretionaryData,
companyEntryDescription,
companyName,
createdAt,
createdBy,
currency,
destinationAccountHolder,
externalAccountId,
funding,
id,
idempotencyKey,
inboundFundsHold,
individualId,
individualName,
network,
notificationsOfChange.map { it.toUnmodifiable() },
pendingTransactionId,
preferredEffectiveDate,
return_,
routingNumber,
standardEntryClassCode,
statementDescriptor,
status,
submission,
transactionId,
type,
additionalProperties.toUnmodifiable(),
)
}
/**
* After the transfer is acknowledged by FedACH, this will contain supplemental details. The
* Federal Reserve sends an acknowledgement message for each file that Increase submits.
*/
@JsonDeserialize(builder = Acknowledgement.Builder::class)
@NoAutoDetect
class Acknowledgement
private constructor(
private val acknowledgedAt: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** When the Federal Reserve acknowledged the submitted file containing this transfer. */
fun acknowledgedAt(): String = acknowledgedAt.getRequired("acknowledged_at")
/** When the Federal Reserve acknowledged the submitted file containing this transfer. */
@JsonProperty("acknowledged_at") @ExcludeMissing fun _acknowledgedAt() = acknowledgedAt
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Acknowledgement = apply {
if (!validated) {
acknowledgedAt()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Acknowledgement &&
this.acknowledgedAt == other.acknowledgedAt &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(acknowledgedAt, additionalProperties)
}
return hashCode
}
override fun toString() =
"Acknowledgement{acknowledgedAt=$acknowledgedAt, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var acknowledgedAt: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(acknowledgement: Acknowledgement) = apply {
this.acknowledgedAt = acknowledgement.acknowledgedAt
additionalProperties(acknowledgement.additionalProperties)
}
/**
* When the Federal Reserve acknowledged the submitted file containing this transfer.
*/
fun acknowledgedAt(acknowledgedAt: String) =
acknowledgedAt(JsonField.of(acknowledgedAt))
/**
* When the Federal Reserve acknowledged the submitted file containing this transfer.
*/
@JsonProperty("acknowledged_at")
@ExcludeMissing
fun acknowledgedAt(acknowledgedAt: JsonField) = apply {
this.acknowledgedAt = acknowledgedAt
}
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(): Acknowledgement =
Acknowledgement(acknowledgedAt, additionalProperties.toUnmodifiable())
}
}
/** Additional information that will be sent to the recipient. */
@JsonDeserialize(builder = Addenda.Builder::class)
@NoAutoDetect
class Addenda
private constructor(
private val category: JsonField,
private val freeform: JsonField,
private val paymentOrderRemittanceAdvice: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* 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")
/** Unstructured `payment_related_information` passed through with the transfer. */
fun freeform(): Freeform? = freeform.getNullable("freeform")
/**
* Structured ASC X12 820 remittance advice records. Please reach out to
* [[email protected]](mailto:[email protected]) for more information.
*/
fun paymentOrderRemittanceAdvice(): PaymentOrderRemittanceAdvice? =
paymentOrderRemittanceAdvice.getNullable("payment_order_remittance_advice")
/**
* 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
/** Unstructured `payment_related_information` passed through with the transfer. */
@JsonProperty("freeform") @ExcludeMissing fun _freeform() = freeform
/**
* Structured ASC X12 820 remittance advice records. Please reach out to
* [[email protected]](mailto:[email protected]) for more information.
*/
@JsonProperty("payment_order_remittance_advice")
@ExcludeMissing
fun _paymentOrderRemittanceAdvice() = paymentOrderRemittanceAdvice
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Addenda = apply {
if (!validated) {
category()
freeform()?.validate()
paymentOrderRemittanceAdvice()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Addenda &&
this.category == other.category &&
this.freeform == other.freeform &&
this.paymentOrderRemittanceAdvice == other.paymentOrderRemittanceAdvice &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
category,
freeform,
paymentOrderRemittanceAdvice,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Addenda{category=$category, freeform=$freeform, paymentOrderRemittanceAdvice=$paymentOrderRemittanceAdvice, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var category: JsonField = JsonMissing.of()
private var freeform: JsonField = JsonMissing.of()
private var paymentOrderRemittanceAdvice: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(addenda: Addenda) = apply {
this.category = addenda.category
this.freeform = addenda.freeform
this.paymentOrderRemittanceAdvice = addenda.paymentOrderRemittanceAdvice
additionalProperties(addenda.additionalProperties)
}
/**
* 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 }
/** Unstructured `payment_related_information` passed through with the transfer. */
fun freeform(freeform: Freeform) = freeform(JsonField.of(freeform))
/** Unstructured `payment_related_information` passed through with the transfer. */
@JsonProperty("freeform")
@ExcludeMissing
fun freeform(freeform: JsonField) = apply { this.freeform = freeform }
/**
* Structured ASC X12 820 remittance advice records. Please reach out to
* [[email protected]](mailto:[email protected]) for more information.
*/
fun paymentOrderRemittanceAdvice(
paymentOrderRemittanceAdvice: PaymentOrderRemittanceAdvice
) = paymentOrderRemittanceAdvice(JsonField.of(paymentOrderRemittanceAdvice))
/**
* Structured ASC X12 820 remittance advice records. Please reach out to
* [[email protected]](mailto:[email protected]) for more information.
*/
@JsonProperty("payment_order_remittance_advice")
@ExcludeMissing
fun paymentOrderRemittanceAdvice(
paymentOrderRemittanceAdvice: JsonField
) = apply { this.paymentOrderRemittanceAdvice = paymentOrderRemittanceAdvice }
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(): Addenda =
Addenda(
category,
freeform,
paymentOrderRemittanceAdvice,
additionalProperties.toUnmodifiable(),
)
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Category && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val FREEFORM = Category(JsonField.of("freeform"))
val PAYMENT_ORDER_REMITTANCE_ADVICE =
Category(JsonField.of("payment_order_remittance_advice"))
val OTHER = Category(JsonField.of("other"))
fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
FREEFORM,
PAYMENT_ORDER_REMITTANCE_ADVICE,
OTHER,
}
enum class Value {
FREEFORM,
PAYMENT_ORDER_REMITTANCE_ADVICE,
OTHER,
_UNKNOWN,
}
fun value(): Value =
when (this) {
FREEFORM -> Value.FREEFORM
PAYMENT_ORDER_REMITTANCE_ADVICE -> Value.PAYMENT_ORDER_REMITTANCE_ADVICE
OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
FREEFORM -> Known.FREEFORM
PAYMENT_ORDER_REMITTANCE_ADVICE -> Known.PAYMENT_ORDER_REMITTANCE_ADVICE
OTHER -> Known.OTHER
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Unstructured `payment_related_information` passed through with the transfer. */
@JsonDeserialize(builder = Freeform.Builder::class)
@NoAutoDetect
class Freeform
private constructor(
private val entries: JsonField>,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Each entry represents an addendum sent with the transfer. */
fun entries(): List = entries.getRequired("entries")
/** Each entry represents an addendum sent with the transfer. */
@JsonProperty("entries") @ExcludeMissing fun _entries() = entries
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Freeform = apply {
if (!validated) {
entries().forEach { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Freeform &&
this.entries == other.entries &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(entries, additionalProperties)
}
return hashCode
}
override fun toString() =
"Freeform{entries=$entries, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var entries: JsonField> = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(freeform: Freeform) = apply {
this.entries = freeform.entries
additionalProperties(freeform.additionalProperties)
}
/** Each entry represents an addendum sent with the transfer. */
fun entries(entries: List) = entries(JsonField.of(entries))
/** Each entry represents an addendum sent with the transfer. */
@JsonProperty("entries")
@ExcludeMissing
fun entries(entries: JsonField>) = apply { this.entries = entries }
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(): Freeform =
Freeform(
entries.map { it.toUnmodifiable() },
additionalProperties.toUnmodifiable()
)
}
@JsonDeserialize(builder = Entry.Builder::class)
@NoAutoDetect
class Entry
private constructor(
private val paymentRelatedInformation: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The payment related information passed in the addendum. */
fun paymentRelatedInformation(): String =
paymentRelatedInformation.getRequired("payment_related_information")
/** The payment related information passed in the addendum. */
@JsonProperty("payment_related_information")
@ExcludeMissing
fun _paymentRelatedInformation() = paymentRelatedInformation
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Entry = apply {
if (!validated) {
paymentRelatedInformation()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Entry &&
this.paymentRelatedInformation == other.paymentRelatedInformation &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(paymentRelatedInformation, additionalProperties)
}
return hashCode
}
override fun toString() =
"Entry{paymentRelatedInformation=$paymentRelatedInformation, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var paymentRelatedInformation: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(entry: Entry) = apply {
this.paymentRelatedInformation = entry.paymentRelatedInformation
additionalProperties(entry.additionalProperties)
}
/** The payment related information passed in the addendum. */
fun paymentRelatedInformation(paymentRelatedInformation: String) =
paymentRelatedInformation(JsonField.of(paymentRelatedInformation))
/** The payment related information passed in the addendum. */
@JsonProperty("payment_related_information")
@ExcludeMissing
fun paymentRelatedInformation(paymentRelatedInformation: JsonField) =
apply {
this.paymentRelatedInformation = paymentRelatedInformation
}
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(): Entry =
Entry(paymentRelatedInformation, additionalProperties.toUnmodifiable())
}
}
}
/**
* Structured ASC X12 820 remittance advice records. Please reach out to
* [[email protected]](mailto:[email protected]) for more information.
*/
@JsonDeserialize(builder = PaymentOrderRemittanceAdvice.Builder::class)
@NoAutoDetect
class PaymentOrderRemittanceAdvice
private constructor(
private val invoices: JsonField>,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** ASC X12 RMR records for this specific transfer. */
fun invoices(): List = invoices.getRequired("invoices")
/** ASC X12 RMR records for this specific transfer. */
@JsonProperty("invoices") @ExcludeMissing fun _invoices() = invoices
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): PaymentOrderRemittanceAdvice = apply {
if (!validated) {
invoices().forEach { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is PaymentOrderRemittanceAdvice &&
this.invoices == other.invoices &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(invoices, additionalProperties)
}
return hashCode
}
override fun toString() =
"PaymentOrderRemittanceAdvice{invoices=$invoices, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var invoices: JsonField> = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(paymentOrderRemittanceAdvice: PaymentOrderRemittanceAdvice) =
apply {
this.invoices = paymentOrderRemittanceAdvice.invoices
additionalProperties(paymentOrderRemittanceAdvice.additionalProperties)
}
/** ASC X12 RMR records for this specific transfer. */
fun invoices(invoices: List) = invoices(JsonField.of(invoices))
/** ASC X12 RMR records for this specific transfer. */
@JsonProperty("invoices")
@ExcludeMissing
fun invoices(invoices: JsonField>) = apply {
this.invoices = invoices
}
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(): PaymentOrderRemittanceAdvice =
PaymentOrderRemittanceAdvice(
invoices.map { it.toUnmodifiable() },
additionalProperties.toUnmodifiable()
)
}
@JsonDeserialize(builder = Invoice.Builder::class)
@NoAutoDetect
class Invoice
private constructor(
private val invoiceNumber: JsonField,
private val paidAmount: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* The invoice number for this reference, determined in advance with the receiver.
*/
fun invoiceNumber(): String = invoiceNumber.getRequired("invoice_number")
/**
* The amount that was paid for this invoice in the minor unit of its currency. For
* dollars, for example, this is cents.
*/
fun paidAmount(): Long = paidAmount.getRequired("paid_amount")
/**
* The invoice number for this reference, determined in advance with the receiver.
*/
@JsonProperty("invoice_number") @ExcludeMissing fun _invoiceNumber() = invoiceNumber
/**
* The amount that was paid for this invoice in the minor unit of its currency. For
* dollars, for example, this is cents.
*/
@JsonProperty("paid_amount") @ExcludeMissing fun _paidAmount() = paidAmount
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Invoice = apply {
if (!validated) {
invoiceNumber()
paidAmount()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Invoice &&
this.invoiceNumber == other.invoiceNumber &&
this.paidAmount == other.paidAmount &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
invoiceNumber,
paidAmount,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Invoice{invoiceNumber=$invoiceNumber, paidAmount=$paidAmount, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var invoiceNumber: JsonField = JsonMissing.of()
private var paidAmount: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(invoice: Invoice) = apply {
this.invoiceNumber = invoice.invoiceNumber
this.paidAmount = invoice.paidAmount
additionalProperties(invoice.additionalProperties)
}
/**
* The invoice number for this reference, determined in advance with the
* receiver.
*/
fun invoiceNumber(invoiceNumber: String) =
invoiceNumber(JsonField.of(invoiceNumber))
/**
* The invoice number for this reference, determined in advance with the
* receiver.
*/
@JsonProperty("invoice_number")
@ExcludeMissing
fun invoiceNumber(invoiceNumber: JsonField) = apply {
this.invoiceNumber = invoiceNumber
}
/**
* The amount that was paid for this invoice in the minor unit of its currency.
* For dollars, for example, this is cents.
*/
fun paidAmount(paidAmount: Long) = paidAmount(JsonField.of(paidAmount))
/**
* The amount that was paid for this invoice in the minor unit of its currency.
* For dollars, for example, this is cents.
*/
@JsonProperty("paid_amount")
@ExcludeMissing
fun paidAmount(paidAmount: JsonField) = apply {
this.paidAmount = paidAmount
}
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(): Invoice =
Invoice(
invoiceNumber,
paidAmount,
additionalProperties.toUnmodifiable(),
)
}
}
}
}
/**
* If your account requires approvals for transfers and the transfer was approved, this will
* contain details of the approval.
*/
@JsonDeserialize(builder = Approval.Builder::class)
@NoAutoDetect
class Approval
private constructor(
private val approvedAt: JsonField,
private val approvedBy: 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 approved.
*/
fun approvedAt(): OffsetDateTime = approvedAt.getRequired("approved_at")
/**
* If the Transfer was approved by a user in the dashboard, the email address of that user.
*/
fun approvedBy(): String? = approvedBy.getNullable("approved_by")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was approved.
*/
@JsonProperty("approved_at") @ExcludeMissing fun _approvedAt() = approvedAt
/**
* If the Transfer was approved by a user in the dashboard, the email address of that user.
*/
@JsonProperty("approved_by") @ExcludeMissing fun _approvedBy() = approvedBy
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Approval = apply {
if (!validated) {
approvedAt()
approvedBy()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Approval &&
this.approvedAt == other.approvedAt &&
this.approvedBy == other.approvedBy &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
approvedAt,
approvedBy,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Approval{approvedAt=$approvedAt, approvedBy=$approvedBy, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var approvedAt: JsonField = JsonMissing.of()
private var approvedBy: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(approval: Approval) = apply {
this.approvedAt = approval.approvedAt
this.approvedBy = approval.approvedBy
additionalProperties(approval.additionalProperties)
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was approved.
*/
fun approvedAt(approvedAt: OffsetDateTime) = approvedAt(JsonField.of(approvedAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* transfer was approved.
*/
@JsonProperty("approved_at")
@ExcludeMissing
fun approvedAt(approvedAt: JsonField) = apply {
this.approvedAt = approvedAt
}
/**
* If the Transfer was approved by a user in the dashboard, the email address of that
* user.
*/
fun approvedBy(approvedBy: String) = approvedBy(JsonField.of(approvedBy))
/**
* If the Transfer was approved by a user in the dashboard, the email address of that
* user.
*/
@JsonProperty("approved_by")
@ExcludeMissing
fun approvedBy(approvedBy: JsonField) = apply { this.approvedBy = approvedBy }
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(): Approval =
Approval(
approvedAt,
approvedBy,
additionalProperties.toUnmodifiable(),
)
}
}
/**
* If your account requires approvals for transfers and the transfer was not approved, this will
* contain details of the cancellation.
*/
@JsonDeserialize(builder = Cancellation.Builder::class)
@NoAutoDetect
class Cancellation
private constructor(
private val canceledAt: JsonField,
private val canceledBy: 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 canceled.
*/
fun canceledAt(): OffsetDateTime = canceledAt.getRequired("canceled_at")
/**
* If the Transfer was canceled by a user in the dashboard, the email address of that user.
*/
fun canceledBy(): String? = canceledBy.getNullable("canceled_by")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Transfer was canceled.
*/
@JsonProperty("canceled_at") @ExcludeMissing fun _canceledAt() = canceledAt
/**
* If the Transfer was canceled by a user in the dashboard, the email address of that user.
*/
@JsonProperty("canceled_by") @ExcludeMissing fun _canceledBy() = canceledBy
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Cancellation = apply {
if (!validated) {
canceledAt()
canceledBy()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Cancellation &&
this.canceledAt == other.canceledAt &&
this.canceledBy == other.canceledBy &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
canceledAt,
canceledBy,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Cancellation{canceledAt=$canceledAt, canceledBy=$canceledBy, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var canceledAt: JsonField = JsonMissing.of()
private var canceledBy: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cancellation: Cancellation) = apply {
this.canceledAt = cancellation.canceledAt
this.canceledBy = cancellation.canceledBy
additionalProperties(cancellation.additionalProperties)
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Transfer was canceled.
*/
fun canceledAt(canceledAt: OffsetDateTime) = canceledAt(JsonField.of(canceledAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* Transfer was canceled.
*/
@JsonProperty("canceled_at")
@ExcludeMissing
fun canceledAt(canceledAt: JsonField) = apply {
this.canceledAt = canceledAt
}
/**
* If the Transfer was canceled by a user in the dashboard, the email address of that
* user.
*/
fun canceledBy(canceledBy: String) = canceledBy(JsonField.of(canceledBy))
/**
* If the Transfer was canceled by a user in the dashboard, the email address of that
* user.
*/
@JsonProperty("canceled_by")
@ExcludeMissing
fun canceledBy(canceledBy: JsonField) = apply { this.canceledBy = canceledBy }
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(): Cancellation =
Cancellation(
canceledAt,
canceledBy,
additionalProperties.toUnmodifiable(),
)
}
}
/** What object created the transfer, either via the API or the dashboard. */
@JsonDeserialize(builder = CreatedBy.Builder::class)
@NoAutoDetect
class CreatedBy
private constructor(
private val apiKey: JsonField,
private val category: JsonField,
private val oauthApplication: JsonField,
private val user: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** If present, details about the API key that created the transfer. */
fun apiKey(): ApiKey? = apiKey.getNullable("api_key")
/** The type of object that created this transfer. */
fun category(): Category = category.getRequired("category")
/** If present, details about the OAuth Application that created the transfer. */
fun oauthApplication(): OAuthApplication? =
oauthApplication.getNullable("oauth_application")
/** If present, details about the User that created the transfer. */
fun user(): User? = user.getNullable("user")
/** If present, details about the API key that created the transfer. */
@JsonProperty("api_key") @ExcludeMissing fun _apiKey() = apiKey
/** The type of object that created this transfer. */
@JsonProperty("category") @ExcludeMissing fun _category() = category
/** If present, details about the OAuth Application that created the transfer. */
@JsonProperty("oauth_application")
@ExcludeMissing
fun _oauthApplication() = oauthApplication
/** If present, details about the User that created the transfer. */
@JsonProperty("user") @ExcludeMissing fun _user() = user
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CreatedBy = apply {
if (!validated) {
apiKey()?.validate()
category()
oauthApplication()?.validate()
user()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CreatedBy &&
this.apiKey == other.apiKey &&
this.category == other.category &&
this.oauthApplication == other.oauthApplication &&
this.user == other.user &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
apiKey,
category,
oauthApplication,
user,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CreatedBy{apiKey=$apiKey, category=$category, oauthApplication=$oauthApplication, user=$user, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var apiKey: JsonField = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var oauthApplication: JsonField = JsonMissing.of()
private var user: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(createdBy: CreatedBy) = apply {
this.apiKey = createdBy.apiKey
this.category = createdBy.category
this.oauthApplication = createdBy.oauthApplication
this.user = createdBy.user
additionalProperties(createdBy.additionalProperties)
}
/** If present, details about the API key that created the transfer. */
fun apiKey(apiKey: ApiKey) = apiKey(JsonField.of(apiKey))
/** If present, details about the API key that created the transfer. */
@JsonProperty("api_key")
@ExcludeMissing
fun apiKey(apiKey: JsonField) = apply { this.apiKey = apiKey }
/** The type of object that created this transfer. */
fun category(category: Category) = category(JsonField.of(category))
/** The type of object that created this transfer. */
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/** If present, details about the OAuth Application that created the transfer. */
fun oauthApplication(oauthApplication: OAuthApplication) =
oauthApplication(JsonField.of(oauthApplication))
/** If present, details about the OAuth Application that created the transfer. */
@JsonProperty("oauth_application")
@ExcludeMissing
fun oauthApplication(oauthApplication: JsonField) = apply {
this.oauthApplication = oauthApplication
}
/** If present, details about the User that created the transfer. */
fun user(user: User) = user(JsonField.of(user))
/** If present, details about the User that created the transfer. */
@JsonProperty("user")
@ExcludeMissing
fun user(user: JsonField) = apply { this.user = user }
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(): CreatedBy =
CreatedBy(
apiKey,
category,
oauthApplication,
user,
additionalProperties.toUnmodifiable(),
)
}
/** If present, details about the API key that created the transfer. */
@JsonDeserialize(builder = ApiKey.Builder::class)
@NoAutoDetect
class ApiKey
private constructor(
private val description: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The description set for the API key when it was created. */
fun description(): String? = description.getNullable("description")
/** The description set for the API key when it was created. */
@JsonProperty("description") @ExcludeMissing fun _description() = description
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): ApiKey = apply {
if (!validated) {
description()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is ApiKey &&
this.description == other.description &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(description, additionalProperties)
}
return hashCode
}
override fun toString() =
"ApiKey{description=$description, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var description: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(apiKey: ApiKey) = apply {
this.description = apiKey.description
additionalProperties(apiKey.additionalProperties)
}
/** The description set for the API key when it was created. */
fun description(description: String) = description(JsonField.of(description))
/** The description set for the API key when it was created. */
@JsonProperty("description")
@ExcludeMissing
fun description(description: JsonField) = apply {
this.description = description
}
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(): ApiKey = ApiKey(description, additionalProperties.toUnmodifiable())
}
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Category && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val API_KEY = Category(JsonField.of("api_key"))
val OAUTH_APPLICATION = Category(JsonField.of("oauth_application"))
val USER = Category(JsonField.of("user"))
fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
API_KEY,
OAUTH_APPLICATION,
USER,
}
enum class Value {
API_KEY,
OAUTH_APPLICATION,
USER,
_UNKNOWN,
}
fun value(): Value =
when (this) {
API_KEY -> Value.API_KEY
OAUTH_APPLICATION -> Value.OAUTH_APPLICATION
USER -> Value.USER
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
API_KEY -> Known.API_KEY
OAUTH_APPLICATION -> Known.OAUTH_APPLICATION
USER -> Known.USER
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** If present, details about the OAuth Application that created the transfer. */
@JsonDeserialize(builder = OAuthApplication.Builder::class)
@NoAutoDetect
class OAuthApplication
private constructor(
private val name: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The name of the OAuth Application. */
fun name(): String = name.getRequired("name")
/** The name of the OAuth Application. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): OAuthApplication = apply {
if (!validated) {
name()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is OAuthApplication &&
this.name == other.name &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(name, additionalProperties)
}
return hashCode
}
override fun toString() =
"OAuthApplication{name=$name, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(oauthApplication: OAuthApplication) = apply {
this.name = oauthApplication.name
additionalProperties(oauthApplication.additionalProperties)
}
/** The name of the OAuth Application. */
fun name(name: String) = name(JsonField.of(name))
/** The name of the OAuth Application. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
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(): OAuthApplication =
OAuthApplication(name, additionalProperties.toUnmodifiable())
}
}
/** If present, details about the User that created the transfer. */
@JsonDeserialize(builder = User.Builder::class)
@NoAutoDetect
class User
private constructor(
private val email: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The email address of the User. */
fun email(): String = email.getRequired("email")
/** The email address of the User. */
@JsonProperty("email") @ExcludeMissing fun _email() = email
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): User = apply {
if (!validated) {
email()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is User &&
this.email == other.email &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = Objects.hash(email, additionalProperties)
}
return hashCode
}
override fun toString() =
"User{email=$email, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var email: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(user: User) = apply {
this.email = user.email
additionalProperties(user.additionalProperties)
}
/** The email address of the User. */
fun email(email: String) = email(JsonField.of(email))
/** The email address of the User. */
@JsonProperty("email")
@ExcludeMissing
fun email(email: JsonField) = apply { this.email = email }
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(): User = User(email, 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 {
val CAD = Currency(JsonField.of("CAD"))
val CHF = Currency(JsonField.of("CHF"))
val EUR = Currency(JsonField.of("EUR"))
val GBP = Currency(JsonField.of("GBP"))
val JPY = Currency(JsonField.of("JPY"))
val USD = Currency(JsonField.of("USD"))
fun of(value: String) = Currency(JsonField.of(value))
}
enum class Known {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
}
enum class Value {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CAD -> Value.CAD
CHF -> Value.CHF
EUR -> Value.EUR
GBP -> Value.GBP
JPY -> Value.JPY
USD -> Value.USD
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CAD -> Known.CAD
CHF -> Known.CHF
EUR -> Known.EUR
GBP -> Known.GBP
JPY -> Known.JPY
USD -> Known.USD
else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class DestinationAccountHolder
@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 DestinationAccountHolder && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val BUSINESS = DestinationAccountHolder(JsonField.of("business"))
val INDIVIDUAL = DestinationAccountHolder(JsonField.of("individual"))
val UNKNOWN = DestinationAccountHolder(JsonField.of("unknown"))
fun of(value: String) = DestinationAccountHolder(JsonField.of(value))
}
enum class Known {
BUSINESS,
INDIVIDUAL,
UNKNOWN,
}
enum class Value {
BUSINESS,
INDIVIDUAL,
UNKNOWN,
_UNKNOWN,
}
fun value(): Value =
when (this) {
BUSINESS -> Value.BUSINESS
INDIVIDUAL -> Value.INDIVIDUAL
UNKNOWN -> Value.UNKNOWN
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
BUSINESS -> Known.BUSINESS
INDIVIDUAL -> Known.INDIVIDUAL
UNKNOWN -> Known.UNKNOWN
else ->
throw IncreaseInvalidDataException("Unknown DestinationAccountHolder: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Funding
@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 Funding && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CHECKING = Funding(JsonField.of("checking"))
val SAVINGS = Funding(JsonField.of("savings"))
fun of(value: String) = Funding(JsonField.of(value))
}
enum class Known {
CHECKING,
SAVINGS,
}
enum class Value {
CHECKING,
SAVINGS,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CHECKING -> Value.CHECKING
SAVINGS -> Value.SAVINGS
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CHECKING -> Known.CHECKING
SAVINGS -> Known.SAVINGS
else -> throw IncreaseInvalidDataException("Unknown Funding: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/**
* Increase will sometimes hold the funds for ACH debit transfers. If funds are held, this
* sub-object will contain details of the hold.
*/
@JsonDeserialize(builder = InboundFundsHold.Builder::class)
@NoAutoDetect
class InboundFundsHold
private constructor(
private val amount: JsonField,
private val automaticallyReleasesAt: JsonField,
private val createdAt: JsonField,
private val currency: JsonField,
private val heldTransactionId: JsonField,
private val id: JsonField,
private val pendingTransactionId: JsonField,
private val releasedAt: JsonField,
private val status: JsonField