com.increase.api.models.CheckTransfer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of increase-java-core Show documentation
Show all versions of increase-java-core Show documentation
An SDK library for increase
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.OffsetDateTime
import java.util.Objects
import java.util.Optional
/** Check Transfers move funds from your Increase account by mailing a physical check. */
@JsonDeserialize(builder = CheckTransfer.Builder::class)
@NoAutoDetect
class CheckTransfer
private constructor(
private val accountId: JsonField,
private val accountNumber: JsonField,
private val amount: JsonField,
private val approval: JsonField,
private val approvedInboundCheckDepositId: JsonField,
private val cancellation: JsonField,
private val checkNumber: JsonField,
private val createdAt: JsonField,
private val createdBy: JsonField,
private val currency: JsonField,
private val fulfillmentMethod: JsonField,
private val id: JsonField,
private val idempotencyKey: JsonField,
private val mailing: JsonField,
private val pendingTransactionId: JsonField,
private val physicalCheck: JsonField,
private val routingNumber: JsonField,
private val sourceAccountNumberId: JsonField,
private val status: JsonField,
private val stopPaymentRequest: JsonField,
private val submission: JsonField,
private val thirdParty: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The identifier of the Account from which funds will be transferred. */
fun accountId(): String = accountId.getRequired("account_id")
/** The account number printed on the check. */
fun accountNumber(): String = accountNumber.getRequired("account_number")
/** The transfer amount in USD cents. */
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(): Optional = Optional.ofNullable(approval.getNullable("approval"))
/**
* If the Check Transfer was successfully deposited, this will contain the identifier of the
* Inbound Check Deposit object with details of the deposit.
*/
fun approvedInboundCheckDepositId(): Optional =
Optional.ofNullable(
approvedInboundCheckDepositId.getNullable("approved_inbound_check_deposit_id")
)
/**
* If your account requires approvals for transfers and the transfer was not approved, this will
* contain details of the cancellation.
*/
fun cancellation(): Optional =
Optional.ofNullable(cancellation.getNullable("cancellation"))
/** The check number printed on the check. */
fun checkNumber(): String = checkNumber.getRequired("check_number")
/**
* 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(): Optional = Optional.ofNullable(createdBy.getNullable("created_by"))
/** The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's currency. */
fun currency(): Currency = currency.getRequired("currency")
/** Whether Increase will print and mail the check or if you will do it yourself. */
fun fulfillmentMethod(): FulfillmentMethod = fulfillmentMethod.getRequired("fulfillment_method")
/** The Check 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(): Optional =
Optional.ofNullable(idempotencyKey.getNullable("idempotency_key"))
/** If the check has been mailed by Increase, this will contain details of the shipment. */
fun mailing(): Optional = Optional.ofNullable(mailing.getNullable("mailing"))
/**
* 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(): Optional =
Optional.ofNullable(pendingTransactionId.getNullable("pending_transaction_id"))
/**
* Details relating to the physical check that Increase will print and mail. Will be present if
* and only if `fulfillment_method` is equal to `physical_check`.
*/
fun physicalCheck(): Optional =
Optional.ofNullable(physicalCheck.getNullable("physical_check"))
/** The routing number printed on the check. */
fun routingNumber(): String = routingNumber.getRequired("routing_number")
/**
* The identifier of the Account Number from which to send the transfer and print on the check.
*/
fun sourceAccountNumberId(): Optional =
Optional.ofNullable(sourceAccountNumberId.getNullable("source_account_number_id"))
/** The lifecycle status of the transfer. */
fun status(): Status = status.getRequired("status")
/** After a stop-payment is requested on the check, this will contain supplemental details. */
fun stopPaymentRequest(): Optional =
Optional.ofNullable(stopPaymentRequest.getNullable("stop_payment_request"))
/** After the transfer is submitted, this will contain supplemental details. */
fun submission(): Optional =
Optional.ofNullable(submission.getNullable("submission"))
/**
* Details relating to the custom fulfillment you will perform. Will be present if and only if
* `fulfillment_method` is equal to `third_party`.
*/
fun thirdParty(): Optional =
Optional.ofNullable(thirdParty.getNullable("third_party"))
/**
* A constant representing the object's type. For this resource it will always be
* `check_transfer`.
*/
fun type(): Type = type.getRequired("type")
/** The identifier of the Account from which funds will be transferred. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/** The account number printed on the check. */
@JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber
/** The transfer amount in USD cents. */
@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 the Check Transfer was successfully deposited, this will contain the identifier of the
* Inbound Check Deposit object with details of the deposit.
*/
@JsonProperty("approved_inbound_check_deposit_id")
@ExcludeMissing
fun _approvedInboundCheckDepositId() = approvedInboundCheckDepositId
/**
* 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 check number printed on the check. */
@JsonProperty("check_number") @ExcludeMissing fun _checkNumber() = checkNumber
/**
* 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 check's currency. */
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/** Whether Increase will print and mail the check or if you will do it yourself. */
@JsonProperty("fulfillment_method") @ExcludeMissing fun _fulfillmentMethod() = fulfillmentMethod
/** The Check 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
/** If the check has been mailed by Increase, this will contain details of the shipment. */
@JsonProperty("mailing") @ExcludeMissing fun _mailing() = mailing
/**
* 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
/**
* Details relating to the physical check that Increase will print and mail. Will be present if
* and only if `fulfillment_method` is equal to `physical_check`.
*/
@JsonProperty("physical_check") @ExcludeMissing fun _physicalCheck() = physicalCheck
/** The routing number printed on the check. */
@JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber
/**
* The identifier of the Account Number from which to send the transfer and print on the check.
*/
@JsonProperty("source_account_number_id")
@ExcludeMissing
fun _sourceAccountNumberId() = sourceAccountNumberId
/** The lifecycle status of the transfer. */
@JsonProperty("status") @ExcludeMissing fun _status() = status
/** After a stop-payment is requested on the check, this will contain supplemental details. */
@JsonProperty("stop_payment_request")
@ExcludeMissing
fun _stopPaymentRequest() = stopPaymentRequest
/** After the transfer is submitted, this will contain supplemental details. */
@JsonProperty("submission") @ExcludeMissing fun _submission() = submission
/**
* Details relating to the custom fulfillment you will perform. Will be present if and only if
* `fulfillment_method` is equal to `third_party`.
*/
@JsonProperty("third_party") @ExcludeMissing fun _thirdParty() = thirdParty
/**
* A constant representing the object's type. For this resource it will always be
* `check_transfer`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CheckTransfer = apply {
if (!validated) {
accountId()
accountNumber()
amount()
approval().map { it.validate() }
approvedInboundCheckDepositId()
cancellation().map { it.validate() }
checkNumber()
createdAt()
createdBy().map { it.validate() }
currency()
fulfillmentMethod()
id()
idempotencyKey()
mailing().map { it.validate() }
pendingTransactionId()
physicalCheck().map { it.validate() }
routingNumber()
sourceAccountNumberId()
status()
stopPaymentRequest().map { it.validate() }
submission().map { it.validate() }
thirdParty().map { it.validate() }
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CheckTransfer &&
this.accountId == other.accountId &&
this.accountNumber == other.accountNumber &&
this.amount == other.amount &&
this.approval == other.approval &&
this.approvedInboundCheckDepositId == other.approvedInboundCheckDepositId &&
this.cancellation == other.cancellation &&
this.checkNumber == other.checkNumber &&
this.createdAt == other.createdAt &&
this.createdBy == other.createdBy &&
this.currency == other.currency &&
this.fulfillmentMethod == other.fulfillmentMethod &&
this.id == other.id &&
this.idempotencyKey == other.idempotencyKey &&
this.mailing == other.mailing &&
this.pendingTransactionId == other.pendingTransactionId &&
this.physicalCheck == other.physicalCheck &&
this.routingNumber == other.routingNumber &&
this.sourceAccountNumberId == other.sourceAccountNumberId &&
this.status == other.status &&
this.stopPaymentRequest == other.stopPaymentRequest &&
this.submission == other.submission &&
this.thirdParty == other.thirdParty &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
accountId,
accountNumber,
amount,
approval,
approvedInboundCheckDepositId,
cancellation,
checkNumber,
createdAt,
createdBy,
currency,
fulfillmentMethod,
id,
idempotencyKey,
mailing,
pendingTransactionId,
physicalCheck,
routingNumber,
sourceAccountNumberId,
status,
stopPaymentRequest,
submission,
thirdParty,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CheckTransfer{accountId=$accountId, accountNumber=$accountNumber, amount=$amount, approval=$approval, approvedInboundCheckDepositId=$approvedInboundCheckDepositId, cancellation=$cancellation, checkNumber=$checkNumber, createdAt=$createdAt, createdBy=$createdBy, currency=$currency, fulfillmentMethod=$fulfillmentMethod, id=$id, idempotencyKey=$idempotencyKey, mailing=$mailing, pendingTransactionId=$pendingTransactionId, physicalCheck=$physicalCheck, routingNumber=$routingNumber, sourceAccountNumberId=$sourceAccountNumberId, status=$status, stopPaymentRequest=$stopPaymentRequest, submission=$submission, thirdParty=$thirdParty, type=$type, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var accountNumber: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var approval: JsonField = JsonMissing.of()
private var approvedInboundCheckDepositId: JsonField = JsonMissing.of()
private var cancellation: JsonField = JsonMissing.of()
private var checkNumber: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var createdBy: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var fulfillmentMethod: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var idempotencyKey: JsonField = JsonMissing.of()
private var mailing: JsonField = JsonMissing.of()
private var pendingTransactionId: JsonField = JsonMissing.of()
private var physicalCheck: JsonField = JsonMissing.of()
private var routingNumber: JsonField = JsonMissing.of()
private var sourceAccountNumberId: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
private var stopPaymentRequest: JsonField = JsonMissing.of()
private var submission: JsonField = JsonMissing.of()
private var thirdParty: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(checkTransfer: CheckTransfer) = apply {
this.accountId = checkTransfer.accountId
this.accountNumber = checkTransfer.accountNumber
this.amount = checkTransfer.amount
this.approval = checkTransfer.approval
this.approvedInboundCheckDepositId = checkTransfer.approvedInboundCheckDepositId
this.cancellation = checkTransfer.cancellation
this.checkNumber = checkTransfer.checkNumber
this.createdAt = checkTransfer.createdAt
this.createdBy = checkTransfer.createdBy
this.currency = checkTransfer.currency
this.fulfillmentMethod = checkTransfer.fulfillmentMethod
this.id = checkTransfer.id
this.idempotencyKey = checkTransfer.idempotencyKey
this.mailing = checkTransfer.mailing
this.pendingTransactionId = checkTransfer.pendingTransactionId
this.physicalCheck = checkTransfer.physicalCheck
this.routingNumber = checkTransfer.routingNumber
this.sourceAccountNumberId = checkTransfer.sourceAccountNumberId
this.status = checkTransfer.status
this.stopPaymentRequest = checkTransfer.stopPaymentRequest
this.submission = checkTransfer.submission
this.thirdParty = checkTransfer.thirdParty
this.type = checkTransfer.type
additionalProperties(checkTransfer.additionalProperties)
}
/** The identifier of the Account from which funds will be transferred. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The identifier of the Account from which funds will be transferred. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/** The account number printed on the check. */
fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber))
/** The account number printed on the check. */
@JsonProperty("account_number")
@ExcludeMissing
fun accountNumber(accountNumber: JsonField) = apply {
this.accountNumber = accountNumber
}
/** The transfer amount in USD cents. */
fun amount(amount: Long) = amount(JsonField.of(amount))
/** The transfer amount in USD cents. */
@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 the Check Transfer was successfully deposited, this will contain the identifier of the
* Inbound Check Deposit object with details of the deposit.
*/
fun approvedInboundCheckDepositId(approvedInboundCheckDepositId: String) =
approvedInboundCheckDepositId(JsonField.of(approvedInboundCheckDepositId))
/**
* If the Check Transfer was successfully deposited, this will contain the identifier of the
* Inbound Check Deposit object with details of the deposit.
*/
@JsonProperty("approved_inbound_check_deposit_id")
@ExcludeMissing
fun approvedInboundCheckDepositId(approvedInboundCheckDepositId: JsonField) =
apply {
this.approvedInboundCheckDepositId = approvedInboundCheckDepositId
}
/**
* 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 check number printed on the check. */
fun checkNumber(checkNumber: String) = checkNumber(JsonField.of(checkNumber))
/** The check number printed on the check. */
@JsonProperty("check_number")
@ExcludeMissing
fun checkNumber(checkNumber: JsonField) = apply { this.checkNumber = checkNumber }
/**
* 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 check's currency. */
fun currency(currency: Currency) = currency(JsonField.of(currency))
/** The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the check's currency. */
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/** Whether Increase will print and mail the check or if you will do it yourself. */
fun fulfillmentMethod(fulfillmentMethod: FulfillmentMethod) =
fulfillmentMethod(JsonField.of(fulfillmentMethod))
/** Whether Increase will print and mail the check or if you will do it yourself. */
@JsonProperty("fulfillment_method")
@ExcludeMissing
fun fulfillmentMethod(fulfillmentMethod: JsonField) = apply {
this.fulfillmentMethod = fulfillmentMethod
}
/** The Check transfer's identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Check 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
}
/** If the check has been mailed by Increase, this will contain details of the shipment. */
fun mailing(mailing: Mailing) = mailing(JsonField.of(mailing))
/** If the check has been mailed by Increase, this will contain details of the shipment. */
@JsonProperty("mailing")
@ExcludeMissing
fun mailing(mailing: JsonField) = apply { this.mailing = mailing }
/**
* 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
}
/**
* Details relating to the physical check that Increase will print and mail. Will be present
* if and only if `fulfillment_method` is equal to `physical_check`.
*/
fun physicalCheck(physicalCheck: PhysicalCheck) = physicalCheck(JsonField.of(physicalCheck))
/**
* Details relating to the physical check that Increase will print and mail. Will be present
* if and only if `fulfillment_method` is equal to `physical_check`.
*/
@JsonProperty("physical_check")
@ExcludeMissing
fun physicalCheck(physicalCheck: JsonField) = apply {
this.physicalCheck = physicalCheck
}
/** The routing number printed on the check. */
fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber))
/** The routing number printed on the check. */
@JsonProperty("routing_number")
@ExcludeMissing
fun routingNumber(routingNumber: JsonField) = apply {
this.routingNumber = routingNumber
}
/**
* The identifier of the Account Number from which to send the transfer and print on the
* check.
*/
fun sourceAccountNumberId(sourceAccountNumberId: String) =
sourceAccountNumberId(JsonField.of(sourceAccountNumberId))
/**
* The identifier of the Account Number from which to send the transfer and print on the
* check.
*/
@JsonProperty("source_account_number_id")
@ExcludeMissing
fun sourceAccountNumberId(sourceAccountNumberId: JsonField) = apply {
this.sourceAccountNumberId = sourceAccountNumberId
}
/** 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 a stop-payment is requested on the check, this will contain supplemental details.
*/
fun stopPaymentRequest(stopPaymentRequest: StopPaymentRequest) =
stopPaymentRequest(JsonField.of(stopPaymentRequest))
/**
* After a stop-payment is requested on the check, this will contain supplemental details.
*/
@JsonProperty("stop_payment_request")
@ExcludeMissing
fun stopPaymentRequest(stopPaymentRequest: JsonField) = apply {
this.stopPaymentRequest = stopPaymentRequest
}
/** After the transfer is submitted, this will contain supplemental details. */
fun submission(submission: Submission) = submission(JsonField.of(submission))
/** After the transfer is submitted, this will contain supplemental details. */
@JsonProperty("submission")
@ExcludeMissing
fun submission(submission: JsonField) = apply { this.submission = submission }
/**
* Details relating to the custom fulfillment you will perform. Will be present if and only
* if `fulfillment_method` is equal to `third_party`.
*/
fun thirdParty(thirdParty: ThirdParty) = thirdParty(JsonField.of(thirdParty))
/**
* Details relating to the custom fulfillment you will perform. Will be present if and only
* if `fulfillment_method` is equal to `third_party`.
*/
@JsonProperty("third_party")
@ExcludeMissing
fun thirdParty(thirdParty: JsonField) = apply { this.thirdParty = thirdParty }
/**
* A constant representing the object's type. For this resource it will always be
* `check_transfer`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `check_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(): CheckTransfer =
CheckTransfer(
accountId,
accountNumber,
amount,
approval,
approvedInboundCheckDepositId,
cancellation,
checkNumber,
createdAt,
createdBy,
currency,
fulfillmentMethod,
id,
idempotencyKey,
mailing,
pendingTransactionId,
physicalCheck,
routingNumber,
sourceAccountNumberId,
status,
stopPaymentRequest,
submission,
thirdParty,
type,
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(): Optional =
Optional.ofNullable(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 {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var approvedAt: JsonField = JsonMissing.of()
private var approvedBy: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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(): Optional =
Optional.ofNullable(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 {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var canceledAt: JsonField = JsonMissing.of()
private var canceledBy: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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(): Optional = Optional.ofNullable(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(): Optional =
Optional.ofNullable(oauthApplication.getNullable("oauth_application"))
/** If present, details about the User that created the transfer. */
fun user(): Optional = Optional.ofNullable(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().map { it.validate() }
category()
oauthApplication().map { it.validate() }
user().map { it.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 {
@JvmStatic 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()
@JvmSynthetic
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(): Optional =
Optional.ofNullable(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 {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var description: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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 {
@JvmField val API_KEY = Category(JsonField.of("api_key"))
@JvmField val OAUTH_APPLICATION = Category(JsonField.of("oauth_application"))
@JvmField val USER = Category(JsonField.of("user"))
@JvmStatic 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 {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var name: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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 {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var email: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
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 {
@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 FulfillmentMethod
@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 FulfillmentMethod && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
@JvmField val PHYSICAL_CHECK = FulfillmentMethod(JsonField.of("physical_check"))
@JvmField val THIRD_PARTY = FulfillmentMethod(JsonField.of("third_party"))
@JvmStatic fun of(value: String) = FulfillmentMethod(JsonField.of(value))
}
enum class Known {
PHYSICAL_CHECK,
THIRD_PARTY,
}
enum class Value {
PHYSICAL_CHECK,
THIRD_PARTY,
_UNKNOWN,
}
fun value(): Value =
when (this) {
PHYSICAL_CHECK -> Value.PHYSICAL_CHECK
THIRD_PARTY -> Value.THIRD_PARTY
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
PHYSICAL_CHECK -> Known.PHYSICAL_CHECK
THIRD_PARTY -> Known.THIRD_PARTY
else -> throw IncreaseInvalidDataException("Unknown FulfillmentMethod: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** If the check has been mailed by Increase, this will contain details of the shipment. */
@JsonDeserialize(builder = Mailing.Builder::class)
@NoAutoDetect
class Mailing
private constructor(
private val imageId: JsonField,
private val mailedAt: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* The ID of the file corresponding to an image of the check that was mailed, if available.
*/
fun imageId(): Optional = Optional.ofNullable(imageId.getNullable("image_id"))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the check
* was mailed.
*/
fun mailedAt(): OffsetDateTime = mailedAt.getRequired("mailed_at")
/**
* The ID of the file corresponding to an image of the check that was mailed, if available.
*/
@JsonProperty("image_id") @ExcludeMissing fun _imageId() = imageId
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the check
* was mailed.
*/
@JsonProperty("mailed_at") @ExcludeMissing fun _mailedAt() = mailedAt
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Mailing = apply {
if (!validated) {
imageId()
mailedAt()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Mailing &&
this.imageId == other.imageId &&
this.mailedAt == other.mailedAt &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
imageId,
mailedAt,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Mailing{imageId=$imageId, mailedAt=$mailedAt, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var imageId: JsonField = JsonMissing.of()
private var mailedAt: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(mailing: Mailing) = apply {
this.imageId = mailing.imageId
this.mailedAt = mailing.mailedAt
additionalProperties(mailing.additionalProperties)
}
/**
* The ID of the file corresponding to an image of the check that was mailed, if
* available.
*/
fun imageId(imageId: String) = imageId(JsonField.of(imageId))
/**
* The ID of the file corresponding to an image of the check that was mailed, if
* available.
*/
@JsonProperty("image_id")
@ExcludeMissing
fun imageId(imageId: JsonField) = apply { this.imageId = imageId }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* check was mailed.
*/
fun mailedAt(mailedAt: OffsetDateTime) = mailedAt(JsonField.of(mailedAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* check was mailed.
*/
@JsonProperty("mailed_at")
@ExcludeMissing
fun mailedAt(mailedAt: JsonField) = apply { this.mailedAt = mailedAt }
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(): Mailing =
Mailing(
imageId,
mailedAt,
additionalProperties.toUnmodifiable(),
)
}
}
/**
* Details relating to the physical check that Increase will print and mail. Will be present if
* and only if `fulfillment_method` is equal to `physical_check`.
*/
@JsonDeserialize(builder = PhysicalCheck.Builder::class)
@NoAutoDetect
class PhysicalCheck
private constructor(
private val mailingAddress: JsonField,
private val memo: JsonField,
private val note: JsonField,
private val recipientName: JsonField,
private val returnAddress: JsonField,
private val signatureText: JsonField,
private val trackingUpdates: JsonField>,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Details for where Increase will mail the check. */
fun mailingAddress(): MailingAddress = mailingAddress.getRequired("mailing_address")
/** The descriptor that will be printed on the memo field on the check. */
fun memo(): Optional = Optional.ofNullable(memo.getNullable("memo"))
/** The descriptor that will be printed on the letter included with the check. */
fun note(): Optional = Optional.ofNullable(note.getNullable("note"))
/** The name that will be printed on the check. */
fun recipientName(): String = recipientName.getRequired("recipient_name")
/** The return address to be printed on the check. */
fun returnAddress(): Optional =
Optional.ofNullable(returnAddress.getNullable("return_address"))
/**
* The text that will appear as the signature on the check in cursive font. If blank, the
* check will be printed with 'No signature required'.
*/
fun signatureText(): Optional =
Optional.ofNullable(signatureText.getNullable("signature_text"))
/** Tracking updates relating to the physical check's delivery. */
fun trackingUpdates(): List =
trackingUpdates.getRequired("tracking_updates")
/** Details for where Increase will mail the check. */
@JsonProperty("mailing_address") @ExcludeMissing fun _mailingAddress() = mailingAddress
/** The descriptor that will be printed on the memo field on the check. */
@JsonProperty("memo") @ExcludeMissing fun _memo() = memo
/** The descriptor that will be printed on the letter included with the check. */
@JsonProperty("note") @ExcludeMissing fun _note() = note
/** The name that will be printed on the check. */
@JsonProperty("recipient_name") @ExcludeMissing fun _recipientName() = recipientName
/** The return address to be printed on the check. */
@JsonProperty("return_address") @ExcludeMissing fun _returnAddress() = returnAddress
/**
* The text that will appear as the signature on the check in cursive font. If blank, the
* check will be printed with 'No signature required'.
*/
@JsonProperty("signature_text") @ExcludeMissing fun _signatureText() = signatureText
/** Tracking updates relating to the physical check's delivery. */
@JsonProperty("tracking_updates") @ExcludeMissing fun _trackingUpdates() = trackingUpdates
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): PhysicalCheck = apply {
if (!validated) {
mailingAddress().validate()
memo()
note()
recipientName()
returnAddress().map { it.validate() }
signatureText()
trackingUpdates().forEach { it.validate() }
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is PhysicalCheck &&
this.mailingAddress == other.mailingAddress &&
this.memo == other.memo &&
this.note == other.note &&
this.recipientName == other.recipientName &&
this.returnAddress == other.returnAddress &&
this.signatureText == other.signatureText &&
this.trackingUpdates == other.trackingUpdates &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
mailingAddress,
memo,
note,
recipientName,
returnAddress,
signatureText,
trackingUpdates,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"PhysicalCheck{mailingAddress=$mailingAddress, memo=$memo, note=$note, recipientName=$recipientName, returnAddress=$returnAddress, signatureText=$signatureText, trackingUpdates=$trackingUpdates, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var mailingAddress: JsonField = JsonMissing.of()
private var memo: JsonField = JsonMissing.of()
private var note: JsonField = JsonMissing.of()
private var recipientName: JsonField = JsonMissing.of()
private var returnAddress: JsonField = JsonMissing.of()
private var signatureText: JsonField = JsonMissing.of()
private var trackingUpdates: JsonField> = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(physicalCheck: PhysicalCheck) = apply {
this.mailingAddress = physicalCheck.mailingAddress
this.memo = physicalCheck.memo
this.note = physicalCheck.note
this.recipientName = physicalCheck.recipientName
this.returnAddress = physicalCheck.returnAddress
this.signatureText = physicalCheck.signatureText
this.trackingUpdates = physicalCheck.trackingUpdates
additionalProperties(physicalCheck.additionalProperties)
}
/** Details for where Increase will mail the check. */
fun mailingAddress(mailingAddress: MailingAddress) =
mailingAddress(JsonField.of(mailingAddress))
/** Details for where Increase will mail the check. */
@JsonProperty("mailing_address")
@ExcludeMissing
fun mailingAddress(mailingAddress: JsonField) = apply {
this.mailingAddress = mailingAddress
}
/** The descriptor that will be printed on the memo field on the check. */
fun memo(memo: String) = memo(JsonField.of(memo))
/** The descriptor that will be printed on the memo field on the check. */
@JsonProperty("memo")
@ExcludeMissing
fun memo(memo: JsonField) = apply { this.memo = memo }
/** The descriptor that will be printed on the letter included with the check. */
fun note(note: String) = note(JsonField.of(note))
/** The descriptor that will be printed on the letter included with the check. */
@JsonProperty("note")
@ExcludeMissing
fun note(note: JsonField) = apply { this.note = note }
/** The name that will be printed on the check. */
fun recipientName(recipientName: String) = recipientName(JsonField.of(recipientName))
/** The name that will be printed on the check. */
@JsonProperty("recipient_name")
@ExcludeMissing
fun recipientName(recipientName: JsonField) = apply {
this.recipientName = recipientName
}
/** The return address to be printed on the check. */
fun returnAddress(returnAddress: ReturnAddress) =
returnAddress(JsonField.of(returnAddress))
/** The return address to be printed on the check. */
@JsonProperty("return_address")
@ExcludeMissing
fun returnAddress(returnAddress: JsonField) = apply {
this.returnAddress = returnAddress
}
/**
* The text that will appear as the signature on the check in cursive font. If blank,
* the check will be printed with 'No signature required'.
*/
fun signatureText(signatureText: String) = signatureText(JsonField.of(signatureText))
/**
* The text that will appear as the signature on the check in cursive font. If blank,
* the check will be printed with 'No signature required'.
*/
@JsonProperty("signature_text")
@ExcludeMissing
fun signatureText(signatureText: JsonField) = apply {
this.signatureText = signatureText
}
/** Tracking updates relating to the physical check's delivery. */
fun trackingUpdates(trackingUpdates: List) =
trackingUpdates(JsonField.of(trackingUpdates))
/** Tracking updates relating to the physical check's delivery. */
@JsonProperty("tracking_updates")
@ExcludeMissing
fun trackingUpdates(trackingUpdates: JsonField>) = apply {
this.trackingUpdates = trackingUpdates
}
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(): PhysicalCheck =
PhysicalCheck(
mailingAddress,
memo,
note,
recipientName,
returnAddress,
signatureText,
trackingUpdates.map { it.toUnmodifiable() },
additionalProperties.toUnmodifiable(),
)
}
/** Details for where Increase will mail the check. */
@JsonDeserialize(builder = MailingAddress.Builder::class)
@NoAutoDetect
class MailingAddress
private constructor(
private val city: JsonField,
private val line1: JsonField,
private val line2: JsonField,
private val name: JsonField,
private val postalCode: JsonField,
private val state: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The city of the check's destination. */
fun city(): Optional = Optional.ofNullable(city.getNullable("city"))
/** The street address of the check's destination. */
fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1"))
/** The second line of the address of the check's destination. */
fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2"))
/** The name component of the check's mailing address. */
fun name(): Optional = Optional.ofNullable(name.getNullable("name"))
/** The postal code of the check's destination. */
fun postalCode(): Optional =
Optional.ofNullable(postalCode.getNullable("postal_code"))
/** The state of the check's destination. */
fun state(): Optional = Optional.ofNullable(state.getNullable("state"))
/** The city of the check's destination. */
@JsonProperty("city") @ExcludeMissing fun _city() = city
/** The street address of the check's destination. */
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
/** The second line of the address of the check's destination. */
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
/** The name component of the check's mailing address. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
/** The postal code of the check's destination. */
@JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode
/** The state of the check's destination. */
@JsonProperty("state") @ExcludeMissing fun _state() = state
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): MailingAddress = apply {
if (!validated) {
city()
line1()
line2()
name()
postalCode()
state()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is MailingAddress &&
this.city == other.city &&
this.line1 == other.line1 &&
this.line2 == other.line2 &&
this.name == other.name &&
this.postalCode == other.postalCode &&
this.state == other.state &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
city,
line1,
line2,
name,
postalCode,
state,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"MailingAddress{city=$city, line1=$line1, line2=$line2, name=$name, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var city: JsonField = JsonMissing.of()
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var name: JsonField = JsonMissing.of()
private var postalCode: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
@JvmSynthetic
internal fun from(mailingAddress: MailingAddress) = apply {
this.city = mailingAddress.city
this.line1 = mailingAddress.line1
this.line2 = mailingAddress.line2
this.name = mailingAddress.name
this.postalCode = mailingAddress.postalCode
this.state = mailingAddress.state
additionalProperties(mailingAddress.additionalProperties)
}
/** The city of the check's destination. */
fun city(city: String) = city(JsonField.of(city))
/** The city of the check's destination. */
@JsonProperty("city")
@ExcludeMissing
fun city(city: JsonField) = apply { this.city = city }
/** The street address of the check's destination. */
fun line1(line1: String) = line1(JsonField.of(line1))
/** The street address of the check's destination. */
@JsonProperty("line1")
@ExcludeMissing
fun line1(line1: JsonField) = apply { this.line1 = line1 }
/** The second line of the address of the check's destination. */
fun line2(line2: String) = line2(JsonField.of(line2))
/** The second line of the address of the check's destination. */
@JsonProperty("line2")
@ExcludeMissing
fun line2(line2: JsonField) = apply { this.line2 = line2 }
/** The name component of the check's mailing address. */
fun name(name: String) = name(JsonField.of(name))
/** The name component of the check's mailing address. */
@JsonProperty("name")
@ExcludeMissing
fun name(name: JsonField) = apply { this.name = name }
/** The postal code of the check's destination. */
fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode))
/** The postal code of the check's destination. */
@JsonProperty("postal_code")
@ExcludeMissing
fun postalCode(postalCode: JsonField) = apply {
this.postalCode = postalCode
}
/** The state of the check's destination. */
fun state(state: String) = state(JsonField.of(state))
/** The state of the check's destination. */
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
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(): MailingAddress =
MailingAddress(
city,
line1,
line2,
name,
postalCode,
state,
additionalProperties.toUnmodifiable(),
)
}
}
/** The return address to be printed on the check. */
@JsonDeserialize(builder = ReturnAddress.Builder::class)
@NoAutoDetect
class ReturnAddress
private constructor(
private val city: JsonField,
private val line1: JsonField,
private val line2: JsonField,
private val name: JsonField,
private val postalCode: JsonField,
private val state: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** The city of the check's destination. */
fun city(): Optional = Optional.ofNullable(city.getNullable("city"))
/** The street address of the check's destination. */
fun line1(): Optional = Optional.ofNullable(line1.getNullable("line1"))
/** The second line of the address of the check's destination. */
fun line2(): Optional = Optional.ofNullable(line2.getNullable("line2"))
/** The name component of the check's return address. */
fun name(): Optional = Optional.ofNullable(name.getNullable("name"))
/** The postal code of the check's destination. */
fun postalCode(): Optional =
Optional.ofNullable(postalCode.getNullable("postal_code"))
/** The state of the check's destination. */
fun state(): Optional = Optional.ofNullable(state.getNullable("state"))
/** The city of the check's destination. */
@JsonProperty("city") @ExcludeMissing fun _city() = city
/** The street address of the check's destination. */
@JsonProperty("line1") @ExcludeMissing fun _line1() = line1
/** The second line of the address of the check's destination. */
@JsonProperty("line2") @ExcludeMissing fun _line2() = line2
/** The name component of the check's return address. */
@JsonProperty("name") @ExcludeMissing fun _name() = name
/** The postal code of the check's destination. */
@JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode
/** The state of the check's destination. */
@JsonProperty("state") @ExcludeMissing fun _state() = state
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): ReturnAddress = apply {
if (!validated) {
city()
line1()
line2()
name()
postalCode()
state()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is ReturnAddress &&
this.city == other.city &&
this.line1 == other.line1 &&
this.line2 == other.line2 &&
this.name == other.name &&
this.postalCode == other.postalCode &&
this.state == other.state &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
city,
line1,
line2,
name,
postalCode,
state,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"ReturnAddress{city=$city, line1=$line1, line2=$line2, name=$name, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}"
companion object {
@JvmStatic fun builder() = Builder()
}
class Builder {
private var city: JsonField = JsonMissing.of()
private var line1: JsonField = JsonMissing.of()
private var line2: JsonField = JsonMissing.of()
private var name: JsonField