diff --git a/.stats.yml b/.stats.yml index 46f8373c2..faca0ebe3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 113 +configured_endpoints: 115 diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f4a3cae5..b6136571c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,19 +10,11 @@ Full Changelog: [v0.34.0...v0.35.0](https://github.com/lithic-com/lithic-java/co ## 0.34.0 (2024-05-29) -Full Changelog: [v0.33.0...v0.34.0](https://github.com/lithic-com/lithic-java/compare/v0.33.0...v0.34.0) +Full Changelog: [v0.33.0...v0.33.1](https://github.com/lithic-com/lithic-java/compare/v0.33.0...v0.33.1) -### Features - -* **api:** updates ([#224](https://github.com/lithic-com/lithic-java/issues/224)) ([83f78d6](https://github.com/lithic-com/lithic-java/commit/83f78d62873dd6d18ce046e3a3328155c4f8355e)) -* propagate resource description field from stainless config to SDK docs ([#219](https://github.com/lithic-com/lithic-java/issues/219)) ([3f13f6d](https://github.com/lithic-com/lithic-java/commit/3f13f6d70c5c028ac55c1fde6fb2e1f9c298e1b4)) - - -### Chores +### Bug Fixes -* **docs:** add SECURITY.md ([#221](https://github.com/lithic-com/lithic-java/issues/221)) ([9170209](https://github.com/lithic-com/lithic-java/commit/9170209d294e3ce99a4c5be9b1da1640b83425cb)) -* **internal:** add scripts-to-rule-them-all ([#222](https://github.com/lithic-com/lithic-java/issues/222)) ([2c38662](https://github.com/lithic-com/lithic-java/commit/2c38662da811be14216190eb4c171df301117f37)) -* **tests:** update some example values ([#223](https://github.com/lithic-com/lithic-java/issues/223)) ([453d332](https://github.com/lithic-com/lithic-java/commit/453d3323664641f889ba535bb7cfde6f12b936b2)) +* **examples:** generate correctly typed example snippets for enums ([16e93fd](https://github.com/lithic-com/lithic-java/commit/16e93fd41e8f27656dd88f805726197f6d791dfa)) ## 0.33.0 (2024-05-01) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt index a44b7bb28..752c25416 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt @@ -15,6 +15,10 @@ import com.lithic.api.core.toUnmodifiable import java.util.Objects import java.util.Optional +/** + * Address used during Address Verification Service (AVS) checks during transactions if enabled via + * Auth Rules. + */ @JsonDeserialize(builder = ExternalBankAccountAddress.Builder::class) @NoAutoDetect class ExternalBankAccountAddress @@ -22,9 +26,9 @@ private constructor( private val address1: JsonField, private val address2: JsonField, private val city: JsonField, - private val state: JsonField, - private val postalCode: JsonField, private val country: JsonField, + private val postalCode: JsonField, + private val state: JsonField, private val additionalProperties: Map, ) { @@ -38,11 +42,11 @@ private constructor( fun city(): String = city.getRequired("city") - fun state(): String = state.getRequired("state") + fun country(): String = country.getRequired("country") fun postalCode(): String = postalCode.getRequired("postal_code") - fun country(): String = country.getRequired("country") + fun state(): String = state.getRequired("state") @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 @@ -50,11 +54,11 @@ private constructor( @JsonProperty("city") @ExcludeMissing fun _city() = city - @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonProperty("country") @ExcludeMissing fun _country() = country @JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode - @JsonProperty("country") @ExcludeMissing fun _country() = country + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -65,9 +69,9 @@ private constructor( address1() address2() city() - state() - postalCode() country() + postalCode() + state() validated = true } } @@ -83,9 +87,9 @@ private constructor( this.address1 == other.address1 && this.address2 == other.address2 && this.city == other.city && - this.state == other.state && - this.postalCode == other.postalCode && this.country == other.country && + this.postalCode == other.postalCode && + this.state == other.state && this.additionalProperties == other.additionalProperties } @@ -96,9 +100,9 @@ private constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties, ) } @@ -106,7 +110,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountAddress{address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "ExternalBankAccountAddress{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" companion object { @@ -118,9 +122,9 @@ private constructor( private var address1: JsonField = JsonMissing.of() private var address2: JsonField = JsonMissing.of() private var city: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var postalCode: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() + private var postalCode: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -128,9 +132,9 @@ private constructor( this.address1 = externalBankAccountAddress.address1 this.address2 = externalBankAccountAddress.address2 this.city = externalBankAccountAddress.city - this.state = externalBankAccountAddress.state - this.postalCode = externalBankAccountAddress.postalCode this.country = externalBankAccountAddress.country + this.postalCode = externalBankAccountAddress.postalCode + this.state = externalBankAccountAddress.state additionalProperties(externalBankAccountAddress.additionalProperties) } @@ -152,11 +156,11 @@ private constructor( @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } - fun state(state: String) = state(JsonField.of(state)) + fun country(country: String) = country(JsonField.of(country)) - @JsonProperty("state") + @JsonProperty("country") @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } + fun country(country: JsonField) = apply { this.country = country } fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) @@ -164,11 +168,11 @@ private constructor( @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - fun country(country: String) = country(JsonField.of(country)) + fun state(state: String) = state(JsonField.of(state)) - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -189,9 +193,9 @@ private constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt index d2575cc3d..8f5694825 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt @@ -331,89 +331,79 @@ constructor( @NoAutoDetect class BankVerifiedCreateBankAccountApiRequest private constructor( - private val verificationMethod: VerificationMethod?, - private val ownerType: OwnerType?, - private val owner: String?, + private val accountNumber: String?, private val accountToken: String?, + private val address: ExternalBankAccountAddress?, private val companyId: String?, - private val doingBusinessAs: String?, - private val dob: LocalDate?, - private val userDefinedId: String?, - private val type: AccountType?, - private val routingNumber: String?, - private val accountNumber: String?, - private val name: String?, private val country: String?, private val currency: String?, - private val verificationEnforcement: Boolean?, - private val address: ExternalBankAccountAddress?, + private val dob: LocalDate?, + private val doingBusinessAs: String?, private val financialAccountToken: String?, + private val name: String?, + private val owner: String?, + private val ownerType: OwnerType?, + private val routingNumber: String?, + private val type: AccountType?, + private val userDefinedId: String?, + private val verificationEnforcement: Boolean?, + private val verificationMethod: VerificationMethod?, private val additionalProperties: Map, ) { private var hashCode: Int = 0 - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod? = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType + @JsonProperty("account_number") fun accountNumber(): String? = accountNumber - /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements - */ - @JsonProperty("owner") fun owner(): String? = owner + @JsonProperty("account_token") fun accountToken(): String? = accountToken /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. */ - @JsonProperty("account_token") fun accountToken(): String? = accountToken + @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId - /** Doing Business As */ - @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs + @JsonProperty("country") fun country(): String? = country + + @JsonProperty("currency") fun currency(): String? = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob - /** User Defined ID */ - @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId + @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** Account Type */ - @JsonProperty("type") fun type(): AccountType? = type + /** + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account + */ + @JsonProperty("financial_account_token") + fun financialAccountToken(): String? = financialAccountToken + + @JsonProperty("name") fun name(): String? = name + + @JsonProperty("owner") fun owner(): String? = owner + + @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType - /** Routing Number */ @JsonProperty("routing_number") fun routingNumber(): String? = routingNumber - /** Routing Number */ - @JsonProperty("account_number") fun accountNumber(): String? = accountNumber + @JsonProperty("type") fun type(): AccountType? = type - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") fun name(): String? = name + @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * Indicates whether verification was enforced for a given association record. For + * MICRO_DEPOSIT, option to disable verification if the external bank account has already + * been verified before. By default, verification will be required unless users pass in a + * value of false */ - @JsonProperty("country") fun country(): String? = country - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") fun currency(): String? = currency - @JsonProperty("verification_enforcement") fun verificationEnforcement(): Boolean? = verificationEnforcement - /** Address */ - @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - fun financialAccountToken(): String? = financialAccountToken + @JsonProperty("verification_method") + fun verificationMethod(): VerificationMethod? = verificationMethod @JsonAnyGetter @ExcludeMissing @@ -427,23 +417,23 @@ constructor( } return other is BankVerifiedCreateBankAccountApiRequest && - this.verificationMethod == other.verificationMethod && - this.ownerType == other.ownerType && - this.owner == other.owner && + this.accountNumber == other.accountNumber && this.accountToken == other.accountToken && + this.address == other.address && this.companyId == other.companyId && - this.doingBusinessAs == other.doingBusinessAs && - this.dob == other.dob && - this.userDefinedId == other.userDefinedId && - this.type == other.type && - this.routingNumber == other.routingNumber && - this.accountNumber == other.accountNumber && - this.name == other.name && this.country == other.country && this.currency == other.currency && - this.verificationEnforcement == other.verificationEnforcement && - this.address == other.address && + this.dob == other.dob && + this.doingBusinessAs == other.doingBusinessAs && this.financialAccountToken == other.financialAccountToken && + this.name == other.name && + this.owner == other.owner && + this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationEnforcement == other.verificationEnforcement && + this.verificationMethod == other.verificationMethod && this.additionalProperties == other.additionalProperties } @@ -451,23 +441,23 @@ constructor( if (hashCode == 0) { hashCode = Objects.hash( - verificationMethod, - ownerType, - owner, + accountNumber, accountToken, + address, companyId, - doingBusinessAs, - dob, - userDefinedId, - type, - routingNumber, - accountNumber, - name, country, currency, - verificationEnforcement, - address, + dob, + doingBusinessAs, financialAccountToken, + name, + owner, + ownerType, + routingNumber, + type, + userDefinedId, + verificationEnforcement, + verificationMethod, additionalProperties, ) } @@ -475,7 +465,7 @@ constructor( } override fun toString() = - "BankVerifiedCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, doingBusinessAs=$doingBusinessAs, dob=$dob, userDefinedId=$userDefinedId, type=$type, routingNumber=$routingNumber, accountNumber=$accountNumber, name=$name, country=$country, currency=$currency, verificationEnforcement=$verificationEnforcement, address=$address, financialAccountToken=$financialAccountToken, additionalProperties=$additionalProperties}" + "BankVerifiedCreateBankAccountApiRequest{accountNumber=$accountNumber, accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, type=$type, userDefinedId=$userDefinedId, verificationEnforcement=$verificationEnforcement, verificationMethod=$verificationMethod, additionalProperties=$additionalProperties}" companion object { @@ -484,129 +474,118 @@ constructor( class Builder { - private var verificationMethod: VerificationMethod? = null - private var ownerType: OwnerType? = null - private var owner: String? = null + private var accountNumber: String? = null private var accountToken: String? = null + private var address: ExternalBankAccountAddress? = null private var companyId: String? = null - private var doingBusinessAs: String? = null - private var dob: LocalDate? = null - private var userDefinedId: String? = null - private var type: AccountType? = null - private var routingNumber: String? = null - private var accountNumber: String? = null - private var name: String? = null private var country: String? = null private var currency: String? = null - private var verificationEnforcement: Boolean? = null - private var address: ExternalBankAccountAddress? = null + private var dob: LocalDate? = null + private var doingBusinessAs: String? = null private var financialAccountToken: String? = null + private var name: String? = null + private var owner: String? = null + private var ownerType: OwnerType? = null + private var routingNumber: String? = null + private var type: AccountType? = null + private var userDefinedId: String? = null + private var verificationEnforcement: Boolean? = null + private var verificationMethod: VerificationMethod? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest ) = apply { - this.verificationMethod = bankVerifiedCreateBankAccountApiRequest.verificationMethod - this.ownerType = bankVerifiedCreateBankAccountApiRequest.ownerType - this.owner = bankVerifiedCreateBankAccountApiRequest.owner + this.accountNumber = bankVerifiedCreateBankAccountApiRequest.accountNumber this.accountToken = bankVerifiedCreateBankAccountApiRequest.accountToken + this.address = bankVerifiedCreateBankAccountApiRequest.address this.companyId = bankVerifiedCreateBankAccountApiRequest.companyId - this.doingBusinessAs = bankVerifiedCreateBankAccountApiRequest.doingBusinessAs - this.dob = bankVerifiedCreateBankAccountApiRequest.dob - this.userDefinedId = bankVerifiedCreateBankAccountApiRequest.userDefinedId - this.type = bankVerifiedCreateBankAccountApiRequest.type - this.routingNumber = bankVerifiedCreateBankAccountApiRequest.routingNumber - this.accountNumber = bankVerifiedCreateBankAccountApiRequest.accountNumber - this.name = bankVerifiedCreateBankAccountApiRequest.name this.country = bankVerifiedCreateBankAccountApiRequest.country this.currency = bankVerifiedCreateBankAccountApiRequest.currency - this.verificationEnforcement = - bankVerifiedCreateBankAccountApiRequest.verificationEnforcement - this.address = bankVerifiedCreateBankAccountApiRequest.address + this.dob = bankVerifiedCreateBankAccountApiRequest.dob + this.doingBusinessAs = bankVerifiedCreateBankAccountApiRequest.doingBusinessAs this.financialAccountToken = bankVerifiedCreateBankAccountApiRequest.financialAccountToken + this.name = bankVerifiedCreateBankAccountApiRequest.name + this.owner = bankVerifiedCreateBankAccountApiRequest.owner + this.ownerType = bankVerifiedCreateBankAccountApiRequest.ownerType + this.routingNumber = bankVerifiedCreateBankAccountApiRequest.routingNumber + this.type = bankVerifiedCreateBankAccountApiRequest.type + this.userDefinedId = bankVerifiedCreateBankAccountApiRequest.userDefinedId + this.verificationEnforcement = + bankVerifiedCreateBankAccountApiRequest.verificationEnforcement + this.verificationMethod = bankVerifiedCreateBankAccountApiRequest.verificationMethod additionalProperties(bankVerifiedCreateBankAccountApiRequest.additionalProperties) } - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - @JsonProperty("owner_type") - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + @JsonProperty("account_number") + fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - /** - * Legal Name of the business or individual who owns the external account. This will - * appear in statements - */ - @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + @JsonProperty("account_token") + fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be - * null + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. */ - @JsonProperty("account_token") - fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } + @JsonProperty("address") + fun address(address: ExternalBankAccountAddress) = apply { this.address = address } - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } - /** Doing Business As */ + @JsonProperty("country") fun country(country: String) = apply { this.country = country } + + @JsonProperty("currency") + fun currency(currency: String) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } + @JsonProperty("doing_business_as") fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } + /** + * The financial account token of the operating account, which will provide the funds + * for micro deposits used to verify the account + */ + @JsonProperty("financial_account_token") + fun financialAccountToken(financialAccountToken: String) = apply { + this.financialAccountToken = financialAccountToken + } - /** User Defined ID */ - @JsonProperty("user_defined_id") - fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } + @JsonProperty("name") fun name(name: String) = apply { this.name = name } - /** Account Type */ - @JsonProperty("type") fun type(type: AccountType) = apply { this.type = type } + @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + + @JsonProperty("owner_type") + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - /** Routing Number */ @JsonProperty("routing_number") fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } - /** Routing Number */ - @JsonProperty("account_number") - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } + @JsonProperty("type") fun type(type: AccountType) = apply { this.type = type } - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") fun name(name: String) = apply { this.name = name } + @JsonProperty("user_defined_id") + fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } /** - * The country that the bank account is located in using ISO 3166-1. We will only accept - * USA bank accounts e.g., USA + * Indicates whether verification was enforced for a given association record. For + * MICRO_DEPOSIT, option to disable verification if the external bank account has + * already been verified before. By default, verification will be required unless users + * pass in a value of false */ - @JsonProperty("country") fun country(country: String) = apply { this.country = country } - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - fun currency(currency: String) = apply { this.currency = currency } - @JsonProperty("verification_enforcement") fun verificationEnforcement(verificationEnforcement: Boolean) = apply { this.verificationEnforcement = verificationEnforcement } - /** Address */ - @JsonProperty("address") - fun address(address: ExternalBankAccountAddress) = apply { this.address = address } - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - fun financialAccountToken(financialAccountToken: String) = apply { - this.financialAccountToken = financialAccountToken + @JsonProperty("verification_method") + fun verificationMethod(verificationMethod: VerificationMethod) = apply { + this.verificationMethod = verificationMethod } fun additionalProperties(additionalProperties: Map) = apply { @@ -625,25 +604,27 @@ constructor( fun build(): BankVerifiedCreateBankAccountApiRequest = BankVerifiedCreateBankAccountApiRequest( - checkNotNull(verificationMethod) { - "`verificationMethod` is required but was not set" - }, - checkNotNull(ownerType) { "`ownerType` is required but was not set" }, - checkNotNull(owner) { "`owner` is required but was not set" }, + checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, accountToken, + address, companyId, - doingBusinessAs, - dob, - userDefinedId, - checkNotNull(type) { "`type` is required but was not set" }, - checkNotNull(routingNumber) { "`routingNumber` is required but was not set" }, - checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, - name, checkNotNull(country) { "`country` is required but was not set" }, checkNotNull(currency) { "`currency` is required but was not set" }, + dob, + doingBusinessAs, + checkNotNull(financialAccountToken) { + "`financialAccountToken` is required but was not set" + }, + name, + checkNotNull(owner) { "`owner` is required but was not set" }, + checkNotNull(ownerType) { "`ownerType` is required but was not set" }, + checkNotNull(routingNumber) { "`routingNumber` is required but was not set" }, + checkNotNull(type) { "`type` is required but was not set" }, + userDefinedId, verificationEnforcement, - address, - financialAccountToken, + checkNotNull(verificationMethod) { + "`verificationMethod` is required but was not set" + }, additionalProperties.toUnmodifiable(), ) } @@ -710,53 +691,40 @@ constructor( @NoAutoDetect class PlaidCreateBankAccountApiRequest private constructor( - private val verificationMethod: VerificationMethod?, - private val ownerType: OwnerType?, - private val owner: String?, private val accountToken: String?, private val companyId: String?, - private val doingBusinessAs: String?, private val dob: LocalDate?, - private val userDefinedId: String?, + private val doingBusinessAs: String?, + private val owner: String?, + private val ownerType: OwnerType?, private val processorToken: String?, + private val userDefinedId: String?, + private val verificationMethod: VerificationMethod?, private val additionalProperties: Map, ) { private var hashCode: Int = 0 - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod? = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType - - /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements - */ - @JsonProperty("owner") fun owner(): String? = owner - - /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null - */ @JsonProperty("account_token") fun accountToken(): String? = accountToken - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId - /** Doing Business As */ - @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob - /** User Defined ID */ - @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId + @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs + + @JsonProperty("owner") fun owner(): String? = owner + + @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType @JsonProperty("processor_token") fun processorToken(): String? = processorToken + @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId + + @JsonProperty("verification_method") + fun verificationMethod(): VerificationMethod? = verificationMethod + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -769,15 +737,15 @@ constructor( } return other is PlaidCreateBankAccountApiRequest && - this.verificationMethod == other.verificationMethod && - this.ownerType == other.ownerType && - this.owner == other.owner && this.accountToken == other.accountToken && this.companyId == other.companyId && - this.doingBusinessAs == other.doingBusinessAs && this.dob == other.dob && - this.userDefinedId == other.userDefinedId && + this.doingBusinessAs == other.doingBusinessAs && + this.owner == other.owner && + this.ownerType == other.ownerType && this.processorToken == other.processorToken && + this.userDefinedId == other.userDefinedId && + this.verificationMethod == other.verificationMethod && this.additionalProperties == other.additionalProperties } @@ -785,15 +753,15 @@ constructor( if (hashCode == 0) { hashCode = Objects.hash( - verificationMethod, - ownerType, - owner, accountToken, companyId, - doingBusinessAs, dob, - userDefinedId, + doingBusinessAs, + owner, + ownerType, processorToken, + userDefinedId, + verificationMethod, additionalProperties, ) } @@ -801,7 +769,7 @@ constructor( } override fun toString() = - "PlaidCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, doingBusinessAs=$doingBusinessAs, dob=$dob, userDefinedId=$userDefinedId, processorToken=$processorToken, additionalProperties=$additionalProperties}" + "PlaidCreateBankAccountApiRequest{accountToken=$accountToken, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, owner=$owner, ownerType=$ownerType, processorToken=$processorToken, userDefinedId=$userDefinedId, verificationMethod=$verificationMethod, additionalProperties=$additionalProperties}" companion object { @@ -810,78 +778,64 @@ constructor( class Builder { - private var verificationMethod: VerificationMethod? = null - private var ownerType: OwnerType? = null - private var owner: String? = null private var accountToken: String? = null private var companyId: String? = null - private var doingBusinessAs: String? = null private var dob: LocalDate? = null - private var userDefinedId: String? = null + private var doingBusinessAs: String? = null + private var owner: String? = null + private var ownerType: OwnerType? = null private var processorToken: String? = null + private var userDefinedId: String? = null + private var verificationMethod: VerificationMethod? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest) = apply { - this.verificationMethod = plaidCreateBankAccountApiRequest.verificationMethod - this.ownerType = plaidCreateBankAccountApiRequest.ownerType - this.owner = plaidCreateBankAccountApiRequest.owner this.accountToken = plaidCreateBankAccountApiRequest.accountToken this.companyId = plaidCreateBankAccountApiRequest.companyId - this.doingBusinessAs = plaidCreateBankAccountApiRequest.doingBusinessAs this.dob = plaidCreateBankAccountApiRequest.dob - this.userDefinedId = plaidCreateBankAccountApiRequest.userDefinedId + this.doingBusinessAs = plaidCreateBankAccountApiRequest.doingBusinessAs + this.owner = plaidCreateBankAccountApiRequest.owner + this.ownerType = plaidCreateBankAccountApiRequest.ownerType this.processorToken = plaidCreateBankAccountApiRequest.processorToken + this.userDefinedId = plaidCreateBankAccountApiRequest.userDefinedId + this.verificationMethod = plaidCreateBankAccountApiRequest.verificationMethod additionalProperties(plaidCreateBankAccountApiRequest.additionalProperties) } - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - @JsonProperty("owner_type") - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - - /** - * Legal Name of the business or individual who owns the external account. This will - * appear in statements - */ - @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } - - /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be - * null - */ @JsonProperty("account_token") fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } - /** Doing Business As */ + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } + @JsonProperty("doing_business_as") fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } + @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } - /** User Defined ID */ - @JsonProperty("user_defined_id") - fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } + @JsonProperty("owner_type") + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } @JsonProperty("processor_token") fun processorToken(processorToken: String) = apply { this.processorToken = processorToken } + @JsonProperty("user_defined_id") + fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } + + @JsonProperty("verification_method") + fun verificationMethod(verificationMethod: VerificationMethod) = apply { + this.verificationMethod = verificationMethod + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -898,17 +852,17 @@ constructor( fun build(): PlaidCreateBankAccountApiRequest = PlaidCreateBankAccountApiRequest( - checkNotNull(verificationMethod) { - "`verificationMethod` is required but was not set" - }, - checkNotNull(ownerType) { "`ownerType` is required but was not set" }, - checkNotNull(owner) { "`owner` is required but was not set" }, accountToken, companyId, - doingBusinessAs, dob, - userDefinedId, + doingBusinessAs, + checkNotNull(owner) { "`owner` is required but was not set" }, + checkNotNull(ownerType) { "`ownerType` is required but was not set" }, checkNotNull(processorToken) { "`processorToken` is required but was not set" }, + userDefinedId, + checkNotNull(verificationMethod) { + "`verificationMethod` is required but was not set" + }, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt index 1653929ae..9d0f98c36 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class ExternalBankAccountCreateResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ExternalBankAccountCreateResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is ExternalBankAccountCreateResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountCreateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountCreateResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,97 +337,148 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(externalBankAccountCreateResponse: ExternalBankAccountCreateResponse) = apply { - this.token = externalBankAccountCreateResponse.token - this.owner = externalBankAccountCreateResponse.owner - this.routingNumber = externalBankAccountCreateResponse.routingNumber - this.lastFour = externalBankAccountCreateResponse.lastFour - this.name = externalBankAccountCreateResponse.name - this.currency = externalBankAccountCreateResponse.currency - this.country = externalBankAccountCreateResponse.country this.accountToken = externalBankAccountCreateResponse.accountToken - this.created = externalBankAccountCreateResponse.created + this.address = externalBankAccountCreateResponse.address this.companyId = externalBankAccountCreateResponse.companyId + this.country = externalBankAccountCreateResponse.country + this.created = externalBankAccountCreateResponse.created + this.currency = externalBankAccountCreateResponse.currency this.dob = externalBankAccountCreateResponse.dob this.doingBusinessAs = externalBankAccountCreateResponse.doingBusinessAs + this.lastFour = externalBankAccountCreateResponse.lastFour + this.name = externalBankAccountCreateResponse.name + this.financialAccountToken = externalBankAccountCreateResponse.financialAccountToken + this.owner = externalBankAccountCreateResponse.owner + this.ownerType = externalBankAccountCreateResponse.ownerType + this.routingNumber = externalBankAccountCreateResponse.routingNumber + this.state = externalBankAccountCreateResponse.state + this.token = externalBankAccountCreateResponse.token + this.type = externalBankAccountCreateResponse.type this.userDefinedId = externalBankAccountCreateResponse.userDefinedId + this.verificationAttempts = externalBankAccountCreateResponse.verificationAttempts this.verificationFailedReason = externalBankAccountCreateResponse.verificationFailedReason - this.verificationAttempts = externalBankAccountCreateResponse.verificationAttempts - this.financialAccountToken = externalBankAccountCreateResponse.financialAccountToken - this.type = externalBankAccountCreateResponse.type this.verificationMethod = externalBankAccountCreateResponse.verificationMethod - this.ownerType = externalBankAccountCreateResponse.ownerType - this.state = externalBankAccountCreateResponse.state this.verificationState = externalBankAccountCreateResponse.verificationState - this.address = externalBankAccountCreateResponse.address additionalProperties(externalBankAccountCreateResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -454,93 +501,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -560,84 +612,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -654,28 +646,28 @@ private constructor( fun build(): ExternalBankAccountCreateResponse = ExternalBankAccountCreateResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -759,40 +751,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -948,8 +940,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -957,39 +947,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt index 308cc61ff..accbf27c6 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListParams.kt @@ -359,40 +359,40 @@ constructor( companion object { - @JvmField val ENABLED = AccountState(JsonField.of("ENABLED")) - @JvmField val CLOSED = AccountState(JsonField.of("CLOSED")) + @JvmField val ENABLED = AccountState(JsonField.of("ENABLED")) + @JvmField val PAUSED = AccountState(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = AccountState(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown AccountState: $value") } @@ -422,8 +422,6 @@ constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -431,39 +429,41 @@ constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt index 209e51f4f..4e5b84202 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class ExternalBankAccountListResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ExternalBankAccountListResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is ExternalBankAccountListResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountListResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountListResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,97 +337,148 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(externalBankAccountListResponse: ExternalBankAccountListResponse) = apply { - this.token = externalBankAccountListResponse.token - this.owner = externalBankAccountListResponse.owner - this.routingNumber = externalBankAccountListResponse.routingNumber - this.lastFour = externalBankAccountListResponse.lastFour - this.name = externalBankAccountListResponse.name - this.currency = externalBankAccountListResponse.currency - this.country = externalBankAccountListResponse.country this.accountToken = externalBankAccountListResponse.accountToken - this.created = externalBankAccountListResponse.created + this.address = externalBankAccountListResponse.address this.companyId = externalBankAccountListResponse.companyId + this.country = externalBankAccountListResponse.country + this.created = externalBankAccountListResponse.created + this.currency = externalBankAccountListResponse.currency this.dob = externalBankAccountListResponse.dob this.doingBusinessAs = externalBankAccountListResponse.doingBusinessAs + this.lastFour = externalBankAccountListResponse.lastFour + this.name = externalBankAccountListResponse.name + this.financialAccountToken = externalBankAccountListResponse.financialAccountToken + this.owner = externalBankAccountListResponse.owner + this.ownerType = externalBankAccountListResponse.ownerType + this.routingNumber = externalBankAccountListResponse.routingNumber + this.state = externalBankAccountListResponse.state + this.token = externalBankAccountListResponse.token + this.type = externalBankAccountListResponse.type this.userDefinedId = externalBankAccountListResponse.userDefinedId + this.verificationAttempts = externalBankAccountListResponse.verificationAttempts this.verificationFailedReason = externalBankAccountListResponse.verificationFailedReason - this.verificationAttempts = externalBankAccountListResponse.verificationAttempts - this.financialAccountToken = externalBankAccountListResponse.financialAccountToken - this.type = externalBankAccountListResponse.type this.verificationMethod = externalBankAccountListResponse.verificationMethod - this.ownerType = externalBankAccountListResponse.ownerType - this.state = externalBankAccountListResponse.state this.verificationState = externalBankAccountListResponse.verificationState - this.address = externalBankAccountListResponse.address additionalProperties(externalBankAccountListResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -454,93 +501,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -560,84 +612,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -654,28 +646,28 @@ private constructor( fun build(): ExternalBankAccountListResponse = ExternalBankAccountListResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -759,40 +751,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -948,8 +940,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -957,39 +947,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt index 19d5be970..492eaad25 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class ExternalBankAccountRetrieveResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ExternalBankAccountRetrieveResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is ExternalBankAccountRetrieveResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountRetrieveResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountRetrieveResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,98 +337,149 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from( externalBankAccountRetrieveResponse: ExternalBankAccountRetrieveResponse ) = apply { - this.token = externalBankAccountRetrieveResponse.token - this.owner = externalBankAccountRetrieveResponse.owner - this.routingNumber = externalBankAccountRetrieveResponse.routingNumber - this.lastFour = externalBankAccountRetrieveResponse.lastFour - this.name = externalBankAccountRetrieveResponse.name - this.currency = externalBankAccountRetrieveResponse.currency - this.country = externalBankAccountRetrieveResponse.country this.accountToken = externalBankAccountRetrieveResponse.accountToken - this.created = externalBankAccountRetrieveResponse.created + this.address = externalBankAccountRetrieveResponse.address this.companyId = externalBankAccountRetrieveResponse.companyId + this.country = externalBankAccountRetrieveResponse.country + this.created = externalBankAccountRetrieveResponse.created + this.currency = externalBankAccountRetrieveResponse.currency this.dob = externalBankAccountRetrieveResponse.dob this.doingBusinessAs = externalBankAccountRetrieveResponse.doingBusinessAs + this.lastFour = externalBankAccountRetrieveResponse.lastFour + this.name = externalBankAccountRetrieveResponse.name + this.financialAccountToken = externalBankAccountRetrieveResponse.financialAccountToken + this.owner = externalBankAccountRetrieveResponse.owner + this.ownerType = externalBankAccountRetrieveResponse.ownerType + this.routingNumber = externalBankAccountRetrieveResponse.routingNumber + this.state = externalBankAccountRetrieveResponse.state + this.token = externalBankAccountRetrieveResponse.token + this.type = externalBankAccountRetrieveResponse.type this.userDefinedId = externalBankAccountRetrieveResponse.userDefinedId + this.verificationAttempts = externalBankAccountRetrieveResponse.verificationAttempts this.verificationFailedReason = externalBankAccountRetrieveResponse.verificationFailedReason - this.verificationAttempts = externalBankAccountRetrieveResponse.verificationAttempts - this.financialAccountToken = externalBankAccountRetrieveResponse.financialAccountToken - this.type = externalBankAccountRetrieveResponse.type this.verificationMethod = externalBankAccountRetrieveResponse.verificationMethod - this.ownerType = externalBankAccountRetrieveResponse.ownerType - this.state = externalBankAccountRetrieveResponse.state this.verificationState = externalBankAccountRetrieveResponse.verificationState - this.address = externalBankAccountRetrieveResponse.address additionalProperties(externalBankAccountRetrieveResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -455,93 +502,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -561,84 +613,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -655,28 +647,28 @@ private constructor( fun build(): ExternalBankAccountRetrieveResponse = ExternalBankAccountRetrieveResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -760,40 +752,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -949,8 +941,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -958,39 +948,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt index 510b9d9a8..d98e71daf 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsParams.kt @@ -56,6 +56,10 @@ constructor( private var hashCode: Int = 0 + /** + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account + */ @JsonProperty("financial_account_token") fun financialAccountToken(): String? = financialAccountToken @@ -104,6 +108,10 @@ constructor( additionalProperties(externalBankAccountRetryMicroDepositsBody.additionalProperties) } + /** + * The financial account token of the operating account, which will provide the funds + * for micro deposits used to verify the account + */ @JsonProperty("financial_account_token") fun financialAccountToken(financialAccountToken: String) = apply { this.financialAccountToken = financialAccountToken @@ -198,6 +206,10 @@ constructor( this.externalBankAccountToken = externalBankAccountToken } + /** + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account + */ fun financialAccountToken(financialAccountToken: String) = apply { this.financialAccountToken = financialAccountToken } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt index 152c81999..f1edccd1a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class ExternalBankAccountRetryMicroDepositsResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ExternalBankAccountRetryMicroDepositsResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is ExternalBankAccountRetryMicroDepositsResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountRetryMicroDepositsResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountRetryMicroDepositsResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,28 +337,28 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -370,73 +366,124 @@ private constructor( externalBankAccountRetryMicroDepositsResponse: ExternalBankAccountRetryMicroDepositsResponse ) = apply { - this.token = externalBankAccountRetryMicroDepositsResponse.token - this.owner = externalBankAccountRetryMicroDepositsResponse.owner - this.routingNumber = externalBankAccountRetryMicroDepositsResponse.routingNumber - this.lastFour = externalBankAccountRetryMicroDepositsResponse.lastFour - this.name = externalBankAccountRetryMicroDepositsResponse.name - this.currency = externalBankAccountRetryMicroDepositsResponse.currency - this.country = externalBankAccountRetryMicroDepositsResponse.country this.accountToken = externalBankAccountRetryMicroDepositsResponse.accountToken - this.created = externalBankAccountRetryMicroDepositsResponse.created + this.address = externalBankAccountRetryMicroDepositsResponse.address this.companyId = externalBankAccountRetryMicroDepositsResponse.companyId + this.country = externalBankAccountRetryMicroDepositsResponse.country + this.created = externalBankAccountRetryMicroDepositsResponse.created + this.currency = externalBankAccountRetryMicroDepositsResponse.currency this.dob = externalBankAccountRetryMicroDepositsResponse.dob this.doingBusinessAs = externalBankAccountRetryMicroDepositsResponse.doingBusinessAs - this.userDefinedId = externalBankAccountRetryMicroDepositsResponse.userDefinedId - this.verificationFailedReason = - externalBankAccountRetryMicroDepositsResponse.verificationFailedReason - this.verificationAttempts = - externalBankAccountRetryMicroDepositsResponse.verificationAttempts + this.lastFour = externalBankAccountRetryMicroDepositsResponse.lastFour + this.name = externalBankAccountRetryMicroDepositsResponse.name this.financialAccountToken = externalBankAccountRetryMicroDepositsResponse.financialAccountToken + this.owner = externalBankAccountRetryMicroDepositsResponse.owner + this.ownerType = externalBankAccountRetryMicroDepositsResponse.ownerType + this.routingNumber = externalBankAccountRetryMicroDepositsResponse.routingNumber + this.state = externalBankAccountRetryMicroDepositsResponse.state + this.token = externalBankAccountRetryMicroDepositsResponse.token this.type = externalBankAccountRetryMicroDepositsResponse.type + this.userDefinedId = externalBankAccountRetryMicroDepositsResponse.userDefinedId + this.verificationAttempts = + externalBankAccountRetryMicroDepositsResponse.verificationAttempts + this.verificationFailedReason = + externalBankAccountRetryMicroDepositsResponse.verificationFailedReason this.verificationMethod = externalBankAccountRetryMicroDepositsResponse.verificationMethod - this.ownerType = externalBankAccountRetryMicroDepositsResponse.ownerType - this.state = externalBankAccountRetryMicroDepositsResponse.state this.verificationState = externalBankAccountRetryMicroDepositsResponse.verificationState - this.address = externalBankAccountRetryMicroDepositsResponse.address additionalProperties(externalBankAccountRetryMicroDepositsResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -459,93 +506,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -565,84 +617,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -659,28 +651,28 @@ private constructor( fun build(): ExternalBankAccountRetryMicroDepositsResponse = ExternalBankAccountRetryMicroDepositsResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -764,40 +756,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -953,8 +945,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -962,39 +952,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt index 8f832fd51..6dba68e28 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParams.kt @@ -92,31 +92,25 @@ constructor( private var hashCode: Int = 0 - /** Address */ + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob - /** Doing Business As */ @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** The nickname given to this record of External Bank Account */ @JsonProperty("name") fun name(): String? = name - /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements - */ @JsonProperty("owner") fun owner(): String? = owner - /** Owner Type */ @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType - /** User Defined ID */ @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId @JsonAnyGetter @@ -194,37 +188,31 @@ constructor( additionalProperties(externalBankAccountUpdateBody.additionalProperties) } - /** Address */ + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ @JsonProperty("address") fun address(address: ExternalBankAccountAddress) = apply { this.address = address } - /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } - /** Doing Business As */ @JsonProperty("doing_business_as") fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** The nickname given to this record of External Bank Account */ @JsonProperty("name") fun name(name: String) = apply { this.name = name } - /** - * Legal Name of the business or individual who owns the external account. This will - * appear in statements - */ @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } - /** Owner Type */ @JsonProperty("owner_type") fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - /** User Defined ID */ @JsonProperty("user_defined_id") fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } @@ -348,33 +336,27 @@ constructor( this.externalBankAccountToken = externalBankAccountToken } - /** Address */ + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ fun address(address: ExternalBankAccountAddress) = apply { this.address = address } - /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = apply { this.companyId = companyId } /** Date of Birth of the Individual that owns the external bank account */ fun dob(dob: LocalDate) = apply { this.dob = dob } - /** Doing Business As */ fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** The nickname given to this record of External Bank Account */ fun name(name: String) = apply { this.name = name } - /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements - */ fun owner(owner: String) = apply { this.owner = owner } - /** Owner Type */ fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } fun additionalQueryParams(additionalQueryParams: Map>) = apply { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt index 50ff4edad..e3c94ebd0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class ExternalBankAccountUpdateResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ExternalBankAccountUpdateResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is ExternalBankAccountUpdateResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "ExternalBankAccountUpdateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountUpdateResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,97 +337,148 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(externalBankAccountUpdateResponse: ExternalBankAccountUpdateResponse) = apply { - this.token = externalBankAccountUpdateResponse.token - this.owner = externalBankAccountUpdateResponse.owner - this.routingNumber = externalBankAccountUpdateResponse.routingNumber - this.lastFour = externalBankAccountUpdateResponse.lastFour - this.name = externalBankAccountUpdateResponse.name - this.currency = externalBankAccountUpdateResponse.currency - this.country = externalBankAccountUpdateResponse.country this.accountToken = externalBankAccountUpdateResponse.accountToken - this.created = externalBankAccountUpdateResponse.created + this.address = externalBankAccountUpdateResponse.address this.companyId = externalBankAccountUpdateResponse.companyId + this.country = externalBankAccountUpdateResponse.country + this.created = externalBankAccountUpdateResponse.created + this.currency = externalBankAccountUpdateResponse.currency this.dob = externalBankAccountUpdateResponse.dob this.doingBusinessAs = externalBankAccountUpdateResponse.doingBusinessAs + this.lastFour = externalBankAccountUpdateResponse.lastFour + this.name = externalBankAccountUpdateResponse.name + this.financialAccountToken = externalBankAccountUpdateResponse.financialAccountToken + this.owner = externalBankAccountUpdateResponse.owner + this.ownerType = externalBankAccountUpdateResponse.ownerType + this.routingNumber = externalBankAccountUpdateResponse.routingNumber + this.state = externalBankAccountUpdateResponse.state + this.token = externalBankAccountUpdateResponse.token + this.type = externalBankAccountUpdateResponse.type this.userDefinedId = externalBankAccountUpdateResponse.userDefinedId + this.verificationAttempts = externalBankAccountUpdateResponse.verificationAttempts this.verificationFailedReason = externalBankAccountUpdateResponse.verificationFailedReason - this.verificationAttempts = externalBankAccountUpdateResponse.verificationAttempts - this.financialAccountToken = externalBankAccountUpdateResponse.financialAccountToken - this.type = externalBankAccountUpdateResponse.type this.verificationMethod = externalBankAccountUpdateResponse.verificationMethod - this.ownerType = externalBankAccountUpdateResponse.ownerType - this.state = externalBankAccountUpdateResponse.state this.verificationState = externalBankAccountUpdateResponse.verificationState - this.address = externalBankAccountUpdateResponse.address additionalProperties(externalBankAccountUpdateResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -454,93 +501,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -560,84 +612,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -654,28 +646,28 @@ private constructor( fun build(): ExternalBankAccountUpdateResponse = ExternalBankAccountUpdateResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -759,40 +751,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -948,8 +940,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -957,39 +947,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt index 6e2c55b12..2628b179e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt @@ -512,6 +512,7 @@ private constructor( private constructor( private val amount: JsonField, private val created: JsonField, + private val detailedResults: JsonField>, private val result: JsonField, private val token: JsonField, private val type: JsonField, @@ -532,6 +533,10 @@ private constructor( fun created(): Optional = Optional.ofNullable(created.getNullable("created")) + /** More detailed reasons for the event */ + fun detailedResults(): Optional> = + Optional.ofNullable(detailedResults.getNullable("detailed_results")) + /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. @@ -543,21 +548,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -592,6 +596,9 @@ private constructor( /** Date and time when the financial event occurred. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created + /** More detailed reasons for the event */ + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. @@ -603,21 +610,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -651,6 +657,7 @@ private constructor( if (!validated) { amount() created() + detailedResults() result() token() type() @@ -668,6 +675,7 @@ private constructor( return other is FinancialEvent && this.amount == other.amount && this.created == other.created && + this.detailedResults == other.detailedResults && this.result == other.result && this.token == other.token && this.type == other.type && @@ -680,6 +688,7 @@ private constructor( Objects.hash( amount, created, + detailedResults, result, token, type, @@ -690,7 +699,7 @@ private constructor( } override fun toString() = - "FinancialEvent{amount=$amount, created=$created, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "FinancialEvent{amount=$amount, created=$created, detailedResults=$detailedResults, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -701,6 +710,7 @@ private constructor( private var amount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() + private var detailedResults: JsonField> = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -710,6 +720,7 @@ private constructor( internal fun from(financialEvent: FinancialEvent) = apply { this.amount = financialEvent.amount this.created = financialEvent.created + this.detailedResults = financialEvent.detailedResults this.result = financialEvent.result this.token = financialEvent.token this.type = financialEvent.type @@ -738,6 +749,17 @@ private constructor( @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } + /** More detailed reasons for the event */ + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + /** More detailed reasons for the event */ + @JsonProperty("detailed_results") + @ExcludeMissing + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + /** * APPROVED financial events were successful while DECLINED financial events were * declined by user, Lithic, or the network. @@ -762,22 +784,21 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release * from an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending - * processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the + * fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + * Financial Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial - * Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -805,22 +826,21 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release * from an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending - * processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the + * fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + * Financial Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial - * Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -866,6 +886,7 @@ private constructor( FinancialEvent( amount, created, + detailedResults.map { it.toUnmodifiable() }, result, token, type, @@ -873,6 +894,94 @@ private constructor( ) } + class DetailedResult + @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 DetailedResult && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val APPROVED = DetailedResult(JsonField.of("APPROVED")) + + @JvmField + val FUNDS_INSUFFICIENT = DetailedResult(JsonField.of("FUNDS_INSUFFICIENT")) + + @JvmField val ACCOUNT_INVALID = DetailedResult(JsonField.of("ACCOUNT_INVALID")) + + @JvmField + val PROGRAM_TRANSACTION_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_TRANSACTION_LIMITS_EXCEEDED")) + + @JvmField + val PROGRAM_DAILY_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_DAILY_LIMITS_EXCEEDED")) + + @JvmField + val PROGRAM_MONTHLY_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_MONTHLY_LIMITS_EXCEEDED")) + + @JvmStatic fun of(value: String) = DetailedResult(JsonField.of(value)) + } + + enum class Known { + APPROVED, + FUNDS_INSUFFICIENT, + ACCOUNT_INVALID, + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + } + + enum class Value { + APPROVED, + FUNDS_INSUFFICIENT, + ACCOUNT_INVALID, + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + APPROVED -> Value.APPROVED + FUNDS_INSUFFICIENT -> Value.FUNDS_INSUFFICIENT + ACCOUNT_INVALID -> Value.ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Value.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Value.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Value.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + APPROVED -> Known.APPROVED + FUNDS_INSUFFICIENT -> Known.FUNDS_INSUFFICIENT + ACCOUNT_INVALID -> Known.ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Known.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Known.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Known.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> throw LithicInvalidDataException("Unknown DetailedResult: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + class Result @JsonCreator private constructor( @@ -952,33 +1061,14 @@ private constructor( companion object { - @JvmField - val ACH_EXCEEDED_THRESHOLD = - FinancialEventType(JsonField.of("ACH_EXCEEDED_THRESHOLD")) - - @JvmField - val ACH_INSUFFICIENT_FUNDS = - FinancialEventType(JsonField.of("ACH_INSUFFICIENT_FUNDS")) - - @JvmField - val ACH_INVALID_ACCOUNT = FinancialEventType(JsonField.of("ACH_INVALID_ACCOUNT")) - - @JvmField - val ACH_ORIGINATION_PENDING = - FinancialEventType(JsonField.of("ACH_ORIGINATION_PENDING")) - - @JvmField - val ACH_ORIGINATION_APPROVED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_APPROVED")) - - @JvmField - val ACH_ORIGINATION_DECLINED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_DECLINED")) - @JvmField val ACH_ORIGINATION_CANCELLED = FinancialEventType(JsonField.of("ACH_ORIGINATION_CANCELLED")) + @JvmField + val ACH_ORIGINATION_INITIATED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_INITIATED")) + @JvmField val ACH_ORIGINATION_PROCESSED = FinancialEventType(JsonField.of("ACH_ORIGINATION_PROCESSED")) @@ -992,15 +1082,21 @@ private constructor( FinancialEventType(JsonField.of("ACH_ORIGINATION_RELEASED")) @JvmField - val ACH_RECEIPT_PENDING = FinancialEventType(JsonField.of("ACH_RECEIPT_PENDING")) + val ACH_ORIGINATION_REVIEWED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_REVIEWED")) @JvmField - val ACH_RECEIPT_RELEASED = FinancialEventType(JsonField.of("ACH_RECEIPT_RELEASED")) + val ACH_RECEIPT_PROCESSED = + FinancialEventType(JsonField.of("ACH_RECEIPT_PROCESSED")) - @JvmField val ACH_RETURN = FinancialEventType(JsonField.of("ACH_RETURN")) + @JvmField + val ACH_RECEIPT_SETTLED = FinancialEventType(JsonField.of("ACH_RECEIPT_SETTLED")) + + @JvmField + val ACH_RETURN_INITIATED = FinancialEventType(JsonField.of("ACH_RETURN_INITIATED")) @JvmField - val ACH_RETURN_PENDING = FinancialEventType(JsonField.of("ACH_RETURN_PENDING")) + val ACH_RETURN_PROCESSED = FinancialEventType(JsonField.of("ACH_RETURN_PROCESSED")) @JvmField val AUTHORIZATION = FinancialEventType(JsonField.of("AUTHORIZATION")) @@ -1053,20 +1149,16 @@ private constructor( } enum class Known { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -1086,20 +1178,16 @@ private constructor( } enum class Value { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -1121,20 +1209,16 @@ private constructor( fun value(): Value = when (this) { - ACH_EXCEEDED_THRESHOLD -> Value.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Value.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Value.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Value.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Value.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Value.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Value.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Value.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Value.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Value.ACH_RECEIPT_RELEASED - ACH_RETURN -> Value.ACH_RETURN - ACH_RETURN_PENDING -> Value.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Value.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED AUTHORIZATION -> Value.AUTHORIZATION AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY @@ -1156,20 +1240,16 @@ private constructor( fun known(): Known = when (this) { - ACH_EXCEEDED_THRESHOLD -> Known.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Known.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Known.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Known.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Known.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Known.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Known.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Known.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Known.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Known.ACH_RECEIPT_RELEASED - ACH_RETURN -> Known.ACH_RETURN - ACH_RETURN_PENDING -> Known.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Known.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED AUTHORIZATION -> Known.AUTHORIZATION AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt index 12e1cac63..7eed286c4 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Kyb.kt @@ -52,9 +52,9 @@ private constructor( beneficialOwnerEntities.getRequired("beneficial_owner_entities") /** - * List of all direct and indirect individuals with >25% ownership in the company. If no entity - * or individual owns >25% of the company, and the largest shareholder is an individual, please - * identify them in this field. See + * List of all individuals with >25% ownership in the company. If no entity or individual + * owns >25% of the company, and the largest shareholder is an individual, please identify them + * in this field. See * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section I) for more background on individuals that should be included. If no individual is * an entity, pass in an empty list. However, either this parameter or @@ -119,9 +119,9 @@ private constructor( fun _beneficialOwnerEntities() = beneficialOwnerEntities /** - * List of all direct and indirect individuals with >25% ownership in the company. If no entity - * or individual owns >25% of the company, and the largest shareholder is an individual, please - * identify them in this field. See + * List of all individuals with >25% ownership in the company. If no entity or individual + * owns >25% of the company, and the largest shareholder is an individual, please identify them + * in this field. See * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section I) for more background on individuals that should be included. If no individual is * an entity, pass in an empty list. However, either this parameter or @@ -301,9 +301,9 @@ private constructor( } /** - * List of all direct and indirect individuals with >25% ownership in the company. If no - * entity or individual owns >25% of the company, and the largest shareholder is an - * individual, please identify them in this field. See + * List of all individuals with >25% ownership in the company. If no entity or individual + * owns >25% of the company, and the largest shareholder is an individual, please identify + * them in this field. See * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section I) for more background on individuals that should be included. If no individual * is an entity, pass in an empty list. However, either this parameter or @@ -313,9 +313,9 @@ private constructor( beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) /** - * List of all direct and indirect individuals with >25% ownership in the company. If no - * entity or individual owns >25% of the company, and the largest shareholder is an - * individual, please identify them in this field. See + * List of all individuals with >25% ownership in the company. If no entity or individual + * owns >25% of the company, and the largest shareholder is an individual, please identify + * them in this field. See * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section I) for more background on individuals that should be included. If no individual * is an entity, pass in an empty list. However, either this parameter or diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt index a6d1ae4cf..1cd1d0f18 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt @@ -59,18 +59,19 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from an + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release from an * ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial + * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -127,18 +128,19 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from an + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release from an * ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial + * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -327,21 +329,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -369,21 +370,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -569,31 +569,14 @@ private constructor( companion object { - @JvmField - val ACH_EXCEEDED_THRESHOLD = FinancialEventType(JsonField.of("ACH_EXCEEDED_THRESHOLD")) - - @JvmField - val ACH_INSUFFICIENT_FUNDS = FinancialEventType(JsonField.of("ACH_INSUFFICIENT_FUNDS")) - - @JvmField - val ACH_INVALID_ACCOUNT = FinancialEventType(JsonField.of("ACH_INVALID_ACCOUNT")) - - @JvmField - val ACH_ORIGINATION_PENDING = - FinancialEventType(JsonField.of("ACH_ORIGINATION_PENDING")) - - @JvmField - val ACH_ORIGINATION_APPROVED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_APPROVED")) - - @JvmField - val ACH_ORIGINATION_DECLINED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_DECLINED")) - @JvmField val ACH_ORIGINATION_CANCELLED = FinancialEventType(JsonField.of("ACH_ORIGINATION_CANCELLED")) + @JvmField + val ACH_ORIGINATION_INITIATED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_INITIATED")) + @JvmField val ACH_ORIGINATION_PROCESSED = FinancialEventType(JsonField.of("ACH_ORIGINATION_PROCESSED")) @@ -607,15 +590,20 @@ private constructor( FinancialEventType(JsonField.of("ACH_ORIGINATION_RELEASED")) @JvmField - val ACH_RECEIPT_PENDING = FinancialEventType(JsonField.of("ACH_RECEIPT_PENDING")) + val ACH_ORIGINATION_REVIEWED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_REVIEWED")) @JvmField - val ACH_RECEIPT_RELEASED = FinancialEventType(JsonField.of("ACH_RECEIPT_RELEASED")) + val ACH_RECEIPT_PROCESSED = FinancialEventType(JsonField.of("ACH_RECEIPT_PROCESSED")) - @JvmField val ACH_RETURN = FinancialEventType(JsonField.of("ACH_RETURN")) + @JvmField + val ACH_RECEIPT_SETTLED = FinancialEventType(JsonField.of("ACH_RECEIPT_SETTLED")) + + @JvmField + val ACH_RETURN_INITIATED = FinancialEventType(JsonField.of("ACH_RETURN_INITIATED")) @JvmField - val ACH_RETURN_PENDING = FinancialEventType(JsonField.of("ACH_RETURN_PENDING")) + val ACH_RETURN_PROCESSED = FinancialEventType(JsonField.of("ACH_RETURN_PROCESSED")) @JvmField val AUTHORIZATION = FinancialEventType(JsonField.of("AUTHORIZATION")) @@ -665,20 +653,16 @@ private constructor( } enum class Known { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -698,20 +682,16 @@ private constructor( } enum class Value { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -733,20 +713,16 @@ private constructor( fun value(): Value = when (this) { - ACH_EXCEEDED_THRESHOLD -> Value.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Value.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Value.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Value.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Value.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Value.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Value.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Value.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Value.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Value.ACH_RECEIPT_RELEASED - ACH_RETURN -> Value.ACH_RETURN - ACH_RETURN_PENDING -> Value.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Value.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED AUTHORIZATION -> Value.AUTHORIZATION AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY @@ -768,20 +744,16 @@ private constructor( fun known(): Known = when (this) { - ACH_EXCEEDED_THRESHOLD -> Known.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Known.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Known.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Known.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Known.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Known.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Known.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Known.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Known.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Known.ACH_RECEIPT_RELEASED - ACH_RETURN -> Known.ACH_RETURN - ACH_RETURN_PENDING -> Known.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Known.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED AUTHORIZATION -> Known.AUTHORIZATION AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt index ccfda1cdb..71bf13be8 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt @@ -24,28 +24,28 @@ import java.util.Optional @NoAutoDetect class MicroDepositCreateResponse private constructor( - private val token: JsonField, - private val owner: JsonField, - private val routingNumber: JsonField, - private val lastFour: JsonField, - private val name: JsonField, - private val currency: JsonField, - private val country: JsonField, private val accountToken: JsonField, - private val created: JsonField, + private val address: JsonField, private val companyId: JsonField, + private val country: JsonField, + private val created: JsonField, + private val currency: JsonField, private val dob: JsonField, private val doingBusinessAs: JsonField, - private val userDefinedId: JsonField, - private val verificationFailedReason: JsonField, - private val verificationAttempts: JsonField, + private val lastFour: JsonField, + private val name: JsonField, private val financialAccountToken: JsonField, - private val type: JsonField, - private val verificationMethod: JsonField, + private val owner: JsonField, private val ownerType: JsonField, + private val routingNumber: JsonField, private val state: JsonField, + private val token: JsonField, + private val type: JsonField, + private val userDefinedId: JsonField, + private val verificationAttempts: JsonField, + private val verificationFailedReason: JsonField, + private val verificationMethod: JsonField, private val verificationState: JsonField, - private val address: JsonField, private val additionalProperties: Map, ) { @@ -54,29 +54,21 @@ private constructor( private var hashCode: Int = 0 /** - * A globally unique identifier for this record of an external bank account association. If a - * program links an external bank account to more than one end-user or to both the program and - * the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null */ - fun token(): String = token.getRequired("token") + fun accountToken(): Optional = + Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. */ - fun owner(): String = owner.getRequired("owner") - - /** Routing Number */ - fun routingNumber(): String = routingNumber.getRequired("routing_number") - - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") - - /** The nickname given to this record of External Bank Account */ - fun name(): Optional = Optional.ofNullable(name.getNullable("name")) + fun address(): Optional = + Optional.ofNullable(address.getNullable("address")) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -84,89 +76,85 @@ private constructor( */ fun country(): String = country.getRequired("country") - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - fun accountToken(): Optional = - Optional.ofNullable(accountToken.getNullable("account_token")) - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") /** Date of Birth of the Individual that owns the external bank account */ fun dob(): Optional = Optional.ofNullable(dob.getNullable("dob")) - /** Doing Business As */ fun doingBusinessAs(): Optional = Optional.ofNullable(doingBusinessAs.getNullable("doing_business_as")) - /** User Defined ID */ - fun userDefinedId(): Optional = - Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + + /** The nickname given to this record of External Bank Account */ + fun name(): Optional = Optional.ofNullable(name.getNullable("name")) /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - fun verificationFailedReason(): Optional = - Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ fun financialAccountToken(): Optional = Optional.ofNullable(financialAccountToken.getNullable("financial_account_token")) - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + fun owner(): String = owner.getRequired("owner") - /** Owner Type */ fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") + fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** Address */ - fun address(): Optional = - Optional.ofNullable(address.getNullable("address")) + fun state(): State = state.getRequired("state") /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and * the end-user, then Lithic will return each record of the association */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") + + fun type(): Type = type.getRequired("type") + + fun userDefinedId(): Optional = + Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) + + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") /** - * Legal Name of the business or individual who owns the external account. This will appear in - * statements + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network */ - @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + fun verificationFailedReason(): Optional = + Optional.ofNullable(verificationFailedReason.getNullable("verification_failed_reason")) - /** Routing Number */ - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - /** The nickname given to this record of External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** + * Indicates which Lithic account the external account is associated with. For external accounts + * that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Address used during Address Verification Service (AVS) checks during transactions if enabled + * via Auth Rules. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId /** * The country that the bank account is located in using ISO 3166-1. We will only accept USA @@ -174,94 +162,102 @@ private constructor( */ @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Indicates which Lithic account the external account is associated with. For external accounts - * that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob - /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs - /** User Defined ID */ - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** The nickname given to this record of External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** - * Optional free text description of the reason for the failed verification. For ACH - * micro-deposits returned, this field will display the reason return code sent by the ACH - * network + * The financial account token of the operating account, which will provide the funds for micro + * deposits used to verify the account */ - @JsonProperty("verification_failed_reason") + @JsonProperty("financial_account_token") @ExcludeMissing - fun _verificationFailedReason() = verificationFailedReason + fun _financialAccountToken() = financialAccountToken + + /** + * Legal Name of the business or individual who owns the external account. This will appear in + * statements + */ + @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** + * A globally unique identifier for this record of an external bank account association. If a + * program links an external bank account to more than one end-user or to both the program and + * the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** The number of attempts at verification */ @JsonProperty("verification_attempts") @ExcludeMissing fun _verificationAttempts() = verificationAttempts - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") + /** + * Optional free text description of the reason for the failed verification. For ACH + * micro-deposits returned, this field will display the reason return code sent by the ACH + * network + */ + @JsonProperty("verification_failed_reason") @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun _verificationFailedReason() = verificationFailedReason - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun _verificationMethod() = verificationMethod - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): MicroDepositCreateResponse = apply { if (!validated) { - token() - owner() - routingNumber() - lastFour() - name() - currency() - country() accountToken() - created() + address().map { it.validate() } companyId() + country() + created() + currency() dob() doingBusinessAs() - userDefinedId() - verificationFailedReason() - verificationAttempts() + lastFour() + name() financialAccountToken() - type() - verificationMethod() + owner() ownerType() + routingNumber() state() + token() + type() + userDefinedId() + verificationAttempts() + verificationFailedReason() + verificationMethod() verificationState() - address().map { it.validate() } validated = true } } @@ -274,28 +270,28 @@ private constructor( } return other is MicroDepositCreateResponse && - this.token == other.token && - this.owner == other.owner && - this.routingNumber == other.routingNumber && - this.lastFour == other.lastFour && - this.name == other.name && - this.currency == other.currency && - this.country == other.country && this.accountToken == other.accountToken && - this.created == other.created && + this.address == other.address && this.companyId == other.companyId && + this.country == other.country && + this.created == other.created && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && - this.userDefinedId == other.userDefinedId && - this.verificationFailedReason == other.verificationFailedReason && - this.verificationAttempts == other.verificationAttempts && + this.lastFour == other.lastFour && + this.name == other.name && this.financialAccountToken == other.financialAccountToken && - this.type == other.type && - this.verificationMethod == other.verificationMethod && + this.owner == other.owner && this.ownerType == other.ownerType && + this.routingNumber == other.routingNumber && this.state == other.state && + this.token == other.token && + this.type == other.type && + this.userDefinedId == other.userDefinedId && + this.verificationAttempts == other.verificationAttempts && + this.verificationFailedReason == other.verificationFailedReason && + this.verificationMethod == other.verificationMethod && this.verificationState == other.verificationState && - this.address == other.address && this.additionalProperties == other.additionalProperties } @@ -303,28 +299,28 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties, ) } @@ -332,7 +328,7 @@ private constructor( } override fun toString() = - "MicroDepositCreateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "MicroDepositCreateResponse{accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, created=$created, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, lastFour=$lastFour, name=$name, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, token=$token, type=$type, userDefinedId=$userDefinedId, verificationAttempts=$verificationAttempts, verificationFailedReason=$verificationFailedReason, verificationMethod=$verificationMethod, verificationState=$verificationState, additionalProperties=$additionalProperties}" companion object { @@ -341,95 +337,146 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(microDepositCreateResponse: MicroDepositCreateResponse) = apply { - this.token = microDepositCreateResponse.token - this.owner = microDepositCreateResponse.owner - this.routingNumber = microDepositCreateResponse.routingNumber - this.lastFour = microDepositCreateResponse.lastFour - this.name = microDepositCreateResponse.name - this.currency = microDepositCreateResponse.currency - this.country = microDepositCreateResponse.country this.accountToken = microDepositCreateResponse.accountToken - this.created = microDepositCreateResponse.created + this.address = microDepositCreateResponse.address this.companyId = microDepositCreateResponse.companyId + this.country = microDepositCreateResponse.country + this.created = microDepositCreateResponse.created + this.currency = microDepositCreateResponse.currency this.dob = microDepositCreateResponse.dob this.doingBusinessAs = microDepositCreateResponse.doingBusinessAs - this.userDefinedId = microDepositCreateResponse.userDefinedId - this.verificationFailedReason = microDepositCreateResponse.verificationFailedReason - this.verificationAttempts = microDepositCreateResponse.verificationAttempts + this.lastFour = microDepositCreateResponse.lastFour + this.name = microDepositCreateResponse.name this.financialAccountToken = microDepositCreateResponse.financialAccountToken - this.type = microDepositCreateResponse.type - this.verificationMethod = microDepositCreateResponse.verificationMethod + this.owner = microDepositCreateResponse.owner this.ownerType = microDepositCreateResponse.ownerType + this.routingNumber = microDepositCreateResponse.routingNumber this.state = microDepositCreateResponse.state + this.token = microDepositCreateResponse.token + this.type = microDepositCreateResponse.type + this.userDefinedId = microDepositCreateResponse.userDefinedId + this.verificationAttempts = microDepositCreateResponse.verificationAttempts + this.verificationFailedReason = microDepositCreateResponse.verificationFailedReason + this.verificationMethod = microDepositCreateResponse.verificationMethod this.verificationState = microDepositCreateResponse.verificationState - this.address = microDepositCreateResponse.address additionalProperties(microDepositCreateResponse.additionalProperties) } /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) + + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") + @ExcludeMissing + fun address(address: JsonField) = apply { + this.address = address + } + + /** Optional field that helps identify bank accounts in receipts */ + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + /** Optional field that helps identify bank accounts in receipts */ + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - fun token(token: String) = token(JsonField.of(token)) + fun country(country: String) = country(JsonField.of(country)) /** - * A globally unique identifier for this record of an external bank account association. If - * a program links an external bank account to more than one end-user or to both the program - * and the end-user, then Lithic will return each record of the association + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA */ - @JsonProperty("token") + @JsonProperty("country") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun country(country: JsonField) = apply { this.country = country } /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun owner(owner: String) = owner(JsonField.of(owner)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** - * Legal Name of the business or individual who owns the external account. This will appear - * in statements + * An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("owner") + @JsonProperty("created") @ExcludeMissing - fun owner(owner: JsonField) = apply { this.owner = owner } + fun created(created: JsonField) = apply { this.created = created } - /** Routing Number */ - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Routing Number */ - @JsonProperty("routing_number") + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + + /** Date of Birth of the Individual that owns the external bank account */ + @JsonProperty("dob") + @ExcludeMissing + fun dob(dob: JsonField) = apply { this.dob = dob } + + fun doingBusinessAs(doingBusinessAs: String) = + doingBusinessAs(JsonField.of(doingBusinessAs)) + + @JsonProperty("doing_business_as") + @ExcludeMissing + fun doingBusinessAs(doingBusinessAs: JsonField) = apply { + this.doingBusinessAs = doingBusinessAs } /** @@ -452,93 +499,98 @@ private constructor( @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") - @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - fun country(country: String) = country(JsonField.of(country)) + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA + * The financial account token of the operating account, which will provide the funds for + * micro deposits used to verify the account */ - @JsonProperty("country") + @JsonProperty("financial_account_token") @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + fun owner(owner: String) = owner(JsonField.of(owner)) /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null + * Legal Name of the business or individual who owns the external account. This will appear + * in statements */ - @JsonProperty("account_token") + @JsonProperty("owner") @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } + fun owner(owner: JsonField) = apply { this.owner = owner } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - @JsonProperty("created") + @JsonProperty("owner_type") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - /** Optional field that helps identify bank accounts in receipts */ - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Optional field that helps identify bank accounts in receipts */ - @JsonProperty("company_id") + @JsonProperty("routing_number") @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber + } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = dob(JsonField.of(dob)) + fun state(state: State) = state(JsonField.of(state)) - /** Date of Birth of the Individual that owns the external bank account */ - @JsonProperty("dob") + @JsonProperty("state") @ExcludeMissing - fun dob(dob: JsonField) = apply { this.dob = dob } + fun state(state: JsonField) = apply { this.state = state } - /** Doing Business As */ - fun doingBusinessAs(doingBusinessAs: String) = - doingBusinessAs(JsonField.of(doingBusinessAs)) + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + fun token(token: String) = token(JsonField.of(token)) - /** Doing Business As */ - @JsonProperty("doing_business_as") + /** + * A globally unique identifier for this record of an external bank account association. If + * a program links an external bank account to more than one end-user or to both the program + * and the end-user, then Lithic will return each record of the association + */ + @JsonProperty("token") @ExcludeMissing - fun doingBusinessAs(doingBusinessAs: JsonField) = apply { - this.doingBusinessAs = doingBusinessAs - } + fun token(token: JsonField) = apply { this.token = token } + + fun type(type: Type) = type(JsonField.of(type)) + + @JsonProperty("type") + @ExcludeMissing + fun type(type: JsonField) = apply { this.type = type } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) - /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun userDefinedId(userDefinedId: JsonField) = apply { this.userDefinedId = userDefinedId } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) + + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } + /** * Optional free text description of the reason for the failed verification. For ACH * micro-deposits returned, this field will display the reason return code sent by the ACH @@ -558,84 +610,24 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - @JsonProperty("type") - @ExcludeMissing - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ fun verificationMethod(verificationMethod: VerificationMethod) = verificationMethod(JsonField.of(verificationMethod)) - /** Verification Method */ @JsonProperty("verification_method") @ExcludeMissing fun verificationMethod(verificationMethod: JsonField) = apply { this.verificationMethod = verificationMethod } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - @JsonProperty("owner_type") - @ExcludeMissing - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ fun verificationState(verificationState: VerificationState) = verificationState(JsonField.of(verificationState)) - /** Verification State */ @JsonProperty("verification_state") @ExcludeMissing fun verificationState(verificationState: JsonField) = apply { this.verificationState = verificationState } - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - @JsonProperty("address") - @ExcludeMissing - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -652,28 +644,28 @@ private constructor( fun build(): MicroDepositCreateResponse = MicroDepositCreateResponse( - token, - owner, - routingNumber, - lastFour, - name, - currency, - country, accountToken, - created, + address, companyId, + country, + created, + currency, dob, doingBusinessAs, - userDefinedId, - verificationFailedReason, - verificationAttempts, + lastFour, + name, financialAccountToken, - type, - verificationMethod, + owner, ownerType, + routingNumber, state, + token, + type, + userDefinedId, + verificationAttempts, + verificationFailedReason, + verificationMethod, verificationState, - address, additionalProperties.toUnmodifiable(), ) } @@ -757,40 +749,40 @@ private constructor( companion object { - @JvmField val ENABLED = State(JsonField.of("ENABLED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) + @JvmField val PAUSED = State(JsonField.of("PAUSED")) @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { - ENABLED, CLOSED, + ENABLED, PAUSED, } enum class Value { - ENABLED, CLOSED, + ENABLED, PAUSED, _UNKNOWN, } fun value(): Value = when (this) { - ENABLED -> Value.ENABLED CLOSED -> Value.CLOSED + ENABLED -> Value.ENABLED PAUSED -> Value.PAUSED else -> Value._UNKNOWN } fun known(): Known = when (this) { - ENABLED -> Known.ENABLED CLOSED -> Known.CLOSED + ENABLED -> Known.ENABLED PAUSED -> Known.PAUSED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -946,8 +938,6 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField @@ -955,39 +945,41 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = VerificationState(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, INSUFFICIENT_FUNDS, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt index 857c6bc58..58c6d79ca 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/OwnerType.kt @@ -30,35 +30,35 @@ private constructor( companion object { - @JvmField val INDIVIDUAL = OwnerType(JsonField.of("INDIVIDUAL")) - @JvmField val BUSINESS = OwnerType(JsonField.of("BUSINESS")) + @JvmField val INDIVIDUAL = OwnerType(JsonField.of("INDIVIDUAL")) + @JvmStatic fun of(value: String) = OwnerType(JsonField.of(value)) } enum class Known { - INDIVIDUAL, BUSINESS, + INDIVIDUAL, } enum class Value { - INDIVIDUAL, BUSINESS, + INDIVIDUAL, _UNKNOWN, } fun value(): Value = when (this) { - INDIVIDUAL -> Value.INDIVIDUAL BUSINESS -> Value.BUSINESS + INDIVIDUAL -> Value.INDIVIDUAL else -> Value._UNKNOWN } fun known(): Known = when (this) { - INDIVIDUAL -> Known.INDIVIDUAL BUSINESS -> Known.BUSINESS + INDIVIDUAL -> Known.INDIVIDUAL else -> throw LithicInvalidDataException("Unknown OwnerType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt new file mode 100644 index 000000000..100907808 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionParams.kt @@ -0,0 +1,500 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.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.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonValue +import com.lithic.api.core.NoAutoDetect +import com.lithic.api.core.toUnmodifiable +import com.lithic.api.errors.LithicInvalidDataException +import com.lithic.api.models.* +import java.util.Objects +import java.util.Optional + +class PaymentSimulateActionParams +constructor( + private val paymentToken: String, + private val eventType: SupportedSimulationTypes, + private val declineReason: SupportedSimulationDeclineReasons?, + private val returnReasonCode: String?, + private val additionalQueryParams: Map>, + private val additionalHeaders: Map>, + private val additionalBodyProperties: Map, +) { + + fun paymentToken(): String = paymentToken + + fun eventType(): SupportedSimulationTypes = eventType + + fun declineReason(): Optional = + Optional.ofNullable(declineReason) + + fun returnReasonCode(): Optional = Optional.ofNullable(returnReasonCode) + + @JvmSynthetic + internal fun getBody(): PaymentSimulateActionBody { + return PaymentSimulateActionBody( + eventType, + declineReason, + returnReasonCode, + additionalBodyProperties, + ) + } + + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams + + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders + + fun getPathParam(index: Int): String { + return when (index) { + 0 -> paymentToken + else -> "" + } + } + + @JsonDeserialize(builder = PaymentSimulateActionBody.Builder::class) + @NoAutoDetect + class PaymentSimulateActionBody + internal constructor( + private val eventType: SupportedSimulationTypes?, + private val declineReason: SupportedSimulationDeclineReasons?, + private val returnReasonCode: String?, + private val additionalProperties: Map, + ) { + + private var hashCode: Int = 0 + + /** Event Type */ + @JsonProperty("event_type") fun eventType(): SupportedSimulationTypes? = eventType + + /** Decline reason */ + @JsonProperty("decline_reason") + fun declineReason(): SupportedSimulationDeclineReasons? = declineReason + + /** Return Reason Code */ + @JsonProperty("return_reason_code") fun returnReasonCode(): String? = returnReasonCode + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateActionBody && + this.eventType == other.eventType && + this.declineReason == other.declineReason && + this.returnReasonCode == other.returnReasonCode && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + eventType, + declineReason, + returnReasonCode, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "PaymentSimulateActionBody{eventType=$eventType, declineReason=$declineReason, returnReasonCode=$returnReasonCode, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var eventType: SupportedSimulationTypes? = null + private var declineReason: SupportedSimulationDeclineReasons? = null + private var returnReasonCode: String? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateActionBody: PaymentSimulateActionBody) = apply { + this.eventType = paymentSimulateActionBody.eventType + this.declineReason = paymentSimulateActionBody.declineReason + this.returnReasonCode = paymentSimulateActionBody.returnReasonCode + additionalProperties(paymentSimulateActionBody.additionalProperties) + } + + /** Event Type */ + @JsonProperty("event_type") + fun eventType(eventType: SupportedSimulationTypes) = apply { + this.eventType = eventType + } + + /** Decline reason */ + @JsonProperty("decline_reason") + fun declineReason(declineReason: SupportedSimulationDeclineReasons) = apply { + this.declineReason = declineReason + } + + /** Return Reason Code */ + @JsonProperty("return_reason_code") + fun returnReasonCode(returnReasonCode: String) = apply { + this.returnReasonCode = returnReasonCode + } + + 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(): PaymentSimulateActionBody = + PaymentSimulateActionBody( + checkNotNull(eventType) { "`eventType` is required but was not set" }, + declineReason, + returnReasonCode, + additionalProperties.toUnmodifiable(), + ) + } + } + + fun _additionalQueryParams(): Map> = additionalQueryParams + + fun _additionalHeaders(): Map> = additionalHeaders + + fun _additionalBodyProperties(): Map = additionalBodyProperties + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateActionParams && + this.paymentToken == other.paymentToken && + this.eventType == other.eventType && + this.declineReason == other.declineReason && + this.returnReasonCode == other.returnReasonCode && + this.additionalQueryParams == other.additionalQueryParams && + this.additionalHeaders == other.additionalHeaders && + this.additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int { + return Objects.hash( + paymentToken, + eventType, + declineReason, + returnReasonCode, + additionalQueryParams, + additionalHeaders, + additionalBodyProperties, + ) + } + + override fun toString() = + "PaymentSimulateActionParams{paymentToken=$paymentToken, eventType=$eventType, declineReason=$declineReason, returnReasonCode=$returnReasonCode, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + @NoAutoDetect + class Builder { + + private var paymentToken: String? = null + private var eventType: SupportedSimulationTypes? = null + private var declineReason: SupportedSimulationDeclineReasons? = null + private var returnReasonCode: String? = null + private var additionalQueryParams: MutableMap> = mutableMapOf() + private var additionalHeaders: MutableMap> = mutableMapOf() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateActionParams: PaymentSimulateActionParams) = apply { + this.paymentToken = paymentSimulateActionParams.paymentToken + this.eventType = paymentSimulateActionParams.eventType + this.declineReason = paymentSimulateActionParams.declineReason + this.returnReasonCode = paymentSimulateActionParams.returnReasonCode + additionalQueryParams(paymentSimulateActionParams.additionalQueryParams) + additionalHeaders(paymentSimulateActionParams.additionalHeaders) + additionalBodyProperties(paymentSimulateActionParams.additionalBodyProperties) + } + + fun paymentToken(paymentToken: String) = apply { this.paymentToken = paymentToken } + + /** Event Type */ + fun eventType(eventType: SupportedSimulationTypes) = apply { this.eventType = eventType } + + /** Decline reason */ + fun declineReason(declineReason: SupportedSimulationDeclineReasons) = apply { + this.declineReason = declineReason + } + + /** Return Reason Code */ + fun returnReasonCode(returnReasonCode: String) = apply { + this.returnReasonCode = returnReasonCode + } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } + + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { + this.additionalQueryParams.put(name, mutableListOf()) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) + } + + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun build(): PaymentSimulateActionParams = + PaymentSimulateActionParams( + checkNotNull(paymentToken) { "`paymentToken` is required but was not set" }, + checkNotNull(eventType) { "`eventType` is required but was not set" }, + declineReason, + returnReasonCode, + additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalBodyProperties.toUnmodifiable(), + ) + } + + class SupportedSimulationTypes + @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 SupportedSimulationTypes && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val ACH_ORIGINATION_REVIEWED = + SupportedSimulationTypes(JsonField.of("ACH_ORIGINATION_REVIEWED")) + + @JvmField + val ACH_ORIGINATION_RELEASED = + SupportedSimulationTypes(JsonField.of("ACH_ORIGINATION_RELEASED")) + + @JvmField + val ACH_ORIGINATION_PROCESSED = + SupportedSimulationTypes(JsonField.of("ACH_ORIGINATION_PROCESSED")) + + @JvmField + val ACH_ORIGINATION_SETTLED = + SupportedSimulationTypes(JsonField.of("ACH_ORIGINATION_SETTLED")) + + @JvmField + val ACH_RECEIPT_SETTLED = SupportedSimulationTypes(JsonField.of("ACH_RECEIPT_SETTLED")) + + @JvmField + val ACH_RETURN_INITIATED = + SupportedSimulationTypes(JsonField.of("ACH_RETURN_INITIATED")) + + @JvmField + val ACH_RETURN_PROCESSED = + SupportedSimulationTypes(JsonField.of("ACH_RETURN_PROCESSED")) + + @JvmStatic fun of(value: String) = SupportedSimulationTypes(JsonField.of(value)) + } + + enum class Known { + ACH_ORIGINATION_REVIEWED, + ACH_ORIGINATION_RELEASED, + ACH_ORIGINATION_PROCESSED, + ACH_ORIGINATION_SETTLED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, + } + + enum class Value { + ACH_ORIGINATION_REVIEWED, + ACH_ORIGINATION_RELEASED, + ACH_ORIGINATION_PROCESSED, + ACH_ORIGINATION_SETTLED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED + ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED + ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED + ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED + ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED + else -> throw LithicInvalidDataException("Unknown SupportedSimulationTypes: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + + class SupportedSimulationDeclineReasons + @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 SupportedSimulationDeclineReasons && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField + val PROGRAM_TRANSACTION_LIMITS_EXCEEDED = + SupportedSimulationDeclineReasons( + JsonField.of("PROGRAM_TRANSACTION_LIMITS_EXCEEDED") + ) + + @JvmField + val PROGRAM_DAILY_LIMITS_EXCEEDED = + SupportedSimulationDeclineReasons(JsonField.of("PROGRAM_DAILY_LIMITS_EXCEEDED")) + + @JvmField + val PROGRAM_MONTHLY_LIMITS_EXCEEDED = + SupportedSimulationDeclineReasons(JsonField.of("PROGRAM_MONTHLY_LIMITS_EXCEEDED")) + + @JvmStatic + fun of(value: String) = SupportedSimulationDeclineReasons(JsonField.of(value)) + } + + enum class Known { + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + } + + enum class Value { + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Value.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Value.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Value.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Known.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Known.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Known.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> + throw LithicInvalidDataException( + "Unknown SupportedSimulationDeclineReasons: $value" + ) + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt new file mode 100644 index 000000000..ed544c73c --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt @@ -0,0 +1,229 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.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.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.NoAutoDetect +import com.lithic.api.core.toUnmodifiable +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Objects + +@JsonDeserialize(builder = PaymentSimulateActionResponse.Builder::class) +@NoAutoDetect +class PaymentSimulateActionResponse +private constructor( + private val result: JsonField, + private val transactionEventToken: JsonField, + private val debuggingRequestId: JsonField, + private val additionalProperties: Map, +) { + + private var validated: Boolean = false + + private var hashCode: Int = 0 + + /** Request Result */ + fun result(): Result = result.getRequired("result") + + /** Transaction Event Token */ + fun transactionEventToken(): String = + transactionEventToken.getRequired("transaction_event_token") + + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + + /** Request Result */ + @JsonProperty("result") @ExcludeMissing fun _result() = result + + /** Transaction Event Token */ + @JsonProperty("transaction_event_token") + @ExcludeMissing + fun _transactionEventToken() = transactionEventToken + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): PaymentSimulateActionResponse = apply { + if (!validated) { + result() + transactionEventToken() + debuggingRequestId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateActionResponse && + this.result == other.result && + this.transactionEventToken == other.transactionEventToken && + this.debuggingRequestId == other.debuggingRequestId && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + result, + transactionEventToken, + debuggingRequestId, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "PaymentSimulateActionResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var result: JsonField = JsonMissing.of() + private var transactionEventToken: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateActionResponse: PaymentSimulateActionResponse) = apply { + this.result = paymentSimulateActionResponse.result + this.transactionEventToken = paymentSimulateActionResponse.transactionEventToken + this.debuggingRequestId = paymentSimulateActionResponse.debuggingRequestId + additionalProperties(paymentSimulateActionResponse.additionalProperties) + } + + /** Request Result */ + fun result(result: Result) = result(JsonField.of(result)) + + /** Request Result */ + @JsonProperty("result") + @ExcludeMissing + fun result(result: JsonField) = apply { this.result = result } + + /** Transaction Event Token */ + fun transactionEventToken(transactionEventToken: String) = + transactionEventToken(JsonField.of(transactionEventToken)) + + /** Transaction Event Token */ + @JsonProperty("transaction_event_token") + @ExcludeMissing + fun transactionEventToken(transactionEventToken: JsonField) = apply { + this.transactionEventToken = transactionEventToken + } + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + + 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(): PaymentSimulateActionResponse = + PaymentSimulateActionResponse( + result, + transactionEventToken, + debuggingRequestId, + additionalProperties.toUnmodifiable(), + ) + } + + class Result + @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 Result && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val APPROVED = Result(JsonField.of("APPROVED")) + + @JvmField val DECLINED = Result(JsonField.of("DECLINED")) + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + enum class Known { + APPROVED, + DECLINED, + } + + enum class Value { + APPROVED, + DECLINED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + APPROVED -> Value.APPROVED + DECLINED -> Value.DECLINED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + APPROVED -> Known.APPROVED + DECLINED -> Known.DECLINED + else -> throw LithicInvalidDataException("Unknown Result: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt new file mode 100644 index 000000000..b57fd8168 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptParams.kt @@ -0,0 +1,409 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.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.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonValue +import com.lithic.api.core.NoAutoDetect +import com.lithic.api.core.toUnmodifiable +import com.lithic.api.errors.LithicInvalidDataException +import com.lithic.api.models.* +import java.util.Objects +import java.util.Optional + +class PaymentSimulateReceiptParams +constructor( + private val token: String, + private val amount: Long, + private val financialAccountToken: String, + private val receiptType: ReceiptType, + private val memo: String?, + private val additionalQueryParams: Map>, + private val additionalHeaders: Map>, + private val additionalBodyProperties: Map, +) { + + fun token(): String = token + + fun amount(): Long = amount + + fun financialAccountToken(): String = financialAccountToken + + fun receiptType(): ReceiptType = receiptType + + fun memo(): Optional = Optional.ofNullable(memo) + + @JvmSynthetic + internal fun getBody(): PaymentSimulateReceiptBody { + return PaymentSimulateReceiptBody( + token, + amount, + financialAccountToken, + receiptType, + memo, + additionalBodyProperties, + ) + } + + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams + + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders + + @JsonDeserialize(builder = PaymentSimulateReceiptBody.Builder::class) + @NoAutoDetect + class PaymentSimulateReceiptBody + internal constructor( + private val token: String?, + private val amount: Long?, + private val financialAccountToken: String?, + private val receiptType: ReceiptType?, + private val memo: String?, + private val additionalProperties: Map, + ) { + + private var hashCode: Int = 0 + + /** Payment token */ + @JsonProperty("token") fun token(): String? = token + + /** Amount */ + @JsonProperty("amount") fun amount(): Long? = amount + + /** Financial Account Token */ + @JsonProperty("financial_account_token") + fun financialAccountToken(): String? = financialAccountToken + + /** Receipt Type */ + @JsonProperty("receipt_type") fun receiptType(): ReceiptType? = receiptType + + /** Memo */ + @JsonProperty("memo") fun memo(): String? = memo + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateReceiptBody && + this.token == other.token && + this.amount == other.amount && + this.financialAccountToken == other.financialAccountToken && + this.receiptType == other.receiptType && + this.memo == other.memo && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + token, + amount, + financialAccountToken, + receiptType, + memo, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "PaymentSimulateReceiptBody{token=$token, amount=$amount, financialAccountToken=$financialAccountToken, receiptType=$receiptType, memo=$memo, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var token: String? = null + private var amount: Long? = null + private var financialAccountToken: String? = null + private var receiptType: ReceiptType? = null + private var memo: String? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateReceiptBody: PaymentSimulateReceiptBody) = apply { + this.token = paymentSimulateReceiptBody.token + this.amount = paymentSimulateReceiptBody.amount + this.financialAccountToken = paymentSimulateReceiptBody.financialAccountToken + this.receiptType = paymentSimulateReceiptBody.receiptType + this.memo = paymentSimulateReceiptBody.memo + additionalProperties(paymentSimulateReceiptBody.additionalProperties) + } + + /** Payment token */ + @JsonProperty("token") fun token(token: String) = apply { this.token = token } + + /** Amount */ + @JsonProperty("amount") fun amount(amount: Long) = apply { this.amount = amount } + + /** Financial Account Token */ + @JsonProperty("financial_account_token") + fun financialAccountToken(financialAccountToken: String) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Receipt Type */ + @JsonProperty("receipt_type") + fun receiptType(receiptType: ReceiptType) = apply { this.receiptType = receiptType } + + /** Memo */ + @JsonProperty("memo") fun memo(memo: String) = apply { this.memo = memo } + + 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(): PaymentSimulateReceiptBody = + PaymentSimulateReceiptBody( + checkNotNull(token) { "`token` is required but was not set" }, + checkNotNull(amount) { "`amount` is required but was not set" }, + checkNotNull(financialAccountToken) { + "`financialAccountToken` is required but was not set" + }, + checkNotNull(receiptType) { "`receiptType` is required but was not set" }, + memo, + additionalProperties.toUnmodifiable(), + ) + } + } + + fun _additionalQueryParams(): Map> = additionalQueryParams + + fun _additionalHeaders(): Map> = additionalHeaders + + fun _additionalBodyProperties(): Map = additionalBodyProperties + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateReceiptParams && + this.token == other.token && + this.amount == other.amount && + this.financialAccountToken == other.financialAccountToken && + this.receiptType == other.receiptType && + this.memo == other.memo && + this.additionalQueryParams == other.additionalQueryParams && + this.additionalHeaders == other.additionalHeaders && + this.additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int { + return Objects.hash( + token, + amount, + financialAccountToken, + receiptType, + memo, + additionalQueryParams, + additionalHeaders, + additionalBodyProperties, + ) + } + + override fun toString() = + "PaymentSimulateReceiptParams{token=$token, amount=$amount, financialAccountToken=$financialAccountToken, receiptType=$receiptType, memo=$memo, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + @NoAutoDetect + class Builder { + + private var token: String? = null + private var amount: Long? = null + private var financialAccountToken: String? = null + private var receiptType: ReceiptType? = null + private var memo: String? = null + private var additionalQueryParams: MutableMap> = mutableMapOf() + private var additionalHeaders: MutableMap> = mutableMapOf() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateReceiptParams: PaymentSimulateReceiptParams) = apply { + this.token = paymentSimulateReceiptParams.token + this.amount = paymentSimulateReceiptParams.amount + this.financialAccountToken = paymentSimulateReceiptParams.financialAccountToken + this.receiptType = paymentSimulateReceiptParams.receiptType + this.memo = paymentSimulateReceiptParams.memo + additionalQueryParams(paymentSimulateReceiptParams.additionalQueryParams) + additionalHeaders(paymentSimulateReceiptParams.additionalHeaders) + additionalBodyProperties(paymentSimulateReceiptParams.additionalBodyProperties) + } + + /** Payment token */ + fun token(token: String) = apply { this.token = token } + + /** Amount */ + fun amount(amount: Long) = apply { this.amount = amount } + + /** Financial Account Token */ + fun financialAccountToken(financialAccountToken: String) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Receipt Type */ + fun receiptType(receiptType: ReceiptType) = apply { this.receiptType = receiptType } + + /** Memo */ + fun memo(memo: String) = apply { this.memo = memo } + + fun additionalQueryParams(additionalQueryParams: Map>) = apply { + this.additionalQueryParams.clear() + putAllQueryParams(additionalQueryParams) + } + + fun putQueryParam(name: String, value: String) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putQueryParams(name: String, values: Iterable) = apply { + this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllQueryParams(additionalQueryParams: Map>) = apply { + additionalQueryParams.forEach(this::putQueryParams) + } + + fun removeQueryParam(name: String) = apply { + this.additionalQueryParams.put(name, mutableListOf()) + } + + fun additionalHeaders(additionalHeaders: Map>) = apply { + this.additionalHeaders.clear() + putAllHeaders(additionalHeaders) + } + + fun putHeader(name: String, value: String) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value) + } + + fun putHeaders(name: String, values: Iterable) = apply { + this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values) + } + + fun putAllHeaders(additionalHeaders: Map>) = apply { + additionalHeaders.forEach(this::putHeaders) + } + + fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) } + + fun additionalBodyProperties(additionalBodyProperties: Map) = apply { + this.additionalBodyProperties.clear() + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply { + this.additionalBodyProperties.put(key, value) + } + + fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) = + apply { + this.additionalBodyProperties.putAll(additionalBodyProperties) + } + + fun build(): PaymentSimulateReceiptParams = + PaymentSimulateReceiptParams( + checkNotNull(token) { "`token` is required but was not set" }, + checkNotNull(amount) { "`amount` is required but was not set" }, + checkNotNull(financialAccountToken) { + "`financialAccountToken` is required but was not set" + }, + checkNotNull(receiptType) { "`receiptType` is required but was not set" }, + memo, + additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalBodyProperties.toUnmodifiable(), + ) + } + + class ReceiptType + @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 ReceiptType && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val RECEIPT_CREDIT = ReceiptType(JsonField.of("RECEIPT_CREDIT")) + + @JvmField val RECEIPT_DEBIT = ReceiptType(JsonField.of("RECEIPT_DEBIT")) + + @JvmStatic fun of(value: String) = ReceiptType(JsonField.of(value)) + } + + enum class Known { + RECEIPT_CREDIT, + RECEIPT_DEBIT, + } + + enum class Value { + RECEIPT_CREDIT, + RECEIPT_DEBIT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + RECEIPT_CREDIT -> Value.RECEIPT_CREDIT + RECEIPT_DEBIT -> Value.RECEIPT_DEBIT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + RECEIPT_CREDIT -> Known.RECEIPT_CREDIT + RECEIPT_DEBIT -> Known.RECEIPT_DEBIT + else -> throw LithicInvalidDataException("Unknown ReceiptType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt new file mode 100644 index 000000000..909e7ebd3 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt @@ -0,0 +1,229 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.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.lithic.api.core.Enum +import com.lithic.api.core.ExcludeMissing +import com.lithic.api.core.JsonField +import com.lithic.api.core.JsonMissing +import com.lithic.api.core.JsonValue +import com.lithic.api.core.NoAutoDetect +import com.lithic.api.core.toUnmodifiable +import com.lithic.api.errors.LithicInvalidDataException +import java.util.Objects + +@JsonDeserialize(builder = PaymentSimulateReceiptResponse.Builder::class) +@NoAutoDetect +class PaymentSimulateReceiptResponse +private constructor( + private val result: JsonField, + private val transactionEventToken: JsonField, + private val debuggingRequestId: JsonField, + private val additionalProperties: Map, +) { + + private var validated: Boolean = false + + private var hashCode: Int = 0 + + /** Request Result */ + fun result(): Result = result.getRequired("result") + + /** Transaction Event Token */ + fun transactionEventToken(): String = + transactionEventToken.getRequired("transaction_event_token") + + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + + /** Request Result */ + @JsonProperty("result") @ExcludeMissing fun _result() = result + + /** Transaction Event Token */ + @JsonProperty("transaction_event_token") + @ExcludeMissing + fun _transactionEventToken() = transactionEventToken + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + fun validate(): PaymentSimulateReceiptResponse = apply { + if (!validated) { + result() + transactionEventToken() + debuggingRequestId() + validated = true + } + } + + fun toBuilder() = Builder().from(this) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PaymentSimulateReceiptResponse && + this.result == other.result && + this.transactionEventToken == other.transactionEventToken && + this.debuggingRequestId == other.debuggingRequestId && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + result, + transactionEventToken, + debuggingRequestId, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "PaymentSimulateReceiptResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var result: JsonField = JsonMissing.of() + private var transactionEventToken: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(paymentSimulateReceiptResponse: PaymentSimulateReceiptResponse) = apply { + this.result = paymentSimulateReceiptResponse.result + this.transactionEventToken = paymentSimulateReceiptResponse.transactionEventToken + this.debuggingRequestId = paymentSimulateReceiptResponse.debuggingRequestId + additionalProperties(paymentSimulateReceiptResponse.additionalProperties) + } + + /** Request Result */ + fun result(result: Result) = result(JsonField.of(result)) + + /** Request Result */ + @JsonProperty("result") + @ExcludeMissing + fun result(result: JsonField) = apply { this.result = result } + + /** Transaction Event Token */ + fun transactionEventToken(transactionEventToken: String) = + transactionEventToken(JsonField.of(transactionEventToken)) + + /** Transaction Event Token */ + @JsonProperty("transaction_event_token") + @ExcludeMissing + fun transactionEventToken(transactionEventToken: JsonField) = apply { + this.transactionEventToken = transactionEventToken + } + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + + 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(): PaymentSimulateReceiptResponse = + PaymentSimulateReceiptResponse( + result, + transactionEventToken, + debuggingRequestId, + additionalProperties.toUnmodifiable(), + ) + } + + class Result + @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 Result && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val APPROVED = Result(JsonField.of("APPROVED")) + + @JvmField val DECLINED = Result(JsonField.of("DECLINED")) + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + enum class Known { + APPROVED, + DECLINED, + } + + enum class Value { + APPROVED, + DECLINED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + APPROVED -> Value.APPROVED + DECLINED -> Value.DECLINED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + APPROVED -> Known.APPROVED + DECLINED -> Known.DECLINED + else -> throw LithicInvalidDataException("Unknown Result: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt index 01f97d721..1e88a7e02 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseParams.kt @@ -42,6 +42,7 @@ constructor( private var hashCode: Int = 0 + /** Payment Token */ @JsonProperty("payment_token") fun paymentToken(): String? = paymentToken @JsonAnyGetter @@ -86,6 +87,7 @@ constructor( additionalProperties(paymentSimulateReleaseBody.additionalProperties) } + /** Payment Token */ @JsonProperty("payment_token") fun paymentToken(paymentToken: String) = apply { this.paymentToken = paymentToken } @@ -164,6 +166,7 @@ constructor( additionalBodyProperties(paymentSimulateReleaseParams.additionalBodyProperties) } + /** Payment Token */ fun paymentToken(paymentToken: String) = apply { this.paymentToken = paymentToken } fun additionalQueryParams(additionalQueryParams: Map>) = apply { diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt index 860c7a1c5..59f34a4a0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt @@ -16,15 +16,14 @@ import com.lithic.api.core.NoAutoDetect import com.lithic.api.core.toUnmodifiable import com.lithic.api.errors.LithicInvalidDataException import java.util.Objects -import java.util.Optional @JsonDeserialize(builder = PaymentSimulateReleaseResponse.Builder::class) @NoAutoDetect class PaymentSimulateReleaseResponse private constructor( - private val debuggingRequestId: JsonField, private val result: JsonField, private val transactionEventToken: JsonField, + private val debuggingRequestId: JsonField, private val additionalProperties: Map, ) { @@ -32,33 +31,38 @@ private constructor( private var hashCode: Int = 0 - fun debuggingRequestId(): Optional = - Optional.ofNullable(debuggingRequestId.getNullable("debugging_request_id")) - - fun result(): Optional = Optional.ofNullable(result.getNullable("result")) + /** Request Result */ + fun result(): Result = result.getRequired("result") - fun transactionEventToken(): Optional = - Optional.ofNullable(transactionEventToken.getNullable("transaction_event_token")) + /** Transaction Event Token */ + fun transactionEventToken(): String = + transactionEventToken.getRequired("transaction_event_token") - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result + /** Transaction Event Token */ @JsonProperty("transaction_event_token") @ExcludeMissing fun _transactionEventToken() = transactionEventToken + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): PaymentSimulateReleaseResponse = apply { if (!validated) { - debuggingRequestId() result() transactionEventToken() + debuggingRequestId() validated = true } } @@ -71,9 +75,9 @@ private constructor( } return other is PaymentSimulateReleaseResponse && - this.debuggingRequestId == other.debuggingRequestId && this.result == other.result && this.transactionEventToken == other.transactionEventToken && + this.debuggingRequestId == other.debuggingRequestId && this.additionalProperties == other.additionalProperties } @@ -81,9 +85,9 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - debuggingRequestId, result, transactionEventToken, + debuggingRequestId, additionalProperties, ) } @@ -91,7 +95,7 @@ private constructor( } override fun toString() = - "PaymentSimulateReleaseResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" + "PaymentSimulateReleaseResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" companion object { @@ -100,43 +104,49 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentSimulateReleaseResponse: PaymentSimulateReleaseResponse) = apply { - this.debuggingRequestId = paymentSimulateReleaseResponse.debuggingRequestId this.result = paymentSimulateReleaseResponse.result this.transactionEventToken = paymentSimulateReleaseResponse.transactionEventToken + this.debuggingRequestId = paymentSimulateReleaseResponse.debuggingRequestId additionalProperties(paymentSimulateReleaseResponse.additionalProperties) } - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) + /** Request Result */ @JsonProperty("result") @ExcludeMissing fun result(result: JsonField) = apply { this.result = result } + /** Transaction Event Token */ fun transactionEventToken(transactionEventToken: String) = transactionEventToken(JsonField.of(transactionEventToken)) + /** Transaction Event Token */ @JsonProperty("transaction_event_token") @ExcludeMissing fun transactionEventToken(transactionEventToken: JsonField) = apply { this.transactionEventToken = transactionEventToken } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -153,9 +163,9 @@ private constructor( fun build(): PaymentSimulateReleaseResponse = PaymentSimulateReleaseResponse( - debuggingRequestId, result, transactionEventToken, + debuggingRequestId, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt index 3991da68a..2d43859c5 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnParams.kt @@ -51,8 +51,10 @@ constructor( private var hashCode: Int = 0 + /** Payment Token */ @JsonProperty("payment_token") fun paymentToken(): String? = paymentToken + /** Return Reason Code */ @JsonProperty("return_reason_code") fun returnReasonCode(): String? = returnReasonCode @JsonAnyGetter @@ -105,9 +107,11 @@ constructor( additionalProperties(paymentSimulateReturnBody.additionalProperties) } + /** Payment Token */ @JsonProperty("payment_token") fun paymentToken(paymentToken: String) = apply { this.paymentToken = paymentToken } + /** Return Reason Code */ @JsonProperty("return_reason_code") fun returnReasonCode(returnReasonCode: String) = apply { this.returnReasonCode = returnReasonCode @@ -193,8 +197,10 @@ constructor( additionalBodyProperties(paymentSimulateReturnParams.additionalBodyProperties) } + /** Payment Token */ fun paymentToken(paymentToken: String) = apply { this.paymentToken = paymentToken } + /** Return Reason Code */ fun returnReasonCode(returnReasonCode: String) = apply { this.returnReasonCode = returnReasonCode } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt index 99804b543..7d685c1fe 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt @@ -16,15 +16,14 @@ import com.lithic.api.core.NoAutoDetect import com.lithic.api.core.toUnmodifiable import com.lithic.api.errors.LithicInvalidDataException import java.util.Objects -import java.util.Optional @JsonDeserialize(builder = PaymentSimulateReturnResponse.Builder::class) @NoAutoDetect class PaymentSimulateReturnResponse private constructor( - private val debuggingRequestId: JsonField, private val result: JsonField, private val transactionEventToken: JsonField, + private val debuggingRequestId: JsonField, private val additionalProperties: Map, ) { @@ -32,33 +31,38 @@ private constructor( private var hashCode: Int = 0 - fun debuggingRequestId(): Optional = - Optional.ofNullable(debuggingRequestId.getNullable("debugging_request_id")) - - fun result(): Optional = Optional.ofNullable(result.getNullable("result")) + /** Request Result */ + fun result(): Result = result.getRequired("result") - fun transactionEventToken(): Optional = - Optional.ofNullable(transactionEventToken.getNullable("transaction_event_token")) + /** Transaction Event Token */ + fun transactionEventToken(): String = + transactionEventToken.getRequired("transaction_event_token") - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result + /** Transaction Event Token */ @JsonProperty("transaction_event_token") @ExcludeMissing fun _transactionEventToken() = transactionEventToken + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): PaymentSimulateReturnResponse = apply { if (!validated) { - debuggingRequestId() result() transactionEventToken() + debuggingRequestId() validated = true } } @@ -71,9 +75,9 @@ private constructor( } return other is PaymentSimulateReturnResponse && - this.debuggingRequestId == other.debuggingRequestId && this.result == other.result && this.transactionEventToken == other.transactionEventToken && + this.debuggingRequestId == other.debuggingRequestId && this.additionalProperties == other.additionalProperties } @@ -81,9 +85,9 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - debuggingRequestId, result, transactionEventToken, + debuggingRequestId, additionalProperties, ) } @@ -91,7 +95,7 @@ private constructor( } override fun toString() = - "PaymentSimulateReturnResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" + "PaymentSimulateReturnResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" companion object { @@ -100,43 +104,49 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentSimulateReturnResponse: PaymentSimulateReturnResponse) = apply { - this.debuggingRequestId = paymentSimulateReturnResponse.debuggingRequestId this.result = paymentSimulateReturnResponse.result this.transactionEventToken = paymentSimulateReturnResponse.transactionEventToken + this.debuggingRequestId = paymentSimulateReturnResponse.debuggingRequestId additionalProperties(paymentSimulateReturnResponse.additionalProperties) } - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) + /** Request Result */ @JsonProperty("result") @ExcludeMissing fun result(result: JsonField) = apply { this.result = result } + /** Transaction Event Token */ fun transactionEventToken(transactionEventToken: String) = transactionEventToken(JsonField.of(transactionEventToken)) + /** Transaction Event Token */ @JsonProperty("transaction_event_token") @ExcludeMissing fun transactionEventToken(transactionEventToken: JsonField) = apply { this.transactionEventToken = transactionEventToken } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -153,9 +163,9 @@ private constructor( fun build(): PaymentSimulateReturnResponse = PaymentSimulateReturnResponse( - debuggingRequestId, result, transactionEventToken, + debuggingRequestId, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt index cdc65d6e1..1a96d9e33 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transaction.kt @@ -1366,9 +1366,6 @@ private constructor( @JvmField val DO_NOT_HONOR = DetailedResult(JsonField.of("DO_NOT_HONOR")) - @JvmField - val DRIVER_NUMBER_INVALID = DetailedResult(JsonField.of("DRIVER_NUMBER_INVALID")) - @JvmField val FORMAT_ERROR = DetailedResult(JsonField.of("FORMAT_ERROR")) @JvmField @@ -1378,6 +1375,10 @@ private constructor( @JvmField val INSUFFICIENT_FUNDS = DetailedResult(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val INVALID_DRIVER = DetailedResult(JsonField.of("INVALID_DRIVER")) + + @JvmField val INVALID_VEHICLE = DetailedResult(JsonField.of("INVALID_VEHICLE")) + @JvmField val LITHIC_SYSTEM_ERROR = DetailedResult(JsonField.of("LITHIC_SYSTEM_ERROR")) @@ -1443,9 +1444,6 @@ private constructor( @JvmField val UNAUTHORIZED_MERCHANT = DetailedResult(JsonField.of("UNAUTHORIZED_MERCHANT")) - @JvmField - val VEHICLE_NUMBER_INVALID = DetailedResult(JsonField.of("VEHICLE_NUMBER_INVALID")) - @JvmStatic fun of(value: String) = DetailedResult(JsonField.of(value)) } @@ -1477,10 +1475,11 @@ private constructor( CUSTOM_ASA_RESULT, DECLINED, DO_NOT_HONOR, - DRIVER_NUMBER_INVALID, FORMAT_ERROR, INSUFFICIENT_FUNDING_SOURCE_BALANCE, INSUFFICIENT_FUNDS, + INVALID_DRIVER, + INVALID_VEHICLE, LITHIC_SYSTEM_ERROR, LITHIC_SYSTEM_RATE_LIMIT, MALFORMED_ASA_RESPONSE, @@ -1499,7 +1498,6 @@ private constructor( TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, TRANSACTION_PREVIOUSLY_COMPLETED, UNAUTHORIZED_MERCHANT, - VEHICLE_NUMBER_INVALID, } enum class Value { @@ -1530,10 +1528,11 @@ private constructor( CUSTOM_ASA_RESULT, DECLINED, DO_NOT_HONOR, - DRIVER_NUMBER_INVALID, FORMAT_ERROR, INSUFFICIENT_FUNDING_SOURCE_BALANCE, INSUFFICIENT_FUNDS, + INVALID_DRIVER, + INVALID_VEHICLE, LITHIC_SYSTEM_ERROR, LITHIC_SYSTEM_RATE_LIMIT, MALFORMED_ASA_RESPONSE, @@ -1552,7 +1551,6 @@ private constructor( TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, TRANSACTION_PREVIOUSLY_COMPLETED, UNAUTHORIZED_MERCHANT, - VEHICLE_NUMBER_INVALID, _UNKNOWN, } @@ -1587,10 +1585,11 @@ private constructor( CUSTOM_ASA_RESULT -> Value.CUSTOM_ASA_RESULT DECLINED -> Value.DECLINED DO_NOT_HONOR -> Value.DO_NOT_HONOR - DRIVER_NUMBER_INVALID -> Value.DRIVER_NUMBER_INVALID FORMAT_ERROR -> Value.FORMAT_ERROR INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Value.INSUFFICIENT_FUNDING_SOURCE_BALANCE INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + INVALID_DRIVER -> Value.INVALID_DRIVER + INVALID_VEHICLE -> Value.INVALID_VEHICLE LITHIC_SYSTEM_ERROR -> Value.LITHIC_SYSTEM_ERROR LITHIC_SYSTEM_RATE_LIMIT -> Value.LITHIC_SYSTEM_RATE_LIMIT MALFORMED_ASA_RESPONSE -> Value.MALFORMED_ASA_RESPONSE @@ -1612,7 +1611,6 @@ private constructor( Value.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER TRANSACTION_PREVIOUSLY_COMPLETED -> Value.TRANSACTION_PREVIOUSLY_COMPLETED UNAUTHORIZED_MERCHANT -> Value.UNAUTHORIZED_MERCHANT - VEHICLE_NUMBER_INVALID -> Value.VEHICLE_NUMBER_INVALID else -> Value._UNKNOWN } @@ -1647,10 +1645,11 @@ private constructor( CUSTOM_ASA_RESULT -> Known.CUSTOM_ASA_RESULT DECLINED -> Known.DECLINED DO_NOT_HONOR -> Known.DO_NOT_HONOR - DRIVER_NUMBER_INVALID -> Known.DRIVER_NUMBER_INVALID FORMAT_ERROR -> Known.FORMAT_ERROR INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Known.INSUFFICIENT_FUNDING_SOURCE_BALANCE INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + INVALID_DRIVER -> Known.INVALID_DRIVER + INVALID_VEHICLE -> Known.INVALID_VEHICLE LITHIC_SYSTEM_ERROR -> Known.LITHIC_SYSTEM_ERROR LITHIC_SYSTEM_RATE_LIMIT -> Known.LITHIC_SYSTEM_RATE_LIMIT MALFORMED_ASA_RESPONSE -> Known.MALFORMED_ASA_RESPONSE @@ -1672,7 +1671,6 @@ private constructor( Known.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER TRANSACTION_PREVIOUSLY_COMPLETED -> Known.TRANSACTION_PREVIOUSLY_COMPLETED UNAUTHORIZED_MERCHANT -> Known.UNAUTHORIZED_MERCHANT - VEHICLE_NUMBER_INVALID -> Known.VEHICLE_NUMBER_INVALID else -> throw LithicInvalidDataException("Unknown DetailedResult: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt index 218dfe9f4..7092b3be7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Transfer.kt @@ -522,6 +522,7 @@ private constructor( private constructor( private val amount: JsonField, private val created: JsonField, + private val detailedResults: JsonField>, private val result: JsonField, private val token: JsonField, private val type: JsonField, @@ -542,6 +543,10 @@ private constructor( fun created(): Optional = Optional.ofNullable(created.getNullable("created")) + /** More detailed reasons for the event */ + fun detailedResults(): Optional> = + Optional.ofNullable(detailedResults.getNullable("detailed_results")) + /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. @@ -553,21 +558,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -602,6 +606,9 @@ private constructor( /** Date and time when the financial event occurred. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created + /** More detailed reasons for the event */ + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. @@ -613,21 +620,20 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release from - * an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release + * from an ACH hold. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. - * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository Financial * Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. + * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -661,6 +667,7 @@ private constructor( if (!validated) { amount() created() + detailedResults() result() token() type() @@ -678,6 +685,7 @@ private constructor( return other is FinancialEvent && this.amount == other.amount && this.created == other.created && + this.detailedResults == other.detailedResults && this.result == other.result && this.token == other.token && this.type == other.type && @@ -690,6 +698,7 @@ private constructor( Objects.hash( amount, created, + detailedResults, result, token, type, @@ -700,7 +709,7 @@ private constructor( } override fun toString() = - "FinancialEvent{amount=$amount, created=$created, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "FinancialEvent{amount=$amount, created=$created, detailedResults=$detailedResults, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -711,6 +720,7 @@ private constructor( private var amount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() + private var detailedResults: JsonField> = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() @@ -720,6 +730,7 @@ private constructor( internal fun from(financialEvent: FinancialEvent) = apply { this.amount = financialEvent.amount this.created = financialEvent.created + this.detailedResults = financialEvent.detailedResults this.result = financialEvent.result this.token = financialEvent.token this.type = financialEvent.type @@ -748,6 +759,17 @@ private constructor( @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } + /** More detailed reasons for the event */ + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + /** More detailed reasons for the event */ + @JsonProperty("detailed_results") + @ExcludeMissing + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + /** * APPROVED financial events were successful while DECLINED financial events were * declined by user, Lithic, or the network. @@ -772,22 +794,21 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release * from an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending - * processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the + * fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + * Financial Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial - * Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -815,22 +836,21 @@ private constructor( /** * Event types: - * - `ACH_INSUFFICIENT_FUNDS` - Attempted ACH origination declined due to insufficient - * balance. - * - `ACH_ORIGINATION_PENDING` - ACH origination received and pending approval/release + * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release * from an ACH hold. - * - `ACH_ORIGINATION_APPROVED` - ACH origination has been approved and pending - * processing. - * - `ACH_ORIGINATION_DECLINED` - ACH origination has been declined. + * - `ACH_ORIGINATION_REVIEWED` - ACH origination has completed the review process. * - `ACH_ORIGINATION_CANCELLED` - ACH origination has been cancelled. - * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed. + * - `ACH_ORIGINATION_PROCESSED` - ACH origination has been processed and sent to the + * fed. * - `ACH_ORIGINATION_SETTLED` - ACH origination has settled. * - `ACH_ORIGINATION_RELEASED` - ACH origination released from pending to available * balance. - * - `ACH_RECEIPT_PENDING` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_PROCESSED` - ACH origination returned by the Receiving Depository + * Financial Institution. + * - `ACH_RECEIPT_PROCESSED` - ACH receipt pending release from an ACH holder. + * - `ACH_RETURN_INITIATED` - ACH initiated return for a ACH receipt. + * - `ACH_RECEIPT_SETTLED` - ACH receipt funds have settled. * - `ACH_RECEIPT_RELEASED` - ACH receipt released from pending to available balance. - * - `ACH_RETURN` - ACH origination returned by the Receiving Depository Financial - * Institution. * - `AUTHORIZATION` - Authorize a card transaction. * - `AUTHORIZATION_ADVICE` - Advice on a card transaction. * - `AUTHORIZATION_EXPIRY` - Card Authorization has expired and reversed by Lithic. @@ -876,6 +896,7 @@ private constructor( FinancialEvent( amount, created, + detailedResults.map { it.toUnmodifiable() }, result, token, type, @@ -883,6 +904,94 @@ private constructor( ) } + class DetailedResult + @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 DetailedResult && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val APPROVED = DetailedResult(JsonField.of("APPROVED")) + + @JvmField + val FUNDS_INSUFFICIENT = DetailedResult(JsonField.of("FUNDS_INSUFFICIENT")) + + @JvmField val ACCOUNT_INVALID = DetailedResult(JsonField.of("ACCOUNT_INVALID")) + + @JvmField + val PROGRAM_TRANSACTION_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_TRANSACTION_LIMITS_EXCEEDED")) + + @JvmField + val PROGRAM_DAILY_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_DAILY_LIMITS_EXCEEDED")) + + @JvmField + val PROGRAM_MONTHLY_LIMITS_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_MONTHLY_LIMITS_EXCEEDED")) + + @JvmStatic fun of(value: String) = DetailedResult(JsonField.of(value)) + } + + enum class Known { + APPROVED, + FUNDS_INSUFFICIENT, + ACCOUNT_INVALID, + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + } + + enum class Value { + APPROVED, + FUNDS_INSUFFICIENT, + ACCOUNT_INVALID, + PROGRAM_TRANSACTION_LIMITS_EXCEEDED, + PROGRAM_DAILY_LIMITS_EXCEEDED, + PROGRAM_MONTHLY_LIMITS_EXCEEDED, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + APPROVED -> Value.APPROVED + FUNDS_INSUFFICIENT -> Value.FUNDS_INSUFFICIENT + ACCOUNT_INVALID -> Value.ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Value.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Value.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Value.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + APPROVED -> Known.APPROVED + FUNDS_INSUFFICIENT -> Known.FUNDS_INSUFFICIENT + ACCOUNT_INVALID -> Known.ACCOUNT_INVALID + PROGRAM_TRANSACTION_LIMITS_EXCEEDED -> Known.PROGRAM_TRANSACTION_LIMITS_EXCEEDED + PROGRAM_DAILY_LIMITS_EXCEEDED -> Known.PROGRAM_DAILY_LIMITS_EXCEEDED + PROGRAM_MONTHLY_LIMITS_EXCEEDED -> Known.PROGRAM_MONTHLY_LIMITS_EXCEEDED + else -> throw LithicInvalidDataException("Unknown DetailedResult: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + class Result @JsonCreator private constructor( @@ -962,33 +1071,14 @@ private constructor( companion object { - @JvmField - val ACH_EXCEEDED_THRESHOLD = - FinancialEventType(JsonField.of("ACH_EXCEEDED_THRESHOLD")) - - @JvmField - val ACH_INSUFFICIENT_FUNDS = - FinancialEventType(JsonField.of("ACH_INSUFFICIENT_FUNDS")) - - @JvmField - val ACH_INVALID_ACCOUNT = FinancialEventType(JsonField.of("ACH_INVALID_ACCOUNT")) - - @JvmField - val ACH_ORIGINATION_PENDING = - FinancialEventType(JsonField.of("ACH_ORIGINATION_PENDING")) - - @JvmField - val ACH_ORIGINATION_APPROVED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_APPROVED")) - - @JvmField - val ACH_ORIGINATION_DECLINED = - FinancialEventType(JsonField.of("ACH_ORIGINATION_DECLINED")) - @JvmField val ACH_ORIGINATION_CANCELLED = FinancialEventType(JsonField.of("ACH_ORIGINATION_CANCELLED")) + @JvmField + val ACH_ORIGINATION_INITIATED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_INITIATED")) + @JvmField val ACH_ORIGINATION_PROCESSED = FinancialEventType(JsonField.of("ACH_ORIGINATION_PROCESSED")) @@ -1002,15 +1092,21 @@ private constructor( FinancialEventType(JsonField.of("ACH_ORIGINATION_RELEASED")) @JvmField - val ACH_RECEIPT_PENDING = FinancialEventType(JsonField.of("ACH_RECEIPT_PENDING")) + val ACH_ORIGINATION_REVIEWED = + FinancialEventType(JsonField.of("ACH_ORIGINATION_REVIEWED")) @JvmField - val ACH_RECEIPT_RELEASED = FinancialEventType(JsonField.of("ACH_RECEIPT_RELEASED")) + val ACH_RECEIPT_PROCESSED = + FinancialEventType(JsonField.of("ACH_RECEIPT_PROCESSED")) - @JvmField val ACH_RETURN = FinancialEventType(JsonField.of("ACH_RETURN")) + @JvmField + val ACH_RECEIPT_SETTLED = FinancialEventType(JsonField.of("ACH_RECEIPT_SETTLED")) + + @JvmField + val ACH_RETURN_INITIATED = FinancialEventType(JsonField.of("ACH_RETURN_INITIATED")) @JvmField - val ACH_RETURN_PENDING = FinancialEventType(JsonField.of("ACH_RETURN_PENDING")) + val ACH_RETURN_PROCESSED = FinancialEventType(JsonField.of("ACH_RETURN_PROCESSED")) @JvmField val AUTHORIZATION = FinancialEventType(JsonField.of("AUTHORIZATION")) @@ -1063,20 +1159,16 @@ private constructor( } enum class Known { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -1096,20 +1188,16 @@ private constructor( } enum class Value { - ACH_EXCEEDED_THRESHOLD, - ACH_INSUFFICIENT_FUNDS, - ACH_INVALID_ACCOUNT, - ACH_ORIGINATION_PENDING, - ACH_ORIGINATION_APPROVED, - ACH_ORIGINATION_DECLINED, ACH_ORIGINATION_CANCELLED, + ACH_ORIGINATION_INITIATED, ACH_ORIGINATION_PROCESSED, ACH_ORIGINATION_SETTLED, ACH_ORIGINATION_RELEASED, - ACH_RECEIPT_PENDING, - ACH_RECEIPT_RELEASED, - ACH_RETURN, - ACH_RETURN_PENDING, + ACH_ORIGINATION_REVIEWED, + ACH_RECEIPT_PROCESSED, + ACH_RECEIPT_SETTLED, + ACH_RETURN_INITIATED, + ACH_RETURN_PROCESSED, AUTHORIZATION, AUTHORIZATION_ADVICE, AUTHORIZATION_EXPIRY, @@ -1131,20 +1219,16 @@ private constructor( fun value(): Value = when (this) { - ACH_EXCEEDED_THRESHOLD -> Value.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Value.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Value.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Value.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Value.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Value.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Value.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Value.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Value.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Value.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Value.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Value.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Value.ACH_RECEIPT_RELEASED - ACH_RETURN -> Value.ACH_RETURN - ACH_RETURN_PENDING -> Value.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Value.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Value.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Value.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Value.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Value.ACH_RETURN_PROCESSED AUTHORIZATION -> Value.AUTHORIZATION AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY @@ -1166,20 +1250,16 @@ private constructor( fun known(): Known = when (this) { - ACH_EXCEEDED_THRESHOLD -> Known.ACH_EXCEEDED_THRESHOLD - ACH_INSUFFICIENT_FUNDS -> Known.ACH_INSUFFICIENT_FUNDS - ACH_INVALID_ACCOUNT -> Known.ACH_INVALID_ACCOUNT - ACH_ORIGINATION_PENDING -> Known.ACH_ORIGINATION_PENDING - ACH_ORIGINATION_APPROVED -> Known.ACH_ORIGINATION_APPROVED - ACH_ORIGINATION_DECLINED -> Known.ACH_ORIGINATION_DECLINED ACH_ORIGINATION_CANCELLED -> Known.ACH_ORIGINATION_CANCELLED + ACH_ORIGINATION_INITIATED -> Known.ACH_ORIGINATION_INITIATED ACH_ORIGINATION_PROCESSED -> Known.ACH_ORIGINATION_PROCESSED ACH_ORIGINATION_SETTLED -> Known.ACH_ORIGINATION_SETTLED ACH_ORIGINATION_RELEASED -> Known.ACH_ORIGINATION_RELEASED - ACH_RECEIPT_PENDING -> Known.ACH_RECEIPT_PENDING - ACH_RECEIPT_RELEASED -> Known.ACH_RECEIPT_RELEASED - ACH_RETURN -> Known.ACH_RETURN - ACH_RETURN_PENDING -> Known.ACH_RETURN_PENDING + ACH_ORIGINATION_REVIEWED -> Known.ACH_ORIGINATION_REVIEWED + ACH_RECEIPT_PROCESSED -> Known.ACH_RECEIPT_PROCESSED + ACH_RECEIPT_SETTLED -> Known.ACH_RECEIPT_SETTLED + ACH_RETURN_INITIATED -> Known.ACH_RETURN_INITIATED + ACH_RETURN_PROCESSED -> Known.ACH_RETURN_PROCESSED AUTHORIZATION -> Known.AUTHORIZATION AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt index 27a1336e2..d41b52c4c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsync.kt @@ -13,6 +13,10 @@ import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams import com.lithic.api.models.PaymentRetryParams import com.lithic.api.models.PaymentRetryResponse +import com.lithic.api.models.PaymentSimulateActionParams +import com.lithic.api.models.PaymentSimulateActionResponse +import com.lithic.api.models.PaymentSimulateReceiptParams +import com.lithic.api.models.PaymentSimulateReceiptResponse import com.lithic.api.models.PaymentSimulateReleaseParams import com.lithic.api.models.PaymentSimulateReleaseResponse import com.lithic.api.models.PaymentSimulateReturnParams @@ -49,6 +53,20 @@ interface PaymentServiceAsync { requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture + /** Simulate payment lifecycle event */ + @JvmOverloads + fun simulateAction( + params: PaymentSimulateActionParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture + + /** Simulates a receipt of a Payment. */ + @JvmOverloads + fun simulateReceipt( + params: PaymentSimulateReceiptParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture + /** Simulates a release of a Payment. */ @JvmOverloads fun simulateRelease( diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt index 836c55916..98b6bf44a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/PaymentServiceAsyncImpl.kt @@ -16,6 +16,10 @@ import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams import com.lithic.api.models.PaymentRetryParams import com.lithic.api.models.PaymentRetryResponse +import com.lithic.api.models.PaymentSimulateActionParams +import com.lithic.api.models.PaymentSimulateActionResponse +import com.lithic.api.models.PaymentSimulateReceiptParams +import com.lithic.api.models.PaymentSimulateReceiptResponse import com.lithic.api.models.PaymentSimulateReleaseParams import com.lithic.api.models.PaymentSimulateReleaseResponse import com.lithic.api.models.PaymentSimulateReturnParams @@ -149,6 +153,66 @@ constructor( } } + private val simulateActionHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Simulate payment lifecycle event */ + override fun simulateAction( + params: PaymentSimulateActionParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("simulate", "payments", params.getPathParam(0), "action") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { simulateActionHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + + private val simulateReceiptHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Simulates a receipt of a Payment. */ + override fun simulateReceipt( + params: PaymentSimulateReceiptParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("simulate", "payments", "receipt") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.executeAsync(request, requestOptions).thenApply { response + -> + response + .use { simulateReceiptHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + private val simulateReleaseHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt index ba5cd4f4d..c252e5095 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentService.kt @@ -13,6 +13,10 @@ import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams import com.lithic.api.models.PaymentRetryParams import com.lithic.api.models.PaymentRetryResponse +import com.lithic.api.models.PaymentSimulateActionParams +import com.lithic.api.models.PaymentSimulateActionResponse +import com.lithic.api.models.PaymentSimulateReceiptParams +import com.lithic.api.models.PaymentSimulateReceiptResponse import com.lithic.api.models.PaymentSimulateReleaseParams import com.lithic.api.models.PaymentSimulateReleaseResponse import com.lithic.api.models.PaymentSimulateReturnParams @@ -48,6 +52,20 @@ interface PaymentService { requestOptions: RequestOptions = RequestOptions.none() ): PaymentRetryResponse + /** Simulate payment lifecycle event */ + @JvmOverloads + fun simulateAction( + params: PaymentSimulateActionParams, + requestOptions: RequestOptions = RequestOptions.none() + ): PaymentSimulateActionResponse + + /** Simulates a receipt of a Payment. */ + @JvmOverloads + fun simulateReceipt( + params: PaymentSimulateReceiptParams, + requestOptions: RequestOptions = RequestOptions.none() + ): PaymentSimulateReceiptResponse + /** Simulates a release of a Payment. */ @JvmOverloads fun simulateRelease( diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt index e34b1aa59..2463b9478 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/PaymentServiceImpl.kt @@ -16,6 +16,10 @@ import com.lithic.api.models.PaymentListParams import com.lithic.api.models.PaymentRetrieveParams import com.lithic.api.models.PaymentRetryParams import com.lithic.api.models.PaymentRetryResponse +import com.lithic.api.models.PaymentSimulateActionParams +import com.lithic.api.models.PaymentSimulateActionResponse +import com.lithic.api.models.PaymentSimulateReceiptParams +import com.lithic.api.models.PaymentSimulateReceiptResponse import com.lithic.api.models.PaymentSimulateReleaseParams import com.lithic.api.models.PaymentSimulateReleaseResponse import com.lithic.api.models.PaymentSimulateReturnParams @@ -138,6 +142,64 @@ constructor( } } + private val simulateActionHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Simulate payment lifecycle event */ + override fun simulateAction( + params: PaymentSimulateActionParams, + requestOptions: RequestOptions + ): PaymentSimulateActionResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("simulate", "payments", params.getPathParam(0), "action") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { simulateActionHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + + private val simulateReceiptHandler: Handler = + jsonHandler(clientOptions.jsonMapper) + .withErrorHandler(errorHandler) + + /** Simulates a receipt of a Payment. */ + override fun simulateReceipt( + params: PaymentSimulateReceiptParams, + requestOptions: RequestOptions + ): PaymentSimulateReceiptResponse { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("simulate", "payments", "receipt") + .putAllQueryParams(params.getQueryParams()) + .putAllHeaders(clientOptions.headers) + .putAllHeaders(params.getHeaders()) + .body(json(clientOptions.jsonMapper, params.getBody())) + .build() + return clientOptions.httpClient.execute(request, requestOptions).let { response -> + response + .use { simulateReceiptHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + private val simulateReleaseHandler: Handler = jsonHandler(clientOptions.jsonMapper) .withErrorHandler(errorHandler) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateParamsTest.kt index b9d84eab3..47624961e 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateParamsTest.kt @@ -16,8 +16,9 @@ class ExternalBankAccountCreateParamsTest { .accountNumber("12345678901234567") .country("USD") .currency("USD") + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) + .ownerType(OwnerType.BUSINESS) .routingNumber("123456789") .type( ExternalBankAccountCreateParams.BankVerifiedCreateBankAccountApiRequest @@ -38,10 +39,9 @@ class ExternalBankAccountCreateParamsTest { ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) - .doingBusinessAs("x") - .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .doingBusinessAs("string") .name("x") - .userDefinedId("x") + .userDefinedId("string") .verificationEnforcement(true) .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponseTest.kt index 94572f5e4..171a56f24 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponseTest.kt @@ -21,11 +21,11 @@ class ExternalBankAccountCreateResponseTest { .owner("string") .ownerType(ExternalBankAccountCreateResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(ExternalBankAccountCreateResponse.State.ENABLED) + .state(ExternalBankAccountCreateResponse.State.CLOSED) .type(ExternalBankAccountCreateResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod(ExternalBankAccountCreateResponse.VerificationMethod.MANUAL) - .verificationState(ExternalBankAccountCreateResponse.VerificationState.PENDING) + .verificationState(ExternalBankAccountCreateResponse.VerificationState.ENABLED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( ExternalBankAccountAddress.builder() @@ -58,14 +58,14 @@ class ExternalBankAccountCreateResponseTest { .isEqualTo(ExternalBankAccountCreateResponse.OwnerType.BUSINESS) assertThat(externalBankAccountCreateResponse.routingNumber()).isEqualTo("string") assertThat(externalBankAccountCreateResponse.state()) - .isEqualTo(ExternalBankAccountCreateResponse.State.ENABLED) + .isEqualTo(ExternalBankAccountCreateResponse.State.CLOSED) assertThat(externalBankAccountCreateResponse.type()) .isEqualTo(ExternalBankAccountCreateResponse.Type.CHECKING) assertThat(externalBankAccountCreateResponse.verificationAttempts()).isEqualTo(123L) assertThat(externalBankAccountCreateResponse.verificationMethod()) .isEqualTo(ExternalBankAccountCreateResponse.VerificationMethod.MANUAL) assertThat(externalBankAccountCreateResponse.verificationState()) - .isEqualTo(ExternalBankAccountCreateResponse.VerificationState.PENDING) + .isEqualTo(ExternalBankAccountCreateResponse.VerificationState.ENABLED) assertThat(externalBankAccountCreateResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(externalBankAccountCreateResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListParamsTest.kt index a0b49baa9..5b878f08a 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListParamsTest.kt @@ -15,11 +15,11 @@ class ExternalBankAccountListParamsTest { .accountTypes(listOf(ExternalBankAccountListParams.AccountType.CHECKING)) .countries(listOf("string")) .endingBefore("string") - .ownerTypes(listOf(OwnerType.INDIVIDUAL)) + .ownerTypes(listOf(OwnerType.BUSINESS)) .pageSize(123L) .startingAfter("string") - .states(listOf(ExternalBankAccountListParams.AccountState.ENABLED)) - .verificationStates(listOf(ExternalBankAccountListParams.VerificationState.PENDING)) + .states(listOf(ExternalBankAccountListParams.AccountState.CLOSED)) + .verificationStates(listOf(ExternalBankAccountListParams.VerificationState.ENABLED)) .build() } @@ -31,11 +31,11 @@ class ExternalBankAccountListParamsTest { .accountTypes(listOf(ExternalBankAccountListParams.AccountType.CHECKING)) .countries(listOf("string")) .endingBefore("string") - .ownerTypes(listOf(OwnerType.INDIVIDUAL)) + .ownerTypes(listOf(OwnerType.BUSINESS)) .pageSize(123L) .startingAfter("string") - .states(listOf(ExternalBankAccountListParams.AccountState.ENABLED)) - .verificationStates(listOf(ExternalBankAccountListParams.VerificationState.PENDING)) + .states(listOf(ExternalBankAccountListParams.AccountState.CLOSED)) + .verificationStates(listOf(ExternalBankAccountListParams.VerificationState.ENABLED)) .build() val expected = mutableMapOf>() expected.put("account_token", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) @@ -45,16 +45,13 @@ class ExternalBankAccountListParamsTest { ) expected.put("countries", listOf("string")) expected.put("ending_before", listOf("string")) - expected.put("owner_types", listOf(OwnerType.INDIVIDUAL.toString())) + expected.put("owner_types", listOf(OwnerType.BUSINESS.toString())) expected.put("page_size", listOf("123")) expected.put("starting_after", listOf("string")) - expected.put( - "states", - listOf(ExternalBankAccountListParams.AccountState.ENABLED.toString()) - ) + expected.put("states", listOf(ExternalBankAccountListParams.AccountState.CLOSED.toString())) expected.put( "verification_states", - listOf(ExternalBankAccountListParams.VerificationState.PENDING.toString()) + listOf(ExternalBankAccountListParams.VerificationState.ENABLED.toString()) ) assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListResponseTest.kt index 3871764f9..a5471ccb9 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountListResponseTest.kt @@ -21,11 +21,11 @@ class ExternalBankAccountListResponseTest { .owner("string") .ownerType(ExternalBankAccountListResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(ExternalBankAccountListResponse.State.ENABLED) + .state(ExternalBankAccountListResponse.State.CLOSED) .type(ExternalBankAccountListResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod(ExternalBankAccountListResponse.VerificationMethod.MANUAL) - .verificationState(ExternalBankAccountListResponse.VerificationState.PENDING) + .verificationState(ExternalBankAccountListResponse.VerificationState.ENABLED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( ExternalBankAccountAddress.builder() @@ -58,14 +58,14 @@ class ExternalBankAccountListResponseTest { .isEqualTo(ExternalBankAccountListResponse.OwnerType.BUSINESS) assertThat(externalBankAccountListResponse.routingNumber()).isEqualTo("string") assertThat(externalBankAccountListResponse.state()) - .isEqualTo(ExternalBankAccountListResponse.State.ENABLED) + .isEqualTo(ExternalBankAccountListResponse.State.CLOSED) assertThat(externalBankAccountListResponse.type()) .isEqualTo(ExternalBankAccountListResponse.Type.CHECKING) assertThat(externalBankAccountListResponse.verificationAttempts()).isEqualTo(123L) assertThat(externalBankAccountListResponse.verificationMethod()) .isEqualTo(ExternalBankAccountListResponse.VerificationMethod.MANUAL) assertThat(externalBankAccountListResponse.verificationState()) - .isEqualTo(ExternalBankAccountListResponse.VerificationState.PENDING) + .isEqualTo(ExternalBankAccountListResponse.VerificationState.ENABLED) assertThat(externalBankAccountListResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(externalBankAccountListResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParamsTest.kt index 3a5dfa125..0695bee3d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountMicroDepositCreateParamsTest.kt @@ -12,7 +12,7 @@ class ExternalBankAccountMicroDepositCreateParamsTest { fun createExternalBankAccountMicroDepositCreateParams() { ExternalBankAccountMicroDepositCreateParams.builder() .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .microDeposits(listOf(123L, 123L)) + .microDeposits(listOf(123L)) .build() } @@ -21,11 +21,11 @@ class ExternalBankAccountMicroDepositCreateParamsTest { val params = ExternalBankAccountMicroDepositCreateParams.builder() .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .microDeposits(listOf(123L, 123L)) + .microDeposits(listOf(123L)) .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.microDeposits()).isEqualTo(listOf(123L, 123L)) + assertThat(body.microDeposits()).isEqualTo(listOf(123L)) } @Test @@ -33,11 +33,11 @@ class ExternalBankAccountMicroDepositCreateParamsTest { val params = ExternalBankAccountMicroDepositCreateParams.builder() .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .microDeposits(listOf(123L, 123L)) + .microDeposits(listOf(123L)) .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.microDeposits()).isEqualTo(listOf(123L, 123L)) + assertThat(body.microDeposits()).isEqualTo(listOf(123L)) } @Test @@ -45,7 +45,7 @@ class ExternalBankAccountMicroDepositCreateParamsTest { val params = ExternalBankAccountMicroDepositCreateParams.builder() .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .microDeposits(listOf(123L, 123L)) + .microDeposits(listOf(123L)) .build() assertThat(params).isNotNull // path param "externalBankAccountToken" diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponseTest.kt index 29a7c4fff..bccf455a7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponseTest.kt @@ -21,11 +21,11 @@ class ExternalBankAccountRetrieveResponseTest { .owner("string") .ownerType(ExternalBankAccountRetrieveResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(ExternalBankAccountRetrieveResponse.State.ENABLED) + .state(ExternalBankAccountRetrieveResponse.State.CLOSED) .type(ExternalBankAccountRetrieveResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod(ExternalBankAccountRetrieveResponse.VerificationMethod.MANUAL) - .verificationState(ExternalBankAccountRetrieveResponse.VerificationState.PENDING) + .verificationState(ExternalBankAccountRetrieveResponse.VerificationState.ENABLED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( ExternalBankAccountAddress.builder() @@ -58,14 +58,14 @@ class ExternalBankAccountRetrieveResponseTest { .isEqualTo(ExternalBankAccountRetrieveResponse.OwnerType.BUSINESS) assertThat(externalBankAccountRetrieveResponse.routingNumber()).isEqualTo("string") assertThat(externalBankAccountRetrieveResponse.state()) - .isEqualTo(ExternalBankAccountRetrieveResponse.State.ENABLED) + .isEqualTo(ExternalBankAccountRetrieveResponse.State.CLOSED) assertThat(externalBankAccountRetrieveResponse.type()) .isEqualTo(ExternalBankAccountRetrieveResponse.Type.CHECKING) assertThat(externalBankAccountRetrieveResponse.verificationAttempts()).isEqualTo(123L) assertThat(externalBankAccountRetrieveResponse.verificationMethod()) .isEqualTo(ExternalBankAccountRetrieveResponse.VerificationMethod.MANUAL) assertThat(externalBankAccountRetrieveResponse.verificationState()) - .isEqualTo(ExternalBankAccountRetrieveResponse.VerificationState.PENDING) + .isEqualTo(ExternalBankAccountRetrieveResponse.VerificationState.ENABLED) assertThat(externalBankAccountRetrieveResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(externalBankAccountRetrieveResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponseTest.kt index a5c980c2b..67592676d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponseTest.kt @@ -21,14 +21,14 @@ class ExternalBankAccountRetryMicroDepositsResponseTest { .owner("string") .ownerType(ExternalBankAccountRetryMicroDepositsResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(ExternalBankAccountRetryMicroDepositsResponse.State.ENABLED) + .state(ExternalBankAccountRetryMicroDepositsResponse.State.CLOSED) .type(ExternalBankAccountRetryMicroDepositsResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod( ExternalBankAccountRetryMicroDepositsResponse.VerificationMethod.MANUAL ) .verificationState( - ExternalBankAccountRetryMicroDepositsResponse.VerificationState.PENDING + ExternalBankAccountRetryMicroDepositsResponse.VerificationState.ENABLED ) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( @@ -63,7 +63,7 @@ class ExternalBankAccountRetryMicroDepositsResponseTest { assertThat(externalBankAccountRetryMicroDepositsResponse.routingNumber()) .isEqualTo("string") assertThat(externalBankAccountRetryMicroDepositsResponse.state()) - .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.State.ENABLED) + .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.State.CLOSED) assertThat(externalBankAccountRetryMicroDepositsResponse.type()) .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.Type.CHECKING) assertThat(externalBankAccountRetryMicroDepositsResponse.verificationAttempts()) @@ -71,7 +71,7 @@ class ExternalBankAccountRetryMicroDepositsResponseTest { assertThat(externalBankAccountRetryMicroDepositsResponse.verificationMethod()) .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.VerificationMethod.MANUAL) assertThat(externalBankAccountRetryMicroDepositsResponse.verificationState()) - .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.VerificationState.PENDING) + .isEqualTo(ExternalBankAccountRetryMicroDepositsResponse.VerificationState.ENABLED) assertThat(externalBankAccountRetryMicroDepositsResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(externalBankAccountRetryMicroDepositsResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParamsTest.kt index f611d481b..ccb507789 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParamsTest.kt @@ -25,11 +25,11 @@ class ExternalBankAccountUpdateParamsTest { ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) - .doingBusinessAs("x") + .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) - .userDefinedId("x") + .ownerType(OwnerType.BUSINESS) + .userDefinedId("string") .build() } @@ -50,11 +50,11 @@ class ExternalBankAccountUpdateParamsTest { ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) - .doingBusinessAs("x") + .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) - .userDefinedId("x") + .ownerType(OwnerType.BUSINESS) + .userDefinedId("string") .build() val body = params.getBody() assertThat(body).isNotNull @@ -71,11 +71,11 @@ class ExternalBankAccountUpdateParamsTest { ) assertThat(body.companyId()).isEqualTo("x") assertThat(body.dob()).isEqualTo(LocalDate.parse("2019-12-27")) - assertThat(body.doingBusinessAs()).isEqualTo("x") + assertThat(body.doingBusinessAs()).isEqualTo("string") assertThat(body.name()).isEqualTo("x") assertThat(body.owner()).isEqualTo("x") - assertThat(body.ownerType()).isEqualTo(OwnerType.INDIVIDUAL) - assertThat(body.userDefinedId()).isEqualTo("x") + assertThat(body.ownerType()).isEqualTo(OwnerType.BUSINESS) + assertThat(body.userDefinedId()).isEqualTo("string") } @Test diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponseTest.kt index 5ee100d94..6378188cf 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponseTest.kt @@ -21,11 +21,11 @@ class ExternalBankAccountUpdateResponseTest { .owner("string") .ownerType(ExternalBankAccountUpdateResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(ExternalBankAccountUpdateResponse.State.ENABLED) + .state(ExternalBankAccountUpdateResponse.State.CLOSED) .type(ExternalBankAccountUpdateResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod(ExternalBankAccountUpdateResponse.VerificationMethod.MANUAL) - .verificationState(ExternalBankAccountUpdateResponse.VerificationState.PENDING) + .verificationState(ExternalBankAccountUpdateResponse.VerificationState.ENABLED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( ExternalBankAccountAddress.builder() @@ -58,14 +58,14 @@ class ExternalBankAccountUpdateResponseTest { .isEqualTo(ExternalBankAccountUpdateResponse.OwnerType.BUSINESS) assertThat(externalBankAccountUpdateResponse.routingNumber()).isEqualTo("string") assertThat(externalBankAccountUpdateResponse.state()) - .isEqualTo(ExternalBankAccountUpdateResponse.State.ENABLED) + .isEqualTo(ExternalBankAccountUpdateResponse.State.CLOSED) assertThat(externalBankAccountUpdateResponse.type()) .isEqualTo(ExternalBankAccountUpdateResponse.Type.CHECKING) assertThat(externalBankAccountUpdateResponse.verificationAttempts()).isEqualTo(123L) assertThat(externalBankAccountUpdateResponse.verificationMethod()) .isEqualTo(ExternalBankAccountUpdateResponse.VerificationMethod.MANUAL) assertThat(externalBankAccountUpdateResponse.verificationState()) - .isEqualTo(ExternalBankAccountUpdateResponse.VerificationState.PENDING) + .isEqualTo(ExternalBankAccountUpdateResponse.VerificationState.ENABLED) assertThat(externalBankAccountUpdateResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(externalBankAccountUpdateResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialTransactionTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialTransactionTest.kt index dafadfbbd..ee34ebc0d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialTransactionTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/FinancialTransactionTest.kt @@ -23,10 +23,13 @@ class FinancialTransactionTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(123L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .detailedResults( + listOf(FinancialTransaction.FinancialEvent.DetailedResult.APPROVED) + ) .result(FinancialTransaction.FinancialEvent.Result.APPROVED) .type( FinancialTransaction.FinancialEvent.FinancialEventType - .ACH_EXCEEDED_THRESHOLD + .ACH_ORIGINATION_CANCELLED ) .build() ) @@ -50,10 +53,13 @@ class FinancialTransactionTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(123L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .detailedResults( + listOf(FinancialTransaction.FinancialEvent.DetailedResult.APPROVED) + ) .result(FinancialTransaction.FinancialEvent.Result.APPROVED) .type( FinancialTransaction.FinancialEvent.FinancialEventType - .ACH_EXCEEDED_THRESHOLD + .ACH_ORIGINATION_CANCELLED ) .build() ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LineItemListResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LineItemListResponseTest.kt index 2cd71d651..66dc5ddae 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/LineItemListResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/LineItemListResponseTest.kt @@ -18,7 +18,7 @@ class LineItemListResponseTest { .category(LineItemListResponse.Category.ACH) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("string") - .eventType(LineItemListResponse.FinancialEventType.ACH_EXCEEDED_THRESHOLD) + .eventType(LineItemListResponse.FinancialEventType.ACH_ORIGINATION_CANCELLED) .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .financialTransactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .settledDate(LocalDate.parse("2019-12-27")) @@ -33,7 +33,7 @@ class LineItemListResponseTest { .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(lineItemListResponse.currency()).isEqualTo("string") assertThat(lineItemListResponse.eventType()) - .isEqualTo(LineItemListResponse.FinancialEventType.ACH_EXCEEDED_THRESHOLD) + .isEqualTo(LineItemListResponse.FinancialEventType.ACH_ORIGINATION_CANCELLED) assertThat(lineItemListResponse.financialAccountToken()) .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(lineItemListResponse.financialTransactionToken()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/MicroDepositCreateResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/MicroDepositCreateResponseTest.kt index 50ec0f639..8c906ee52 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/MicroDepositCreateResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/MicroDepositCreateResponseTest.kt @@ -21,11 +21,11 @@ class MicroDepositCreateResponseTest { .owner("string") .ownerType(MicroDepositCreateResponse.OwnerType.BUSINESS) .routingNumber("string") - .state(MicroDepositCreateResponse.State.ENABLED) + .state(MicroDepositCreateResponse.State.CLOSED) .type(MicroDepositCreateResponse.Type.CHECKING) .verificationAttempts(123L) .verificationMethod(MicroDepositCreateResponse.VerificationMethod.MANUAL) - .verificationState(MicroDepositCreateResponse.VerificationState.PENDING) + .verificationState(MicroDepositCreateResponse.VerificationState.ENABLED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .address( ExternalBankAccountAddress.builder() @@ -58,14 +58,14 @@ class MicroDepositCreateResponseTest { .isEqualTo(MicroDepositCreateResponse.OwnerType.BUSINESS) assertThat(microDepositCreateResponse.routingNumber()).isEqualTo("string") assertThat(microDepositCreateResponse.state()) - .isEqualTo(MicroDepositCreateResponse.State.ENABLED) + .isEqualTo(MicroDepositCreateResponse.State.CLOSED) assertThat(microDepositCreateResponse.type()) .isEqualTo(MicroDepositCreateResponse.Type.CHECKING) assertThat(microDepositCreateResponse.verificationAttempts()).isEqualTo(123L) assertThat(microDepositCreateResponse.verificationMethod()) .isEqualTo(MicroDepositCreateResponse.VerificationMethod.MANUAL) assertThat(microDepositCreateResponse.verificationState()) - .isEqualTo(MicroDepositCreateResponse.VerificationState.PENDING) + .isEqualTo(MicroDepositCreateResponse.VerificationState.ENABLED) assertThat(microDepositCreateResponse.accountToken()) .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(microDepositCreateResponse.address()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionParamsTest.kt new file mode 100644 index 000000000..0079ebc5d --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionParamsTest.kt @@ -0,0 +1,86 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.models.* +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class PaymentSimulateActionParamsTest { + + @Test + fun createPaymentSimulateActionParams() { + PaymentSimulateActionParams.builder() + .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .eventType( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + .declineReason( + PaymentSimulateActionParams.SupportedSimulationDeclineReasons + .PROGRAM_TRANSACTION_LIMITS_EXCEEDED + ) + .returnReasonCode("string") + .build() + } + + @Test + fun getBody() { + val params = + PaymentSimulateActionParams.builder() + .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .eventType( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + .declineReason( + PaymentSimulateActionParams.SupportedSimulationDeclineReasons + .PROGRAM_TRANSACTION_LIMITS_EXCEEDED + ) + .returnReasonCode("string") + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.eventType()) + .isEqualTo( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + assertThat(body.declineReason()) + .isEqualTo( + PaymentSimulateActionParams.SupportedSimulationDeclineReasons + .PROGRAM_TRANSACTION_LIMITS_EXCEEDED + ) + assertThat(body.returnReasonCode()).isEqualTo("string") + } + + @Test + fun getBodyWithoutOptionalFields() { + val params = + PaymentSimulateActionParams.builder() + .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .eventType( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.eventType()) + .isEqualTo( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + } + + @Test + fun getPathParam() { + val params = + PaymentSimulateActionParams.builder() + .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .eventType( + PaymentSimulateActionParams.SupportedSimulationTypes.ACH_ORIGINATION_REVIEWED + ) + .build() + assertThat(params).isNotNull + // path param "paymentToken" + assertThat(params.getPathParam(0)).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + // out-of-bound path param + assertThat(params.getPathParam(1)).isEqualTo("") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionResponseTest.kt new file mode 100644 index 000000000..c81576144 --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateActionResponseTest.kt @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class PaymentSimulateActionResponseTest { + + @Test + fun createPaymentSimulateActionResponse() { + val paymentSimulateActionResponse = + PaymentSimulateActionResponse.builder() + .debuggingRequestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .result(PaymentSimulateActionResponse.Result.APPROVED) + .transactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + assertThat(paymentSimulateActionResponse).isNotNull + assertThat(paymentSimulateActionResponse.debuggingRequestId()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(paymentSimulateActionResponse.result()) + .isEqualTo(PaymentSimulateActionResponse.Result.APPROVED) + assertThat(paymentSimulateActionResponse.transactionEventToken()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptParamsTest.kt new file mode 100644 index 000000000..7054a240e --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptParamsTest.kt @@ -0,0 +1,59 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import com.lithic.api.models.* +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class PaymentSimulateReceiptParamsTest { + + @Test + fun createPaymentSimulateReceiptParams() { + PaymentSimulateReceiptParams.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .amount(123L) + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + .memo("string") + .build() + } + + @Test + fun getBody() { + val params = + PaymentSimulateReceiptParams.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .amount(123L) + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + .memo("string") + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.amount()).isEqualTo(123L) + assertThat(body.financialAccountToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.receiptType()) + .isEqualTo(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + assertThat(body.memo()).isEqualTo("string") + } + + @Test + fun getBodyWithoutOptionalFields() { + val params = + PaymentSimulateReceiptParams.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .amount(123L) + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.amount()).isEqualTo(123L) + assertThat(body.financialAccountToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.receiptType()) + .isEqualTo(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponseTest.kt new file mode 100644 index 000000000..e2db501dc --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponseTest.kt @@ -0,0 +1,26 @@ +// File generated from our OpenAPI spec by Stainless. + +package com.lithic.api.models + +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class PaymentSimulateReceiptResponseTest { + + @Test + fun createPaymentSimulateReceiptResponse() { + val paymentSimulateReceiptResponse = + PaymentSimulateReceiptResponse.builder() + .debuggingRequestId("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .result(PaymentSimulateReceiptResponse.Result.APPROVED) + .transactionEventToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .build() + assertThat(paymentSimulateReceiptResponse).isNotNull + assertThat(paymentSimulateReceiptResponse.debuggingRequestId()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(paymentSimulateReceiptResponse.result()) + .isEqualTo(PaymentSimulateReceiptResponse.Result.APPROVED) + assertThat(paymentSimulateReceiptResponse.transactionEventToken()) + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + } +} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponseTest.kt index c7c5dc509..4d87c3cb4 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponseTest.kt @@ -17,10 +17,10 @@ class PaymentSimulateReleaseResponseTest { .build() assertThat(paymentSimulateReleaseResponse).isNotNull assertThat(paymentSimulateReleaseResponse.debuggingRequestId()) - .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentSimulateReleaseResponse.result()) - .contains(PaymentSimulateReleaseResponse.Result.APPROVED) + .isEqualTo(PaymentSimulateReleaseResponse.Result.APPROVED) assertThat(paymentSimulateReleaseResponse.transactionEventToken()) - .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnParamsTest.kt index acdc73371..706ad296b 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnParamsTest.kt @@ -12,7 +12,7 @@ class PaymentSimulateReturnParamsTest { fun createPaymentSimulateReturnParams() { PaymentSimulateReturnParams.builder() .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .returnReasonCode("string") + .returnReasonCode("R12") .build() } @@ -21,12 +21,12 @@ class PaymentSimulateReturnParamsTest { val params = PaymentSimulateReturnParams.builder() .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .returnReasonCode("string") + .returnReasonCode("R12") .build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.paymentToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(body.returnReasonCode()).isEqualTo("string") + assertThat(body.returnReasonCode()).isEqualTo("R12") } @Test diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnResponseTest.kt index 3bdd29943..9cf7dfd44 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentSimulateReturnResponseTest.kt @@ -17,10 +17,10 @@ class PaymentSimulateReturnResponseTest { .build() assertThat(paymentSimulateReturnResponse).isNotNull assertThat(paymentSimulateReturnResponse.debuggingRequestId()) - .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(paymentSimulateReturnResponse.result()) - .contains(PaymentSimulateReturnResponse.Result.APPROVED) + .isEqualTo(PaymentSimulateReturnResponse.Result.APPROVED) assertThat(paymentSimulateReturnResponse.transactionEventToken()) - .contains("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferTest.kt index 815fcd1e7..8b47e88af 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferTest.kt @@ -23,8 +23,13 @@ class TransferTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(123L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .detailedResults( + listOf(Transfer.FinancialEvent.DetailedResult.APPROVED) + ) .result(Transfer.FinancialEvent.Result.APPROVED) - .type(Transfer.FinancialEvent.FinancialEventType.ACH_EXCEEDED_THRESHOLD) + .type( + Transfer.FinancialEvent.FinancialEventType.ACH_ORIGINATION_CANCELLED + ) .build() ) ) @@ -78,8 +83,9 @@ class TransferTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(123L) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) + .detailedResults(listOf(Transfer.FinancialEvent.DetailedResult.APPROVED)) .result(Transfer.FinancialEvent.Result.APPROVED) - .type(Transfer.FinancialEvent.FinancialEventType.ACH_EXCEEDED_THRESHOLD) + .type(Transfer.FinancialEvent.FinancialEventType.ACH_ORIGINATION_CANCELLED) .build() ) assertThat(transfer.fromBalance().get()) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/ExternalBankAccountServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/ExternalBankAccountServiceTest.kt index 2a08c8d6b..18d931916 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/ExternalBankAccountServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/ExternalBankAccountServiceTest.kt @@ -30,8 +30,9 @@ class ExternalBankAccountServiceTest { .accountNumber("12345678901234567") .country("USD") .currency("USD") + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) + .ownerType(OwnerType.BUSINESS) .routingNumber("123456789") .type( ExternalBankAccountCreateParams @@ -53,10 +54,9 @@ class ExternalBankAccountServiceTest { ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) - .doingBusinessAs("x") - .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .doingBusinessAs("string") .name("x") - .userDefinedId("x") + .userDefinedId("string") .verificationEnforcement(true) .build() ) @@ -108,11 +108,11 @@ class ExternalBankAccountServiceTest { ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) - .doingBusinessAs("x") + .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) - .userDefinedId("x") + .ownerType(OwnerType.BUSINESS) + .userDefinedId("string") .build() ) println(externalBankAccountUpdateResponse) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt index 053858198..caf41751b 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/PaymentServiceTest.kt @@ -92,6 +92,55 @@ class PaymentServiceTest { println(paymentRetryResponse) } + @Test + fun callSimulateAction() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val paymentService = client.payments() + val paymentSimulateActionResponse = + paymentService.simulateAction( + PaymentSimulateActionParams.builder() + .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .eventType( + PaymentSimulateActionParams.SupportedSimulationTypes + .ACH_ORIGINATION_REVIEWED + ) + .declineReason( + PaymentSimulateActionParams.SupportedSimulationDeclineReasons + .PROGRAM_TRANSACTION_LIMITS_EXCEEDED + ) + .returnReasonCode("string") + .build() + ) + println(paymentSimulateActionResponse) + paymentSimulateActionResponse.validate() + } + + @Test + fun callSimulateReceipt() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val paymentService = client.payments() + val paymentSimulateReceiptResponse = + paymentService.simulateReceipt( + PaymentSimulateReceiptParams.builder() + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .amount(123L) + .financialAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .receiptType(PaymentSimulateReceiptParams.ReceiptType.RECEIPT_CREDIT) + .memo("string") + .build() + ) + println(paymentSimulateReceiptResponse) + paymentSimulateReceiptResponse.validate() + } + @Test fun callSimulateRelease() { val client = @@ -122,7 +171,7 @@ class PaymentServiceTest { paymentService.simulateReturn( PaymentSimulateReturnParams.builder() .paymentToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .returnReasonCode("string") + .returnReasonCode("R12") .build() ) println(paymentSimulateReturnResponse) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/externalBankAccounts/MicroDepositServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/externalBankAccounts/MicroDepositServiceTest.kt index 7e753d1ab..322ed2a30 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/externalBankAccounts/MicroDepositServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/externalBankAccounts/MicroDepositServiceTest.kt @@ -23,7 +23,7 @@ class MicroDepositServiceTest { microDepositService.create( ExternalBankAccountMicroDepositCreateParams.builder() .externalBankAccountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .microDeposits(listOf(123L, 123L)) + .microDeposits(listOf(123L)) .build() ) println(microDepositCreateResponse)