diff --git a/.stats.yml b/.stats.yml index 771d33ac..023b5846 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1 @@ -configured_endpoints: 104 +configured_endpoints: 105 diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt index 0db3eb04..16e987e3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClient.kt @@ -58,7 +58,7 @@ interface LithicClient { fun digitalCardArt(): DigitalCardArtService - /** API status check */ + /** Status of api */ @JvmOverloads fun apiStatus( params: ClientApiStatusParams, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt index b8eaec6b..b7a49b57 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsync.kt @@ -59,7 +59,7 @@ interface LithicClientAsync { fun digitalCardArt(): DigitalCardArtServiceAsync - /** API status check */ + /** Status of api */ @JvmOverloads fun apiStatus( params: ClientApiStatusParams, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt index 56ad077e..d0c1dc01 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientAsyncImpl.kt @@ -146,7 +146,7 @@ constructor( private val apiStatusHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** API status check */ + /** Status of api */ override fun apiStatus( params: ClientApiStatusParams, requestOptions: RequestOptions diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt index f603c107..3111778d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/client/LithicClientImpl.kt @@ -138,7 +138,7 @@ constructor( private val apiStatusHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) - /** API status check */ + /** Status of api */ override fun apiStatus( params: ClientApiStatusParams, requestOptions: RequestOptions diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt index 0cfeb9e9..fbbf09f7 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Account.kt @@ -21,12 +21,12 @@ import java.util.Optional @NoAutoDetect class Account private constructor( + private val accountHolder: JsonField, + private val authRuleTokens: JsonField>, private val spendLimit: JsonField, private val state: JsonField, private val token: JsonField, - private val authRuleTokens: JsonField>, private val verificationAddress: JsonField, - private val accountHolder: JsonField, private val additionalProperties: Map, ) { @@ -34,6 +34,13 @@ private constructor( private var hashCode: Int = 0 + fun accountHolder(): Optional = + Optional.ofNullable(accountHolder.getNullable("account_holder")) + + /** List of identifiers for the Auth Rule(s) that are applied on the account. */ + fun authRuleTokens(): Optional> = + Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens")) + /** * Spend limit information for the user containing the daily, monthly, and lifetime spend limit * of the account. Any charges to a card owned by this account will be declined once their @@ -57,15 +64,13 @@ private constructor( */ fun token(): String = token.getRequired("token") - /** List of identifiers for the Auth Rule(s) that are applied on the account. */ - fun authRuleTokens(): Optional> = - Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens")) - fun verificationAddress(): Optional = Optional.ofNullable(verificationAddress.getNullable("verification_address")) - fun accountHolder(): Optional = - Optional.ofNullable(accountHolder.getNullable("account_holder")) + @JsonProperty("account_holder") @ExcludeMissing fun _accountHolder() = accountHolder + + /** List of identifiers for the Auth Rule(s) that are applied on the account. */ + @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens /** * Spend limit information for the user containing the daily, monthly, and lifetime spend limit @@ -90,27 +95,22 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token - /** List of identifiers for the Auth Rule(s) that are applied on the account. */ - @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens - @JsonProperty("verification_address") @ExcludeMissing fun _verificationAddress() = verificationAddress - @JsonProperty("account_holder") @ExcludeMissing fun _accountHolder() = accountHolder - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Account = apply { if (!validated) { + accountHolder().map { it.validate() } + authRuleTokens() spendLimit().validate() state() token() - authRuleTokens() verificationAddress().map { it.validate() } - accountHolder().map { it.validate() } validated = true } } @@ -123,12 +123,12 @@ private constructor( } return other is Account && + this.accountHolder == other.accountHolder && + this.authRuleTokens == other.authRuleTokens && this.spendLimit == other.spendLimit && this.state == other.state && this.token == other.token && - this.authRuleTokens == other.authRuleTokens && this.verificationAddress == other.verificationAddress && - this.accountHolder == other.accountHolder && this.additionalProperties == other.additionalProperties } @@ -136,12 +136,12 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( + accountHolder, + authRuleTokens, spendLimit, state, token, - authRuleTokens, verificationAddress, - accountHolder, additionalProperties, ) } @@ -149,7 +149,7 @@ private constructor( } override fun toString() = - "Account{spendLimit=$spendLimit, state=$state, token=$token, authRuleTokens=$authRuleTokens, verificationAddress=$verificationAddress, accountHolder=$accountHolder, additionalProperties=$additionalProperties}" + "Account{accountHolder=$accountHolder, authRuleTokens=$authRuleTokens, spendLimit=$spendLimit, state=$state, token=$token, verificationAddress=$verificationAddress, additionalProperties=$additionalProperties}" companion object { @@ -158,25 +158,44 @@ private constructor( class Builder { + private var accountHolder: JsonField = JsonMissing.of() + private var authRuleTokens: JsonField> = JsonMissing.of() private var spendLimit: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() - private var authRuleTokens: JsonField> = JsonMissing.of() private var verificationAddress: JsonField = JsonMissing.of() - private var accountHolder: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(account: Account) = apply { + this.accountHolder = account.accountHolder + this.authRuleTokens = account.authRuleTokens this.spendLimit = account.spendLimit this.state = account.state this.token = account.token - this.authRuleTokens = account.authRuleTokens this.verificationAddress = account.verificationAddress - this.accountHolder = account.accountHolder additionalProperties(account.additionalProperties) } + fun accountHolder(accountHolder: AccountHolder) = accountHolder(JsonField.of(accountHolder)) + + @JsonProperty("account_holder") + @ExcludeMissing + fun accountHolder(accountHolder: JsonField) = apply { + this.accountHolder = accountHolder + } + + /** List of identifiers for the Auth Rule(s) that are applied on the account. */ + fun authRuleTokens(authRuleTokens: List) = + authRuleTokens(JsonField.of(authRuleTokens)) + + /** List of identifiers for the Auth Rule(s) that are applied on the account. */ + @JsonProperty("auth_rule_tokens") + @ExcludeMissing + fun authRuleTokens(authRuleTokens: JsonField>) = apply { + this.authRuleTokens = authRuleTokens + } + /** * Spend limit information for the user containing the daily, monthly, and lifetime spend * limit of the account. Any charges to a card owned by this account will be declined once @@ -229,17 +248,6 @@ private constructor( @ExcludeMissing fun token(token: JsonField) = apply { this.token = token } - /** List of identifiers for the Auth Rule(s) that are applied on the account. */ - fun authRuleTokens(authRuleTokens: List) = - authRuleTokens(JsonField.of(authRuleTokens)) - - /** List of identifiers for the Auth Rule(s) that are applied on the account. */ - @JsonProperty("auth_rule_tokens") - @ExcludeMissing - fun authRuleTokens(authRuleTokens: JsonField>) = apply { - this.authRuleTokens = authRuleTokens - } - fun verificationAddress(verificationAddress: VerificationAddress) = verificationAddress(JsonField.of(verificationAddress)) @@ -249,14 +257,6 @@ private constructor( this.verificationAddress = verificationAddress } - fun accountHolder(accountHolder: AccountHolder) = accountHolder(JsonField.of(accountHolder)) - - @JsonProperty("account_holder") - @ExcludeMissing - fun accountHolder(accountHolder: JsonField) = apply { - this.accountHolder = accountHolder - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -273,12 +273,12 @@ private constructor( fun build(): Account = Account( + accountHolder, + authRuleTokens.map { it.toUnmodifiable() }, spendLimit, state, token, - authRuleTokens.map { it.toUnmodifiable() }, verificationAddress, - accountHolder, additionalProperties.toUnmodifiable(), ) } @@ -294,8 +294,8 @@ private constructor( class SpendLimit private constructor( private val daily: JsonField, - private val monthly: JsonField, private val lifetime: JsonField, + private val monthly: JsonField, private val additionalProperties: Map, ) { @@ -306,21 +306,21 @@ private constructor( /** Daily spend limit (in cents). */ fun daily(): Long = daily.getRequired("daily") - /** Monthly spend limit (in cents). */ - fun monthly(): Long = monthly.getRequired("monthly") - /** Total spend limit over account lifetime (in cents). */ fun lifetime(): Long = lifetime.getRequired("lifetime") + /** Monthly spend limit (in cents). */ + fun monthly(): Long = monthly.getRequired("monthly") + /** Daily spend limit (in cents). */ @JsonProperty("daily") @ExcludeMissing fun _daily() = daily - /** Monthly spend limit (in cents). */ - @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly - /** Total spend limit over account lifetime (in cents). */ @JsonProperty("lifetime") @ExcludeMissing fun _lifetime() = lifetime + /** Monthly spend limit (in cents). */ + @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -328,8 +328,8 @@ private constructor( fun validate(): SpendLimit = apply { if (!validated) { daily() - monthly() lifetime() + monthly() validated = true } } @@ -343,8 +343,8 @@ private constructor( return other is SpendLimit && this.daily == other.daily && - this.monthly == other.monthly && this.lifetime == other.lifetime && + this.monthly == other.monthly && this.additionalProperties == other.additionalProperties } @@ -353,8 +353,8 @@ private constructor( hashCode = Objects.hash( daily, - monthly, lifetime, + monthly, additionalProperties, ) } @@ -362,7 +362,7 @@ private constructor( } override fun toString() = - "SpendLimit{daily=$daily, monthly=$monthly, lifetime=$lifetime, additionalProperties=$additionalProperties}" + "SpendLimit{daily=$daily, lifetime=$lifetime, monthly=$monthly, additionalProperties=$additionalProperties}" companion object { @@ -372,15 +372,15 @@ private constructor( class Builder { private var daily: JsonField = JsonMissing.of() - private var monthly: JsonField = JsonMissing.of() private var lifetime: JsonField = JsonMissing.of() + private var monthly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(spendLimit: SpendLimit) = apply { this.daily = spendLimit.daily - this.monthly = spendLimit.monthly this.lifetime = spendLimit.lifetime + this.monthly = spendLimit.monthly additionalProperties(spendLimit.additionalProperties) } @@ -392,14 +392,6 @@ private constructor( @ExcludeMissing fun daily(daily: JsonField) = apply { this.daily = daily } - /** Monthly spend limit (in cents). */ - fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) - - /** Monthly spend limit (in cents). */ - @JsonProperty("monthly") - @ExcludeMissing - fun monthly(monthly: JsonField) = apply { this.monthly = monthly } - /** Total spend limit over account lifetime (in cents). */ fun lifetime(lifetime: Long) = lifetime(JsonField.of(lifetime)) @@ -408,6 +400,14 @@ private constructor( @ExcludeMissing fun lifetime(lifetime: JsonField) = apply { this.lifetime = lifetime } + /** Monthly spend limit (in cents). */ + fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) + + /** Monthly spend limit (in cents). */ + @JsonProperty("monthly") + @ExcludeMissing + fun monthly(monthly: JsonField) = apply { this.monthly = monthly } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -425,8 +425,8 @@ private constructor( fun build(): SpendLimit = SpendLimit( daily, - monthly, lifetime, + monthly, additionalProperties.toUnmodifiable(), ) } @@ -493,10 +493,10 @@ private constructor( @NoAutoDetect class AccountHolder private constructor( - private val token: JsonField, - private val phoneNumber: JsonField, - private val email: JsonField, private val businessAccountToken: JsonField, + private val email: JsonField, + private val phoneNumber: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -504,15 +504,6 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier for the account holder. */ - fun token(): String = token.getRequired("token") - - /** Phone number of the individual. */ - fun phoneNumber(): String = phoneNumber.getRequired("phone_number") - - /** Email address. */ - fun email(): String = email.getRequired("email") - /** * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of * businesses. Account_token of the enrolled business associated with an enrolled @@ -521,14 +512,14 @@ private constructor( fun businessAccountToken(): String = businessAccountToken.getRequired("business_account_token") - /** Globally unique identifier for the account holder. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Email address. */ + fun email(): String = email.getRequired("email") /** Phone number of the individual. */ - @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + fun phoneNumber(): String = phoneNumber.getRequired("phone_number") - /** Email address. */ - @JsonProperty("email") @ExcludeMissing fun _email() = email + /** Globally unique identifier for the account holder. */ + fun token(): String = token.getRequired("token") /** * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of @@ -539,16 +530,25 @@ private constructor( @ExcludeMissing fun _businessAccountToken() = businessAccountToken + /** Email address. */ + @JsonProperty("email") @ExcludeMissing fun _email() = email + + /** Phone number of the individual. */ + @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + + /** Globally unique identifier for the account holder. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AccountHolder = apply { if (!validated) { - token() - phoneNumber() - email() businessAccountToken() + email() + phoneNumber() + token() validated = true } } @@ -561,10 +561,10 @@ private constructor( } return other is AccountHolder && - this.token == other.token && - this.phoneNumber == other.phoneNumber && - this.email == other.email && this.businessAccountToken == other.businessAccountToken && + this.email == other.email && + this.phoneNumber == other.phoneNumber && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -572,10 +572,10 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - phoneNumber, - email, businessAccountToken, + email, + phoneNumber, + token, additionalProperties, ) } @@ -583,7 +583,7 @@ private constructor( } override fun toString() = - "AccountHolder{token=$token, phoneNumber=$phoneNumber, email=$email, businessAccountToken=$businessAccountToken, additionalProperties=$additionalProperties}" + "AccountHolder{businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -592,47 +592,21 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var phoneNumber: JsonField = JsonMissing.of() - private var email: JsonField = JsonMissing.of() private var businessAccountToken: JsonField = JsonMissing.of() + private var email: JsonField = JsonMissing.of() + private var phoneNumber: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountHolder: AccountHolder) = apply { - this.token = accountHolder.token - this.phoneNumber = accountHolder.phoneNumber - this.email = accountHolder.email this.businessAccountToken = accountHolder.businessAccountToken + this.email = accountHolder.email + this.phoneNumber = accountHolder.phoneNumber + this.token = accountHolder.token additionalProperties(accountHolder.additionalProperties) } - /** Globally unique identifier for the account holder. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the account holder. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - - /** Phone number of the individual. */ - fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) - - /** Phone number of the individual. */ - @JsonProperty("phone_number") - @ExcludeMissing - fun phoneNumber(phoneNumber: JsonField) = apply { - this.phoneNumber = phoneNumber - } - - /** Email address. */ - fun email(email: String) = email(JsonField.of(email)) - - /** Email address. */ - @JsonProperty("email") - @ExcludeMissing - fun email(email: JsonField) = apply { this.email = email } - /** * Only applicable for customers using the KYC-Exempt workflow to enroll authorized * users of businesses. Account_token of the enrolled business associated with an @@ -652,6 +626,32 @@ private constructor( this.businessAccountToken = businessAccountToken } + /** Email address. */ + fun email(email: String) = email(JsonField.of(email)) + + /** Email address. */ + @JsonProperty("email") + @ExcludeMissing + fun email(email: JsonField) = apply { this.email = email } + + /** Phone number of the individual. */ + fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) + + /** Phone number of the individual. */ + @JsonProperty("phone_number") + @ExcludeMissing + fun phoneNumber(phoneNumber: JsonField) = apply { + this.phoneNumber = phoneNumber + } + + /** Globally unique identifier for the account holder. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the account holder. */ + @JsonProperty("token") + @ExcludeMissing + fun token(token: JsonField) = apply { this.token = token } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -668,10 +668,10 @@ private constructor( fun build(): AccountHolder = AccountHolder( - token, - phoneNumber, - email, businessAccountToken, + email, + phoneNumber, + token, additionalProperties.toUnmodifiable(), ) } @@ -684,9 +684,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, ) { @@ -703,11 +703,8 @@ private constructor( /** City name. */ fun city(): String = city.getRequired("city") - /** - * Valid state code. Only USA state codes are currently supported, entered in uppercase ISO - * 3166-2 two-character format. - */ - fun state(): String = state.getRequired("state") + /** Country name. Only USA is currently supported. */ + fun country(): String = country.getRequired("country") /** * Valid postal code. Only USA ZIP codes are currently supported, entered as a five-digit @@ -715,8 +712,11 @@ private constructor( */ fun postalCode(): String = postalCode.getRequired("postal_code") - /** Country name. Only USA is currently supported. */ - fun country(): String = country.getRequired("country") + /** + * Valid state code. Only USA state codes are currently supported, entered in uppercase ISO + * 3166-2 two-character format. + */ + fun state(): String = state.getRequired("state") /** Valid deliverable address (no PO boxes). */ @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 @@ -727,11 +727,8 @@ private constructor( /** City name. */ @JsonProperty("city") @ExcludeMissing fun _city() = city - /** - * Valid state code. Only USA state codes are currently supported, entered in uppercase ISO - * 3166-2 two-character format. - */ - @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Country name. Only USA is currently supported. */ + @JsonProperty("country") @ExcludeMissing fun _country() = country /** * Valid postal code. Only USA ZIP codes are currently supported, entered as a five-digit @@ -739,8 +736,11 @@ private constructor( */ @JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode - /** Country name. Only USA is currently supported. */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** + * Valid state code. Only USA state codes are currently supported, entered in uppercase ISO + * 3166-2 two-character format. + */ + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -751,9 +751,9 @@ private constructor( address1() address2() city() - state() - postalCode() country() + postalCode() + state() validated = true } } @@ -769,9 +769,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 } @@ -782,9 +782,9 @@ private constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties, ) } @@ -792,7 +792,7 @@ private constructor( } override fun toString() = - "VerificationAddress{address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "VerificationAddress{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" companion object { @@ -804,9 +804,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 @@ -814,9 +814,9 @@ private constructor( this.address1 = verificationAddress.address1 this.address2 = verificationAddress.address2 this.city = verificationAddress.city - this.state = verificationAddress.state - this.postalCode = verificationAddress.postalCode this.country = verificationAddress.country + this.postalCode = verificationAddress.postalCode + this.state = verificationAddress.state additionalProperties(verificationAddress.additionalProperties) } @@ -844,19 +844,13 @@ private constructor( @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } - /** - * Valid state code. Only USA state codes are currently supported, entered in uppercase - * ISO 3166-2 two-character format. - */ - fun state(state: String) = state(JsonField.of(state)) + /** Country name. Only USA is currently supported. */ + fun country(country: String) = country(JsonField.of(country)) - /** - * Valid state code. Only USA state codes are currently supported, entered in uppercase - * ISO 3166-2 two-character format. - */ - @JsonProperty("state") + /** Country name. Only USA is currently supported. */ + @JsonProperty("country") @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } + fun country(country: JsonField) = apply { this.country = country } /** * Valid postal code. Only USA ZIP codes are currently supported, entered as a @@ -872,13 +866,19 @@ private constructor( @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - /** Country name. Only USA is currently supported. */ - fun country(country: String) = country(JsonField.of(country)) + /** + * Valid state code. Only USA state codes are currently supported, entered in uppercase + * ISO 3166-2 two-character format. + */ + fun state(state: String) = state(JsonField.of(state)) - /** Country name. Only USA is currently supported. */ - @JsonProperty("country") + /** + * Valid state code. Only USA state codes are currently supported, entered in uppercase + * ISO 3166-2 two-character format. + */ + @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() @@ -899,9 +899,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/AccountHolder.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt index 71dd637f..e22d0162 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt @@ -22,25 +22,25 @@ import java.util.Optional @NoAutoDetect class AccountHolder private constructor( - private val token: JsonField, private val accountToken: JsonField, + private val beneficialOwnerEntities: JsonField>, + private val beneficialOwnerIndividuals: JsonField>, private val businessAccountToken: JsonField, + private val businessEntity: JsonField, + private val controlPerson: JsonField, private val created: JsonField, - private val externalId: JsonField, + private val email: JsonField, private val exemptionType: JsonField, - private val userType: JsonField, - private val verificationApplication: JsonField, + private val externalId: JsonField, private val individual: JsonField, - private val businessEntity: JsonField, - private val beneficialOwnerEntities: JsonField>, - private val beneficialOwnerIndividuals: JsonField>, - private val controlPerson: JsonField, private val natureOfBusiness: JsonField, - private val websiteUrl: JsonField, - private val email: JsonField, private val phoneNumber: JsonField, private val status: JsonField, private val statusReasons: JsonField>, + private val token: JsonField, + private val userType: JsonField, + private val verificationApplication: JsonField, + private val websiteUrl: JsonField, private val additionalProperties: Map, ) { @@ -48,52 +48,31 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier for the account holder. */ - fun token(): Optional = Optional.ofNullable(token.getNullable("token")) - /** Globally unique identifier for the account. */ fun accountToken(): Optional = Optional.ofNullable(accountToken.getNullable("account_token")) /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - fun businessAccountToken(): Optional = - Optional.ofNullable(businessAccountToken.getNullable("business_account_token")) - - /** Timestamp of when the account holder was created. */ - fun created(): Optional = Optional.ofNullable(created.getNullable("created")) - - /** - * Customer-provided token that indicates a relationship with an object outside of the Lithic - * ecosystem. + * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the + * company. */ - fun externalId(): Optional = Optional.ofNullable(externalId.getNullable("external_id")) - - /** The type of KYC exemption for a KYC-Exempt Account Holder. */ - fun exemptionType(): Optional = - Optional.ofNullable(exemptionType.getNullable("exemption_type")) + fun beneficialOwnerEntities(): Optional> = + Optional.ofNullable(beneficialOwnerEntities.getNullable("beneficial_owner_entities")) /** - * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be - * present. If the type is "BUSINESS" then the "business_entity", "control_person", - * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and - * "website_url" attributes will be present. + * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in the + * company. */ - fun userType(): Optional = Optional.ofNullable(userType.getNullable("user_type")) - - /** Information about the most recent identity verification attempt */ - fun verificationApplication(): Optional = - Optional.ofNullable(verificationApplication.getNullable("verification_application")) + fun beneficialOwnerIndividuals(): Optional> = + Optional.ofNullable(beneficialOwnerIndividuals.getNullable("beneficial_owner_individuals")) /** - * Only present when user_type == "INDIVIDUAL". Information about the individual for which the - * account is being opened and KYC is being run. + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. */ - fun individual(): Optional = - Optional.ofNullable(individual.getNullable("individual")) + fun businessAccountToken(): Optional = + Optional.ofNullable(businessAccountToken.getNullable("business_account_token")) /** * Only present when user_type == "BUSINESS". Information about the business for which the @@ -102,20 +81,6 @@ private constructor( fun businessEntity(): Optional = Optional.ofNullable(businessEntity.getNullable("business_entity")) - /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the - * company. - */ - fun beneficialOwnerEntities(): Optional> = - Optional.ofNullable(beneficialOwnerEntities.getNullable("beneficial_owner_entities")) - - /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in the - * company. - */ - fun beneficialOwnerIndividuals(): Optional> = - Optional.ofNullable(beneficialOwnerIndividuals.getNullable("beneficial_owner_individuals")) - /** * Only present when user_type == "BUSINESS". An individual with significant responsibility for * managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer, Chief @@ -127,12 +92,8 @@ private constructor( fun controlPerson(): Optional = Optional.ofNullable(controlPerson.getNullable("control_person")) - /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ - fun natureOfBusiness(): Optional = - Optional.ofNullable(natureOfBusiness.getNullable("nature_of_business")) - - /** Only present when user_type == "BUSINESS". Business's primary website. */ - fun websiteUrl(): Optional = Optional.ofNullable(websiteUrl.getNullable("website_url")) + /** Timestamp of when the account holder was created. */ + fun created(): Optional = Optional.ofNullable(created.getNullable("created")) /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use @@ -142,6 +103,27 @@ private constructor( */ fun email(): Optional = Optional.ofNullable(email.getNullable("email")) + /** The type of KYC exemption for a KYC-Exempt Account Holder. */ + fun exemptionType(): Optional = + Optional.ofNullable(exemptionType.getNullable("exemption_type")) + + /** + * Customer-provided token that indicates a relationship with an object outside of the Lithic + * ecosystem. + */ + fun externalId(): Optional = Optional.ofNullable(externalId.getNullable("external_id")) + + /** + * Only present when user_type == "INDIVIDUAL". Information about the individual for which the + * account is being opened and KYC is being run. + */ + fun individual(): Optional = + Optional.ofNullable(individual.getNullable("individual")) + + /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ + fun natureOfBusiness(): Optional = + Optional.ofNullable(natureOfBusiness.getNullable("nature_of_business")) + /** * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -165,31 +147,7 @@ private constructor( Optional.ofNullable(statusReasons.getNullable("status_reasons")) /** Globally unique identifier for the account holder. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - - /** Globally unique identifier for the account. */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - @JsonProperty("business_account_token") - @ExcludeMissing - fun _businessAccountToken() = businessAccountToken - - /** Timestamp of when the account holder was created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - - /** - * Customer-provided token that indicates a relationship with an object outside of the Lithic - * ecosystem. - */ - @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId - - /** The type of KYC exemption for a KYC-Exempt Account Holder. */ - @JsonProperty("exemption_type") @ExcludeMissing fun _exemptionType() = exemptionType + fun token(): Optional = Optional.ofNullable(token.getNullable("token")) /** * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be @@ -197,24 +155,17 @@ private constructor( * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and * "website_url" attributes will be present. */ - @JsonProperty("user_type") @ExcludeMissing fun _userType() = userType + fun userType(): Optional = Optional.ofNullable(userType.getNullable("user_type")) /** Information about the most recent identity verification attempt */ - @JsonProperty("verification_application") - @ExcludeMissing - fun _verificationApplication() = verificationApplication + fun verificationApplication(): Optional = + Optional.ofNullable(verificationApplication.getNullable("verification_application")) - /** - * Only present when user_type == "INDIVIDUAL". Information about the individual for which the - * account is being opened and KYC is being run. - */ - @JsonProperty("individual") @ExcludeMissing fun _individual() = individual + /** Only present when user_type == "BUSINESS". Business's primary website. */ + fun websiteUrl(): Optional = Optional.ofNullable(websiteUrl.getNullable("website_url")) - /** - * Only present when user_type == "BUSINESS". Information about the business for which the - * account is being opened and KYB is being run. - */ - @JsonProperty("business_entity") @ExcludeMissing fun _businessEntity() = businessEntity + /** Globally unique identifier for the account. */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken /** * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the @@ -232,6 +183,21 @@ private constructor( @ExcludeMissing fun _beneficialOwnerIndividuals() = beneficialOwnerIndividuals + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + @JsonProperty("business_account_token") + @ExcludeMissing + fun _businessAccountToken() = businessAccountToken + + /** + * Only present when user_type == "BUSINESS". Information about the business for which the + * account is being opened and KYB is being run. + */ + @JsonProperty("business_entity") @ExcludeMissing fun _businessEntity() = businessEntity + /** * Only present when user_type == "BUSINESS". An individual with significant responsibility for * managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer, Chief @@ -242,11 +208,8 @@ private constructor( */ @JsonProperty("control_person") @ExcludeMissing fun _controlPerson() = controlPerson - /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ - @JsonProperty("nature_of_business") @ExcludeMissing fun _natureOfBusiness() = natureOfBusiness - - /** Only present when user_type == "BUSINESS". Business's primary website. */ - @JsonProperty("website_url") @ExcludeMissing fun _websiteUrl() = websiteUrl + /** Timestamp of when the account holder was created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use @@ -256,6 +219,24 @@ private constructor( */ @JsonProperty("email") @ExcludeMissing fun _email() = email + /** The type of KYC exemption for a KYC-Exempt Account Holder. */ + @JsonProperty("exemption_type") @ExcludeMissing fun _exemptionType() = exemptionType + + /** + * Customer-provided token that indicates a relationship with an object outside of the Lithic + * ecosystem. + */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId + + /** + * Only present when user_type == "INDIVIDUAL". Information about the individual for which the + * account is being opened and KYC is being run. + */ + @JsonProperty("individual") @ExcludeMissing fun _individual() = individual + + /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ + @JsonProperty("nature_of_business") @ExcludeMissing fun _natureOfBusiness() = natureOfBusiness + /** * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -276,31 +257,50 @@ private constructor( */ @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons + /** Globally unique identifier for the account holder. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** + * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be + * present. If the type is "BUSINESS" then the "business_entity", "control_person", + * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and + * "website_url" attributes will be present. + */ + @JsonProperty("user_type") @ExcludeMissing fun _userType() = userType + + /** Information about the most recent identity verification attempt */ + @JsonProperty("verification_application") + @ExcludeMissing + fun _verificationApplication() = verificationApplication + + /** Only present when user_type == "BUSINESS". Business's primary website. */ + @JsonProperty("website_url") @ExcludeMissing fun _websiteUrl() = websiteUrl + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AccountHolder = apply { if (!validated) { - token() accountToken() + beneficialOwnerEntities().map { it.forEach { it.validate() } } + beneficialOwnerIndividuals().map { it.forEach { it.validate() } } businessAccountToken() + businessEntity().map { it.validate() } + controlPerson().map { it.validate() } created() - externalId() + email() exemptionType() - userType() - verificationApplication().map { it.validate() } + externalId() individual().map { it.validate() } - businessEntity().map { it.validate() } - beneficialOwnerEntities().map { it.forEach { it.validate() } } - beneficialOwnerIndividuals().map { it.forEach { it.validate() } } - controlPerson().map { it.validate() } natureOfBusiness() - websiteUrl() - email() phoneNumber() status() statusReasons() + token() + userType() + verificationApplication().map { it.validate() } + websiteUrl() validated = true } } @@ -313,25 +313,25 @@ private constructor( } return other is AccountHolder && - this.token == other.token && this.accountToken == other.accountToken && + this.beneficialOwnerEntities == other.beneficialOwnerEntities && + this.beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && this.businessAccountToken == other.businessAccountToken && + this.businessEntity == other.businessEntity && + this.controlPerson == other.controlPerson && this.created == other.created && - this.externalId == other.externalId && + this.email == other.email && this.exemptionType == other.exemptionType && - this.userType == other.userType && - this.verificationApplication == other.verificationApplication && + this.externalId == other.externalId && this.individual == other.individual && - this.businessEntity == other.businessEntity && - this.beneficialOwnerEntities == other.beneficialOwnerEntities && - this.beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && - this.controlPerson == other.controlPerson && this.natureOfBusiness == other.natureOfBusiness && - this.websiteUrl == other.websiteUrl && - this.email == other.email && this.phoneNumber == other.phoneNumber && this.status == other.status && this.statusReasons == other.statusReasons && + this.token == other.token && + this.userType == other.userType && + this.verificationApplication == other.verificationApplication && + this.websiteUrl == other.websiteUrl && this.additionalProperties == other.additionalProperties } @@ -339,25 +339,25 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, accountToken, + beneficialOwnerEntities, + beneficialOwnerIndividuals, businessAccountToken, + businessEntity, + controlPerson, created, - externalId, + email, exemptionType, - userType, - verificationApplication, + externalId, individual, - businessEntity, - beneficialOwnerEntities, - beneficialOwnerIndividuals, - controlPerson, natureOfBusiness, - websiteUrl, - email, phoneNumber, status, statusReasons, + token, + userType, + verificationApplication, + websiteUrl, additionalProperties, ) } @@ -365,7 +365,7 @@ private constructor( } override fun toString() = - "AccountHolder{token=$token, accountToken=$accountToken, businessAccountToken=$businessAccountToken, created=$created, externalId=$externalId, exemptionType=$exemptionType, userType=$userType, verificationApplication=$verificationApplication, individual=$individual, businessEntity=$businessEntity, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, natureOfBusiness=$natureOfBusiness, websiteUrl=$websiteUrl, email=$email, phoneNumber=$phoneNumber, status=$status, statusReasons=$statusReasons, additionalProperties=$additionalProperties}" + "AccountHolder{accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, status=$status, statusReasons=$statusReasons, token=$token, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}" companion object { @@ -374,61 +374,53 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var businessAccountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() - private var externalId: JsonField = JsonMissing.of() - private var exemptionType: JsonField = JsonMissing.of() - private var userType: JsonField = JsonMissing.of() - private var verificationApplication: JsonField = - JsonMissing.of() - private var individual: JsonField = JsonMissing.of() - private var businessEntity: JsonField = JsonMissing.of() private var beneficialOwnerEntities: JsonField> = JsonMissing.of() private var beneficialOwnerIndividuals: JsonField> = JsonMissing.of() + private var businessAccountToken: JsonField = JsonMissing.of() + private var businessEntity: JsonField = JsonMissing.of() private var controlPerson: JsonField = JsonMissing.of() - private var natureOfBusiness: JsonField = JsonMissing.of() - private var websiteUrl: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() + private var exemptionType: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() + private var individual: JsonField = JsonMissing.of() + private var natureOfBusiness: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var userType: JsonField = JsonMissing.of() + private var verificationApplication: JsonField = + JsonMissing.of() + private var websiteUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountHolder: AccountHolder) = apply { - this.token = accountHolder.token this.accountToken = accountHolder.accountToken + this.beneficialOwnerEntities = accountHolder.beneficialOwnerEntities + this.beneficialOwnerIndividuals = accountHolder.beneficialOwnerIndividuals this.businessAccountToken = accountHolder.businessAccountToken + this.businessEntity = accountHolder.businessEntity + this.controlPerson = accountHolder.controlPerson this.created = accountHolder.created - this.externalId = accountHolder.externalId + this.email = accountHolder.email this.exemptionType = accountHolder.exemptionType - this.userType = accountHolder.userType - this.verificationApplication = accountHolder.verificationApplication + this.externalId = accountHolder.externalId this.individual = accountHolder.individual - this.businessEntity = accountHolder.businessEntity - this.beneficialOwnerEntities = accountHolder.beneficialOwnerEntities - this.beneficialOwnerIndividuals = accountHolder.beneficialOwnerIndividuals - this.controlPerson = accountHolder.controlPerson this.natureOfBusiness = accountHolder.natureOfBusiness - this.websiteUrl = accountHolder.websiteUrl - this.email = accountHolder.email this.phoneNumber = accountHolder.phoneNumber this.status = accountHolder.status this.statusReasons = accountHolder.statusReasons + this.token = accountHolder.token + this.userType = accountHolder.userType + this.verificationApplication = accountHolder.verificationApplication + this.websiteUrl = accountHolder.websiteUrl additionalProperties(accountHolder.additionalProperties) } - /** Globally unique identifier for the account holder. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the account holder. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier for the account. */ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) @@ -440,154 +432,76 @@ private constructor( } /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - fun businessAccountToken(businessAccountToken: String) = - businessAccountToken(JsonField.of(businessAccountToken)) - - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - @JsonProperty("business_account_token") - @ExcludeMissing - fun businessAccountToken(businessAccountToken: JsonField) = apply { - this.businessAccountToken = businessAccountToken - } - - /** Timestamp of when the account holder was created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Timestamp of when the account holder was created. */ - @JsonProperty("created") - @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } - - /** - * Customer-provided token that indicates a relationship with an object outside of the - * Lithic ecosystem. - */ - fun externalId(externalId: String) = externalId(JsonField.of(externalId)) - - /** - * Customer-provided token that indicates a relationship with an object outside of the - * Lithic ecosystem. - */ - @JsonProperty("external_id") - @ExcludeMissing - fun externalId(externalId: JsonField) = apply { this.externalId = externalId } - - /** The type of KYC exemption for a KYC-Exempt Account Holder. */ - fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType)) - - /** The type of KYC exemption for a KYC-Exempt Account Holder. */ - @JsonProperty("exemption_type") - @ExcludeMissing - fun exemptionType(exemptionType: JsonField) = apply { - this.exemptionType = exemptionType - } - - /** - * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will - * be present. If the type is "BUSINESS" then the "business_entity", "control_person", - * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and - * "website_url" attributes will be present. - */ - fun userType(userType: UserType) = userType(JsonField.of(userType)) - - /** - * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will - * be present. If the type is "BUSINESS" then the "business_entity", "control_person", - * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and - * "website_url" attributes will be present. - */ - @JsonProperty("user_type") - @ExcludeMissing - fun userType(userType: JsonField) = apply { this.userType = userType } - - /** Information about the most recent identity verification attempt */ - fun verificationApplication(verificationApplication: AccountHolderVerificationApplication) = - verificationApplication(JsonField.of(verificationApplication)) - - /** Information about the most recent identity verification attempt */ - @JsonProperty("verification_application") - @ExcludeMissing - fun verificationApplication( - verificationApplication: JsonField - ) = apply { this.verificationApplication = verificationApplication } - - /** - * Only present when user_type == "INDIVIDUAL". Information about the individual for which - * the account is being opened and KYC is being run. + * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in + * the company. */ - fun individual(individual: AccountHolderIndividualResponse) = - individual(JsonField.of(individual)) + fun beneficialOwnerEntities(beneficialOwnerEntities: List) = + beneficialOwnerEntities(JsonField.of(beneficialOwnerEntities)) /** - * Only present when user_type == "INDIVIDUAL". Information about the individual for which - * the account is being opened and KYC is being run. + * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in + * the company. */ - @JsonProperty("individual") + @JsonProperty("beneficial_owner_entities") @ExcludeMissing - fun individual(individual: JsonField) = apply { - this.individual = individual - } + fun beneficialOwnerEntities(beneficialOwnerEntities: JsonField>) = + apply { + this.beneficialOwnerEntities = beneficialOwnerEntities + } /** - * Only present when user_type == "BUSINESS". Information about the business for which the - * account is being opened and KYB is being run. + * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in + * the company. */ - fun businessEntity(businessEntity: BusinessEntity) = - businessEntity(JsonField.of(businessEntity)) + fun beneficialOwnerIndividuals( + beneficialOwnerIndividuals: List + ) = beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) /** - * Only present when user_type == "BUSINESS". Information about the business for which the - * account is being opened and KYB is being run. + * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in + * the company. */ - @JsonProperty("business_entity") + @JsonProperty("beneficial_owner_individuals") @ExcludeMissing - fun businessEntity(businessEntity: JsonField) = apply { - this.businessEntity = businessEntity - } + fun beneficialOwnerIndividuals( + beneficialOwnerIndividuals: JsonField> + ) = apply { this.beneficialOwnerIndividuals = beneficialOwnerIndividuals } /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in - * the company. + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. */ - fun beneficialOwnerEntities(beneficialOwnerEntities: List) = - beneficialOwnerEntities(JsonField.of(beneficialOwnerEntities)) + fun businessAccountToken(businessAccountToken: String) = + businessAccountToken(JsonField.of(businessAccountToken)) /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in - * the company. + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. */ - @JsonProperty("beneficial_owner_entities") - @ExcludeMissing - fun beneficialOwnerEntities(beneficialOwnerEntities: JsonField>) = - apply { - this.beneficialOwnerEntities = beneficialOwnerEntities - } + @JsonProperty("business_account_token") + @ExcludeMissing + fun businessAccountToken(businessAccountToken: JsonField) = apply { + this.businessAccountToken = businessAccountToken + } /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in - * the company. + * Only present when user_type == "BUSINESS". Information about the business for which the + * account is being opened and KYB is being run. */ - fun beneficialOwnerIndividuals( - beneficialOwnerIndividuals: List - ) = beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) + fun businessEntity(businessEntity: BusinessEntity) = + businessEntity(JsonField.of(businessEntity)) /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in - * the company. + * Only present when user_type == "BUSINESS". Information about the business for which the + * account is being opened and KYB is being run. */ - @JsonProperty("beneficial_owner_individuals") + @JsonProperty("business_entity") @ExcludeMissing - fun beneficialOwnerIndividuals( - beneficialOwnerIndividuals: JsonField> - ) = apply { this.beneficialOwnerIndividuals = beneficialOwnerIndividuals } + fun businessEntity(businessEntity: JsonField) = apply { + this.businessEntity = businessEntity + } /** * Only present when user_type == "BUSINESS". An individual with significant responsibility @@ -614,28 +528,13 @@ private constructor( this.controlPerson = controlPerson } - /** - * Only present when user_type == "BUSINESS". User-submitted description of the business. - */ - fun natureOfBusiness(natureOfBusiness: String) = - natureOfBusiness(JsonField.of(natureOfBusiness)) - - /** - * Only present when user_type == "BUSINESS". User-submitted description of the business. - */ - @JsonProperty("nature_of_business") - @ExcludeMissing - fun natureOfBusiness(natureOfBusiness: JsonField) = apply { - this.natureOfBusiness = natureOfBusiness - } - - /** Only present when user_type == "BUSINESS". Business's primary website. */ - fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) + /** Timestamp of when the account holder was created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Only present when user_type == "BUSINESS". Business's primary website. */ - @JsonProperty("website_url") + /** Timestamp of when the account holder was created. */ + @JsonProperty("created") @ExcludeMissing - fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } + fun created(created: JsonField) = apply { this.created = created } /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use @@ -655,6 +554,62 @@ private constructor( @ExcludeMissing fun email(email: JsonField) = apply { this.email = email } + /** The type of KYC exemption for a KYC-Exempt Account Holder. */ + fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType)) + + /** The type of KYC exemption for a KYC-Exempt Account Holder. */ + @JsonProperty("exemption_type") + @ExcludeMissing + fun exemptionType(exemptionType: JsonField) = apply { + this.exemptionType = exemptionType + } + + /** + * Customer-provided token that indicates a relationship with an object outside of the + * Lithic ecosystem. + */ + fun externalId(externalId: String) = externalId(JsonField.of(externalId)) + + /** + * Customer-provided token that indicates a relationship with an object outside of the + * Lithic ecosystem. + */ + @JsonProperty("external_id") + @ExcludeMissing + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + + /** + * Only present when user_type == "INDIVIDUAL". Information about the individual for which + * the account is being opened and KYC is being run. + */ + fun individual(individual: AccountHolderIndividualResponse) = + individual(JsonField.of(individual)) + + /** + * Only present when user_type == "INDIVIDUAL". Information about the individual for which + * the account is being opened and KYC is being run. + */ + @JsonProperty("individual") + @ExcludeMissing + fun individual(individual: JsonField) = apply { + this.individual = individual + } + + /** + * Only present when user_type == "BUSINESS". User-submitted description of the business. + */ + fun natureOfBusiness(natureOfBusiness: String) = + natureOfBusiness(JsonField.of(natureOfBusiness)) + + /** + * Only present when user_type == "BUSINESS". User-submitted description of the business. + */ + @JsonProperty("nature_of_business") + @ExcludeMissing + fun natureOfBusiness(natureOfBusiness: JsonField) = apply { + this.natureOfBusiness = natureOfBusiness + } + /** * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -706,6 +661,51 @@ private constructor( this.statusReasons = statusReasons } + /** Globally unique identifier for the account holder. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the account holder. */ + @JsonProperty("token") + @ExcludeMissing + fun token(token: JsonField) = apply { this.token = token } + + /** + * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will + * be present. If the type is "BUSINESS" then the "business_entity", "control_person", + * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and + * "website_url" attributes will be present. + */ + fun userType(userType: UserType) = userType(JsonField.of(userType)) + + /** + * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will + * be present. If the type is "BUSINESS" then the "business_entity", "control_person", + * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and + * "website_url" attributes will be present. + */ + @JsonProperty("user_type") + @ExcludeMissing + fun userType(userType: JsonField) = apply { this.userType = userType } + + /** Information about the most recent identity verification attempt */ + fun verificationApplication(verificationApplication: AccountHolderVerificationApplication) = + verificationApplication(JsonField.of(verificationApplication)) + + /** Information about the most recent identity verification attempt */ + @JsonProperty("verification_application") + @ExcludeMissing + fun verificationApplication( + verificationApplication: JsonField + ) = apply { this.verificationApplication = verificationApplication } + + /** Only present when user_type == "BUSINESS". Business's primary website. */ + fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) + + /** Only present when user_type == "BUSINESS". Business's primary website. */ + @JsonProperty("website_url") + @ExcludeMissing + fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -722,25 +722,25 @@ private constructor( fun build(): AccountHolder = AccountHolder( - token, accountToken, + beneficialOwnerEntities.map { it.toUnmodifiable() }, + beneficialOwnerIndividuals.map { it.toUnmodifiable() }, businessAccountToken, + businessEntity, + controlPerson, created, - externalId, + email, exemptionType, - userType, - verificationApplication, + externalId, individual, - businessEntity, - beneficialOwnerEntities.map { it.toUnmodifiable() }, - beneficialOwnerIndividuals.map { it.toUnmodifiable() }, - controlPerson, natureOfBusiness, - websiteUrl, - email, phoneNumber, status, statusReasons.map { it.toUnmodifiable() }, + token, + userType, + verificationApplication, + websiteUrl, additionalProperties.toUnmodifiable(), ) } @@ -1298,45 +1298,45 @@ private constructor( @JvmField val ACCEPTED = Status(JsonField.of("ACCEPTED")) - @JvmField val REJECTED = Status(JsonField.of("REJECTED")) + @JvmField val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) @JvmField val PENDING_RESUBMIT = Status(JsonField.of("PENDING_RESUBMIT")) - @JvmField val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) + @JvmField val REJECTED = Status(JsonField.of("REJECTED")) @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } enum class Known { ACCEPTED, - REJECTED, - PENDING_RESUBMIT, PENDING_DOCUMENT, + PENDING_RESUBMIT, + REJECTED, } enum class Value { ACCEPTED, - REJECTED, - PENDING_RESUBMIT, PENDING_DOCUMENT, + PENDING_RESUBMIT, + REJECTED, _UNKNOWN, } fun value(): Value = when (this) { ACCEPTED -> Value.ACCEPTED - REJECTED -> Value.REJECTED - PENDING_RESUBMIT -> Value.PENDING_RESUBMIT PENDING_DOCUMENT -> Value.PENDING_DOCUMENT + PENDING_RESUBMIT -> Value.PENDING_RESUBMIT + REJECTED -> Value.REJECTED else -> Value._UNKNOWN } fun known(): Known = when (this) { ACCEPTED -> Known.ACCEPTED - REJECTED -> Known.REJECTED - PENDING_RESUBMIT -> Known.PENDING_RESUBMIT PENDING_DOCUMENT -> Known.PENDING_DOCUMENT + PENDING_RESUBMIT -> Known.PENDING_RESUBMIT + REJECTED -> Known.REJECTED else -> throw LithicInvalidDataException("Unknown Status: $value") } @@ -1531,9 +1531,9 @@ private constructor( class AccountHolderVerificationApplication private constructor( private val created: JsonField, - private val updated: JsonField, private val status: JsonField, private val statusReasons: JsonField>, + private val updated: JsonField, private val additionalProperties: Map, ) { @@ -1545,10 +1545,6 @@ private constructor( fun created(): Optional = Optional.ofNullable(created.getNullable("created")) - /** Timestamp of when the application was last updated. */ - fun updated(): Optional = - Optional.ofNullable(updated.getNullable("updated")) - /** * KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only * applicable for the `ADVANCED` workflow. @@ -1559,12 +1555,13 @@ private constructor( fun statusReasons(): Optional> = Optional.ofNullable(statusReasons.getNullable("status_reasons")) + /** Timestamp of when the application was last updated. */ + fun updated(): Optional = + Optional.ofNullable(updated.getNullable("updated")) + /** Timestamp of when the application was created. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Timestamp of when the application was last updated. */ - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - /** * KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only * applicable for the `ADVANCED` workflow. @@ -1574,6 +1571,9 @@ private constructor( /** Reason for the evaluation status. */ @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons + /** Timestamp of when the application was last updated. */ + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1581,9 +1581,9 @@ private constructor( fun validate(): AccountHolderVerificationApplication = apply { if (!validated) { created() - updated() status() statusReasons() + updated() validated = true } } @@ -1597,9 +1597,9 @@ private constructor( return other is AccountHolderVerificationApplication && this.created == other.created && - this.updated == other.updated && this.status == other.status && this.statusReasons == other.statusReasons && + this.updated == other.updated && this.additionalProperties == other.additionalProperties } @@ -1608,9 +1608,9 @@ private constructor( hashCode = Objects.hash( created, - updated, status, statusReasons, + updated, additionalProperties, ) } @@ -1618,7 +1618,7 @@ private constructor( } override fun toString() = - "AccountHolderVerificationApplication{created=$created, updated=$updated, status=$status, statusReasons=$statusReasons, additionalProperties=$additionalProperties}" + "AccountHolderVerificationApplication{created=$created, status=$status, statusReasons=$statusReasons, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -1628,9 +1628,9 @@ private constructor( class Builder { private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() + private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1638,9 +1638,9 @@ private constructor( accountHolderVerificationApplication: AccountHolderVerificationApplication ) = apply { this.created = accountHolderVerificationApplication.created - this.updated = accountHolderVerificationApplication.updated this.status = accountHolderVerificationApplication.status this.statusReasons = accountHolderVerificationApplication.statusReasons + this.updated = accountHolderVerificationApplication.updated additionalProperties(accountHolderVerificationApplication.additionalProperties) } @@ -1652,14 +1652,6 @@ private constructor( @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } - /** Timestamp of when the application was last updated. */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - - /** Timestamp of when the application was last updated. */ - @JsonProperty("updated") - @ExcludeMissing - fun updated(updated: JsonField) = apply { this.updated = updated } - /** * KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are * only applicable for the `ADVANCED` workflow. @@ -1685,6 +1677,14 @@ private constructor( this.statusReasons = statusReasons } + /** Timestamp of when the application was last updated. */ + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + + /** Timestamp of when the application was last updated. */ + @JsonProperty("updated") + @ExcludeMissing + fun updated(updated: JsonField) = apply { this.updated = updated } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -1702,9 +1702,9 @@ private constructor( fun build(): AccountHolderVerificationApplication = AccountHolderVerificationApplication( created, - updated, status, statusReasons.map { it.toUnmodifiable() }, + updated, additionalProperties.toUnmodifiable(), ) } @@ -1733,45 +1733,45 @@ private constructor( @JvmField val ACCEPTED = Status(JsonField.of("ACCEPTED")) - @JvmField val REJECTED = Status(JsonField.of("REJECTED")) + @JvmField val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) @JvmField val PENDING_RESUBMIT = Status(JsonField.of("PENDING_RESUBMIT")) - @JvmField val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) + @JvmField val REJECTED = Status(JsonField.of("REJECTED")) @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } enum class Known { ACCEPTED, - REJECTED, - PENDING_RESUBMIT, PENDING_DOCUMENT, + PENDING_RESUBMIT, + REJECTED, } enum class Value { ACCEPTED, - REJECTED, - PENDING_RESUBMIT, PENDING_DOCUMENT, + PENDING_RESUBMIT, + REJECTED, _UNKNOWN, } fun value(): Value = when (this) { ACCEPTED -> Value.ACCEPTED - REJECTED -> Value.REJECTED - PENDING_RESUBMIT -> Value.PENDING_RESUBMIT PENDING_DOCUMENT -> Value.PENDING_DOCUMENT + PENDING_RESUBMIT -> Value.PENDING_RESUBMIT + REJECTED -> Value.REJECTED else -> Value._UNKNOWN } fun known(): Known = when (this) { ACCEPTED -> Known.ACCEPTED - REJECTED -> Known.REJECTED - PENDING_RESUBMIT -> Known.PENDING_RESUBMIT PENDING_DOCUMENT -> Known.PENDING_DOCUMENT + PENDING_RESUBMIT -> Known.PENDING_RESUBMIT + REJECTED -> Known.REJECTED else -> throw LithicInvalidDataException("Unknown Status: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt index 53274c18..382da7a0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt @@ -19,10 +19,10 @@ import java.util.Optional @NoAutoDetect class AccountHolderUpdateResponse private constructor( - private val token: JsonField, + private val businessAccountToken: JsonField, private val email: JsonField, private val phoneNumber: JsonField, - private val businessAccountToken: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -30,16 +30,6 @@ private constructor( private var hashCode: Int = 0 - /** The token for the account holder that was updated */ - fun token(): Optional = Optional.ofNullable(token.getNullable("token")) - - /** The newly updated email for the account holder */ - fun email(): Optional = Optional.ofNullable(email.getNullable("email")) - - /** The newly updated phone_number for the account holder */ - fun phoneNumber(): Optional = - Optional.ofNullable(phoneNumber.getNullable("phone_number")) - /** * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with * authorized users. Pass the account_token of the enrolled business associated with the @@ -48,14 +38,15 @@ private constructor( fun businessAccountToken(): Optional = Optional.ofNullable(businessAccountToken.getNullable("business_account_token")) - /** The token for the account holder that was updated */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** The newly updated email for the account holder */ - @JsonProperty("email") @ExcludeMissing fun _email() = email + fun email(): Optional = Optional.ofNullable(email.getNullable("email")) /** The newly updated phone_number for the account holder */ - @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + fun phoneNumber(): Optional = + Optional.ofNullable(phoneNumber.getNullable("phone_number")) + + /** The token for the account holder that was updated */ + fun token(): Optional = Optional.ofNullable(token.getNullable("token")) /** * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with @@ -66,16 +57,25 @@ private constructor( @ExcludeMissing fun _businessAccountToken() = businessAccountToken + /** The newly updated email for the account holder */ + @JsonProperty("email") @ExcludeMissing fun _email() = email + + /** The newly updated phone_number for the account holder */ + @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + + /** The token for the account holder that was updated */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AccountHolderUpdateResponse = apply { if (!validated) { - token() + businessAccountToken() email() phoneNumber() - businessAccountToken() + token() validated = true } } @@ -88,10 +88,10 @@ private constructor( } return other is AccountHolderUpdateResponse && - this.token == other.token && + this.businessAccountToken == other.businessAccountToken && this.email == other.email && this.phoneNumber == other.phoneNumber && - this.businessAccountToken == other.businessAccountToken && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -99,10 +99,10 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, + businessAccountToken, email, phoneNumber, - businessAccountToken, + token, additionalProperties, ) } @@ -110,7 +110,7 @@ private constructor( } override fun toString() = - "AccountHolderUpdateResponse{token=$token, email=$email, phoneNumber=$phoneNumber, businessAccountToken=$businessAccountToken, additionalProperties=$additionalProperties}" + "AccountHolderUpdateResponse{businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -119,28 +119,39 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() + private var businessAccountToken: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() - private var businessAccountToken: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountHolderUpdateResponse: AccountHolderUpdateResponse) = apply { - this.token = accountHolderUpdateResponse.token + this.businessAccountToken = accountHolderUpdateResponse.businessAccountToken this.email = accountHolderUpdateResponse.email this.phoneNumber = accountHolderUpdateResponse.phoneNumber - this.businessAccountToken = accountHolderUpdateResponse.businessAccountToken + this.token = accountHolderUpdateResponse.token additionalProperties(accountHolderUpdateResponse.additionalProperties) } - /** The token for the account holder that was updated */ - fun token(token: String) = token(JsonField.of(token)) + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with + * authorized users. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + fun businessAccountToken(businessAccountToken: String) = + businessAccountToken(JsonField.of(businessAccountToken)) - /** The token for the account holder that was updated */ - @JsonProperty("token") + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with + * authorized users. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + @JsonProperty("business_account_token") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun businessAccountToken(businessAccountToken: JsonField) = apply { + this.businessAccountToken = businessAccountToken + } /** The newly updated email for the account holder */ fun email(email: String) = email(JsonField.of(email)) @@ -158,24 +169,13 @@ private constructor( @ExcludeMissing fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with - * authorized users. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - fun businessAccountToken(businessAccountToken: String) = - businessAccountToken(JsonField.of(businessAccountToken)) + /** The token for the account holder that was updated */ + fun token(token: String) = token(JsonField.of(token)) - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with - * authorized users. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - @JsonProperty("business_account_token") + /** The token for the account holder that was updated */ + @JsonProperty("token") @ExcludeMissing - fun businessAccountToken(businessAccountToken: JsonField) = apply { - this.businessAccountToken = businessAccountToken - } + fun token(token: JsonField) = apply { this.token = token } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -193,10 +193,10 @@ private constructor( fun build(): AccountHolderUpdateResponse = AccountHolderUpdateResponse( - token, + businessAccountToken, email, phoneNumber, - businessAccountToken, + token, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt index 9ee6671e..604e6ff3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountSpendLimits.kt @@ -19,7 +19,6 @@ import java.util.Optional @NoAutoDetect class AccountSpendLimits private constructor( - private val required: JsonValue, private val availableSpendLimit: JsonField, private val additionalProperties: Map, ) { @@ -28,10 +27,8 @@ private constructor( private var hashCode: Int = 0 - fun availableSpendLimit(): Optional = - Optional.ofNullable(availableSpendLimit.getNullable("available_spend_limit")) - - @JsonProperty("required") @ExcludeMissing fun _required() = required + fun availableSpendLimit(): AvailableSpendLimit = + availableSpendLimit.getRequired("available_spend_limit") @JsonProperty("available_spend_limit") @ExcludeMissing @@ -43,7 +40,7 @@ private constructor( fun validate(): AccountSpendLimits = apply { if (!validated) { - availableSpendLimit().map { it.validate() } + availableSpendLimit().validate() validated = true } } @@ -56,25 +53,19 @@ private constructor( } return other is AccountSpendLimits && - this.required == other.required && this.availableSpendLimit == other.availableSpendLimit && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { - hashCode = - Objects.hash( - required, - availableSpendLimit, - additionalProperties, - ) + hashCode = Objects.hash(availableSpendLimit, additionalProperties) } return hashCode } override fun toString() = - "AccountSpendLimits{required=$required, availableSpendLimit=$availableSpendLimit, additionalProperties=$additionalProperties}" + "AccountSpendLimits{availableSpendLimit=$availableSpendLimit, additionalProperties=$additionalProperties}" companion object { @@ -83,21 +74,15 @@ private constructor( class Builder { - private var required: JsonValue = JsonMissing.of() private var availableSpendLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(accountSpendLimits: AccountSpendLimits) = apply { - this.required = accountSpendLimits.required this.availableSpendLimit = accountSpendLimits.availableSpendLimit additionalProperties(accountSpendLimits.additionalProperties) } - @JsonProperty("required") - @ExcludeMissing - fun required(required: JsonValue) = apply { this.required = required } - fun availableSpendLimit(availableSpendLimit: AvailableSpendLimit) = availableSpendLimit(JsonField.of(availableSpendLimit)) @@ -122,11 +107,7 @@ private constructor( } fun build(): AccountSpendLimits = - AccountSpendLimits( - required, - availableSpendLimit, - additionalProperties.toUnmodifiable(), - ) + AccountSpendLimits(availableSpendLimit, additionalProperties.toUnmodifiable()) } @JsonDeserialize(builder = AvailableSpendLimit.Builder::class) @@ -134,8 +115,8 @@ private constructor( class AvailableSpendLimit private constructor( private val daily: JsonField, - private val monthly: JsonField, private val lifetime: JsonField, + private val monthly: JsonField, private val additionalProperties: Map, ) { @@ -146,21 +127,21 @@ private constructor( /** The available spend limit relative to the daily limit configured on the Account. */ fun daily(): Optional = Optional.ofNullable(daily.getNullable("daily")) - /** The available spend limit relative to the monthly limit configured on the Account. */ - fun monthly(): Optional = Optional.ofNullable(monthly.getNullable("monthly")) - /** The available spend limit relative to the lifetime limit configured on the Account. */ fun lifetime(): Optional = Optional.ofNullable(lifetime.getNullable("lifetime")) + /** The available spend limit relative to the monthly limit configured on the Account. */ + fun monthly(): Optional = Optional.ofNullable(monthly.getNullable("monthly")) + /** The available spend limit relative to the daily limit configured on the Account. */ @JsonProperty("daily") @ExcludeMissing fun _daily() = daily - /** The available spend limit relative to the monthly limit configured on the Account. */ - @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly - /** The available spend limit relative to the lifetime limit configured on the Account. */ @JsonProperty("lifetime") @ExcludeMissing fun _lifetime() = lifetime + /** The available spend limit relative to the monthly limit configured on the Account. */ + @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -168,8 +149,8 @@ private constructor( fun validate(): AvailableSpendLimit = apply { if (!validated) { daily() - monthly() lifetime() + monthly() validated = true } } @@ -183,8 +164,8 @@ private constructor( return other is AvailableSpendLimit && this.daily == other.daily && - this.monthly == other.monthly && this.lifetime == other.lifetime && + this.monthly == other.monthly && this.additionalProperties == other.additionalProperties } @@ -193,8 +174,8 @@ private constructor( hashCode = Objects.hash( daily, - monthly, lifetime, + monthly, additionalProperties, ) } @@ -202,7 +183,7 @@ private constructor( } override fun toString() = - "AvailableSpendLimit{daily=$daily, monthly=$monthly, lifetime=$lifetime, additionalProperties=$additionalProperties}" + "AvailableSpendLimit{daily=$daily, lifetime=$lifetime, monthly=$monthly, additionalProperties=$additionalProperties}" companion object { @@ -212,15 +193,15 @@ private constructor( class Builder { private var daily: JsonField = JsonMissing.of() - private var monthly: JsonField = JsonMissing.of() private var lifetime: JsonField = JsonMissing.of() + private var monthly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(availableSpendLimit: AvailableSpendLimit) = apply { this.daily = availableSpendLimit.daily - this.monthly = availableSpendLimit.monthly this.lifetime = availableSpendLimit.lifetime + this.monthly = availableSpendLimit.monthly additionalProperties(availableSpendLimit.additionalProperties) } @@ -233,28 +214,28 @@ private constructor( fun daily(daily: JsonField) = apply { this.daily = daily } /** - * The available spend limit relative to the monthly limit configured on the Account. + * The available spend limit relative to the lifetime limit configured on the Account. */ - fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) + fun lifetime(lifetime: Long) = lifetime(JsonField.of(lifetime)) /** - * The available spend limit relative to the monthly limit configured on the Account. + * The available spend limit relative to the lifetime limit configured on the Account. */ - @JsonProperty("monthly") + @JsonProperty("lifetime") @ExcludeMissing - fun monthly(monthly: JsonField) = apply { this.monthly = monthly } + fun lifetime(lifetime: JsonField) = apply { this.lifetime = lifetime } /** - * The available spend limit relative to the lifetime limit configured on the Account. + * The available spend limit relative to the monthly limit configured on the Account. */ - fun lifetime(lifetime: Long) = lifetime(JsonField.of(lifetime)) + fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) /** - * The available spend limit relative to the lifetime limit configured on the Account. + * The available spend limit relative to the monthly limit configured on the Account. */ - @JsonProperty("lifetime") + @JsonProperty("monthly") @ExcludeMissing - fun lifetime(lifetime: JsonField) = apply { this.lifetime = lifetime } + fun monthly(monthly: JsonField) = apply { this.monthly = monthly } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -273,8 +254,8 @@ private constructor( fun build(): AvailableSpendLimit = AvailableSpendLimit( daily, - monthly, lifetime, + monthly, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt index 102e8709..b597dc6c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt @@ -493,9 +493,9 @@ constructor( private val address1: String?, private val address2: String?, private val city: String?, - private val state: String?, - private val postalCode: String?, private val country: String?, + private val postalCode: String?, + private val state: String?, private val additionalProperties: Map, ) { @@ -507,11 +507,11 @@ constructor( @JsonProperty("city") fun city(): String? = city - @JsonProperty("state") fun state(): String? = state + @JsonProperty("country") fun country(): String? = country @JsonProperty("postal_code") fun postalCode(): String? = postalCode - @JsonProperty("country") fun country(): String? = country + @JsonProperty("state") fun state(): String? = state @JsonAnyGetter @ExcludeMissing @@ -528,9 +528,9 @@ 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 } @@ -541,9 +541,9 @@ constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties, ) } @@ -551,7 +551,7 @@ constructor( } override fun toString() = - "VerificationAddress{address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "VerificationAddress{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" companion object { @@ -563,9 +563,9 @@ constructor( private var address1: String? = null private var address2: String? = null private var city: String? = null - private var state: String? = null - private var postalCode: String? = null private var country: String? = null + private var postalCode: String? = null + private var state: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -573,9 +573,9 @@ constructor( this.address1 = verificationAddress.address1 this.address2 = verificationAddress.address2 this.city = verificationAddress.city - this.state = verificationAddress.state - this.postalCode = verificationAddress.postalCode this.country = verificationAddress.country + this.postalCode = verificationAddress.postalCode + this.state = verificationAddress.state additionalProperties(verificationAddress.additionalProperties) } @@ -587,12 +587,12 @@ constructor( @JsonProperty("city") fun city(city: String) = apply { this.city = city } - @JsonProperty("state") fun state(state: String) = apply { this.state = state } + @JsonProperty("country") fun country(country: String) = apply { this.country = country } @JsonProperty("postal_code") fun postalCode(postalCode: String) = apply { this.postalCode = postalCode } - @JsonProperty("country") fun country(country: String) = apply { this.country = country } + @JsonProperty("state") fun state(state: String) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -613,9 +613,9 @@ constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt index c155cc77..337d6083 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalance.kt @@ -22,16 +22,16 @@ import java.util.Objects @NoAutoDetect class AggregateBalance private constructor( - private val financialAccountType: JsonField, - private val currency: JsonField, private val availableAmount: JsonField, + private val created: JsonField, + private val currency: JsonField, + private val financialAccountType: JsonField, + private val lastFinancialAccountToken: JsonField, + private val lastTransactionEventToken: JsonField, + private val lastTransactionToken: JsonField, private val pendingAmount: JsonField, private val totalAmount: JsonField, - private val created: JsonField, private val updated: JsonField, - private val lastTransactionToken: JsonField, - private val lastTransactionEventToken: JsonField, - private val lastFinancialAccountToken: JsonField, private val additionalProperties: Map, ) { @@ -39,15 +39,32 @@ private constructor( private var hashCode: Int = 0 + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + fun availableAmount(): Long = availableAmount.getRequired("available_amount") + + /** Date and time for when the balance was first created. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ + fun currency(): String = currency.getRequired("currency") + /** Type of financial account */ fun financialAccountType(): FinancialAccountType = financialAccountType.getRequired("financial_account_type") - /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ - fun currency(): String = currency.getRequired("currency") + /** + * Globally unique identifier for the financial account that had its balance updated most + * recently + */ + fun lastFinancialAccountToken(): String = + lastFinancialAccountToken.getRequired("last_financial_account_token") - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(): Long = availableAmount.getRequired("available_amount") + /** Globally unique identifier for the last transaction event that impacted this balance */ + fun lastTransactionEventToken(): String = + lastTransactionEventToken.getRequired("last_transaction_event_token") + + /** Globally unique identifier for the last transaction that impacted this balance */ + fun lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") /** * Funds not available for spend due to card authorizations or pending ACH release. Shown in the @@ -61,36 +78,40 @@ private constructor( */ fun totalAmount(): Long = totalAmount.getRequired("total_amount") - /** Date and time for when the balance was first created. */ - fun created(): OffsetDateTime = created.getRequired("created") - /** Date and time for when the balance was last updated. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + @JsonProperty("available_amount") @ExcludeMissing fun _availableAmount() = availableAmount - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(): String = - lastTransactionEventToken.getRequired("last_transaction_event_token") + /** Date and time for when the balance was first created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - */ - fun lastFinancialAccountToken(): String = - lastFinancialAccountToken.getRequired("last_financial_account_token") + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency /** Type of financial account */ @JsonProperty("financial_account_type") @ExcludeMissing fun _financialAccountType() = financialAccountType - /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** + * Globally unique identifier for the financial account that had its balance updated most + * recently + */ + @JsonProperty("last_financial_account_token") + @ExcludeMissing + fun _lastFinancialAccountToken() = lastFinancialAccountToken - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - @JsonProperty("available_amount") @ExcludeMissing fun _availableAmount() = availableAmount + /** Globally unique identifier for the last transaction event that impacted this balance */ + @JsonProperty("last_transaction_event_token") + @ExcludeMissing + fun _lastTransactionEventToken() = lastTransactionEventToken + + /** Globally unique identifier for the last transaction that impacted this balance */ + @JsonProperty("last_transaction_token") + @ExcludeMissing + fun _lastTransactionToken() = lastTransactionToken /** * Funds not available for spend due to card authorizations or pending ACH release. Shown in the @@ -104,46 +125,25 @@ private constructor( */ @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount() = totalAmount - /** Date and time for when the balance was first created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Date and time for when the balance was last updated. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - /** Globally unique identifier for the last transaction that impacted this balance */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun _lastTransactionToken() = lastTransactionToken - - /** Globally unique identifier for the last transaction event that impacted this balance */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun _lastTransactionEventToken() = lastTransactionEventToken - - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - */ - @JsonProperty("last_financial_account_token") - @ExcludeMissing - fun _lastFinancialAccountToken() = lastFinancialAccountToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AggregateBalance = apply { if (!validated) { - financialAccountType() - currency() availableAmount() + created() + currency() + financialAccountType() + lastFinancialAccountToken() + lastTransactionEventToken() + lastTransactionToken() pendingAmount() totalAmount() - created() updated() - lastTransactionToken() - lastTransactionEventToken() - lastFinancialAccountToken() validated = true } } @@ -156,16 +156,16 @@ private constructor( } return other is AggregateBalance && - this.financialAccountType == other.financialAccountType && - this.currency == other.currency && this.availableAmount == other.availableAmount && + this.created == other.created && + this.currency == other.currency && + this.financialAccountType == other.financialAccountType && + this.lastFinancialAccountToken == other.lastFinancialAccountToken && + this.lastTransactionEventToken == other.lastTransactionEventToken && + this.lastTransactionToken == other.lastTransactionToken && this.pendingAmount == other.pendingAmount && this.totalAmount == other.totalAmount && - this.created == other.created && this.updated == other.updated && - this.lastTransactionToken == other.lastTransactionToken && - this.lastTransactionEventToken == other.lastTransactionEventToken && - this.lastFinancialAccountToken == other.lastFinancialAccountToken && this.additionalProperties == other.additionalProperties } @@ -173,16 +173,16 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - financialAccountType, - currency, availableAmount, + created, + currency, + financialAccountType, + lastFinancialAccountToken, + lastTransactionEventToken, + lastTransactionToken, pendingAmount, totalAmount, - created, updated, - lastTransactionToken, - lastTransactionEventToken, - lastFinancialAccountToken, additionalProperties, ) } @@ -190,7 +190,7 @@ private constructor( } override fun toString() = - "AggregateBalance{financialAccountType=$financialAccountType, currency=$currency, availableAmount=$availableAmount, pendingAmount=$pendingAmount, totalAmount=$totalAmount, created=$created, updated=$updated, lastTransactionToken=$lastTransactionToken, lastTransactionEventToken=$lastTransactionEventToken, lastFinancialAccountToken=$lastFinancialAccountToken, additionalProperties=$additionalProperties}" + "AggregateBalance{availableAmount=$availableAmount, created=$created, currency=$currency, financialAccountType=$financialAccountType, lastFinancialAccountToken=$lastFinancialAccountToken, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -199,33 +199,59 @@ private constructor( class Builder { - private var financialAccountType: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() private var availableAmount: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var financialAccountType: JsonField = JsonMissing.of() + private var lastFinancialAccountToken: JsonField = JsonMissing.of() + private var lastTransactionEventToken: JsonField = JsonMissing.of() + private var lastTransactionToken: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var totalAmount: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var lastTransactionToken: JsonField = JsonMissing.of() - private var lastTransactionEventToken: JsonField = JsonMissing.of() - private var lastFinancialAccountToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(aggregateBalance: AggregateBalance) = apply { - this.financialAccountType = aggregateBalance.financialAccountType - this.currency = aggregateBalance.currency this.availableAmount = aggregateBalance.availableAmount + this.created = aggregateBalance.created + this.currency = aggregateBalance.currency + this.financialAccountType = aggregateBalance.financialAccountType + this.lastFinancialAccountToken = aggregateBalance.lastFinancialAccountToken + this.lastTransactionEventToken = aggregateBalance.lastTransactionEventToken + this.lastTransactionToken = aggregateBalance.lastTransactionToken this.pendingAmount = aggregateBalance.pendingAmount this.totalAmount = aggregateBalance.totalAmount - this.created = aggregateBalance.created this.updated = aggregateBalance.updated - this.lastTransactionToken = aggregateBalance.lastTransactionToken - this.lastTransactionEventToken = aggregateBalance.lastTransactionEventToken - this.lastFinancialAccountToken = aggregateBalance.lastFinancialAccountToken additionalProperties(aggregateBalance.additionalProperties) } + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) + + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + @JsonProperty("available_amount") + @ExcludeMissing + fun availableAmount(availableAmount: JsonField) = apply { + this.availableAmount = availableAmount + } + + /** Date and time for when the balance was first created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Date and time for when the balance was first created. */ + @JsonProperty("created") + @ExcludeMissing + fun created(created: JsonField) = apply { this.created = created } + + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ + @JsonProperty("currency") + @ExcludeMissing + fun currency(currency: JsonField) = apply { this.currency = currency } + /** Type of financial account */ fun financialAccountType(financialAccountType: FinancialAccountType) = financialAccountType(JsonField.of(financialAccountType)) @@ -237,22 +263,43 @@ private constructor( this.financialAccountType = financialAccountType } - /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** + * Globally unique identifier for the financial account that had its balance updated most + * recently + */ + fun lastFinancialAccountToken(lastFinancialAccountToken: String) = + lastFinancialAccountToken(JsonField.of(lastFinancialAccountToken)) - /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ - @JsonProperty("currency") + /** + * Globally unique identifier for the financial account that had its balance updated most + * recently + */ + @JsonProperty("last_financial_account_token") @ExcludeMissing - fun currency(currency: JsonField) = apply { this.currency = currency } + fun lastFinancialAccountToken(lastFinancialAccountToken: JsonField) = apply { + this.lastFinancialAccountToken = lastFinancialAccountToken + } - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) + /** Globally unique identifier for the last transaction event that impacted this balance */ + fun lastTransactionEventToken(lastTransactionEventToken: String) = + lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - @JsonProperty("available_amount") + /** Globally unique identifier for the last transaction event that impacted this balance */ + @JsonProperty("last_transaction_event_token") @ExcludeMissing - fun availableAmount(availableAmount: JsonField) = apply { - this.availableAmount = availableAmount + fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { + this.lastTransactionEventToken = lastTransactionEventToken + } + + /** Globally unique identifier for the last transaction that impacted this balance */ + fun lastTransactionToken(lastTransactionToken: String) = + lastTransactionToken(JsonField.of(lastTransactionToken)) + + /** Globally unique identifier for the last transaction that impacted this balance */ + @JsonProperty("last_transaction_token") + @ExcludeMissing + fun lastTransactionToken(lastTransactionToken: JsonField) = apply { + this.lastTransactionToken = lastTransactionToken } /** @@ -285,14 +332,6 @@ private constructor( @ExcludeMissing fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } - /** Date and time for when the balance was first created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Date and time for when the balance was first created. */ - @JsonProperty("created") - @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } - /** Date and time for when the balance was last updated. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -301,45 +340,6 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(lastTransactionToken: String) = - lastTransactionToken(JsonField.of(lastTransactionToken)) - - /** Globally unique identifier for the last transaction that impacted this balance */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun lastTransactionToken(lastTransactionToken: JsonField) = apply { - this.lastTransactionToken = lastTransactionToken - } - - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(lastTransactionEventToken: String) = - lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) - - /** Globally unique identifier for the last transaction event that impacted this balance */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { - this.lastTransactionEventToken = lastTransactionEventToken - } - - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - */ - fun lastFinancialAccountToken(lastFinancialAccountToken: String) = - lastFinancialAccountToken(JsonField.of(lastFinancialAccountToken)) - - /** - * Globally unique identifier for the financial account that had its balance updated most - * recently - */ - @JsonProperty("last_financial_account_token") - @ExcludeMissing - fun lastFinancialAccountToken(lastFinancialAccountToken: JsonField) = apply { - this.lastFinancialAccountToken = lastFinancialAccountToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -356,16 +356,16 @@ private constructor( fun build(): AggregateBalance = AggregateBalance( - financialAccountType, - currency, availableAmount, + created, + currency, + financialAccountType, + lastFinancialAccountToken, + lastTransactionEventToken, + lastTransactionToken, pendingAmount, totalAmount, - created, updated, - lastTransactionToken, - lastTransactionEventToken, - lastFinancialAccountToken, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt index c2cdddc6..bfcb0356 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AggregateBalanceListResponse.kt @@ -20,15 +20,15 @@ import java.util.Objects @NoAutoDetect class AggregateBalanceListResponse private constructor( - private val currency: JsonField, private val availableAmount: JsonField, + private val created: JsonField, + private val currency: JsonField, + private val lastCardToken: JsonField, + private val lastTransactionEventToken: JsonField, + private val lastTransactionToken: JsonField, private val pendingAmount: JsonField, private val totalAmount: JsonField, - private val created: JsonField, private val updated: JsonField, - private val lastTransactionToken: JsonField, - private val lastTransactionEventToken: JsonField, - private val lastCardToken: JsonField, private val additionalProperties: Map, ) { @@ -36,11 +36,24 @@ private constructor( private var hashCode: Int = 0 + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + fun availableAmount(): Long = availableAmount.getRequired("available_amount") + + /** Date and time for when the balance was first created. */ + fun created(): OffsetDateTime = created.getRequired("created") + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ fun currency(): String = currency.getRequired("currency") - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(): Long = availableAmount.getRequired("available_amount") + /** Globally unique identifier for the card that had its balance updated most recently */ + fun lastCardToken(): String = lastCardToken.getRequired("last_card_token") + + /** Globally unique identifier for the last transaction event that impacted this balance */ + fun lastTransactionEventToken(): String = + lastTransactionEventToken.getRequired("last_transaction_event_token") + + /** Globally unique identifier for the last transaction that impacted this balance */ + fun lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") /** * Funds not available for spend due to card authorizations or pending ACH release. Shown in the @@ -54,27 +67,30 @@ private constructor( */ fun totalAmount(): Long = totalAmount.getRequired("total_amount") - /** Date and time for when the balance was first created. */ - fun created(): OffsetDateTime = created.getRequired("created") - /** Date and time for when the balance was last updated. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(): String = lastTransactionToken.getRequired("last_transaction_token") - - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(): String = - lastTransactionEventToken.getRequired("last_transaction_event_token") + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + @JsonProperty("available_amount") @ExcludeMissing fun _availableAmount() = availableAmount - /** Globally unique identifier for the card that had its balance updated most recently */ - fun lastCardToken(): String = lastCardToken.getRequired("last_card_token") + /** Date and time for when the balance was first created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - @JsonProperty("available_amount") @ExcludeMissing fun _availableAmount() = availableAmount + /** Globally unique identifier for the card that had its balance updated most recently */ + @JsonProperty("last_card_token") @ExcludeMissing fun _lastCardToken() = lastCardToken + + /** Globally unique identifier for the last transaction event that impacted this balance */ + @JsonProperty("last_transaction_event_token") + @ExcludeMissing + fun _lastTransactionEventToken() = lastTransactionEventToken + + /** Globally unique identifier for the last transaction that impacted this balance */ + @JsonProperty("last_transaction_token") + @ExcludeMissing + fun _lastTransactionToken() = lastTransactionToken /** * Funds not available for spend due to card authorizations or pending ACH release. Shown in the @@ -88,40 +104,24 @@ private constructor( */ @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount() = totalAmount - /** Date and time for when the balance was first created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Date and time for when the balance was last updated. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - /** Globally unique identifier for the last transaction that impacted this balance */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun _lastTransactionToken() = lastTransactionToken - - /** Globally unique identifier for the last transaction event that impacted this balance */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun _lastTransactionEventToken() = lastTransactionEventToken - - /** Globally unique identifier for the card that had its balance updated most recently */ - @JsonProperty("last_card_token") @ExcludeMissing fun _lastCardToken() = lastCardToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AggregateBalanceListResponse = apply { if (!validated) { - currency() availableAmount() + created() + currency() + lastCardToken() + lastTransactionEventToken() + lastTransactionToken() pendingAmount() totalAmount() - created() updated() - lastTransactionToken() - lastTransactionEventToken() - lastCardToken() validated = true } } @@ -134,15 +134,15 @@ private constructor( } return other is AggregateBalanceListResponse && - this.currency == other.currency && this.availableAmount == other.availableAmount && + this.created == other.created && + this.currency == other.currency && + this.lastCardToken == other.lastCardToken && + this.lastTransactionEventToken == other.lastTransactionEventToken && + this.lastTransactionToken == other.lastTransactionToken && this.pendingAmount == other.pendingAmount && this.totalAmount == other.totalAmount && - this.created == other.created && this.updated == other.updated && - this.lastTransactionToken == other.lastTransactionToken && - this.lastTransactionEventToken == other.lastTransactionEventToken && - this.lastCardToken == other.lastCardToken && this.additionalProperties == other.additionalProperties } @@ -150,15 +150,15 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - currency, availableAmount, + created, + currency, + lastCardToken, + lastTransactionEventToken, + lastTransactionToken, pendingAmount, totalAmount, - created, updated, - lastTransactionToken, - lastTransactionEventToken, - lastCardToken, additionalProperties, ) } @@ -166,7 +166,7 @@ private constructor( } override fun toString() = - "AggregateBalanceListResponse{currency=$currency, availableAmount=$availableAmount, pendingAmount=$pendingAmount, totalAmount=$totalAmount, created=$created, updated=$updated, lastTransactionToken=$lastTransactionToken, lastTransactionEventToken=$lastTransactionEventToken, lastCardToken=$lastCardToken, additionalProperties=$additionalProperties}" + "AggregateBalanceListResponse{availableAmount=$availableAmount, created=$created, currency=$currency, lastCardToken=$lastCardToken, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -175,31 +175,49 @@ private constructor( class Builder { - private var currency: JsonField = JsonMissing.of() private var availableAmount: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastCardToken: JsonField = JsonMissing.of() + private var lastTransactionEventToken: JsonField = JsonMissing.of() + private var lastTransactionToken: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var totalAmount: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var lastTransactionToken: JsonField = JsonMissing.of() - private var lastTransactionEventToken: JsonField = JsonMissing.of() - private var lastCardToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(aggregateBalanceListResponse: AggregateBalanceListResponse) = apply { - this.currency = aggregateBalanceListResponse.currency this.availableAmount = aggregateBalanceListResponse.availableAmount + this.created = aggregateBalanceListResponse.created + this.currency = aggregateBalanceListResponse.currency + this.lastCardToken = aggregateBalanceListResponse.lastCardToken + this.lastTransactionEventToken = aggregateBalanceListResponse.lastTransactionEventToken + this.lastTransactionToken = aggregateBalanceListResponse.lastTransactionToken this.pendingAmount = aggregateBalanceListResponse.pendingAmount this.totalAmount = aggregateBalanceListResponse.totalAmount - this.created = aggregateBalanceListResponse.created this.updated = aggregateBalanceListResponse.updated - this.lastTransactionToken = aggregateBalanceListResponse.lastTransactionToken - this.lastTransactionEventToken = aggregateBalanceListResponse.lastTransactionEventToken - this.lastCardToken = aggregateBalanceListResponse.lastCardToken additionalProperties(aggregateBalanceListResponse.additionalProperties) } + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) + + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ + @JsonProperty("available_amount") + @ExcludeMissing + fun availableAmount(availableAmount: JsonField) = apply { + this.availableAmount = availableAmount + } + + /** Date and time for when the balance was first created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Date and time for when the balance was first created. */ + @JsonProperty("created") + @ExcludeMissing + fun created(created: JsonField) = apply { this.created = created } + /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -208,14 +226,36 @@ private constructor( @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) + /** Globally unique identifier for the card that had its balance updated most recently */ + fun lastCardToken(lastCardToken: String) = lastCardToken(JsonField.of(lastCardToken)) - /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ - @JsonProperty("available_amount") + /** Globally unique identifier for the card that had its balance updated most recently */ + @JsonProperty("last_card_token") @ExcludeMissing - fun availableAmount(availableAmount: JsonField) = apply { - this.availableAmount = availableAmount + fun lastCardToken(lastCardToken: JsonField) = apply { + this.lastCardToken = lastCardToken + } + + /** Globally unique identifier for the last transaction event that impacted this balance */ + fun lastTransactionEventToken(lastTransactionEventToken: String) = + lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) + + /** Globally unique identifier for the last transaction event that impacted this balance */ + @JsonProperty("last_transaction_event_token") + @ExcludeMissing + fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { + this.lastTransactionEventToken = lastTransactionEventToken + } + + /** Globally unique identifier for the last transaction that impacted this balance */ + fun lastTransactionToken(lastTransactionToken: String) = + lastTransactionToken(JsonField.of(lastTransactionToken)) + + /** Globally unique identifier for the last transaction that impacted this balance */ + @JsonProperty("last_transaction_token") + @ExcludeMissing + fun lastTransactionToken(lastTransactionToken: JsonField) = apply { + this.lastTransactionToken = lastTransactionToken } /** @@ -248,14 +288,6 @@ private constructor( @ExcludeMissing fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } - /** Date and time for when the balance was first created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Date and time for when the balance was first created. */ - @JsonProperty("created") - @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } - /** Date and time for when the balance was last updated. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -264,38 +296,6 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - /** Globally unique identifier for the last transaction that impacted this balance */ - fun lastTransactionToken(lastTransactionToken: String) = - lastTransactionToken(JsonField.of(lastTransactionToken)) - - /** Globally unique identifier for the last transaction that impacted this balance */ - @JsonProperty("last_transaction_token") - @ExcludeMissing - fun lastTransactionToken(lastTransactionToken: JsonField) = apply { - this.lastTransactionToken = lastTransactionToken - } - - /** Globally unique identifier for the last transaction event that impacted this balance */ - fun lastTransactionEventToken(lastTransactionEventToken: String) = - lastTransactionEventToken(JsonField.of(lastTransactionEventToken)) - - /** Globally unique identifier for the last transaction event that impacted this balance */ - @JsonProperty("last_transaction_event_token") - @ExcludeMissing - fun lastTransactionEventToken(lastTransactionEventToken: JsonField) = apply { - this.lastTransactionEventToken = lastTransactionEventToken - } - - /** Globally unique identifier for the card that had its balance updated most recently */ - fun lastCardToken(lastCardToken: String) = lastCardToken(JsonField.of(lastCardToken)) - - /** Globally unique identifier for the card that had its balance updated most recently */ - @JsonProperty("last_card_token") - @ExcludeMissing - fun lastCardToken(lastCardToken: JsonField) = apply { - this.lastCardToken = lastCardToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -312,15 +312,15 @@ private constructor( fun build(): AggregateBalanceListResponse = AggregateBalanceListResponse( - currency, availableAmount, + created, + currency, + lastCardToken, + lastTransactionEventToken, + lastTransactionToken, pendingAmount, totalAmount, - created, updated, - lastTransactionToken, - lastTransactionEventToken, - lastCardToken, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt index 5c9e83d2..dad4d91a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt @@ -21,15 +21,15 @@ import java.util.Optional @NoAutoDetect class AuthRule private constructor( - private val token: JsonField, - private val state: JsonField, - private val allowedMcc: JsonField>, - private val blockedMcc: JsonField>, + private val accountTokens: JsonField>, private val allowedCountries: JsonField>, + private val allowedMcc: JsonField>, private val blockedCountries: JsonField>, - private val accountTokens: JsonField>, + private val blockedMcc: JsonField>, private val cardTokens: JsonField>, private val programLevel: JsonField, + private val state: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -37,19 +37,12 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - - /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ - fun state(): State = state.getRequired("state") - - /** Merchant category codes for which the Auth Rule permits transactions. */ - fun allowedMcc(): Optional> = - Optional.ofNullable(allowedMcc.getNullable("allowed_mcc")) - - /** Merchant category codes for which the Auth Rule automatically declines transactions. */ - fun blockedMcc(): Optional> = - Optional.ofNullable(blockedMcc.getNullable("blocked_mcc")) + /** + * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that + * only this field or `card_tokens` can be provided for a given Auth Rule. + */ + fun accountTokens(): Optional> = + Optional.ofNullable(accountTokens.getNullable("account_tokens")) /** * Countries in which the Auth Rule permits transactions. Note that Lithic maintains a list of @@ -59,16 +52,17 @@ private constructor( fun allowedCountries(): Optional> = Optional.ofNullable(allowedCountries.getNullable("allowed_countries")) + /** Merchant category codes for which the Auth Rule permits transactions. */ + fun allowedMcc(): Optional> = + Optional.ofNullable(allowedMcc.getNullable("allowed_mcc")) + /** Countries in which the Auth Rule automatically declines transactions. */ fun blockedCountries(): Optional> = Optional.ofNullable(blockedCountries.getNullable("blocked_countries")) - /** - * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that - * only this field or `card_tokens` can be provided for a given Auth Rule. - */ - fun accountTokens(): Optional> = - Optional.ofNullable(accountTokens.getNullable("account_tokens")) + /** Merchant category codes for which the Auth Rule automatically declines transactions. */ + fun blockedMcc(): Optional> = + Optional.ofNullable(blockedMcc.getNullable("blocked_mcc")) /** * Array of card_token(s) identifying the cards that the Auth Rule applies to. Note that only @@ -81,17 +75,17 @@ private constructor( fun programLevel(): Optional = Optional.ofNullable(programLevel.getNullable("program_level")) - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ - @JsonProperty("state") @ExcludeMissing fun _state() = state + fun state(): State = state.getRequired("state") - /** Merchant category codes for which the Auth Rule permits transactions. */ - @JsonProperty("allowed_mcc") @ExcludeMissing fun _allowedMcc() = allowedMcc + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") - /** Merchant category codes for which the Auth Rule automatically declines transactions. */ - @JsonProperty("blocked_mcc") @ExcludeMissing fun _blockedMcc() = blockedMcc + /** + * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that + * only this field or `card_tokens` can be provided for a given Auth Rule. + */ + @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens /** * Countries in which the Auth Rule permits transactions. Note that Lithic maintains a list of @@ -100,14 +94,14 @@ private constructor( */ @JsonProperty("allowed_countries") @ExcludeMissing fun _allowedCountries() = allowedCountries + /** Merchant category codes for which the Auth Rule permits transactions. */ + @JsonProperty("allowed_mcc") @ExcludeMissing fun _allowedMcc() = allowedMcc + /** Countries in which the Auth Rule automatically declines transactions. */ @JsonProperty("blocked_countries") @ExcludeMissing fun _blockedCountries() = blockedCountries - /** - * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that - * only this field or `card_tokens` can be provided for a given Auth Rule. - */ - @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens + /** Merchant category codes for which the Auth Rule automatically declines transactions. */ + @JsonProperty("blocked_mcc") @ExcludeMissing fun _blockedMcc() = blockedMcc /** * Array of card_token(s) identifying the cards that the Auth Rule applies to. Note that only @@ -118,21 +112,27 @@ private constructor( /** Boolean indicating whether the Auth Rule is applied at the program level. */ @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AuthRule = apply { if (!validated) { - token() - state() - allowedMcc() - blockedMcc() + accountTokens() allowedCountries() + allowedMcc() blockedCountries() - accountTokens() + blockedMcc() cardTokens() programLevel() + state() + token() validated = true } } @@ -145,15 +145,15 @@ private constructor( } return other is AuthRule && - this.token == other.token && - this.state == other.state && - this.allowedMcc == other.allowedMcc && - this.blockedMcc == other.blockedMcc && + this.accountTokens == other.accountTokens && this.allowedCountries == other.allowedCountries && + this.allowedMcc == other.allowedMcc && this.blockedCountries == other.blockedCountries && - this.accountTokens == other.accountTokens && + this.blockedMcc == other.blockedMcc && this.cardTokens == other.cardTokens && this.programLevel == other.programLevel && + this.state == other.state && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -161,15 +161,15 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - state, - allowedMcc, - blockedMcc, + accountTokens, allowedCountries, + allowedMcc, blockedCountries, - accountTokens, + blockedMcc, cardTokens, programLevel, + state, + token, additionalProperties, ) } @@ -177,7 +177,7 @@ private constructor( } override fun toString() = - "AuthRule{token=$token, state=$state, allowedMcc=$allowedMcc, blockedMcc=$blockedMcc, allowedCountries=$allowedCountries, blockedCountries=$blockedCountries, accountTokens=$accountTokens, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}" + "AuthRule{accountTokens=$accountTokens, allowedCountries=$allowedCountries, allowedMcc=$allowedMcc, blockedCountries=$blockedCountries, blockedMcc=$blockedMcc, cardTokens=$cardTokens, programLevel=$programLevel, state=$state, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -186,62 +186,46 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var allowedMcc: JsonField> = JsonMissing.of() - private var blockedMcc: JsonField> = JsonMissing.of() + private var accountTokens: JsonField> = JsonMissing.of() private var allowedCountries: JsonField> = JsonMissing.of() + private var allowedMcc: JsonField> = JsonMissing.of() private var blockedCountries: JsonField> = JsonMissing.of() - private var accountTokens: JsonField> = JsonMissing.of() + private var blockedMcc: JsonField> = JsonMissing.of() private var cardTokens: JsonField> = JsonMissing.of() private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(authRule: AuthRule) = apply { - this.token = authRule.token - this.state = authRule.state - this.allowedMcc = authRule.allowedMcc - this.blockedMcc = authRule.blockedMcc + this.accountTokens = authRule.accountTokens this.allowedCountries = authRule.allowedCountries + this.allowedMcc = authRule.allowedMcc this.blockedCountries = authRule.blockedCountries - this.accountTokens = authRule.accountTokens + this.blockedMcc = authRule.blockedMcc this.cardTokens = authRule.cardTokens this.programLevel = authRule.programLevel + this.state = authRule.state + this.token = authRule.token additionalProperties(authRule.additionalProperties) } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - - /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ - fun state(state: State) = state(JsonField.of(state)) - - /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ - @JsonProperty("state") - @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } - - /** Merchant category codes for which the Auth Rule permits transactions. */ - fun allowedMcc(allowedMcc: List) = allowedMcc(JsonField.of(allowedMcc)) - - /** Merchant category codes for which the Auth Rule permits transactions. */ - @JsonProperty("allowed_mcc") - @ExcludeMissing - fun allowedMcc(allowedMcc: JsonField>) = apply { this.allowedMcc = allowedMcc } - - /** Merchant category codes for which the Auth Rule automatically declines transactions. */ - fun blockedMcc(blockedMcc: List) = blockedMcc(JsonField.of(blockedMcc)) + /** + * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note + * that only this field or `card_tokens` can be provided for a given Auth Rule. + */ + fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) - /** Merchant category codes for which the Auth Rule automatically declines transactions. */ - @JsonProperty("blocked_mcc") + /** + * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note + * that only this field or `card_tokens` can be provided for a given Auth Rule. + */ + @JsonProperty("account_tokens") @ExcludeMissing - fun blockedMcc(blockedMcc: JsonField>) = apply { this.blockedMcc = blockedMcc } + fun accountTokens(accountTokens: JsonField>) = apply { + this.accountTokens = accountTokens + } /** * Countries in which the Auth Rule permits transactions. Note that Lithic maintains a list @@ -262,6 +246,14 @@ private constructor( this.allowedCountries = allowedCountries } + /** Merchant category codes for which the Auth Rule permits transactions. */ + fun allowedMcc(allowedMcc: List) = allowedMcc(JsonField.of(allowedMcc)) + + /** Merchant category codes for which the Auth Rule permits transactions. */ + @JsonProperty("allowed_mcc") + @ExcludeMissing + fun allowedMcc(allowedMcc: JsonField>) = apply { this.allowedMcc = allowedMcc } + /** Countries in which the Auth Rule automatically declines transactions. */ fun blockedCountries(blockedCountries: List) = blockedCountries(JsonField.of(blockedCountries)) @@ -273,21 +265,13 @@ private constructor( this.blockedCountries = blockedCountries } - /** - * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note - * that only this field or `card_tokens` can be provided for a given Auth Rule. - */ - fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) + /** Merchant category codes for which the Auth Rule automatically declines transactions. */ + fun blockedMcc(blockedMcc: List) = blockedMcc(JsonField.of(blockedMcc)) - /** - * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note - * that only this field or `card_tokens` can be provided for a given Auth Rule. - */ - @JsonProperty("account_tokens") + /** Merchant category codes for which the Auth Rule automatically declines transactions. */ + @JsonProperty("blocked_mcc") @ExcludeMissing - fun accountTokens(accountTokens: JsonField>) = apply { - this.accountTokens = accountTokens - } + fun blockedMcc(blockedMcc: JsonField>) = apply { this.blockedMcc = blockedMcc } /** * Array of card_token(s) identifying the cards that the Auth Rule applies to. Note that @@ -313,6 +297,22 @@ private constructor( this.programLevel = programLevel } + /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ + fun state(state: State) = state(JsonField.of(state)) + + /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ + @JsonProperty("state") + @ExcludeMissing + fun state(state: JsonField) = apply { this.state = state } + + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + @JsonProperty("token") + @ExcludeMissing + fun token(token: JsonField) = apply { this.token = token } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -329,15 +329,15 @@ private constructor( fun build(): AuthRule = AuthRule( - token, - state, - allowedMcc.map { it.toUnmodifiable() }, - blockedMcc.map { it.toUnmodifiable() }, + accountTokens.map { it.toUnmodifiable() }, allowedCountries.map { it.toUnmodifiable() }, + allowedMcc.map { it.toUnmodifiable() }, blockedCountries.map { it.toUnmodifiable() }, - accountTokens.map { it.toUnmodifiable() }, + blockedMcc.map { it.toUnmodifiable() }, cardTokens.map { it.toUnmodifiable() }, programLevel, + state, + token, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt index e713be7e..395a4836 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt @@ -636,41 +636,41 @@ private constructor( companion object { - @JvmField val NOT_APPLICABLE = AccountType(JsonField.of("NOT_APPLICABLE")) - @JvmField val CREDIT = AccountType(JsonField.of("CREDIT")) @JvmField val DEBIT = AccountType(JsonField.of("DEBIT")) + @JvmField val NOT_APPLICABLE = AccountType(JsonField.of("NOT_APPLICABLE")) + @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) } enum class Known { - NOT_APPLICABLE, CREDIT, DEBIT, + NOT_APPLICABLE, } enum class Value { - NOT_APPLICABLE, CREDIT, DEBIT, + NOT_APPLICABLE, _UNKNOWN, } fun value(): Value = when (this) { - NOT_APPLICABLE -> Value.NOT_APPLICABLE CREDIT -> Value.CREDIT DEBIT -> Value.DEBIT + NOT_APPLICABLE -> Value.NOT_APPLICABLE else -> Value._UNKNOWN } fun known(): Known = when (this) { - NOT_APPLICABLE -> Known.NOT_APPLICABLE CREDIT -> Known.CREDIT DEBIT -> Known.DEBIT + NOT_APPLICABLE -> Known.NOT_APPLICABLE else -> throw LithicInvalidDataException("Unknown AccountType: $value") } @@ -699,35 +699,35 @@ private constructor( companion object { - @JvmField val SUCCESS = AuthenticationResult(JsonField.of("SUCCESS")) - @JvmField val DECLINE = AuthenticationResult(JsonField.of("DECLINE")) + @JvmField val SUCCESS = AuthenticationResult(JsonField.of("SUCCESS")) + @JvmStatic fun of(value: String) = AuthenticationResult(JsonField.of(value)) } enum class Known { - SUCCESS, DECLINE, + SUCCESS, } enum class Value { - SUCCESS, DECLINE, + SUCCESS, _UNKNOWN, } fun value(): Value = when (this) { - SUCCESS -> Value.SUCCESS DECLINE -> Value.DECLINE + SUCCESS -> Value.SUCCESS else -> Value._UNKNOWN } fun known(): Known = when (this) { - SUCCESS -> Known.SUCCESS DECLINE -> Known.DECLINE + SUCCESS -> Known.SUCCESS else -> throw LithicInvalidDataException("Unknown AuthenticationResult: $value") } @@ -1448,13 +1448,13 @@ private constructor( companion object { - @JvmField val NETWORK = DecisionMadeBy(JsonField.of("NETWORK")) + @JvmField val CUSTOMER_ENDPOINT = DecisionMadeBy(JsonField.of("CUSTOMER_ENDPOINT")) @JvmField val LITHIC_DEFAULT = DecisionMadeBy(JsonField.of("LITHIC_DEFAULT")) @JvmField val LITHIC_RULES = DecisionMadeBy(JsonField.of("LITHIC_RULES")) - @JvmField val CUSTOMER_ENDPOINT = DecisionMadeBy(JsonField.of("CUSTOMER_ENDPOINT")) + @JvmField val NETWORK = DecisionMadeBy(JsonField.of("NETWORK")) @JvmField val UNKNOWN = DecisionMadeBy(JsonField.of("UNKNOWN")) @@ -1462,38 +1462,38 @@ private constructor( } enum class Known { - NETWORK, + CUSTOMER_ENDPOINT, LITHIC_DEFAULT, LITHIC_RULES, - CUSTOMER_ENDPOINT, + NETWORK, UNKNOWN, } enum class Value { - NETWORK, + CUSTOMER_ENDPOINT, LITHIC_DEFAULT, LITHIC_RULES, - CUSTOMER_ENDPOINT, + NETWORK, UNKNOWN, _UNKNOWN, } fun value(): Value = when (this) { - NETWORK -> Value.NETWORK + CUSTOMER_ENDPOINT -> Value.CUSTOMER_ENDPOINT LITHIC_DEFAULT -> Value.LITHIC_DEFAULT LITHIC_RULES -> Value.LITHIC_RULES - CUSTOMER_ENDPOINT -> Value.CUSTOMER_ENDPOINT + NETWORK -> Value.NETWORK UNKNOWN -> Value.UNKNOWN else -> Value._UNKNOWN } fun known(): Known = when (this) { - NETWORK -> Known.NETWORK + CUSTOMER_ENDPOINT -> Known.CUSTOMER_ENDPOINT LITHIC_DEFAULT -> Known.LITHIC_DEFAULT LITHIC_RULES -> Known.LITHIC_RULES - CUSTOMER_ENDPOINT -> Known.CUSTOMER_ENDPOINT + NETWORK -> Known.NETWORK UNKNOWN -> Known.UNKNOWN else -> throw LithicInvalidDataException("Unknown DecisionMadeBy: $value") } @@ -2199,10 +2199,10 @@ private constructor( val ELECTRONIC_DELIVERY = DeliveryTimeFrame(JsonField.of("ELECTRONIC_DELIVERY")) @JvmField - val SAME_DAY_SHIPPING = DeliveryTimeFrame(JsonField.of("SAME_DAY_SHIPPING")) + val OVERNIGHT_SHIPPING = DeliveryTimeFrame(JsonField.of("OVERNIGHT_SHIPPING")) @JvmField - val OVERNIGHT_SHIPPING = DeliveryTimeFrame(JsonField.of("OVERNIGHT_SHIPPING")) + val SAME_DAY_SHIPPING = DeliveryTimeFrame(JsonField.of("SAME_DAY_SHIPPING")) @JvmField val TWO_DAY_OR_MORE_SHIPPING = @@ -2213,15 +2213,15 @@ private constructor( enum class Known { ELECTRONIC_DELIVERY, - SAME_DAY_SHIPPING, OVERNIGHT_SHIPPING, + SAME_DAY_SHIPPING, TWO_DAY_OR_MORE_SHIPPING, } enum class Value { ELECTRONIC_DELIVERY, - SAME_DAY_SHIPPING, OVERNIGHT_SHIPPING, + SAME_DAY_SHIPPING, TWO_DAY_OR_MORE_SHIPPING, _UNKNOWN, } @@ -2229,8 +2229,8 @@ private constructor( fun value(): Value = when (this) { ELECTRONIC_DELIVERY -> Value.ELECTRONIC_DELIVERY - SAME_DAY_SHIPPING -> Value.SAME_DAY_SHIPPING OVERNIGHT_SHIPPING -> Value.OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING -> Value.SAME_DAY_SHIPPING TWO_DAY_OR_MORE_SHIPPING -> Value.TWO_DAY_OR_MORE_SHIPPING else -> Value._UNKNOWN } @@ -2238,8 +2238,8 @@ private constructor( fun known(): Known = when (this) { ELECTRONIC_DELIVERY -> Known.ELECTRONIC_DELIVERY - SAME_DAY_SHIPPING -> Known.SAME_DAY_SHIPPING OVERNIGHT_SHIPPING -> Known.OVERNIGHT_SHIPPING + SAME_DAY_SHIPPING -> Known.SAME_DAY_SHIPPING TWO_DAY_OR_MORE_SHIPPING -> Known.TWO_DAY_OR_MORE_SHIPPING else -> throw LithicInvalidDataException("Unknown DeliveryTimeFrame: $value") @@ -2271,37 +2271,37 @@ private constructor( companion object { @JvmField - val MERCHANDISE_AVAILABLE = - OrderAvailability(JsonField.of("MERCHANDISE_AVAILABLE")) + val FUTURE_AVAILABILITY = OrderAvailability(JsonField.of("FUTURE_AVAILABILITY")) @JvmField - val FUTURE_AVAILABILITY = OrderAvailability(JsonField.of("FUTURE_AVAILABILITY")) + val MERCHANDISE_AVAILABLE = + OrderAvailability(JsonField.of("MERCHANDISE_AVAILABLE")) @JvmStatic fun of(value: String) = OrderAvailability(JsonField.of(value)) } enum class Known { - MERCHANDISE_AVAILABLE, FUTURE_AVAILABILITY, + MERCHANDISE_AVAILABLE, } enum class Value { - MERCHANDISE_AVAILABLE, FUTURE_AVAILABILITY, + MERCHANDISE_AVAILABLE, _UNKNOWN, } fun value(): Value = when (this) { - MERCHANDISE_AVAILABLE -> Value.MERCHANDISE_AVAILABLE FUTURE_AVAILABILITY -> Value.FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE -> Value.MERCHANDISE_AVAILABLE else -> Value._UNKNOWN } fun known(): Known = when (this) { - MERCHANDISE_AVAILABLE -> Known.MERCHANDISE_AVAILABLE FUTURE_AVAILABILITY -> Known.FUTURE_AVAILABILITY + MERCHANDISE_AVAILABLE -> Known.MERCHANDISE_AVAILABLE else -> throw LithicInvalidDataException("Unknown OrderAvailability: $value") } @@ -2389,87 +2389,87 @@ private constructor( companion object { + @JvmField val DIGITAL_GOODS = ShippingMethod(JsonField.of("DIGITAL_GOODS")) + + @JvmField val LOCKER_DELIVERY = ShippingMethod(JsonField.of("LOCKER_DELIVERY")) + + @JvmField val OTHER = ShippingMethod(JsonField.of("OTHER")) + @JvmField - val SHIP_TO_BILLING_ADDRESS = - ShippingMethod(JsonField.of("SHIP_TO_BILLING_ADDRESS")) + val PICK_UP_AND_GO_DELIVERY = + ShippingMethod(JsonField.of("PICK_UP_AND_GO_DELIVERY")) @JvmField - val SHIP_TO_OTHER_VERIFIED_ADDRESS = - ShippingMethod(JsonField.of("SHIP_TO_OTHER_VERIFIED_ADDRESS")) + val SHIP_TO_BILLING_ADDRESS = + ShippingMethod(JsonField.of("SHIP_TO_BILLING_ADDRESS")) @JvmField val SHIP_TO_NON_BILLING_ADDRESS = ShippingMethod(JsonField.of("SHIP_TO_NON_BILLING_ADDRESS")) - @JvmField val SHIP_TO_STORE = ShippingMethod(JsonField.of("SHIP_TO_STORE")) + @JvmField + val SHIP_TO_OTHER_VERIFIED_ADDRESS = + ShippingMethod(JsonField.of("SHIP_TO_OTHER_VERIFIED_ADDRESS")) - @JvmField val DIGITAL_GOODS = ShippingMethod(JsonField.of("DIGITAL_GOODS")) + @JvmField val SHIP_TO_STORE = ShippingMethod(JsonField.of("SHIP_TO_STORE")) @JvmField val TRAVEL_AND_EVENT_TICKETS = ShippingMethod(JsonField.of("TRAVEL_AND_EVENT_TICKETS")) - @JvmField val OTHER = ShippingMethod(JsonField.of("OTHER")) - - @JvmField - val PICK_UP_AND_GO_DELIVERY = - ShippingMethod(JsonField.of("PICK_UP_AND_GO_DELIVERY")) - - @JvmField val LOCKER_DELIVERY = ShippingMethod(JsonField.of("LOCKER_DELIVERY")) - @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) } enum class Known { + DIGITAL_GOODS, + LOCKER_DELIVERY, + OTHER, + PICK_UP_AND_GO_DELIVERY, SHIP_TO_BILLING_ADDRESS, - SHIP_TO_OTHER_VERIFIED_ADDRESS, SHIP_TO_NON_BILLING_ADDRESS, + SHIP_TO_OTHER_VERIFIED_ADDRESS, SHIP_TO_STORE, - DIGITAL_GOODS, TRAVEL_AND_EVENT_TICKETS, - OTHER, - PICK_UP_AND_GO_DELIVERY, - LOCKER_DELIVERY, } enum class Value { + DIGITAL_GOODS, + LOCKER_DELIVERY, + OTHER, + PICK_UP_AND_GO_DELIVERY, SHIP_TO_BILLING_ADDRESS, - SHIP_TO_OTHER_VERIFIED_ADDRESS, SHIP_TO_NON_BILLING_ADDRESS, + SHIP_TO_OTHER_VERIFIED_ADDRESS, SHIP_TO_STORE, - DIGITAL_GOODS, TRAVEL_AND_EVENT_TICKETS, - OTHER, - PICK_UP_AND_GO_DELIVERY, - LOCKER_DELIVERY, _UNKNOWN, } fun value(): Value = when (this) { + DIGITAL_GOODS -> Value.DIGITAL_GOODS + LOCKER_DELIVERY -> Value.LOCKER_DELIVERY + OTHER -> Value.OTHER + PICK_UP_AND_GO_DELIVERY -> Value.PICK_UP_AND_GO_DELIVERY SHIP_TO_BILLING_ADDRESS -> Value.SHIP_TO_BILLING_ADDRESS - SHIP_TO_OTHER_VERIFIED_ADDRESS -> Value.SHIP_TO_OTHER_VERIFIED_ADDRESS SHIP_TO_NON_BILLING_ADDRESS -> Value.SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS -> Value.SHIP_TO_OTHER_VERIFIED_ADDRESS SHIP_TO_STORE -> Value.SHIP_TO_STORE - DIGITAL_GOODS -> Value.DIGITAL_GOODS TRAVEL_AND_EVENT_TICKETS -> Value.TRAVEL_AND_EVENT_TICKETS - OTHER -> Value.OTHER - PICK_UP_AND_GO_DELIVERY -> Value.PICK_UP_AND_GO_DELIVERY - LOCKER_DELIVERY -> Value.LOCKER_DELIVERY else -> Value._UNKNOWN } fun known(): Known = when (this) { + DIGITAL_GOODS -> Known.DIGITAL_GOODS + LOCKER_DELIVERY -> Known.LOCKER_DELIVERY + OTHER -> Known.OTHER + PICK_UP_AND_GO_DELIVERY -> Known.PICK_UP_AND_GO_DELIVERY SHIP_TO_BILLING_ADDRESS -> Known.SHIP_TO_BILLING_ADDRESS - SHIP_TO_OTHER_VERIFIED_ADDRESS -> Known.SHIP_TO_OTHER_VERIFIED_ADDRESS SHIP_TO_NON_BILLING_ADDRESS -> Known.SHIP_TO_NON_BILLING_ADDRESS + SHIP_TO_OTHER_VERIFIED_ADDRESS -> Known.SHIP_TO_OTHER_VERIFIED_ADDRESS SHIP_TO_STORE -> Known.SHIP_TO_STORE - DIGITAL_GOODS -> Known.DIGITAL_GOODS TRAVEL_AND_EVENT_TICKETS -> Known.TRAVEL_AND_EVENT_TICKETS - OTHER -> Known.OTHER - PICK_UP_AND_GO_DELIVERY -> Known.PICK_UP_AND_GO_DELIVERY - LOCKER_DELIVERY -> Known.LOCKER_DELIVERY else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") } @@ -2500,38 +2500,38 @@ private constructor( companion object { - @JvmField - val PAYMENT_AUTHENTICATION = MessageCategory(JsonField.of("PAYMENT_AUTHENTICATION")) - @JvmField val NON_PAYMENT_AUTHENTICATION = MessageCategory(JsonField.of("NON_PAYMENT_AUTHENTICATION")) + @JvmField + val PAYMENT_AUTHENTICATION = MessageCategory(JsonField.of("PAYMENT_AUTHENTICATION")) + @JvmStatic fun of(value: String) = MessageCategory(JsonField.of(value)) } enum class Known { - PAYMENT_AUTHENTICATION, NON_PAYMENT_AUTHENTICATION, + PAYMENT_AUTHENTICATION, } enum class Value { - PAYMENT_AUTHENTICATION, NON_PAYMENT_AUTHENTICATION, + PAYMENT_AUTHENTICATION, _UNKNOWN, } fun value(): Value = when (this) { - PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION NON_PAYMENT_AUTHENTICATION -> Value.NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION else -> Value._UNKNOWN } fun known(): Known = when (this) { - PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION NON_PAYMENT_AUTHENTICATION -> Known.NON_PAYMENT_AUTHENTICATION + PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION else -> throw LithicInvalidDataException("Unknown MessageCategory: $value") } @@ -2929,92 +2929,92 @@ private constructor( companion object { - @JvmField - val PAYMENT_TRANSACTION = AuthenticationRequestType(JsonField.of("PAYMENT_TRANSACTION")) + @JvmField val ADD_CARD = AuthenticationRequestType(JsonField.of("ADD_CARD")) @JvmField - val RECURRING_TRANSACTION = - AuthenticationRequestType(JsonField.of("RECURRING_TRANSACTION")) + val BILLING_AGREEMENT = AuthenticationRequestType(JsonField.of("BILLING_AGREEMENT")) @JvmField - val INSTALLMENT_TRANSACTION = - AuthenticationRequestType(JsonField.of("INSTALLMENT_TRANSACTION")) - - @JvmField val ADD_CARD = AuthenticationRequestType(JsonField.of("ADD_CARD")) - - @JvmField val MAINTAIN_CARD = AuthenticationRequestType(JsonField.of("MAINTAIN_CARD")) + val DELAYED_SHIPMENT = AuthenticationRequestType(JsonField.of("DELAYED_SHIPMENT")) @JvmField val EMV_TOKEN_CARDHOLDER_VERIFICATION = AuthenticationRequestType(JsonField.of("EMV_TOKEN_CARDHOLDER_VERIFICATION")) @JvmField - val BILLING_AGREEMENT = AuthenticationRequestType(JsonField.of("BILLING_AGREEMENT")) + val INSTALLMENT_TRANSACTION = + AuthenticationRequestType(JsonField.of("INSTALLMENT_TRANSACTION")) - @JvmField val SPLIT_SHIPMENT = AuthenticationRequestType(JsonField.of("SPLIT_SHIPMENT")) + @JvmField val MAINTAIN_CARD = AuthenticationRequestType(JsonField.of("MAINTAIN_CARD")) @JvmField - val DELAYED_SHIPMENT = AuthenticationRequestType(JsonField.of("DELAYED_SHIPMENT")) + val PAYMENT_TRANSACTION = AuthenticationRequestType(JsonField.of("PAYMENT_TRANSACTION")) + + @JvmField + val RECURRING_TRANSACTION = + AuthenticationRequestType(JsonField.of("RECURRING_TRANSACTION")) @JvmField val SPLIT_PAYMENT = AuthenticationRequestType(JsonField.of("SPLIT_PAYMENT")) + @JvmField val SPLIT_SHIPMENT = AuthenticationRequestType(JsonField.of("SPLIT_SHIPMENT")) + @JvmStatic fun of(value: String) = AuthenticationRequestType(JsonField.of(value)) } enum class Known { - PAYMENT_TRANSACTION, - RECURRING_TRANSACTION, - INSTALLMENT_TRANSACTION, ADD_CARD, - MAINTAIN_CARD, - EMV_TOKEN_CARDHOLDER_VERIFICATION, BILLING_AGREEMENT, - SPLIT_SHIPMENT, DELAYED_SHIPMENT, + EMV_TOKEN_CARDHOLDER_VERIFICATION, + INSTALLMENT_TRANSACTION, + MAINTAIN_CARD, + PAYMENT_TRANSACTION, + RECURRING_TRANSACTION, SPLIT_PAYMENT, + SPLIT_SHIPMENT, } enum class Value { - PAYMENT_TRANSACTION, - RECURRING_TRANSACTION, - INSTALLMENT_TRANSACTION, ADD_CARD, - MAINTAIN_CARD, - EMV_TOKEN_CARDHOLDER_VERIFICATION, BILLING_AGREEMENT, - SPLIT_SHIPMENT, DELAYED_SHIPMENT, + EMV_TOKEN_CARDHOLDER_VERIFICATION, + INSTALLMENT_TRANSACTION, + MAINTAIN_CARD, + PAYMENT_TRANSACTION, + RECURRING_TRANSACTION, SPLIT_PAYMENT, + SPLIT_SHIPMENT, _UNKNOWN, } fun value(): Value = when (this) { - PAYMENT_TRANSACTION -> Value.PAYMENT_TRANSACTION - RECURRING_TRANSACTION -> Value.RECURRING_TRANSACTION - INSTALLMENT_TRANSACTION -> Value.INSTALLMENT_TRANSACTION ADD_CARD -> Value.ADD_CARD - MAINTAIN_CARD -> Value.MAINTAIN_CARD - EMV_TOKEN_CARDHOLDER_VERIFICATION -> Value.EMV_TOKEN_CARDHOLDER_VERIFICATION BILLING_AGREEMENT -> Value.BILLING_AGREEMENT - SPLIT_SHIPMENT -> Value.SPLIT_SHIPMENT DELAYED_SHIPMENT -> Value.DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION -> Value.EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION -> Value.INSTALLMENT_TRANSACTION + MAINTAIN_CARD -> Value.MAINTAIN_CARD + PAYMENT_TRANSACTION -> Value.PAYMENT_TRANSACTION + RECURRING_TRANSACTION -> Value.RECURRING_TRANSACTION SPLIT_PAYMENT -> Value.SPLIT_PAYMENT + SPLIT_SHIPMENT -> Value.SPLIT_SHIPMENT else -> Value._UNKNOWN } fun known(): Known = when (this) { - PAYMENT_TRANSACTION -> Known.PAYMENT_TRANSACTION - RECURRING_TRANSACTION -> Known.RECURRING_TRANSACTION - INSTALLMENT_TRANSACTION -> Known.INSTALLMENT_TRANSACTION ADD_CARD -> Known.ADD_CARD - MAINTAIN_CARD -> Known.MAINTAIN_CARD - EMV_TOKEN_CARDHOLDER_VERIFICATION -> Known.EMV_TOKEN_CARDHOLDER_VERIFICATION BILLING_AGREEMENT -> Known.BILLING_AGREEMENT - SPLIT_SHIPMENT -> Known.SPLIT_SHIPMENT DELAYED_SHIPMENT -> Known.DELAYED_SHIPMENT + EMV_TOKEN_CARDHOLDER_VERIFICATION -> Known.EMV_TOKEN_CARDHOLDER_VERIFICATION + INSTALLMENT_TRANSACTION -> Known.INSTALLMENT_TRANSACTION + MAINTAIN_CARD -> Known.MAINTAIN_CARD + PAYMENT_TRANSACTION -> Known.PAYMENT_TRANSACTION + RECURRING_TRANSACTION -> Known.RECURRING_TRANSACTION SPLIT_PAYMENT -> Known.SPLIT_PAYMENT + SPLIT_SHIPMENT -> Known.SPLIT_SHIPMENT else -> throw LithicInvalidDataException("Unknown AuthenticationRequestType: $value") } @@ -3328,129 +3328,129 @@ private constructor( companion object { @JvmField - val RECURRING_TRANSACTION = ThreeRiRequestType(JsonField.of("RECURRING_TRANSACTION")) - - @JvmField - val INSTALLMENT_TRANSACTION = - ThreeRiRequestType(JsonField.of("INSTALLMENT_TRANSACTION")) + val ACCOUNT_VERIFICATION = ThreeRiRequestType(JsonField.of("ACCOUNT_VERIFICATION")) @JvmField val ADD_CARD = ThreeRiRequestType(JsonField.of("ADD_CARD")) - @JvmField - val MAINTAIN_CARD_INFO = ThreeRiRequestType(JsonField.of("MAINTAIN_CARD_INFO")) + @JvmField val BILLING_AGREEMENT = ThreeRiRequestType(JsonField.of("BILLING_AGREEMENT")) @JvmField - val ACCOUNT_VERIFICATION = ThreeRiRequestType(JsonField.of("ACCOUNT_VERIFICATION")) + val CARD_SECURITY_CODE_STATUS_CHECK = + ThreeRiRequestType(JsonField.of("CARD_SECURITY_CODE_STATUS_CHECK")) - @JvmField val SPLIT_SHIPMENT = ThreeRiRequestType(JsonField.of("SPLIT_SHIPMENT")) + @JvmField val DELAYED_SHIPMENT = ThreeRiRequestType(JsonField.of("DELAYED_SHIPMENT")) - @JvmField val TOP_UP = ThreeRiRequestType(JsonField.of("TOP_UP")) + @JvmField + val DEVICE_BINDING_STATUS_CHECK = + ThreeRiRequestType(JsonField.of("DEVICE_BINDING_STATUS_CHECK")) - @JvmField val MAIL_ORDER = ThreeRiRequestType(JsonField.of("MAIL_ORDER")) + @JvmField + val INSTALLMENT_TRANSACTION = + ThreeRiRequestType(JsonField.of("INSTALLMENT_TRANSACTION")) - @JvmField val TELEPHONE_ORDER = ThreeRiRequestType(JsonField.of("TELEPHONE_ORDER")) + @JvmField val MAIL_ORDER = ThreeRiRequestType(JsonField.of("MAIL_ORDER")) @JvmField - val TRUST_LIST_STATUS_CHECK = - ThreeRiRequestType(JsonField.of("TRUST_LIST_STATUS_CHECK")) + val MAINTAIN_CARD_INFO = ThreeRiRequestType(JsonField.of("MAINTAIN_CARD_INFO")) @JvmField val OTHER_PAYMENT = ThreeRiRequestType(JsonField.of("OTHER_PAYMENT")) - @JvmField val BILLING_AGREEMENT = ThreeRiRequestType(JsonField.of("BILLING_AGREEMENT")) - @JvmField - val DEVICE_BINDING_STATUS_CHECK = - ThreeRiRequestType(JsonField.of("DEVICE_BINDING_STATUS_CHECK")) + val RECURRING_TRANSACTION = ThreeRiRequestType(JsonField.of("RECURRING_TRANSACTION")) - @JvmField - val CARD_SECURITY_CODE_STATUS_CHECK = - ThreeRiRequestType(JsonField.of("CARD_SECURITY_CODE_STATUS_CHECK")) + @JvmField val SPLIT_PAYMENT = ThreeRiRequestType(JsonField.of("SPLIT_PAYMENT")) - @JvmField val DELAYED_SHIPMENT = ThreeRiRequestType(JsonField.of("DELAYED_SHIPMENT")) + @JvmField val SPLIT_SHIPMENT = ThreeRiRequestType(JsonField.of("SPLIT_SHIPMENT")) - @JvmField val SPLIT_PAYMENT = ThreeRiRequestType(JsonField.of("SPLIT_PAYMENT")) + @JvmField val TELEPHONE_ORDER = ThreeRiRequestType(JsonField.of("TELEPHONE_ORDER")) + + @JvmField val TOP_UP = ThreeRiRequestType(JsonField.of("TOP_UP")) + + @JvmField + val TRUST_LIST_STATUS_CHECK = + ThreeRiRequestType(JsonField.of("TRUST_LIST_STATUS_CHECK")) @JvmStatic fun of(value: String) = ThreeRiRequestType(JsonField.of(value)) } enum class Known { - RECURRING_TRANSACTION, - INSTALLMENT_TRANSACTION, - ADD_CARD, - MAINTAIN_CARD_INFO, ACCOUNT_VERIFICATION, - SPLIT_SHIPMENT, - TOP_UP, - MAIL_ORDER, - TELEPHONE_ORDER, - TRUST_LIST_STATUS_CHECK, - OTHER_PAYMENT, + ADD_CARD, BILLING_AGREEMENT, - DEVICE_BINDING_STATUS_CHECK, CARD_SECURITY_CODE_STATUS_CHECK, DELAYED_SHIPMENT, - SPLIT_PAYMENT, - } - - enum class Value { - RECURRING_TRANSACTION, + DEVICE_BINDING_STATUS_CHECK, INSTALLMENT_TRANSACTION, - ADD_CARD, + MAIL_ORDER, MAINTAIN_CARD_INFO, - ACCOUNT_VERIFICATION, + OTHER_PAYMENT, + RECURRING_TRANSACTION, + SPLIT_PAYMENT, SPLIT_SHIPMENT, - TOP_UP, - MAIL_ORDER, TELEPHONE_ORDER, + TOP_UP, TRUST_LIST_STATUS_CHECK, - OTHER_PAYMENT, + } + + enum class Value { + ACCOUNT_VERIFICATION, + ADD_CARD, BILLING_AGREEMENT, - DEVICE_BINDING_STATUS_CHECK, CARD_SECURITY_CODE_STATUS_CHECK, DELAYED_SHIPMENT, + DEVICE_BINDING_STATUS_CHECK, + INSTALLMENT_TRANSACTION, + MAIL_ORDER, + MAINTAIN_CARD_INFO, + OTHER_PAYMENT, + RECURRING_TRANSACTION, SPLIT_PAYMENT, + SPLIT_SHIPMENT, + TELEPHONE_ORDER, + TOP_UP, + TRUST_LIST_STATUS_CHECK, _UNKNOWN, } fun value(): Value = when (this) { - RECURRING_TRANSACTION -> Value.RECURRING_TRANSACTION - INSTALLMENT_TRANSACTION -> Value.INSTALLMENT_TRANSACTION - ADD_CARD -> Value.ADD_CARD - MAINTAIN_CARD_INFO -> Value.MAINTAIN_CARD_INFO ACCOUNT_VERIFICATION -> Value.ACCOUNT_VERIFICATION - SPLIT_SHIPMENT -> Value.SPLIT_SHIPMENT - TOP_UP -> Value.TOP_UP - MAIL_ORDER -> Value.MAIL_ORDER - TELEPHONE_ORDER -> Value.TELEPHONE_ORDER - TRUST_LIST_STATUS_CHECK -> Value.TRUST_LIST_STATUS_CHECK - OTHER_PAYMENT -> Value.OTHER_PAYMENT + ADD_CARD -> Value.ADD_CARD BILLING_AGREEMENT -> Value.BILLING_AGREEMENT - DEVICE_BINDING_STATUS_CHECK -> Value.DEVICE_BINDING_STATUS_CHECK CARD_SECURITY_CODE_STATUS_CHECK -> Value.CARD_SECURITY_CODE_STATUS_CHECK DELAYED_SHIPMENT -> Value.DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK -> Value.DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION -> Value.INSTALLMENT_TRANSACTION + MAIL_ORDER -> Value.MAIL_ORDER + MAINTAIN_CARD_INFO -> Value.MAINTAIN_CARD_INFO + OTHER_PAYMENT -> Value.OTHER_PAYMENT + RECURRING_TRANSACTION -> Value.RECURRING_TRANSACTION SPLIT_PAYMENT -> Value.SPLIT_PAYMENT + SPLIT_SHIPMENT -> Value.SPLIT_SHIPMENT + TELEPHONE_ORDER -> Value.TELEPHONE_ORDER + TOP_UP -> Value.TOP_UP + TRUST_LIST_STATUS_CHECK -> Value.TRUST_LIST_STATUS_CHECK else -> Value._UNKNOWN } fun known(): Known = when (this) { - RECURRING_TRANSACTION -> Known.RECURRING_TRANSACTION - INSTALLMENT_TRANSACTION -> Known.INSTALLMENT_TRANSACTION - ADD_CARD -> Known.ADD_CARD - MAINTAIN_CARD_INFO -> Known.MAINTAIN_CARD_INFO ACCOUNT_VERIFICATION -> Known.ACCOUNT_VERIFICATION - SPLIT_SHIPMENT -> Known.SPLIT_SHIPMENT - TOP_UP -> Known.TOP_UP - MAIL_ORDER -> Known.MAIL_ORDER - TELEPHONE_ORDER -> Known.TELEPHONE_ORDER - TRUST_LIST_STATUS_CHECK -> Known.TRUST_LIST_STATUS_CHECK - OTHER_PAYMENT -> Known.OTHER_PAYMENT + ADD_CARD -> Known.ADD_CARD BILLING_AGREEMENT -> Known.BILLING_AGREEMENT - DEVICE_BINDING_STATUS_CHECK -> Known.DEVICE_BINDING_STATUS_CHECK CARD_SECURITY_CODE_STATUS_CHECK -> Known.CARD_SECURITY_CODE_STATUS_CHECK DELAYED_SHIPMENT -> Known.DELAYED_SHIPMENT + DEVICE_BINDING_STATUS_CHECK -> Known.DEVICE_BINDING_STATUS_CHECK + INSTALLMENT_TRANSACTION -> Known.INSTALLMENT_TRANSACTION + MAIL_ORDER -> Known.MAIL_ORDER + MAINTAIN_CARD_INFO -> Known.MAINTAIN_CARD_INFO + OTHER_PAYMENT -> Known.OTHER_PAYMENT + RECURRING_TRANSACTION -> Known.RECURRING_TRANSACTION SPLIT_PAYMENT -> Known.SPLIT_PAYMENT + SPLIT_SHIPMENT -> Known.SPLIT_SHIPMENT + TELEPHONE_ORDER -> Known.TELEPHONE_ORDER + TOP_UP -> Known.TOP_UP + TRUST_LIST_STATUS_CHECK -> Known.TRUST_LIST_STATUS_CHECK else -> throw LithicInvalidDataException("Unknown ThreeRiRequestType: $value") } @@ -3720,54 +3720,54 @@ private constructor( companion object { - @JvmField val GOODS_SERVICE_PURCHASE = Type(JsonField.of("GOODS_SERVICE_PURCHASE")) + @JvmField val ACCOUNT_FUNDING = Type(JsonField.of("ACCOUNT_FUNDING")) @JvmField val CHECK_ACCEPTANCE = Type(JsonField.of("CHECK_ACCEPTANCE")) - @JvmField val ACCOUNT_FUNDING = Type(JsonField.of("ACCOUNT_FUNDING")) - - @JvmField val QUASI_CASH_TRANSACTION = Type(JsonField.of("QUASI_CASH_TRANSACTION")) + @JvmField val GOODS_SERVICE_PURCHASE = Type(JsonField.of("GOODS_SERVICE_PURCHASE")) @JvmField val PREPAID_ACTIVATION_AND_LOAD = Type(JsonField.of("PREPAID_ACTIVATION_AND_LOAD")) + @JvmField val QUASI_CASH_TRANSACTION = Type(JsonField.of("QUASI_CASH_TRANSACTION")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { - GOODS_SERVICE_PURCHASE, - CHECK_ACCEPTANCE, ACCOUNT_FUNDING, - QUASI_CASH_TRANSACTION, + CHECK_ACCEPTANCE, + GOODS_SERVICE_PURCHASE, PREPAID_ACTIVATION_AND_LOAD, + QUASI_CASH_TRANSACTION, } enum class Value { - GOODS_SERVICE_PURCHASE, - CHECK_ACCEPTANCE, ACCOUNT_FUNDING, - QUASI_CASH_TRANSACTION, + CHECK_ACCEPTANCE, + GOODS_SERVICE_PURCHASE, PREPAID_ACTIVATION_AND_LOAD, + QUASI_CASH_TRANSACTION, _UNKNOWN, } fun value(): Value = when (this) { - GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION + CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE PREPAID_ACTIVATION_AND_LOAD -> Value.PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION else -> Value._UNKNOWN } fun known(): Known = when (this) { - GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION + CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE + GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE PREPAID_ACTIVATION_AND_LOAD -> Known.PREPAID_ACTIVATION_AND_LOAD + QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt index 5b5325e5..1986aa50 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Balance.kt @@ -25,12 +25,12 @@ private constructor( private val availableAmount: JsonField, private val created: JsonField, private val currency: JsonField, + private val financialAccountToken: JsonField, + private val financialAccountType: JsonField, private val lastTransactionEventToken: JsonField, private val lastTransactionToken: JsonField, private val pendingAmount: JsonField, - private val financialAccountToken: JsonField, private val totalAmount: JsonField, - private val financialAccountType: JsonField, private val updated: JsonField, private val additionalProperties: Map, ) { @@ -48,6 +48,14 @@ private constructor( /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ fun currency(): String = currency.getRequired("currency") + /** Globally unique identifier for the financial account that holds this balance. */ + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + /** Type of financial account. */ + fun financialAccountType(): FinancialAccountType = + financialAccountType.getRequired("financial_account_type") + /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -64,20 +72,12 @@ private constructor( */ fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount") - /** Globally unique identifier for the financial account that holds this balance. */ - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") - /** * The sum of available and pending balance in the currency's smallest unit (e.g., cents for * USD). */ fun totalAmount(): Long = totalAmount.getRequired("total_amount") - /** Type of financial account. */ - fun financialAccountType(): FinancialAccountType = - financialAccountType.getRequired("financial_account_type") - /** Date and time for when the balance was last updated. */ fun updated(): OffsetDateTime = updated.getRequired("updated") @@ -90,6 +90,16 @@ private constructor( /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** Globally unique identifier for the financial account that holds this balance. */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** Type of financial account. */ + @JsonProperty("financial_account_type") + @ExcludeMissing + fun _financialAccountType() = financialAccountType + /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -109,22 +119,12 @@ private constructor( */ @JsonProperty("pending_amount") @ExcludeMissing fun _pendingAmount() = pendingAmount - /** Globally unique identifier for the financial account that holds this balance. */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - /** * The sum of available and pending balance in the currency's smallest unit (e.g., cents for * USD). */ @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount() = totalAmount - /** Type of financial account. */ - @JsonProperty("financial_account_type") - @ExcludeMissing - fun _financialAccountType() = financialAccountType - /** Date and time for when the balance was last updated. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated @@ -137,12 +137,12 @@ private constructor( availableAmount() created() currency() + financialAccountToken() + financialAccountType() lastTransactionEventToken() lastTransactionToken() pendingAmount() - financialAccountToken() totalAmount() - financialAccountType() updated() validated = true } @@ -159,12 +159,12 @@ private constructor( this.availableAmount == other.availableAmount && this.created == other.created && this.currency == other.currency && + this.financialAccountToken == other.financialAccountToken && + this.financialAccountType == other.financialAccountType && this.lastTransactionEventToken == other.lastTransactionEventToken && this.lastTransactionToken == other.lastTransactionToken && this.pendingAmount == other.pendingAmount && - this.financialAccountToken == other.financialAccountToken && this.totalAmount == other.totalAmount && - this.financialAccountType == other.financialAccountType && this.updated == other.updated && this.additionalProperties == other.additionalProperties } @@ -176,12 +176,12 @@ private constructor( availableAmount, created, currency, + financialAccountToken, + financialAccountType, lastTransactionEventToken, lastTransactionToken, pendingAmount, - financialAccountToken, totalAmount, - financialAccountType, updated, additionalProperties, ) @@ -190,7 +190,7 @@ private constructor( } override fun toString() = - "Balance{availableAmount=$availableAmount, created=$created, currency=$currency, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, financialAccountToken=$financialAccountToken, totalAmount=$totalAmount, financialAccountType=$financialAccountType, updated=$updated, additionalProperties=$additionalProperties}" + "Balance{availableAmount=$availableAmount, created=$created, currency=$currency, financialAccountToken=$financialAccountToken, financialAccountType=$financialAccountType, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -202,12 +202,12 @@ private constructor( private var availableAmount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var financialAccountType: JsonField = JsonMissing.of() private var lastTransactionEventToken: JsonField = JsonMissing.of() private var lastTransactionToken: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() private var totalAmount: JsonField = JsonMissing.of() - private var financialAccountType: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -216,12 +216,12 @@ private constructor( this.availableAmount = balance.availableAmount this.created = balance.created this.currency = balance.currency + this.financialAccountToken = balance.financialAccountToken + this.financialAccountType = balance.financialAccountType this.lastTransactionEventToken = balance.lastTransactionEventToken this.lastTransactionToken = balance.lastTransactionToken this.pendingAmount = balance.pendingAmount - this.financialAccountToken = balance.financialAccountToken this.totalAmount = balance.totalAmount - this.financialAccountType = balance.financialAccountType this.updated = balance.updated additionalProperties(balance.additionalProperties) } @@ -252,6 +252,28 @@ private constructor( @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } + /** Globally unique identifier for the financial account that holds this balance. */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** Globally unique identifier for the financial account that holds this balance. */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Type of financial account. */ + fun financialAccountType(financialAccountType: FinancialAccountType) = + financialAccountType(JsonField.of(financialAccountType)) + + /** Type of financial account. */ + @JsonProperty("financial_account_type") + @ExcludeMissing + fun financialAccountType(financialAccountType: JsonField) = apply { + this.financialAccountType = financialAccountType + } + /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -300,17 +322,6 @@ private constructor( this.pendingAmount = pendingAmount } - /** Globally unique identifier for the financial account that holds this balance. */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** Globally unique identifier for the financial account that holds this balance. */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - /** * The sum of available and pending balance in the currency's smallest unit (e.g., cents for * USD). @@ -325,17 +336,6 @@ private constructor( @ExcludeMissing fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } - /** Type of financial account. */ - fun financialAccountType(financialAccountType: FinancialAccountType) = - financialAccountType(JsonField.of(financialAccountType)) - - /** Type of financial account. */ - @JsonProperty("financial_account_type") - @ExcludeMissing - fun financialAccountType(financialAccountType: JsonField) = apply { - this.financialAccountType = financialAccountType - } - /** Date and time for when the balance was last updated. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -363,12 +363,12 @@ private constructor( availableAmount, created, currency, + financialAccountToken, + financialAccountType, lastTransactionEventToken, lastTransactionToken, pendingAmount, - financialAccountToken, totalAmount, - financialAccountType, updated, additionalProperties.toUnmodifiable(), ) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt index ce10ddae..d02ef90f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Card.kt @@ -22,11 +22,13 @@ import java.util.Optional @NoAutoDetect class Card private constructor( + private val authRuleTokens: JsonField>, private val created: JsonField, private val cvv: JsonField, - private val funding: JsonField, + private val digitalCardArtToken: JsonField, private val expMonth: JsonField, private val expYear: JsonField, + private val funding: JsonField, private val hostname: JsonField, private val lastFour: JsonField, private val memo: JsonField, @@ -34,10 +36,8 @@ private constructor( private val spendLimit: JsonField, private val spendLimitDuration: JsonField, private val state: JsonField, - private val authRuleTokens: JsonField>, private val token: JsonField, private val type: JsonField, - private val digitalCardArtToken: JsonField, private val additionalProperties: Map, ) { @@ -45,13 +45,25 @@ private constructor( private var hashCode: Int = 0 + /** List of identifiers for the Auth Rule(s) that are applied on the card. */ + fun authRuleTokens(): Optional> = + Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens")) + /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ fun created(): OffsetDateTime = created.getRequired("created") /** Three digit cvv printed on the back of the card. */ fun cvv(): Optional = Optional.ofNullable(cvv.getNullable("cvv")) - fun funding(): FundingAccount = funding.getRequired("funding") + /** + * Specifies the digital card art to be displayed in the user’s digital wallet after + * tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. + * See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) + * . + */ + fun digitalCardArtToken(): Optional = + Optional.ofNullable(digitalCardArtToken.getNullable("digital_card_art_token")) /** Two digit (MM) expiry month. */ fun expMonth(): Optional = Optional.ofNullable(expMonth.getNullable("exp_month")) @@ -59,6 +71,8 @@ private constructor( /** Four digit (yyyy) expiry year. */ fun expYear(): Optional = Optional.ofNullable(expYear.getNullable("exp_year")) + fun funding(): FundingAccount = funding.getRequired("funding") + /** Hostname of card’s locked merchant (will be empty if not applicable). */ fun hostname(): Optional = Optional.ofNullable(hostname.getNullable("hostname")) @@ -117,10 +131,6 @@ private constructor( */ fun state(): State = state.getRequired("state") - /** List of identifiers for the Auth Rule(s) that are applied on the card. */ - fun authRuleTokens(): Optional> = - Optional.ofNullable(authRuleTokens.getNullable("auth_rule_tokens")) - /** Globally unique identifier. */ fun token(): String = token.getRequired("token") @@ -138,15 +148,8 @@ private constructor( */ fun type(): Type = type.getRequired("type") - /** - * Specifies the digital card art to be displayed in the user’s digital wallet after - * tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. - * See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) - * . - */ - fun digitalCardArtToken(): Optional = - Optional.ofNullable(digitalCardArtToken.getNullable("digital_card_art_token")) + /** List of identifiers for the Auth Rule(s) that are applied on the card. */ + @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created @@ -154,7 +157,16 @@ private constructor( /** Three digit cvv printed on the back of the card. */ @JsonProperty("cvv") @ExcludeMissing fun _cvv() = cvv - @JsonProperty("funding") @ExcludeMissing fun _funding() = funding + /** + * Specifies the digital card art to be displayed in the user’s digital wallet after + * tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. + * See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) + * . + */ + @JsonProperty("digital_card_art_token") + @ExcludeMissing + fun _digitalCardArtToken() = digitalCardArtToken /** Two digit (MM) expiry month. */ @JsonProperty("exp_month") @ExcludeMissing fun _expMonth() = expMonth @@ -162,6 +174,8 @@ private constructor( /** Four digit (yyyy) expiry year. */ @JsonProperty("exp_year") @ExcludeMissing fun _expYear() = expYear + @JsonProperty("funding") @ExcludeMissing fun _funding() = funding + /** Hostname of card’s locked merchant (will be empty if not applicable). */ @JsonProperty("hostname") @ExcludeMissing fun _hostname() = hostname @@ -221,9 +235,6 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state - /** List of identifiers for the Auth Rule(s) that are applied on the card. */ - @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens - /** Globally unique identifier. */ @JsonProperty("token") @ExcludeMissing fun _token() = token @@ -241,28 +252,19 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type() = type - /** - * Specifies the digital card art to be displayed in the user’s digital wallet after - * tokenization. This artwork must be approved by Mastercard and configured by Lithic to use. - * See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) - * . - */ - @JsonProperty("digital_card_art_token") - @ExcludeMissing - fun _digitalCardArtToken() = digitalCardArtToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Card = apply { if (!validated) { + authRuleTokens() created() cvv() - funding().validate() + digitalCardArtToken() expMonth() expYear() + funding().validate() hostname() lastFour() memo() @@ -270,10 +272,8 @@ private constructor( spendLimit() spendLimitDuration() state() - authRuleTokens() token() type() - digitalCardArtToken() validated = true } } @@ -286,11 +286,13 @@ private constructor( } return other is Card && + this.authRuleTokens == other.authRuleTokens && this.created == other.created && this.cvv == other.cvv && - this.funding == other.funding && + this.digitalCardArtToken == other.digitalCardArtToken && this.expMonth == other.expMonth && this.expYear == other.expYear && + this.funding == other.funding && this.hostname == other.hostname && this.lastFour == other.lastFour && this.memo == other.memo && @@ -298,10 +300,8 @@ private constructor( this.spendLimit == other.spendLimit && this.spendLimitDuration == other.spendLimitDuration && this.state == other.state && - this.authRuleTokens == other.authRuleTokens && this.token == other.token && this.type == other.type && - this.digitalCardArtToken == other.digitalCardArtToken && this.additionalProperties == other.additionalProperties } @@ -309,11 +309,13 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( + authRuleTokens, created, cvv, - funding, + digitalCardArtToken, expMonth, expYear, + funding, hostname, lastFour, memo, @@ -321,10 +323,8 @@ private constructor( spendLimit, spendLimitDuration, state, - authRuleTokens, token, type, - digitalCardArtToken, additionalProperties, ) } @@ -332,7 +332,7 @@ private constructor( } override fun toString() = - "Card{created=$created, cvv=$cvv, funding=$funding, expMonth=$expMonth, expYear=$expYear, hostname=$hostname, lastFour=$lastFour, memo=$memo, pan=$pan, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, authRuleTokens=$authRuleTokens, token=$token, type=$type, digitalCardArtToken=$digitalCardArtToken, additionalProperties=$additionalProperties}" + "Card{authRuleTokens=$authRuleTokens, created=$created, cvv=$cvv, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, funding=$funding, hostname=$hostname, lastFour=$lastFour, memo=$memo, pan=$pan, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, token=$token, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -341,11 +341,13 @@ private constructor( class Builder { + private var authRuleTokens: JsonField> = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var cvv: JsonField = JsonMissing.of() - private var funding: JsonField = JsonMissing.of() + private var digitalCardArtToken: JsonField = JsonMissing.of() private var expMonth: JsonField = JsonMissing.of() private var expYear: JsonField = JsonMissing.of() + private var funding: JsonField = JsonMissing.of() private var hostname: JsonField = JsonMissing.of() private var lastFour: JsonField = JsonMissing.of() private var memo: JsonField = JsonMissing.of() @@ -353,19 +355,19 @@ private constructor( private var spendLimit: JsonField = JsonMissing.of() private var spendLimitDuration: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() - private var authRuleTokens: JsonField> = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() - private var digitalCardArtToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(card: Card) = apply { + this.authRuleTokens = card.authRuleTokens this.created = card.created this.cvv = card.cvv - this.funding = card.funding + this.digitalCardArtToken = card.digitalCardArtToken this.expMonth = card.expMonth this.expYear = card.expYear + this.funding = card.funding this.hostname = card.hostname this.lastFour = card.lastFour this.memo = card.memo @@ -373,13 +375,22 @@ private constructor( this.spendLimit = card.spendLimit this.spendLimitDuration = card.spendLimitDuration this.state = card.state - this.authRuleTokens = card.authRuleTokens this.token = card.token this.type = card.type - this.digitalCardArtToken = card.digitalCardArtToken additionalProperties(card.additionalProperties) } + /** List of identifiers for the Auth Rule(s) that are applied on the card. */ + fun authRuleTokens(authRuleTokens: List) = + authRuleTokens(JsonField.of(authRuleTokens)) + + /** List of identifiers for the Auth Rule(s) that are applied on the card. */ + @JsonProperty("auth_rule_tokens") + @ExcludeMissing + fun authRuleTokens(authRuleTokens: JsonField>) = apply { + this.authRuleTokens = authRuleTokens + } + /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -396,11 +407,28 @@ private constructor( @ExcludeMissing fun cvv(cvv: JsonField) = apply { this.cvv = cvv } - fun funding(funding: FundingAccount) = funding(JsonField.of(funding)) + /** + * Specifies the digital card art to be displayed in the user’s digital wallet after + * tokenization. This artwork must be approved by Mastercard and configured by Lithic to + * use. See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) + * . + */ + fun digitalCardArtToken(digitalCardArtToken: String) = + digitalCardArtToken(JsonField.of(digitalCardArtToken)) - @JsonProperty("funding") + /** + * Specifies the digital card art to be displayed in the user’s digital wallet after + * tokenization. This artwork must be approved by Mastercard and configured by Lithic to + * use. See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) + * . + */ + @JsonProperty("digital_card_art_token") @ExcludeMissing - fun funding(funding: JsonField) = apply { this.funding = funding } + fun digitalCardArtToken(digitalCardArtToken: JsonField) = apply { + this.digitalCardArtToken = digitalCardArtToken + } /** Two digit (MM) expiry month. */ fun expMonth(expMonth: String) = expMonth(JsonField.of(expMonth)) @@ -418,6 +446,12 @@ private constructor( @ExcludeMissing fun expYear(expYear: JsonField) = apply { this.expYear = expYear } + fun funding(funding: FundingAccount) = funding(JsonField.of(funding)) + + @JsonProperty("funding") + @ExcludeMissing + fun funding(funding: JsonField) = apply { this.funding = funding } + /** Hostname of card’s locked merchant (will be empty if not applicable). */ fun hostname(hostname: String) = hostname(JsonField.of(hostname)) @@ -553,17 +587,6 @@ private constructor( @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } - /** List of identifiers for the Auth Rule(s) that are applied on the card. */ - fun authRuleTokens(authRuleTokens: List) = - authRuleTokens(JsonField.of(authRuleTokens)) - - /** List of identifiers for the Auth Rule(s) that are applied on the card. */ - @JsonProperty("auth_rule_tokens") - @ExcludeMissing - fun authRuleTokens(authRuleTokens: JsonField>) = apply { - this.authRuleTokens = authRuleTokens - } - /** Globally unique identifier. */ fun token(token: String) = token(JsonField.of(token)) @@ -602,29 +625,6 @@ private constructor( @ExcludeMissing fun type(type: JsonField) = apply { this.type = type } - /** - * Specifies the digital card art to be displayed in the user’s digital wallet after - * tokenization. This artwork must be approved by Mastercard and configured by Lithic to - * use. See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) - * . - */ - fun digitalCardArtToken(digitalCardArtToken: String) = - digitalCardArtToken(JsonField.of(digitalCardArtToken)) - - /** - * Specifies the digital card art to be displayed in the user’s digital wallet after - * tokenization. This artwork must be approved by Mastercard and configured by Lithic to - * use. See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art) - * . - */ - @JsonProperty("digital_card_art_token") - @ExcludeMissing - fun digitalCardArtToken(digitalCardArtToken: JsonField) = apply { - this.digitalCardArtToken = digitalCardArtToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -641,11 +641,13 @@ private constructor( fun build(): Card = Card( + authRuleTokens.map { it.toUnmodifiable() }, created, cvv, - funding, + digitalCardArtToken, expMonth, expYear, + funding, hostname, lastFour, memo, @@ -653,10 +655,8 @@ private constructor( spendLimit, spendLimitDuration, state, - authRuleTokens.map { it.toUnmodifiable() }, token, type, - digitalCardArtToken, additionalProperties.toUnmodifiable(), ) } @@ -994,41 +994,41 @@ private constructor( companion object { + @JvmField val DELETED = State(JsonField.of("DELETED")) + @JvmField val ENABLED = State(JsonField.of("ENABLED")) @JvmField val PENDING = State(JsonField.of("PENDING")) - @JvmField val DELETED = State(JsonField.of("DELETED")) - @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { + DELETED, ENABLED, PENDING, - DELETED, } enum class Value { + DELETED, ENABLED, PENDING, - DELETED, _UNKNOWN, } fun value(): Value = when (this) { + DELETED -> Value.DELETED ENABLED -> Value.ENABLED PENDING -> Value.PENDING - DELETED -> Value.DELETED else -> Value._UNKNOWN } fun known(): Known = when (this) { + DELETED -> Known.DELETED ENABLED -> Known.ENABLED PENDING -> Known.PENDING - DELETED -> Known.DELETED else -> throw LithicInvalidDataException("Unknown State: $value") } @@ -1190,47 +1190,47 @@ private constructor( companion object { - @JvmField val VIRTUAL = Type(JsonField.of("VIRTUAL")) + @JvmField val MERCHANT_LOCKED = Type(JsonField.of("MERCHANT_LOCKED")) @JvmField val PHYSICAL = Type(JsonField.of("PHYSICAL")) - @JvmField val MERCHANT_LOCKED = Type(JsonField.of("MERCHANT_LOCKED")) - @JvmField val SINGLE_USE = Type(JsonField.of("SINGLE_USE")) + @JvmField val VIRTUAL = Type(JsonField.of("VIRTUAL")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { - VIRTUAL, - PHYSICAL, MERCHANT_LOCKED, + PHYSICAL, SINGLE_USE, + VIRTUAL, } enum class Value { - VIRTUAL, - PHYSICAL, MERCHANT_LOCKED, + PHYSICAL, SINGLE_USE, + VIRTUAL, _UNKNOWN, } fun value(): Value = when (this) { - VIRTUAL -> Value.VIRTUAL - PHYSICAL -> Value.PHYSICAL MERCHANT_LOCKED -> Value.MERCHANT_LOCKED + PHYSICAL -> Value.PHYSICAL SINGLE_USE -> Value.SINGLE_USE + VIRTUAL -> Value.VIRTUAL else -> Value._UNKNOWN } fun known(): Known = when (this) { - VIRTUAL -> Known.VIRTUAL - PHYSICAL -> Known.PHYSICAL MERCHANT_LOCKED -> Known.MERCHANT_LOCKED + PHYSICAL -> Known.PHYSICAL SINGLE_USE -> Known.SINGLE_USE + VIRTUAL -> Known.VIRTUAL else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt index 5ea2cee6..11d9b932 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardCreateParams.kt @@ -29,6 +29,7 @@ constructor( private val memo: String?, private val pin: String?, private val productId: String?, + private val replacementFor: String?, private val shippingAddress: ShippingAddress?, private val shippingMethod: ShippingMethod?, private val spendLimit: Long?, @@ -59,6 +60,8 @@ constructor( fun productId(): Optional = Optional.ofNullable(productId) + fun replacementFor(): Optional = Optional.ofNullable(replacementFor) + fun shippingAddress(): Optional = Optional.ofNullable(shippingAddress) fun shippingMethod(): Optional = Optional.ofNullable(shippingMethod) @@ -82,6 +85,7 @@ constructor( memo, pin, productId, + replacementFor, shippingAddress, shippingMethod, spendLimit, @@ -109,6 +113,7 @@ constructor( private val memo: String?, private val pin: String?, private val productId: String?, + private val replacementFor: String?, private val shippingAddress: ShippingAddress?, private val shippingMethod: ShippingMethod?, private val spendLimit: Long?, @@ -194,6 +199,12 @@ constructor( */ @JsonProperty("product_id") fun productId(): String? = productId + /** + * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card that + * this physical card will replace. + */ + @JsonProperty("replacement_for") fun replacementFor(): String? = replacementFor + @JsonProperty("shipping_address") fun shippingAddress(): ShippingAddress? = shippingAddress /** @@ -262,6 +273,7 @@ constructor( this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && + this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && @@ -284,6 +296,7 @@ constructor( memo, pin, productId, + replacementFor, shippingAddress, shippingMethod, spendLimit, @@ -296,7 +309,7 @@ constructor( } override fun toString() = - "CardCreateBody{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}" + "CardCreateBody{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalProperties=$additionalProperties}" companion object { @@ -315,6 +328,7 @@ constructor( private var memo: String? = null private var pin: String? = null private var productId: String? = null + private var replacementFor: String? = null private var shippingAddress: ShippingAddress? = null private var shippingMethod: ShippingMethod? = null private var spendLimit: Long? = null @@ -334,6 +348,7 @@ constructor( this.memo = cardCreateBody.memo this.pin = cardCreateBody.pin this.productId = cardCreateBody.productId + this.replacementFor = cardCreateBody.replacementFor this.shippingAddress = cardCreateBody.shippingAddress this.shippingMethod = cardCreateBody.shippingMethod this.spendLimit = cardCreateBody.spendLimit @@ -428,6 +443,15 @@ constructor( @JsonProperty("product_id") fun productId(productId: String) = apply { this.productId = productId } + /** + * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card + * that this physical card will replace. + */ + @JsonProperty("replacement_for") + fun replacementFor(replacementFor: String) = apply { + this.replacementFor = replacementFor + } + @JsonProperty("shipping_address") fun shippingAddress(shippingAddress: ShippingAddress) = apply { this.shippingAddress = shippingAddress @@ -511,6 +535,7 @@ constructor( memo, pin, productId, + replacementFor, shippingAddress, shippingMethod, spendLimit, @@ -543,6 +568,7 @@ constructor( this.memo == other.memo && this.pin == other.pin && this.productId == other.productId && + this.replacementFor == other.replacementFor && this.shippingAddress == other.shippingAddress && this.shippingMethod == other.shippingMethod && this.spendLimit == other.spendLimit && @@ -565,6 +591,7 @@ constructor( memo, pin, productId, + replacementFor, shippingAddress, shippingMethod, spendLimit, @@ -577,7 +604,7 @@ constructor( } override fun toString() = - "CardCreateParams{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + "CardCreateParams{type=$type, accountToken=$accountToken, cardProgramToken=$cardProgramToken, carrier=$carrier, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, memo=$memo, pin=$pin, productId=$productId, replacementFor=$replacementFor, shippingAddress=$shippingAddress, shippingMethod=$shippingMethod, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" fun toBuilder() = Builder().from(this) @@ -599,6 +626,7 @@ constructor( private var memo: String? = null private var pin: String? = null private var productId: String? = null + private var replacementFor: String? = null private var shippingAddress: ShippingAddress? = null private var shippingMethod: ShippingMethod? = null private var spendLimit: Long? = null @@ -620,6 +648,7 @@ constructor( this.memo = cardCreateParams.memo this.pin = cardCreateParams.pin this.productId = cardCreateParams.productId + this.replacementFor = cardCreateParams.replacementFor this.shippingAddress = cardCreateParams.shippingAddress this.shippingMethod = cardCreateParams.shippingMethod this.spendLimit = cardCreateParams.spendLimit @@ -708,6 +737,12 @@ constructor( */ fun productId(productId: String) = apply { this.productId = productId } + /** + * Only applicable to cards of type `PHYSICAL`. Globally unique identifier for the card that + * this physical card will replace. + */ + fun replacementFor(replacementFor: String) = apply { this.replacementFor = replacementFor } + fun shippingAddress(shippingAddress: ShippingAddress) = apply { this.shippingAddress = shippingAddress } @@ -825,6 +860,7 @@ constructor( memo, pin, productId, + replacementFor, shippingAddress, shippingMethod, spendLimit, @@ -858,47 +894,47 @@ constructor( companion object { - @JvmField val VIRTUAL = Type(JsonField.of("VIRTUAL")) + @JvmField val MERCHANT_LOCKED = Type(JsonField.of("MERCHANT_LOCKED")) @JvmField val PHYSICAL = Type(JsonField.of("PHYSICAL")) - @JvmField val MERCHANT_LOCKED = Type(JsonField.of("MERCHANT_LOCKED")) - @JvmField val SINGLE_USE = Type(JsonField.of("SINGLE_USE")) + @JvmField val VIRTUAL = Type(JsonField.of("VIRTUAL")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { - VIRTUAL, - PHYSICAL, MERCHANT_LOCKED, + PHYSICAL, SINGLE_USE, + VIRTUAL, } enum class Value { - VIRTUAL, - PHYSICAL, MERCHANT_LOCKED, + PHYSICAL, SINGLE_USE, + VIRTUAL, _UNKNOWN, } fun value(): Value = when (this) { - VIRTUAL -> Value.VIRTUAL - PHYSICAL -> Value.PHYSICAL MERCHANT_LOCKED -> Value.MERCHANT_LOCKED + PHYSICAL -> Value.PHYSICAL SINGLE_USE -> Value.SINGLE_USE + VIRTUAL -> Value.VIRTUAL else -> Value._UNKNOWN } fun known(): Known = when (this) { - VIRTUAL -> Known.VIRTUAL - PHYSICAL -> Known.PHYSICAL MERCHANT_LOCKED -> Known.MERCHANT_LOCKED + PHYSICAL -> Known.PHYSICAL SINGLE_USE -> Known.SINGLE_USE + VIRTUAL -> Known.VIRTUAL else -> throw LithicInvalidDataException("Unknown Type: $value") } @@ -927,60 +963,60 @@ constructor( companion object { - @JvmField val STANDARD = ShippingMethod(JsonField.of("STANDARD")) - - @JvmField - val STANDARD_WITH_TRACKING = ShippingMethod(JsonField.of("STANDARD_WITH_TRACKING")) + @JvmField val _2_DAY = ShippingMethod(JsonField.of("2_DAY")) - @JvmField val PRIORITY = ShippingMethod(JsonField.of("PRIORITY")) + @JvmField val EXPEDITED = ShippingMethod(JsonField.of("EXPEDITED")) @JvmField val EXPRESS = ShippingMethod(JsonField.of("EXPRESS")) - @JvmField val _2_DAY = ShippingMethod(JsonField.of("2_DAY")) + @JvmField val PRIORITY = ShippingMethod(JsonField.of("PRIORITY")) - @JvmField val EXPEDITED = ShippingMethod(JsonField.of("EXPEDITED")) + @JvmField val STANDARD = ShippingMethod(JsonField.of("STANDARD")) + + @JvmField + val STANDARD_WITH_TRACKING = ShippingMethod(JsonField.of("STANDARD_WITH_TRACKING")) @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) } enum class Known { - STANDARD, - STANDARD_WITH_TRACKING, - PRIORITY, - EXPRESS, _2_DAY, EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, } enum class Value { - STANDARD, - STANDARD_WITH_TRACKING, - PRIORITY, - EXPRESS, _2_DAY, EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, _UNKNOWN, } fun value(): Value = when (this) { - STANDARD -> Value.STANDARD - STANDARD_WITH_TRACKING -> Value.STANDARD_WITH_TRACKING - PRIORITY -> Value.PRIORITY - EXPRESS -> Value.EXPRESS _2_DAY -> Value._2_DAY EXPEDITED -> Value.EXPEDITED + EXPRESS -> Value.EXPRESS + PRIORITY -> Value.PRIORITY + STANDARD -> Value.STANDARD + STANDARD_WITH_TRACKING -> Value.STANDARD_WITH_TRACKING else -> Value._UNKNOWN } fun known(): Known = when (this) { - STANDARD -> Known.STANDARD - STANDARD_WITH_TRACKING -> Known.STANDARD_WITH_TRACKING - PRIORITY -> Known.PRIORITY - EXPRESS -> Known.EXPRESS _2_DAY -> Known._2_DAY EXPEDITED -> Known.EXPEDITED + EXPRESS -> Known.EXPRESS + PRIORITY -> Known.PRIORITY + STANDARD -> Known.STANDARD + STANDARD_WITH_TRACKING -> Known.STANDARD_WITH_TRACKING else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt index 1012f3ec..51d9a40d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardListParams.kt @@ -236,53 +236,53 @@ constructor( companion object { + @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val OPEN = State(JsonField.of("OPEN")) @JvmField val PAUSED = State(JsonField.of("PAUSED")) - @JvmField val CLOSED = State(JsonField.of("CLOSED")) + @JvmField val PENDING_ACTIVATION = State(JsonField.of("PENDING_ACTIVATION")) @JvmField val PENDING_FULFILLMENT = State(JsonField.of("PENDING_FULFILLMENT")) - @JvmField val PENDING_ACTIVATION = State(JsonField.of("PENDING_ACTIVATION")) - @JvmStatic fun of(value: String) = State(JsonField.of(value)) } enum class Known { + CLOSED, OPEN, PAUSED, - CLOSED, - PENDING_FULFILLMENT, PENDING_ACTIVATION, + PENDING_FULFILLMENT, } enum class Value { + CLOSED, OPEN, PAUSED, - CLOSED, - PENDING_FULFILLMENT, PENDING_ACTIVATION, + PENDING_FULFILLMENT, _UNKNOWN, } fun value(): Value = when (this) { + CLOSED -> Value.CLOSED OPEN -> Value.OPEN PAUSED -> Value.PAUSED - CLOSED -> Value.CLOSED - PENDING_FULFILLMENT -> Value.PENDING_FULFILLMENT PENDING_ACTIVATION -> Value.PENDING_ACTIVATION + PENDING_FULFILLMENT -> Value.PENDING_FULFILLMENT else -> Value._UNKNOWN } fun known(): Known = when (this) { + CLOSED -> Known.CLOSED OPEN -> Known.OPEN PAUSED -> Known.PAUSED - CLOSED -> Known.CLOSED - PENDING_FULFILLMENT -> Known.PENDING_FULFILLMENT PENDING_ACTIVATION -> Known.PENDING_ACTIVATION + PENDING_FULFILLMENT -> Known.PENDING_FULFILLMENT else -> throw LithicInvalidDataException("Unknown State: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProductCreditDetailResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProductCreditDetailResponse.kt index 0b426d44..ce283f7e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProductCreditDetailResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProductCreditDetailResponse.kt @@ -18,8 +18,8 @@ import java.util.Objects @NoAutoDetect class CardProductCreditDetailResponse private constructor( - private val creditLimit: JsonField, private val creditExtended: JsonField, + private val creditLimit: JsonField, private val additionalProperties: Map, ) { @@ -27,26 +27,26 @@ private constructor( private var hashCode: Int = 0 - /** The total credit limit of the program */ - fun creditLimit(): Long = creditLimit.getRequired("credit_limit") - /** The amount of credit extended within the program */ fun creditExtended(): Long = creditExtended.getRequired("credit_extended") /** The total credit limit of the program */ - @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit + fun creditLimit(): Long = creditLimit.getRequired("credit_limit") /** The amount of credit extended within the program */ @JsonProperty("credit_extended") @ExcludeMissing fun _creditExtended() = creditExtended + /** The total credit limit of the program */ + @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): CardProductCreditDetailResponse = apply { if (!validated) { - creditLimit() creditExtended() + creditLimit() validated = true } } @@ -59,8 +59,8 @@ private constructor( } return other is CardProductCreditDetailResponse && - this.creditLimit == other.creditLimit && this.creditExtended == other.creditExtended && + this.creditLimit == other.creditLimit && this.additionalProperties == other.additionalProperties } @@ -68,8 +68,8 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - creditLimit, creditExtended, + creditLimit, additionalProperties, ) } @@ -77,7 +77,7 @@ private constructor( } override fun toString() = - "CardProductCreditDetailResponse{creditLimit=$creditLimit, creditExtended=$creditExtended, additionalProperties=$additionalProperties}" + "CardProductCreditDetailResponse{creditExtended=$creditExtended, creditLimit=$creditLimit, additionalProperties=$additionalProperties}" companion object { @@ -86,26 +86,18 @@ private constructor( class Builder { - private var creditLimit: JsonField = JsonMissing.of() private var creditExtended: JsonField = JsonMissing.of() + private var creditLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(cardProductCreditDetailResponse: CardProductCreditDetailResponse) = apply { - this.creditLimit = cardProductCreditDetailResponse.creditLimit this.creditExtended = cardProductCreditDetailResponse.creditExtended + this.creditLimit = cardProductCreditDetailResponse.creditLimit additionalProperties(cardProductCreditDetailResponse.additionalProperties) } - /** The total credit limit of the program */ - fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - - /** The total credit limit of the program */ - @JsonProperty("credit_limit") - @ExcludeMissing - fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } - /** The amount of credit extended within the program */ fun creditExtended(creditExtended: Long) = creditExtended(JsonField.of(creditExtended)) @@ -116,6 +108,14 @@ private constructor( this.creditExtended = creditExtended } + /** The total credit limit of the program */ + fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) + + /** The total credit limit of the program */ + @JsonProperty("credit_limit") + @ExcludeMissing + fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -132,8 +132,8 @@ private constructor( fun build(): CardProductCreditDetailResponse = CardProductCreditDetailResponse( - creditLimit, creditExtended, + creditLimit, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt index 2d4511bf..3ff9eba0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt @@ -20,10 +20,10 @@ import java.util.Objects class CardProgram private constructor( private val created: JsonField, - private val token: JsonField, - private val panRangeStart: JsonField, - private val panRangeEnd: JsonField, private val name: JsonField, + private val panRangeEnd: JsonField, + private val panRangeStart: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -34,32 +34,32 @@ private constructor( /** Timestamp of when the card program was created. */ fun created(): OffsetDateTime = created.getRequired("created") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - - /** The first digits of the card number that this card program starts with. */ - fun panRangeStart(): String = panRangeStart.getRequired("pan_range_start") + /** The name of the card program. */ + fun name(): String = name.getRequired("name") /** The first digits of the card number that this card program ends with. */ fun panRangeEnd(): String = panRangeEnd.getRequired("pan_range_end") - /** The name of the card program. */ - fun name(): String = name.getRequired("name") + /** The first digits of the card number that this card program starts with. */ + fun panRangeStart(): String = panRangeStart.getRequired("pan_range_start") + + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") /** Timestamp of when the card program was created. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - - /** The first digits of the card number that this card program starts with. */ - @JsonProperty("pan_range_start") @ExcludeMissing fun _panRangeStart() = panRangeStart + /** The name of the card program. */ + @JsonProperty("name") @ExcludeMissing fun _name() = name /** The first digits of the card number that this card program ends with. */ @JsonProperty("pan_range_end") @ExcludeMissing fun _panRangeEnd() = panRangeEnd - /** The name of the card program. */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** The first digits of the card number that this card program starts with. */ + @JsonProperty("pan_range_start") @ExcludeMissing fun _panRangeStart() = panRangeStart + + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token @JsonAnyGetter @ExcludeMissing @@ -68,10 +68,10 @@ private constructor( fun validate(): CardProgram = apply { if (!validated) { created() - token() - panRangeStart() - panRangeEnd() name() + panRangeEnd() + panRangeStart() + token() validated = true } } @@ -85,10 +85,10 @@ private constructor( return other is CardProgram && this.created == other.created && - this.token == other.token && - this.panRangeStart == other.panRangeStart && - this.panRangeEnd == other.panRangeEnd && this.name == other.name && + this.panRangeEnd == other.panRangeEnd && + this.panRangeStart == other.panRangeStart && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -97,10 +97,10 @@ private constructor( hashCode = Objects.hash( created, - token, - panRangeStart, - panRangeEnd, name, + panRangeEnd, + panRangeStart, + token, additionalProperties, ) } @@ -108,7 +108,7 @@ private constructor( } override fun toString() = - "CardProgram{created=$created, token=$token, panRangeStart=$panRangeStart, panRangeEnd=$panRangeEnd, name=$name, additionalProperties=$additionalProperties}" + "CardProgram{created=$created, name=$name, panRangeEnd=$panRangeEnd, panRangeStart=$panRangeStart, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -118,19 +118,19 @@ private constructor( class Builder { private var created: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var panRangeStart: JsonField = JsonMissing.of() - private var panRangeEnd: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var panRangeEnd: JsonField = JsonMissing.of() + private var panRangeStart: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(cardProgram: CardProgram) = apply { this.created = cardProgram.created - this.token = cardProgram.token - this.panRangeStart = cardProgram.panRangeStart - this.panRangeEnd = cardProgram.panRangeEnd this.name = cardProgram.name + this.panRangeEnd = cardProgram.panRangeEnd + this.panRangeStart = cardProgram.panRangeStart + this.token = cardProgram.token additionalProperties(cardProgram.additionalProperties) } @@ -142,13 +142,21 @@ private constructor( @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) + /** The name of the card program. */ + fun name(name: String) = name(JsonField.of(name)) - /** Globally unique identifier. */ - @JsonProperty("token") + /** The name of the card program. */ + @JsonProperty("name") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun name(name: JsonField) = apply { this.name = name } + + /** The first digits of the card number that this card program ends with. */ + fun panRangeEnd(panRangeEnd: String) = panRangeEnd(JsonField.of(panRangeEnd)) + + /** The first digits of the card number that this card program ends with. */ + @JsonProperty("pan_range_end") + @ExcludeMissing + fun panRangeEnd(panRangeEnd: JsonField) = apply { this.panRangeEnd = panRangeEnd } /** The first digits of the card number that this card program starts with. */ fun panRangeStart(panRangeStart: String) = panRangeStart(JsonField.of(panRangeStart)) @@ -160,21 +168,13 @@ private constructor( this.panRangeStart = panRangeStart } - /** The first digits of the card number that this card program ends with. */ - fun panRangeEnd(panRangeEnd: String) = panRangeEnd(JsonField.of(panRangeEnd)) - - /** The first digits of the card number that this card program ends with. */ - @JsonProperty("pan_range_end") - @ExcludeMissing - fun panRangeEnd(panRangeEnd: JsonField) = apply { this.panRangeEnd = panRangeEnd } - - /** The name of the card program. */ - fun name(name: String) = name(JsonField.of(name)) + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) - /** The name of the card program. */ - @JsonProperty("name") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing - fun name(name: JsonField) = apply { this.name = name } + fun token(token: JsonField) = apply { this.token = token } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -193,10 +193,10 @@ private constructor( fun build(): CardProgram = CardProgram( created, - token, - panRangeStart, - panRangeEnd, name, + panRangeEnd, + panRangeStart, + token, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt index 25b75af0..24361fc9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardReissueParams.kt @@ -411,60 +411,60 @@ constructor( companion object { - @JvmField val STANDARD = ShippingMethod(JsonField.of("STANDARD")) - - @JvmField - val STANDARD_WITH_TRACKING = ShippingMethod(JsonField.of("STANDARD_WITH_TRACKING")) + @JvmField val _2_DAY = ShippingMethod(JsonField.of("2-DAY")) - @JvmField val PRIORITY = ShippingMethod(JsonField.of("PRIORITY")) + @JvmField val EXPEDITED = ShippingMethod(JsonField.of("EXPEDITED")) @JvmField val EXPRESS = ShippingMethod(JsonField.of("EXPRESS")) - @JvmField val _2_DAY = ShippingMethod(JsonField.of("2-DAY")) + @JvmField val PRIORITY = ShippingMethod(JsonField.of("PRIORITY")) - @JvmField val EXPEDITED = ShippingMethod(JsonField.of("EXPEDITED")) + @JvmField val STANDARD = ShippingMethod(JsonField.of("STANDARD")) + + @JvmField + val STANDARD_WITH_TRACKING = ShippingMethod(JsonField.of("STANDARD_WITH_TRACKING")) @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) } enum class Known { - STANDARD, - STANDARD_WITH_TRACKING, - PRIORITY, - EXPRESS, _2_DAY, EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, } enum class Value { - STANDARD, - STANDARD_WITH_TRACKING, - PRIORITY, - EXPRESS, _2_DAY, EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, _UNKNOWN, } fun value(): Value = when (this) { - STANDARD -> Value.STANDARD - STANDARD_WITH_TRACKING -> Value.STANDARD_WITH_TRACKING - PRIORITY -> Value.PRIORITY - EXPRESS -> Value.EXPRESS _2_DAY -> Value._2_DAY EXPEDITED -> Value.EXPEDITED + EXPRESS -> Value.EXPRESS + PRIORITY -> Value.PRIORITY + STANDARD -> Value.STANDARD + STANDARD_WITH_TRACKING -> Value.STANDARD_WITH_TRACKING else -> Value._UNKNOWN } fun known(): Known = when (this) { - STANDARD -> Known.STANDARD - STANDARD_WITH_TRACKING -> Known.STANDARD_WITH_TRACKING - PRIORITY -> Known.PRIORITY - EXPRESS -> Known.EXPRESS _2_DAY -> Known._2_DAY EXPEDITED -> Known.EXPEDITED + EXPRESS -> Known.EXPRESS + PRIORITY -> Known.PRIORITY + STANDARD -> Known.STANDARD + STANDARD_WITH_TRACKING -> Known.STANDARD_WITH_TRACKING else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt new file mode 100644 index 00000000..26dad028 --- /dev/null +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardRenewParams.kt @@ -0,0 +1,543 @@ +// 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.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 CardRenewParams +constructor( + private val cardToken: String, + private val shippingAddress: ShippingAddress, + private val carrier: Carrier?, + private val expMonth: String?, + private val expYear: String?, + private val productId: String?, + private val shippingMethod: ShippingMethod?, + private val additionalQueryParams: Map>, + private val additionalHeaders: Map>, + private val additionalBodyProperties: Map, +) { + + fun cardToken(): String = cardToken + + fun shippingAddress(): ShippingAddress = shippingAddress + + fun carrier(): Optional = Optional.ofNullable(carrier) + + fun expMonth(): Optional = Optional.ofNullable(expMonth) + + fun expYear(): Optional = Optional.ofNullable(expYear) + + fun productId(): Optional = Optional.ofNullable(productId) + + fun shippingMethod(): Optional = Optional.ofNullable(shippingMethod) + + @JvmSynthetic + internal fun getBody(): CardRenewBody { + return CardRenewBody( + shippingAddress, + carrier, + expMonth, + expYear, + productId, + shippingMethod, + additionalBodyProperties, + ) + } + + @JvmSynthetic internal fun getQueryParams(): Map> = additionalQueryParams + + @JvmSynthetic internal fun getHeaders(): Map> = additionalHeaders + + fun getPathParam(index: Int): String { + return when (index) { + 0 -> cardToken + else -> "" + } + } + + @JsonDeserialize(builder = CardRenewBody.Builder::class) + @NoAutoDetect + class CardRenewBody + internal constructor( + private val shippingAddress: ShippingAddress?, + private val carrier: Carrier?, + private val expMonth: String?, + private val expYear: String?, + private val productId: String?, + private val shippingMethod: ShippingMethod?, + private val additionalProperties: Map, + ) { + + private var hashCode: Int = 0 + + /** The shipping address this card will be sent to. */ + @JsonProperty("shipping_address") fun shippingAddress(): ShippingAddress? = shippingAddress + + /** If omitted, the previous carrier will be used. */ + @JsonProperty("carrier") fun carrier(): Carrier? = carrier + + /** + * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + @JsonProperty("exp_month") fun expMonth(): String? = expMonth + + /** + * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + @JsonProperty("exp_year") fun expYear(): String? = expYear + + /** + * Specifies the configuration (e.g. physical card art) that the card should be manufactured + * with, and only applies to cards of type `PHYSICAL`. This must be configured with Lithic + * before use. + */ + @JsonProperty("product_id") fun productId(): String? = productId + + /** + * Shipping method for the card. Use of options besides `STANDARD` require additional + * permissions. + * + * - `STANDARD` - USPS regular mail or similar international option, with no tracking + * - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with + * tracking + * - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + * - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + * - `2_DAY` - FedEx 2-day shipping, with tracking + * - `EXPEDITED` - FedEx Standard Overnight or similar international option, with tracking + */ + @JsonProperty("shipping_method") fun shippingMethod(): ShippingMethod? = shippingMethod + + @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 CardRenewBody && + this.shippingAddress == other.shippingAddress && + this.carrier == other.carrier && + this.expMonth == other.expMonth && + this.expYear == other.expYear && + this.productId == other.productId && + this.shippingMethod == other.shippingMethod && + this.additionalProperties == other.additionalProperties + } + + override fun hashCode(): Int { + if (hashCode == 0) { + hashCode = + Objects.hash( + shippingAddress, + carrier, + expMonth, + expYear, + productId, + shippingMethod, + additionalProperties, + ) + } + return hashCode + } + + override fun toString() = + "CardRenewBody{shippingAddress=$shippingAddress, carrier=$carrier, expMonth=$expMonth, expYear=$expYear, productId=$productId, shippingMethod=$shippingMethod, additionalProperties=$additionalProperties}" + + companion object { + + @JvmStatic fun builder() = Builder() + } + + class Builder { + + private var shippingAddress: ShippingAddress? = null + private var carrier: Carrier? = null + private var expMonth: String? = null + private var expYear: String? = null + private var productId: String? = null + private var shippingMethod: ShippingMethod? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardRenewBody: CardRenewBody) = apply { + this.shippingAddress = cardRenewBody.shippingAddress + this.carrier = cardRenewBody.carrier + this.expMonth = cardRenewBody.expMonth + this.expYear = cardRenewBody.expYear + this.productId = cardRenewBody.productId + this.shippingMethod = cardRenewBody.shippingMethod + additionalProperties(cardRenewBody.additionalProperties) + } + + /** The shipping address this card will be sent to. */ + @JsonProperty("shipping_address") + fun shippingAddress(shippingAddress: ShippingAddress) = apply { + this.shippingAddress = shippingAddress + } + + /** If omitted, the previous carrier will be used. */ + @JsonProperty("carrier") + fun carrier(carrier: Carrier) = apply { this.carrier = carrier } + + /** + * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + @JsonProperty("exp_month") + fun expMonth(expMonth: String) = apply { this.expMonth = expMonth } + + /** + * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + @JsonProperty("exp_year") + fun expYear(expYear: String) = apply { this.expYear = expYear } + + /** + * Specifies the configuration (e.g. physical card art) that the card should be + * manufactured with, and only applies to cards of type `PHYSICAL`. This must be + * configured with Lithic before use. + */ + @JsonProperty("product_id") + fun productId(productId: String) = apply { this.productId = productId } + + /** + * Shipping method for the card. Use of options besides `STANDARD` require additional + * permissions. + * + * - `STANDARD` - USPS regular mail or similar international option, with no tracking + * - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with + * tracking + * - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + * - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + * - `2_DAY` - FedEx 2-day shipping, with tracking + * - `EXPEDITED` - FedEx Standard Overnight or similar international option, with + * tracking + */ + @JsonProperty("shipping_method") + fun shippingMethod(shippingMethod: ShippingMethod) = apply { + this.shippingMethod = shippingMethod + } + + 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(): CardRenewBody = + CardRenewBody( + checkNotNull(shippingAddress) { + "`shippingAddress` is required but was not set" + }, + carrier, + expMonth, + expYear, + productId, + shippingMethod, + 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 CardRenewParams && + this.cardToken == other.cardToken && + this.shippingAddress == other.shippingAddress && + this.carrier == other.carrier && + this.expMonth == other.expMonth && + this.expYear == other.expYear && + this.productId == other.productId && + this.shippingMethod == other.shippingMethod && + this.additionalQueryParams == other.additionalQueryParams && + this.additionalHeaders == other.additionalHeaders && + this.additionalBodyProperties == other.additionalBodyProperties + } + + override fun hashCode(): Int { + return Objects.hash( + cardToken, + shippingAddress, + carrier, + expMonth, + expYear, + productId, + shippingMethod, + additionalQueryParams, + additionalHeaders, + additionalBodyProperties, + ) + } + + override fun toString() = + "CardRenewParams{cardToken=$cardToken, shippingAddress=$shippingAddress, carrier=$carrier, expMonth=$expMonth, expYear=$expYear, productId=$productId, shippingMethod=$shippingMethod, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + + fun toBuilder() = Builder().from(this) + + companion object { + + @JvmStatic fun builder() = Builder() + } + + @NoAutoDetect + class Builder { + + private var cardToken: String? = null + private var shippingAddress: ShippingAddress? = null + private var carrier: Carrier? = null + private var expMonth: String? = null + private var expYear: String? = null + private var productId: String? = null + private var shippingMethod: ShippingMethod? = null + private var additionalQueryParams: MutableMap> = mutableMapOf() + private var additionalHeaders: MutableMap> = mutableMapOf() + private var additionalBodyProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardRenewParams: CardRenewParams) = apply { + this.cardToken = cardRenewParams.cardToken + this.shippingAddress = cardRenewParams.shippingAddress + this.carrier = cardRenewParams.carrier + this.expMonth = cardRenewParams.expMonth + this.expYear = cardRenewParams.expYear + this.productId = cardRenewParams.productId + this.shippingMethod = cardRenewParams.shippingMethod + additionalQueryParams(cardRenewParams.additionalQueryParams) + additionalHeaders(cardRenewParams.additionalHeaders) + additionalBodyProperties(cardRenewParams.additionalBodyProperties) + } + + fun cardToken(cardToken: String) = apply { this.cardToken = cardToken } + + /** The shipping address this card will be sent to. */ + fun shippingAddress(shippingAddress: ShippingAddress) = apply { + this.shippingAddress = shippingAddress + } + + /** If omitted, the previous carrier will be used. */ + fun carrier(carrier: Carrier) = apply { this.carrier = carrier } + + /** + * Two digit (MM) expiry month. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + fun expMonth(expMonth: String) = apply { this.expMonth = expMonth } + + /** + * Four digit (yyyy) expiry year. If neither `exp_month` nor `exp_year` is provided, an + * expiration date six years in the future will be generated. + */ + fun expYear(expYear: String) = apply { this.expYear = expYear } + + /** + * Specifies the configuration (e.g. physical card art) that the card should be manufactured + * with, and only applies to cards of type `PHYSICAL`. This must be configured with Lithic + * before use. + */ + fun productId(productId: String) = apply { this.productId = productId } + + /** + * Shipping method for the card. Use of options besides `STANDARD` require additional + * permissions. + * + * - `STANDARD` - USPS regular mail or similar international option, with no tracking + * - `STANDARD_WITH_TRACKING` - USPS regular mail or similar international option, with + * tracking + * - `PRIORITY` - USPS Priority, 1-3 day shipping, with tracking + * - `EXPRESS` - FedEx Express, 3-day shipping, with tracking + * - `2_DAY` - FedEx 2-day shipping, with tracking + * - `EXPEDITED` - FedEx Standard Overnight or similar international option, with tracking + */ + fun shippingMethod(shippingMethod: ShippingMethod) = apply { + this.shippingMethod = shippingMethod + } + + 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(): CardRenewParams = + CardRenewParams( + checkNotNull(cardToken) { "`cardToken` is required but was not set" }, + checkNotNull(shippingAddress) { "`shippingAddress` is required but was not set" }, + carrier, + expMonth, + expYear, + productId, + shippingMethod, + additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), + additionalBodyProperties.toUnmodifiable(), + ) + } + + class ShippingMethod + @JsonCreator + private constructor( + private val value: JsonField, + ) { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is ShippingMethod && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val _2_DAY = ShippingMethod(JsonField.of("2-DAY")) + + @JvmField val EXPEDITED = ShippingMethod(JsonField.of("EXPEDITED")) + + @JvmField val EXPRESS = ShippingMethod(JsonField.of("EXPRESS")) + + @JvmField val PRIORITY = ShippingMethod(JsonField.of("PRIORITY")) + + @JvmField val STANDARD = ShippingMethod(JsonField.of("STANDARD")) + + @JvmField + val STANDARD_WITH_TRACKING = ShippingMethod(JsonField.of("STANDARD_WITH_TRACKING")) + + @JvmStatic fun of(value: String) = ShippingMethod(JsonField.of(value)) + } + + enum class Known { + _2_DAY, + EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, + } + + enum class Value { + _2_DAY, + EXPEDITED, + EXPRESS, + PRIORITY, + STANDARD, + STANDARD_WITH_TRACKING, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + _2_DAY -> Value._2_DAY + EXPEDITED -> Value.EXPEDITED + EXPRESS -> Value.EXPRESS + PRIORITY -> Value.PRIORITY + STANDARD -> Value.STANDARD + STANDARD_WITH_TRACKING -> Value.STANDARD_WITH_TRACKING + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + _2_DAY -> Known._2_DAY + EXPEDITED -> Known.EXPEDITED + EXPRESS -> Known.EXPRESS + PRIORITY -> Known.PRIORITY + STANDARD -> Known.STANDARD + STANDARD_WITH_TRACKING -> Known.STANDARD_WITH_TRACKING + else -> throw LithicInvalidDataException("Unknown ShippingMethod: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } +} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt index 37c296cf..f6382a8e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/CardSpendLimits.kt @@ -19,7 +19,6 @@ import java.util.Optional @NoAutoDetect class CardSpendLimits private constructor( - private val required: JsonValue, private val availableSpendLimit: JsonField, private val additionalProperties: Map, ) { @@ -28,10 +27,8 @@ private constructor( private var hashCode: Int = 0 - fun availableSpendLimit(): Optional = - Optional.ofNullable(availableSpendLimit.getNullable("available_spend_limit")) - - @JsonProperty("required") @ExcludeMissing fun _required() = required + fun availableSpendLimit(): AvailableSpendLimit = + availableSpendLimit.getRequired("available_spend_limit") @JsonProperty("available_spend_limit") @ExcludeMissing @@ -43,7 +40,7 @@ private constructor( fun validate(): CardSpendLimits = apply { if (!validated) { - availableSpendLimit().map { it.validate() } + availableSpendLimit().validate() validated = true } } @@ -56,25 +53,19 @@ private constructor( } return other is CardSpendLimits && - this.required == other.required && this.availableSpendLimit == other.availableSpendLimit && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { - hashCode = - Objects.hash( - required, - availableSpendLimit, - additionalProperties, - ) + hashCode = Objects.hash(availableSpendLimit, additionalProperties) } return hashCode } override fun toString() = - "CardSpendLimits{required=$required, availableSpendLimit=$availableSpendLimit, additionalProperties=$additionalProperties}" + "CardSpendLimits{availableSpendLimit=$availableSpendLimit, additionalProperties=$additionalProperties}" companion object { @@ -83,21 +74,15 @@ private constructor( class Builder { - private var required: JsonValue = JsonMissing.of() private var availableSpendLimit: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(cardSpendLimits: CardSpendLimits) = apply { - this.required = cardSpendLimits.required this.availableSpendLimit = cardSpendLimits.availableSpendLimit additionalProperties(cardSpendLimits.additionalProperties) } - @JsonProperty("required") - @ExcludeMissing - fun required(required: JsonValue) = apply { this.required = required } - fun availableSpendLimit(availableSpendLimit: AvailableSpendLimit) = availableSpendLimit(JsonField.of(availableSpendLimit)) @@ -122,20 +107,16 @@ private constructor( } fun build(): CardSpendLimits = - CardSpendLimits( - required, - availableSpendLimit, - additionalProperties.toUnmodifiable(), - ) + CardSpendLimits(availableSpendLimit, additionalProperties.toUnmodifiable()) } @JsonDeserialize(builder = AvailableSpendLimit.Builder::class) @NoAutoDetect class AvailableSpendLimit private constructor( - private val monthly: JsonField, private val annually: JsonField, private val forever: JsonField, + private val monthly: JsonField, private val additionalProperties: Map, ) { @@ -143,9 +124,6 @@ private constructor( private var hashCode: Int = 0 - /** The available spend limit relative to the monthly limit configured on the Card. */ - fun monthly(): Optional = Optional.ofNullable(monthly.getNullable("monthly")) - /** The available spend limit relative to the annual limit configured on the Card. */ fun annually(): Optional = Optional.ofNullable(annually.getNullable("annually")) @@ -153,7 +131,7 @@ private constructor( fun forever(): Optional = Optional.ofNullable(forever.getNullable("forever")) /** The available spend limit relative to the monthly limit configured on the Card. */ - @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly + fun monthly(): Optional = Optional.ofNullable(monthly.getNullable("monthly")) /** The available spend limit relative to the annual limit configured on the Card. */ @JsonProperty("annually") @ExcludeMissing fun _annually() = annually @@ -161,15 +139,18 @@ private constructor( /** The available spend limit relative to the forever limit configured on the Card. */ @JsonProperty("forever") @ExcludeMissing fun _forever() = forever + /** The available spend limit relative to the monthly limit configured on the Card. */ + @JsonProperty("monthly") @ExcludeMissing fun _monthly() = monthly + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AvailableSpendLimit = apply { if (!validated) { - monthly() annually() forever() + monthly() validated = true } } @@ -182,9 +163,9 @@ private constructor( } return other is AvailableSpendLimit && - this.monthly == other.monthly && this.annually == other.annually && this.forever == other.forever && + this.monthly == other.monthly && this.additionalProperties == other.additionalProperties } @@ -192,9 +173,9 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - monthly, annually, forever, + monthly, additionalProperties, ) } @@ -202,7 +183,7 @@ private constructor( } override fun toString() = - "AvailableSpendLimit{monthly=$monthly, annually=$annually, forever=$forever, additionalProperties=$additionalProperties}" + "AvailableSpendLimit{annually=$annually, forever=$forever, monthly=$monthly, additionalProperties=$additionalProperties}" companion object { @@ -211,27 +192,19 @@ private constructor( class Builder { - private var monthly: JsonField = JsonMissing.of() private var annually: JsonField = JsonMissing.of() private var forever: JsonField = JsonMissing.of() + private var monthly: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(availableSpendLimit: AvailableSpendLimit) = apply { - this.monthly = availableSpendLimit.monthly this.annually = availableSpendLimit.annually this.forever = availableSpendLimit.forever + this.monthly = availableSpendLimit.monthly additionalProperties(availableSpendLimit.additionalProperties) } - /** The available spend limit relative to the monthly limit configured on the Card. */ - fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) - - /** The available spend limit relative to the monthly limit configured on the Card. */ - @JsonProperty("monthly") - @ExcludeMissing - fun monthly(monthly: JsonField) = apply { this.monthly = monthly } - /** The available spend limit relative to the annual limit configured on the Card. */ fun annually(annually: Long) = annually(JsonField.of(annually)) @@ -248,6 +221,14 @@ private constructor( @ExcludeMissing fun forever(forever: JsonField) = apply { this.forever = forever } + /** The available spend limit relative to the monthly limit configured on the Card. */ + fun monthly(monthly: Long) = monthly(JsonField.of(monthly)) + + /** The available spend limit relative to the monthly limit configured on the Card. */ + @JsonProperty("monthly") + @ExcludeMissing + fun monthly(monthly: JsonField) = apply { this.monthly = monthly } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -264,9 +245,9 @@ private constructor( fun build(): AvailableSpendLimit = AvailableSpendLimit( - monthly, annually, forever, + monthly, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt index 858a7de4..8d66f264 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt @@ -22,13 +22,13 @@ import java.util.Optional @NoAutoDetect class DigitalCardArt private constructor( - private val token: JsonField, private val cardProgramToken: JsonField, - private val isEnabled: JsonField, - private val isCardProgramDefault: JsonField, private val created: JsonField, - private val network: JsonField, private val description: JsonField, + private val isCardProgramDefault: JsonField, + private val isEnabled: JsonField, + private val network: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -36,50 +36,50 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier for the card art. */ - fun token(): String = token.getRequired("token") - /** Globally unique identifier for the card program. */ fun cardProgramToken(): String = cardProgramToken.getRequired("card_program_token") - /** Whether the card art is enabled. */ - fun isEnabled(): Boolean = isEnabled.getRequired("is_enabled") + /** Timestamp of when card art was created. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** Description of the card art. */ + fun description(): String = description.getRequired("description") /** Whether the card art is the default card art to be added upon tokenization. */ fun isCardProgramDefault(): Optional = Optional.ofNullable(isCardProgramDefault.getNullable("is_card_program_default")) - /** Timestamp of when card art was created. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Whether the card art is enabled. */ + fun isEnabled(): Boolean = isEnabled.getRequired("is_enabled") /** Card network. */ fun network(): Network = network.getRequired("network") - /** Description of the card art. */ - fun description(): String = description.getRequired("description") - /** Globally unique identifier for the card art. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun token(): String = token.getRequired("token") /** Globally unique identifier for the card program. */ @JsonProperty("card_program_token") @ExcludeMissing fun _cardProgramToken() = cardProgramToken - /** Whether the card art is enabled. */ - @JsonProperty("is_enabled") @ExcludeMissing fun _isEnabled() = isEnabled + /** Timestamp of when card art was created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Description of the card art. */ + @JsonProperty("description") @ExcludeMissing fun _description() = description /** Whether the card art is the default card art to be added upon tokenization. */ @JsonProperty("is_card_program_default") @ExcludeMissing fun _isCardProgramDefault() = isCardProgramDefault - /** Timestamp of when card art was created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Whether the card art is enabled. */ + @JsonProperty("is_enabled") @ExcludeMissing fun _isEnabled() = isEnabled /** Card network. */ @JsonProperty("network") @ExcludeMissing fun _network() = network - /** Description of the card art. */ - @JsonProperty("description") @ExcludeMissing fun _description() = description + /** Globally unique identifier for the card art. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token @JsonAnyGetter @ExcludeMissing @@ -87,13 +87,13 @@ private constructor( fun validate(): DigitalCardArt = apply { if (!validated) { - token() cardProgramToken() - isEnabled() - isCardProgramDefault() created() - network() description() + isCardProgramDefault() + isEnabled() + network() + token() validated = true } } @@ -106,13 +106,13 @@ private constructor( } return other is DigitalCardArt && - this.token == other.token && this.cardProgramToken == other.cardProgramToken && - this.isEnabled == other.isEnabled && - this.isCardProgramDefault == other.isCardProgramDefault && this.created == other.created && - this.network == other.network && this.description == other.description && + this.isCardProgramDefault == other.isCardProgramDefault && + this.isEnabled == other.isEnabled && + this.network == other.network && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -120,13 +120,13 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, cardProgramToken, - isEnabled, - isCardProgramDefault, created, - network, description, + isCardProgramDefault, + isEnabled, + network, + token, additionalProperties, ) } @@ -134,7 +134,7 @@ private constructor( } override fun toString() = - "DigitalCardArt{token=$token, cardProgramToken=$cardProgramToken, isEnabled=$isEnabled, isCardProgramDefault=$isCardProgramDefault, created=$created, network=$network, description=$description, additionalProperties=$additionalProperties}" + "DigitalCardArt{cardProgramToken=$cardProgramToken, created=$created, description=$description, isCardProgramDefault=$isCardProgramDefault, isEnabled=$isEnabled, network=$network, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -143,35 +143,27 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() private var cardProgramToken: JsonField = JsonMissing.of() - private var isEnabled: JsonField = JsonMissing.of() - private var isCardProgramDefault: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var network: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var isCardProgramDefault: JsonField = JsonMissing.of() + private var isEnabled: JsonField = JsonMissing.of() + private var network: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(digitalCardArt: DigitalCardArt) = apply { - this.token = digitalCardArt.token this.cardProgramToken = digitalCardArt.cardProgramToken - this.isEnabled = digitalCardArt.isEnabled - this.isCardProgramDefault = digitalCardArt.isCardProgramDefault this.created = digitalCardArt.created - this.network = digitalCardArt.network this.description = digitalCardArt.description + this.isCardProgramDefault = digitalCardArt.isCardProgramDefault + this.isEnabled = digitalCardArt.isEnabled + this.network = digitalCardArt.network + this.token = digitalCardArt.token additionalProperties(digitalCardArt.additionalProperties) } - /** Globally unique identifier for the card art. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the card art. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier for the card program. */ fun cardProgramToken(cardProgramToken: String) = cardProgramToken(JsonField.of(cardProgramToken)) @@ -183,13 +175,21 @@ private constructor( this.cardProgramToken = cardProgramToken } - /** Whether the card art is enabled. */ - fun isEnabled(isEnabled: Boolean) = isEnabled(JsonField.of(isEnabled)) + /** Timestamp of when card art was created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Whether the card art is enabled. */ - @JsonProperty("is_enabled") + /** Timestamp of when card art was created. */ + @JsonProperty("created") @ExcludeMissing - fun isEnabled(isEnabled: JsonField) = apply { this.isEnabled = isEnabled } + fun created(created: JsonField) = apply { this.created = created } + + /** Description of the card art. */ + fun description(description: String) = description(JsonField.of(description)) + + /** Description of the card art. */ + @JsonProperty("description") + @ExcludeMissing + fun description(description: JsonField) = apply { this.description = description } /** Whether the card art is the default card art to be added upon tokenization. */ fun isCardProgramDefault(isCardProgramDefault: Boolean) = @@ -202,13 +202,13 @@ private constructor( this.isCardProgramDefault = isCardProgramDefault } - /** Timestamp of when card art was created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Whether the card art is enabled. */ + fun isEnabled(isEnabled: Boolean) = isEnabled(JsonField.of(isEnabled)) - /** Timestamp of when card art was created. */ - @JsonProperty("created") + /** Whether the card art is enabled. */ + @JsonProperty("is_enabled") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun isEnabled(isEnabled: JsonField) = apply { this.isEnabled = isEnabled } /** Card network. */ fun network(network: Network) = network(JsonField.of(network)) @@ -218,13 +218,13 @@ private constructor( @ExcludeMissing fun network(network: JsonField) = apply { this.network = network } - /** Description of the card art. */ - fun description(description: String) = description(JsonField.of(description)) + /** Globally unique identifier for the card art. */ + fun token(token: String) = token(JsonField.of(token)) - /** Description of the card art. */ - @JsonProperty("description") + /** Globally unique identifier for the card art. */ + @JsonProperty("token") @ExcludeMissing - fun description(description: JsonField) = apply { this.description = description } + fun token(token: JsonField) = apply { this.token = token } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -242,13 +242,13 @@ private constructor( fun build(): DigitalCardArt = DigitalCardArt( - token, cardProgramToken, - isEnabled, - isCardProgramDefault, created, - network, description, + isCardProgramDefault, + isEnabled, + network, + token, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt index 267d0805..8388f4de 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Dispute.kt @@ -29,10 +29,10 @@ private constructor( private val customerFiledDate: JsonField, private val customerNote: JsonField, private val networkClaimIds: JsonField>, - private val primaryClaimId: JsonField, private val networkFiledDate: JsonField, private val networkReasonCode: JsonField, private val prearbitrationDate: JsonField, + private val primaryClaimId: JsonField, private val reason: JsonField, private val representmentDate: JsonField, private val resolutionAmount: JsonField, @@ -71,13 +71,6 @@ private constructor( fun networkClaimIds(): Optional> = Optional.ofNullable(networkClaimIds.getNullable("network_claim_ids")) - /** - * Unique identifier for the dispute from the network. If there are multiple, this will be the - * first claim id set by the network - */ - fun primaryClaimId(): Optional = - Optional.ofNullable(primaryClaimId.getNullable("primary_claim_id")) - /** Date that the dispute was submitted to the network. */ fun networkFiledDate(): Optional = Optional.ofNullable(networkFiledDate.getNullable("network_filed_date")) @@ -90,6 +83,13 @@ private constructor( fun prearbitrationDate(): Optional = Optional.ofNullable(prearbitrationDate.getNullable("prearbitration_date")) + /** + * Unique identifier for the dispute from the network. If there are multiple, this will be the + * first claim id set by the network + */ + fun primaryClaimId(): Optional = + Optional.ofNullable(primaryClaimId.getNullable("primary_claim_id")) + /** * Dispute reason: * @@ -193,12 +193,6 @@ private constructor( /** Unique identifiers for the dispute from the network. */ @JsonProperty("network_claim_ids") @ExcludeMissing fun _networkClaimIds() = networkClaimIds - /** - * Unique identifier for the dispute from the network. If there are multiple, this will be the - * first claim id set by the network - */ - @JsonProperty("primary_claim_id") @ExcludeMissing fun _primaryClaimId() = primaryClaimId - /** Date that the dispute was submitted to the network. */ @JsonProperty("network_filed_date") @ExcludeMissing fun _networkFiledDate() = networkFiledDate @@ -212,6 +206,12 @@ private constructor( @ExcludeMissing fun _prearbitrationDate() = prearbitrationDate + /** + * Unique identifier for the dispute from the network. If there are multiple, this will be the + * first claim id set by the network + */ + @JsonProperty("primary_claim_id") @ExcludeMissing fun _primaryClaimId() = primaryClaimId + /** * Dispute reason: * @@ -302,10 +302,10 @@ private constructor( customerFiledDate() customerNote() networkClaimIds() - primaryClaimId() networkFiledDate() networkReasonCode() prearbitrationDate() + primaryClaimId() reason() representmentDate() resolutionAmount() @@ -333,10 +333,10 @@ private constructor( this.customerFiledDate == other.customerFiledDate && this.customerNote == other.customerNote && this.networkClaimIds == other.networkClaimIds && - this.primaryClaimId == other.primaryClaimId && this.networkFiledDate == other.networkFiledDate && this.networkReasonCode == other.networkReasonCode && this.prearbitrationDate == other.prearbitrationDate && + this.primaryClaimId == other.primaryClaimId && this.reason == other.reason && this.representmentDate == other.representmentDate && this.resolutionAmount == other.resolutionAmount && @@ -359,10 +359,10 @@ private constructor( customerFiledDate, customerNote, networkClaimIds, - primaryClaimId, networkFiledDate, networkReasonCode, prearbitrationDate, + primaryClaimId, reason, representmentDate, resolutionAmount, @@ -379,7 +379,7 @@ private constructor( } override fun toString() = - "Dispute{amount=$amount, arbitrationDate=$arbitrationDate, created=$created, customerFiledDate=$customerFiledDate, customerNote=$customerNote, networkClaimIds=$networkClaimIds, primaryClaimId=$primaryClaimId, networkFiledDate=$networkFiledDate, networkReasonCode=$networkReasonCode, prearbitrationDate=$prearbitrationDate, reason=$reason, representmentDate=$representmentDate, resolutionAmount=$resolutionAmount, resolutionDate=$resolutionDate, resolutionNote=$resolutionNote, resolutionReason=$resolutionReason, status=$status, token=$token, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" + "Dispute{amount=$amount, arbitrationDate=$arbitrationDate, created=$created, customerFiledDate=$customerFiledDate, customerNote=$customerNote, networkClaimIds=$networkClaimIds, networkFiledDate=$networkFiledDate, networkReasonCode=$networkReasonCode, prearbitrationDate=$prearbitrationDate, primaryClaimId=$primaryClaimId, reason=$reason, representmentDate=$representmentDate, resolutionAmount=$resolutionAmount, resolutionDate=$resolutionDate, resolutionNote=$resolutionNote, resolutionReason=$resolutionReason, status=$status, token=$token, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" companion object { @@ -394,10 +394,10 @@ private constructor( private var customerFiledDate: JsonField = JsonMissing.of() private var customerNote: JsonField = JsonMissing.of() private var networkClaimIds: JsonField> = JsonMissing.of() - private var primaryClaimId: JsonField = JsonMissing.of() private var networkFiledDate: JsonField = JsonMissing.of() private var networkReasonCode: JsonField = JsonMissing.of() private var prearbitrationDate: JsonField = JsonMissing.of() + private var primaryClaimId: JsonField = JsonMissing.of() private var reason: JsonField = JsonMissing.of() private var representmentDate: JsonField = JsonMissing.of() private var resolutionAmount: JsonField = JsonMissing.of() @@ -417,10 +417,10 @@ private constructor( this.customerFiledDate = dispute.customerFiledDate this.customerNote = dispute.customerNote this.networkClaimIds = dispute.networkClaimIds - this.primaryClaimId = dispute.primaryClaimId this.networkFiledDate = dispute.networkFiledDate this.networkReasonCode = dispute.networkReasonCode this.prearbitrationDate = dispute.prearbitrationDate + this.primaryClaimId = dispute.primaryClaimId this.reason = dispute.reason this.representmentDate = dispute.representmentDate this.resolutionAmount = dispute.resolutionAmount @@ -492,22 +492,6 @@ private constructor( this.networkClaimIds = networkClaimIds } - /** - * Unique identifier for the dispute from the network. If there are multiple, this will be - * the first claim id set by the network - */ - fun primaryClaimId(primaryClaimId: String) = primaryClaimId(JsonField.of(primaryClaimId)) - - /** - * Unique identifier for the dispute from the network. If there are multiple, this will be - * the first claim id set by the network - */ - @JsonProperty("primary_claim_id") - @ExcludeMissing - fun primaryClaimId(primaryClaimId: JsonField) = apply { - this.primaryClaimId = primaryClaimId - } - /** Date that the dispute was submitted to the network. */ fun networkFiledDate(networkFiledDate: OffsetDateTime) = networkFiledDate(JsonField.of(networkFiledDate)) @@ -541,6 +525,22 @@ private constructor( this.prearbitrationDate = prearbitrationDate } + /** + * Unique identifier for the dispute from the network. If there are multiple, this will be + * the first claim id set by the network + */ + fun primaryClaimId(primaryClaimId: String) = primaryClaimId(JsonField.of(primaryClaimId)) + + /** + * Unique identifier for the dispute from the network. If there are multiple, this will be + * the first claim id set by the network + */ + @JsonProperty("primary_claim_id") + @ExcludeMissing + fun primaryClaimId(primaryClaimId: JsonField) = apply { + this.primaryClaimId = primaryClaimId + } + /** * Dispute reason: * @@ -756,10 +756,10 @@ private constructor( customerFiledDate, customerNote, networkClaimIds.map { it.toUnmodifiable() }, - primaryClaimId, networkFiledDate, networkReasonCode, prearbitrationDate, + primaryClaimId, reason, representmentDate, resolutionAmount, @@ -822,12 +822,12 @@ private constructor( @JvmField val PROCESSING_ERROR = Reason(JsonField.of("PROCESSING_ERROR")) - @JvmField val REFUND_NOT_PROCESSED = Reason(JsonField.of("REFUND_NOT_PROCESSED")) - @JvmField val RECURRING_TRANSACTION_NOT_CANCELLED = Reason(JsonField.of("RECURRING_TRANSACTION_NOT_CANCELLED")) + @JvmField val REFUND_NOT_PROCESSED = Reason(JsonField.of("REFUND_NOT_PROCESSED")) + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } @@ -844,8 +844,8 @@ private constructor( MISSING_AUTH, OTHER, PROCESSING_ERROR, - REFUND_NOT_PROCESSED, RECURRING_TRANSACTION_NOT_CANCELLED, + REFUND_NOT_PROCESSED, } enum class Value { @@ -861,8 +861,8 @@ private constructor( MISSING_AUTH, OTHER, PROCESSING_ERROR, - REFUND_NOT_PROCESSED, RECURRING_TRANSACTION_NOT_CANCELLED, + REFUND_NOT_PROCESSED, _UNKNOWN, } @@ -880,8 +880,8 @@ private constructor( MISSING_AUTH -> Value.MISSING_AUTH OTHER -> Value.OTHER PROCESSING_ERROR -> Value.PROCESSING_ERROR - REFUND_NOT_PROCESSED -> Value.REFUND_NOT_PROCESSED RECURRING_TRANSACTION_NOT_CANCELLED -> Value.RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED -> Value.REFUND_NOT_PROCESSED else -> Value._UNKNOWN } @@ -899,8 +899,8 @@ private constructor( MISSING_AUTH -> Known.MISSING_AUTH OTHER -> Known.OTHER PROCESSING_ERROR -> Known.PROCESSING_ERROR - REFUND_NOT_PROCESSED -> Known.REFUND_NOT_PROCESSED RECURRING_TRANSACTION_NOT_CANCELLED -> Known.RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED -> Known.REFUND_NOT_PROCESSED else -> throw LithicInvalidDataException("Unknown Reason: $value") } @@ -1092,71 +1092,71 @@ private constructor( companion object { - @JvmField val NEW = Status(JsonField.of("NEW")) + @JvmField val ARBITRATION = Status(JsonField.of("ARBITRATION")) - @JvmField val PENDING_CUSTOMER = Status(JsonField.of("PENDING_CUSTOMER")) + @JvmField val CASE_CLOSED = Status(JsonField.of("CASE_CLOSED")) - @JvmField val SUBMITTED = Status(JsonField.of("SUBMITTED")) + @JvmField val CASE_WON = Status(JsonField.of("CASE_WON")) - @JvmField val REPRESENTMENT = Status(JsonField.of("REPRESENTMENT")) + @JvmField val NEW = Status(JsonField.of("NEW")) - @JvmField val PREARBITRATION = Status(JsonField.of("PREARBITRATION")) + @JvmField val PENDING_CUSTOMER = Status(JsonField.of("PENDING_CUSTOMER")) - @JvmField val ARBITRATION = Status(JsonField.of("ARBITRATION")) + @JvmField val PREARBITRATION = Status(JsonField.of("PREARBITRATION")) - @JvmField val CASE_WON = Status(JsonField.of("CASE_WON")) + @JvmField val REPRESENTMENT = Status(JsonField.of("REPRESENTMENT")) - @JvmField val CASE_CLOSED = Status(JsonField.of("CASE_CLOSED")) + @JvmField val SUBMITTED = Status(JsonField.of("SUBMITTED")) @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } enum class Known { + ARBITRATION, + CASE_CLOSED, + CASE_WON, NEW, PENDING_CUSTOMER, - SUBMITTED, - REPRESENTMENT, PREARBITRATION, - ARBITRATION, - CASE_WON, - CASE_CLOSED, + REPRESENTMENT, + SUBMITTED, } enum class Value { + ARBITRATION, + CASE_CLOSED, + CASE_WON, NEW, PENDING_CUSTOMER, - SUBMITTED, - REPRESENTMENT, PREARBITRATION, - ARBITRATION, - CASE_WON, - CASE_CLOSED, + REPRESENTMENT, + SUBMITTED, _UNKNOWN, } fun value(): Value = when (this) { + ARBITRATION -> Value.ARBITRATION + CASE_CLOSED -> Value.CASE_CLOSED + CASE_WON -> Value.CASE_WON NEW -> Value.NEW PENDING_CUSTOMER -> Value.PENDING_CUSTOMER - SUBMITTED -> Value.SUBMITTED - REPRESENTMENT -> Value.REPRESENTMENT PREARBITRATION -> Value.PREARBITRATION - ARBITRATION -> Value.ARBITRATION - CASE_WON -> Value.CASE_WON - CASE_CLOSED -> Value.CASE_CLOSED + REPRESENTMENT -> Value.REPRESENTMENT + SUBMITTED -> Value.SUBMITTED else -> Value._UNKNOWN } fun known(): Known = when (this) { + ARBITRATION -> Known.ARBITRATION + CASE_CLOSED -> Known.CASE_CLOSED + CASE_WON -> Known.CASE_WON NEW -> Known.NEW PENDING_CUSTOMER -> Known.PENDING_CUSTOMER - SUBMITTED -> Known.SUBMITTED - REPRESENTMENT -> Known.REPRESENTMENT PREARBITRATION -> Known.PREARBITRATION - ARBITRATION -> Known.ARBITRATION - CASE_WON -> Known.CASE_WON - CASE_CLOSED -> Known.CASE_CLOSED + REPRESENTMENT -> Known.REPRESENTMENT + SUBMITTED -> Known.SUBMITTED else -> throw LithicInvalidDataException("Unknown Status: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt index ca47a55d..4571f6bd 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeCreateParams.kt @@ -402,12 +402,12 @@ constructor( @JvmField val PROCESSING_ERROR = Reason(JsonField.of("PROCESSING_ERROR")) - @JvmField val REFUND_NOT_PROCESSED = Reason(JsonField.of("REFUND_NOT_PROCESSED")) - @JvmField val RECURRING_TRANSACTION_NOT_CANCELLED = Reason(JsonField.of("RECURRING_TRANSACTION_NOT_CANCELLED")) + @JvmField val REFUND_NOT_PROCESSED = Reason(JsonField.of("REFUND_NOT_PROCESSED")) + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) } @@ -424,8 +424,8 @@ constructor( MISSING_AUTH, OTHER, PROCESSING_ERROR, - REFUND_NOT_PROCESSED, RECURRING_TRANSACTION_NOT_CANCELLED, + REFUND_NOT_PROCESSED, } enum class Value { @@ -441,8 +441,8 @@ constructor( MISSING_AUTH, OTHER, PROCESSING_ERROR, - REFUND_NOT_PROCESSED, RECURRING_TRANSACTION_NOT_CANCELLED, + REFUND_NOT_PROCESSED, _UNKNOWN, } @@ -460,8 +460,8 @@ constructor( MISSING_AUTH -> Value.MISSING_AUTH OTHER -> Value.OTHER PROCESSING_ERROR -> Value.PROCESSING_ERROR - REFUND_NOT_PROCESSED -> Value.REFUND_NOT_PROCESSED RECURRING_TRANSACTION_NOT_CANCELLED -> Value.RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED -> Value.REFUND_NOT_PROCESSED else -> Value._UNKNOWN } @@ -479,8 +479,8 @@ constructor( MISSING_AUTH -> Known.MISSING_AUTH OTHER -> Known.OTHER PROCESSING_ERROR -> Known.PROCESSING_ERROR - REFUND_NOT_PROCESSED -> Known.REFUND_NOT_PROCESSED RECURRING_TRANSACTION_NOT_CANCELLED -> Known.RECURRING_TRANSACTION_NOT_CANCELLED + REFUND_NOT_PROCESSED -> Known.REFUND_NOT_PROCESSED else -> throw LithicInvalidDataException("Unknown Reason: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt index 3687cd41..c7aa756c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/DisputeListParams.kt @@ -246,71 +246,71 @@ constructor( companion object { - @JvmField val NEW = Status(JsonField.of("NEW")) + @JvmField val ARBITRATION = Status(JsonField.of("ARBITRATION")) - @JvmField val PENDING_CUSTOMER = Status(JsonField.of("PENDING_CUSTOMER")) + @JvmField val CASE_CLOSED = Status(JsonField.of("CASE_CLOSED")) - @JvmField val SUBMITTED = Status(JsonField.of("SUBMITTED")) + @JvmField val CASE_WON = Status(JsonField.of("CASE_WON")) - @JvmField val REPRESENTMENT = Status(JsonField.of("REPRESENTMENT")) + @JvmField val NEW = Status(JsonField.of("NEW")) - @JvmField val PREARBITRATION = Status(JsonField.of("PREARBITRATION")) + @JvmField val PENDING_CUSTOMER = Status(JsonField.of("PENDING_CUSTOMER")) - @JvmField val ARBITRATION = Status(JsonField.of("ARBITRATION")) + @JvmField val PREARBITRATION = Status(JsonField.of("PREARBITRATION")) - @JvmField val CASE_WON = Status(JsonField.of("CASE_WON")) + @JvmField val REPRESENTMENT = Status(JsonField.of("REPRESENTMENT")) - @JvmField val CASE_CLOSED = Status(JsonField.of("CASE_CLOSED")) + @JvmField val SUBMITTED = Status(JsonField.of("SUBMITTED")) @JvmStatic fun of(value: String) = Status(JsonField.of(value)) } enum class Known { + ARBITRATION, + CASE_CLOSED, + CASE_WON, NEW, PENDING_CUSTOMER, - SUBMITTED, - REPRESENTMENT, PREARBITRATION, - ARBITRATION, - CASE_WON, - CASE_CLOSED, + REPRESENTMENT, + SUBMITTED, } enum class Value { + ARBITRATION, + CASE_CLOSED, + CASE_WON, NEW, PENDING_CUSTOMER, - SUBMITTED, - REPRESENTMENT, PREARBITRATION, - ARBITRATION, - CASE_WON, - CASE_CLOSED, + REPRESENTMENT, + SUBMITTED, _UNKNOWN, } fun value(): Value = when (this) { + ARBITRATION -> Value.ARBITRATION + CASE_CLOSED -> Value.CASE_CLOSED + CASE_WON -> Value.CASE_WON NEW -> Value.NEW PENDING_CUSTOMER -> Value.PENDING_CUSTOMER - SUBMITTED -> Value.SUBMITTED - REPRESENTMENT -> Value.REPRESENTMENT PREARBITRATION -> Value.PREARBITRATION - ARBITRATION -> Value.ARBITRATION - CASE_WON -> Value.CASE_WON - CASE_CLOSED -> Value.CASE_CLOSED + REPRESENTMENT -> Value.REPRESENTMENT + SUBMITTED -> Value.SUBMITTED else -> Value._UNKNOWN } fun known(): Known = when (this) { + ARBITRATION -> Known.ARBITRATION + CASE_CLOSED -> Known.CASE_CLOSED + CASE_WON -> Known.CASE_WON NEW -> Known.NEW PENDING_CUSTOMER -> Known.PENDING_CUSTOMER - SUBMITTED -> Known.SUBMITTED - REPRESENTMENT -> Known.REPRESENTMENT PREARBITRATION -> Known.PREARBITRATION - ARBITRATION -> Known.ARBITRATION - CASE_WON -> Known.CASE_WON - CASE_CLOSED -> Known.CASE_CLOSED + REPRESENTMENT -> Known.REPRESENTMENT + SUBMITTED -> Known.SUBMITTED else -> throw LithicInvalidDataException("Unknown Status: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EmbedRequestParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EmbedRequestParams.kt index a1323159..dd393a21 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EmbedRequestParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EmbedRequestParams.kt @@ -22,8 +22,8 @@ class EmbedRequestParams private constructor( private val css: JsonField, private val expiration: JsonField, - private val token: JsonField, private val targetOrigin: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -51,9 +51,6 @@ private constructor( fun expiration(): Optional = Optional.ofNullable(expiration.getNullable("expiration")) - /** Globally unique identifier for the card to be displayed. */ - fun token(): String = token.getRequired("token") - /** * Required if you want to post the element clicked to the parent iframe. * @@ -63,6 +60,9 @@ private constructor( fun targetOrigin(): Optional = Optional.ofNullable(targetOrigin.getNullable("target_origin")) + /** Globally unique identifier for the card to be displayed. */ + fun token(): String = token.getRequired("token") + /** * A publicly available URI, so the white-labeled card element can be styled with the client's * branding. @@ -82,9 +82,6 @@ private constructor( */ @JsonProperty("expiration") @ExcludeMissing fun _expiration() = expiration - /** Globally unique identifier for the card to be displayed. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * Required if you want to post the element clicked to the parent iframe. * @@ -93,6 +90,9 @@ private constructor( */ @JsonProperty("target_origin") @ExcludeMissing fun _targetOrigin() = targetOrigin + /** Globally unique identifier for the card to be displayed. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -101,8 +101,8 @@ private constructor( if (!validated) { css() expiration() - token() targetOrigin() + token() validated = true } } @@ -117,8 +117,8 @@ private constructor( return other is EmbedRequestParams && this.css == other.css && this.expiration == other.expiration && - this.token == other.token && this.targetOrigin == other.targetOrigin && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -128,8 +128,8 @@ private constructor( Objects.hash( css, expiration, - token, targetOrigin, + token, additionalProperties, ) } @@ -137,7 +137,7 @@ private constructor( } override fun toString() = - "EmbedRequestParams{css=$css, expiration=$expiration, token=$token, targetOrigin=$targetOrigin, additionalProperties=$additionalProperties}" + "EmbedRequestParams{css=$css, expiration=$expiration, targetOrigin=$targetOrigin, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -148,16 +148,16 @@ private constructor( private var css: JsonField = JsonMissing.of() private var expiration: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var targetOrigin: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(embedRequestParams: EmbedRequestParams) = apply { this.css = embedRequestParams.css this.expiration = embedRequestParams.expiration - this.token = embedRequestParams.token this.targetOrigin = embedRequestParams.targetOrigin + this.token = embedRequestParams.token additionalProperties(embedRequestParams.additionalProperties) } @@ -205,14 +205,6 @@ private constructor( this.expiration = expiration } - /** Globally unique identifier for the card to be displayed. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the card to be displayed. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - /** * Required if you want to post the element clicked to the parent iframe. * @@ -233,6 +225,14 @@ private constructor( this.targetOrigin = targetOrigin } + /** Globally unique identifier for the card to be displayed. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the card to be displayed. */ + @JsonProperty("token") + @ExcludeMissing + fun token(token: JsonField) = apply { this.token = token } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -251,8 +251,8 @@ private constructor( EmbedRequestParams( css, expiration, - token, targetOrigin, + token, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt index 1700b0cf..f8067389 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Event.kt @@ -22,10 +22,10 @@ import java.util.Objects @NoAutoDetect class Event private constructor( - private val token: JsonField, + private val created: JsonField, private val eventType: JsonField, private val payload: JsonField, - private val created: JsonField, + private val token: JsonField, private val additionalProperties: Map, ) { @@ -33,8 +33,12 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") + /** + * An RFC 3339 timestamp for when the event was created. UTC time zone. + * + * If no timezone is specified, UTC will be used. + */ + fun created(): OffsetDateTime = created.getRequired("created") /** * Event types: @@ -45,6 +49,7 @@ private constructor( * - `account_holder.verification` - Notification than an account holder's identity verification * is complete. * - `card.created` - Notification that a card has been created. + * - `card.renewed` - Notification that a card has been renewed. * - `card.shipped` - Physical card shipment notification. See * https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. * - `card_transaction.updated` - Transaction Lifecycle webhook. See @@ -62,15 +67,15 @@ private constructor( fun payload(): Payload = payload.getRequired("payload") + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * * If no timezone is specified, UTC will be used. */ - fun created(): OffsetDateTime = created.getRequired("created") - - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("created") @ExcludeMissing fun _created() = created /** * Event types: @@ -81,6 +86,7 @@ private constructor( * - `account_holder.verification` - Notification than an account holder's identity verification * is complete. * - `card.created` - Notification that a card has been created. + * - `card.renewed` - Notification that a card has been renewed. * - `card.shipped` - Physical card shipment notification. See * https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. * - `card_transaction.updated` - Transaction Lifecycle webhook. See @@ -98,12 +104,8 @@ private constructor( @JsonProperty("payload") @ExcludeMissing fun _payload() = payload - /** - * An RFC 3339 timestamp for when the event was created. UTC time zone. - * - * If no timezone is specified, UTC will be used. - */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token @JsonAnyGetter @ExcludeMissing @@ -111,10 +113,10 @@ private constructor( fun validate(): Event = apply { if (!validated) { - token() + created() eventType() payload().validate() - created() + token() validated = true } } @@ -127,10 +129,10 @@ private constructor( } return other is Event && - this.token == other.token && + this.created == other.created && this.eventType == other.eventType && this.payload == other.payload && - this.created == other.created && + this.token == other.token && this.additionalProperties == other.additionalProperties } @@ -138,10 +140,10 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, + created, eventType, payload, - created, + token, additionalProperties, ) } @@ -149,7 +151,7 @@ private constructor( } override fun toString() = - "Event{token=$token, eventType=$eventType, payload=$payload, created=$created, additionalProperties=$additionalProperties}" + "Event{created=$created, eventType=$eventType, payload=$payload, token=$token, additionalProperties=$additionalProperties}" companion object { @@ -158,28 +160,36 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var eventType: JsonField = JsonMissing.of() private var payload: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(event: Event) = apply { - this.token = event.token + this.created = event.created this.eventType = event.eventType this.payload = event.payload - this.created = event.created + this.token = event.token additionalProperties(event.additionalProperties) } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) + /** + * An RFC 3339 timestamp for when the event was created. UTC time zone. + * + * If no timezone is specified, UTC will be used. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Globally unique identifier. */ - @JsonProperty("token") + /** + * An RFC 3339 timestamp for when the event was created. UTC time zone. + * + * If no timezone is specified, UTC will be used. + */ + @JsonProperty("created") @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } + fun created(created: JsonField) = apply { this.created = created } /** * Event types: @@ -190,6 +200,7 @@ private constructor( * - `account_holder.verification` - Notification than an account holder's identity * verification is complete. * - `card.created` - Notification that a card has been created. + * - `card.renewed` - Notification that a card has been renewed. * - `card.shipped` - Physical card shipment notification. See * https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. * - `card_transaction.updated` - Transaction Lifecycle webhook. See @@ -214,6 +225,7 @@ private constructor( * - `account_holder.verification` - Notification than an account holder's identity * verification is complete. * - `card.created` - Notification that a card has been created. + * - `card.renewed` - Notification that a card has been renewed. * - `card.shipped` - Physical card shipment notification. See * https://docs.lithic.com/docs/cards#physical-card-shipped-webhook. * - `card_transaction.updated` - Transaction Lifecycle webhook. See @@ -237,21 +249,13 @@ private constructor( @ExcludeMissing fun payload(payload: JsonField) = apply { this.payload = payload } - /** - * An RFC 3339 timestamp for when the event was created. UTC time zone. - * - * If no timezone is specified, UTC will be used. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) - /** - * An RFC 3339 timestamp for when the event was created. UTC time zone. - * - * If no timezone is specified, UTC will be used. - */ - @JsonProperty("created") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun token(token: JsonField) = apply { this.token = token } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -269,10 +273,10 @@ private constructor( fun build(): Event = Event( - token, + created, eventType, payload, - created, + token, additionalProperties.toUnmodifiable(), ) } @@ -306,8 +310,12 @@ private constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -333,16 +341,16 @@ private constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -354,7 +362,9 @@ private constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -362,9 +372,9 @@ private constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -372,7 +382,9 @@ private constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -380,9 +392,9 @@ private constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -392,7 +404,9 @@ private constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -402,9 +416,9 @@ private constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -414,7 +428,9 @@ private constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -424,9 +440,9 @@ private constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt index 807d56e2..a43359fe 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventListParams.kt @@ -249,8 +249,12 @@ constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -276,16 +280,16 @@ constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -297,7 +301,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -305,9 +311,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -315,7 +321,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -323,9 +331,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -335,7 +343,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -345,9 +355,9 @@ constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -357,7 +367,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -367,9 +379,9 @@ constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt index 785458e5..a480154b 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt @@ -25,8 +25,8 @@ private constructor( private val description: JsonField, private val disabled: JsonField, private val eventTypes: JsonField>, - private val url: JsonField, private val token: JsonField, + private val url: JsonField, private val additionalProperties: Map, ) { @@ -43,11 +43,11 @@ private constructor( fun eventTypes(): Optional> = Optional.ofNullable(eventTypes.getNullable("event_types")) - fun url(): String = url.getRequired("url") - /** Globally unique identifier. */ fun token(): String = token.getRequired("token") + fun url(): String = url.getRequired("url") + /** A description of the subscription. */ @JsonProperty("description") @ExcludeMissing fun _description() = description @@ -56,11 +56,11 @@ private constructor( @JsonProperty("event_types") @ExcludeMissing fun _eventTypes() = eventTypes - @JsonProperty("url") @ExcludeMissing fun _url() = url - /** Globally unique identifier. */ @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("url") @ExcludeMissing fun _url() = url + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -70,8 +70,8 @@ private constructor( description() disabled() eventTypes() - url() token() + url() validated = true } } @@ -87,8 +87,8 @@ private constructor( this.description == other.description && this.disabled == other.disabled && this.eventTypes == other.eventTypes && - this.url == other.url && this.token == other.token && + this.url == other.url && this.additionalProperties == other.additionalProperties } @@ -99,8 +99,8 @@ private constructor( description, disabled, eventTypes, - url, token, + url, additionalProperties, ) } @@ -108,7 +108,7 @@ private constructor( } override fun toString() = - "EventSubscription{description=$description, disabled=$disabled, eventTypes=$eventTypes, url=$url, token=$token, additionalProperties=$additionalProperties}" + "EventSubscription{description=$description, disabled=$disabled, eventTypes=$eventTypes, token=$token, url=$url, additionalProperties=$additionalProperties}" companion object { @@ -120,8 +120,8 @@ private constructor( private var description: JsonField = JsonMissing.of() private var disabled: JsonField = JsonMissing.of() private var eventTypes: JsonField> = JsonMissing.of() - private var url: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -129,8 +129,8 @@ private constructor( this.description = eventSubscription.description this.disabled = eventSubscription.disabled this.eventTypes = eventSubscription.eventTypes - this.url = eventSubscription.url this.token = eventSubscription.token + this.url = eventSubscription.url additionalProperties(eventSubscription.additionalProperties) } @@ -158,12 +158,6 @@ private constructor( this.eventTypes = eventTypes } - fun url(url: String) = url(JsonField.of(url)) - - @JsonProperty("url") - @ExcludeMissing - fun url(url: JsonField) = apply { this.url = url } - /** Globally unique identifier. */ fun token(token: String) = token(JsonField.of(token)) @@ -172,6 +166,12 @@ private constructor( @ExcludeMissing fun token(token: JsonField) = apply { this.token = token } + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -191,8 +191,8 @@ private constructor( description, disabled, eventTypes.map { it.toUnmodifiable() }, - url, token, + url, additionalProperties.toUnmodifiable(), ) } @@ -226,8 +226,12 @@ private constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -253,16 +257,16 @@ private constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -274,7 +278,9 @@ private constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -282,9 +288,9 @@ private constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -292,7 +298,9 @@ private constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -300,9 +308,9 @@ private constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -312,7 +320,9 @@ private constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -322,9 +332,9 @@ private constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -334,7 +344,9 @@ private constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -344,9 +356,9 @@ private constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt index c442f002..1a8ca4d9 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionCreateParams.kt @@ -364,8 +364,12 @@ constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -391,16 +395,16 @@ constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -412,7 +416,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -420,9 +426,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -430,7 +436,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -438,9 +446,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -450,7 +458,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -460,9 +470,9 @@ constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -472,7 +482,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -482,9 +494,9 @@ constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt index 8e4d3175..93bc4957 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionSendSimulatedExampleParams.kt @@ -293,8 +293,12 @@ constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -320,16 +324,16 @@ constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -341,7 +345,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -349,9 +355,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -359,7 +365,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -367,9 +375,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -379,7 +387,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -389,9 +399,9 @@ constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -401,7 +411,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -411,9 +423,9 @@ constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt index 7a968815..87a43715 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/EventSubscriptionUpdateParams.kt @@ -385,8 +385,12 @@ constructor( @JvmField val ACCOUNT_HOLDER_VERIFICATION = EventType(JsonField.of("account_holder.verification")) + @JvmField val BALANCE_UPDATED = EventType(JsonField.of("balance.updated")) + @JvmField val CARD_CREATED = EventType(JsonField.of("card.created")) + @JvmField val CARD_RENEWED = EventType(JsonField.of("card.renewed")) + @JvmField val CARD_SHIPPED = EventType(JsonField.of("card.shipped")) @JvmField @@ -412,16 +416,16 @@ constructor( val DISPUTE_EVIDENCE_UPLOAD_FAILED = EventType(JsonField.of("dispute_evidence.upload_failed")) - @JvmField - val THREE_DS_AUTHENTICATION_CREATED = - EventType(JsonField.of("three_ds_authentication.created")) - @JvmField val PAYMENT_TRANSACTION_CREATED = EventType(JsonField.of("payment_transaction.created")) @JvmField val PAYMENT_TRANSACTION_UPDATED = EventType(JsonField.of("payment_transaction.updated")) + @JvmField + val THREE_DS_AUTHENTICATION_CREATED = + EventType(JsonField.of("three_ds_authentication.created")) + @JvmField val TRANSFER_TRANSACTION_CREATED = EventType(JsonField.of("transfer_transaction.created")) @@ -433,7 +437,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -441,9 +447,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, } @@ -451,7 +457,9 @@ constructor( ACCOUNT_HOLDER_CREATED, ACCOUNT_HOLDER_UPDATED, ACCOUNT_HOLDER_VERIFICATION, + BALANCE_UPDATED, CARD_CREATED, + CARD_RENEWED, CARD_SHIPPED, CARD_TRANSACTION_UPDATED, DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST, @@ -459,9 +467,9 @@ constructor( DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE, DISPUTE_UPDATED, DISPUTE_EVIDENCE_UPLOAD_FAILED, - THREE_DS_AUTHENTICATION_CREATED, PAYMENT_TRANSACTION_CREATED, PAYMENT_TRANSACTION_UPDATED, + THREE_DS_AUTHENTICATION_CREATED, TRANSFER_TRANSACTION_CREATED, _UNKNOWN, } @@ -471,7 +479,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Value.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Value.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Value.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Value.BALANCE_UPDATED CARD_CREATED -> Value.CARD_CREATED + CARD_RENEWED -> Value.CARD_RENEWED CARD_SHIPPED -> Value.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Value.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -481,9 +491,9 @@ constructor( Value.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Value.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Value.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Value.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Value.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Value.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Value.TRANSFER_TRANSACTION_CREATED else -> Value._UNKNOWN } @@ -493,7 +503,9 @@ constructor( ACCOUNT_HOLDER_CREATED -> Known.ACCOUNT_HOLDER_CREATED ACCOUNT_HOLDER_UPDATED -> Known.ACCOUNT_HOLDER_UPDATED ACCOUNT_HOLDER_VERIFICATION -> Known.ACCOUNT_HOLDER_VERIFICATION + BALANCE_UPDATED -> Known.BALANCE_UPDATED CARD_CREATED -> Known.CARD_CREATED + CARD_RENEWED -> Known.CARD_RENEWED CARD_SHIPPED -> Known.CARD_SHIPPED CARD_TRANSACTION_UPDATED -> Known.CARD_TRANSACTION_UPDATED DIGITAL_WALLET_TOKENIZATION_APPROVAL_REQUEST -> @@ -503,9 +515,9 @@ constructor( Known.DIGITAL_WALLET_TOKENIZATION_TWO_FACTOR_AUTHENTICATION_CODE DISPUTE_UPDATED -> Known.DISPUTE_UPDATED DISPUTE_EVIDENCE_UPLOAD_FAILED -> Known.DISPUTE_EVIDENCE_UPLOAD_FAILED - THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED PAYMENT_TRANSACTION_CREATED -> Known.PAYMENT_TRANSACTION_CREATED PAYMENT_TRANSACTION_UPDATED -> Known.PAYMENT_TRANSACTION_UPDATED + THREE_DS_AUTHENTICATION_CREATED -> Known.THREE_DS_AUTHENTICATION_CREATED TRANSFER_TRANSACTION_CREATED -> Known.TRANSFER_TRANSACTION_CREATED else -> throw LithicInvalidDataException("Unknown EventType: $value") } 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 666769dc..752c2541 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 @@ -26,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, ) { @@ -42,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 @@ -54,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 @@ -69,9 +69,9 @@ private constructor( address1() address2() city() - state() - postalCode() country() + postalCode() + state() validated = true } } @@ -87,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 } @@ -100,9 +100,9 @@ private constructor( address1, address2, city, - state, - postalCode, country, + postalCode, + state, additionalProperties, ) } @@ -110,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 { @@ -122,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 @@ -132,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) } @@ -156,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)) @@ -168,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() @@ -193,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 12f71876..8fd71828 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 @@ -29,24 +29,24 @@ import java.util.Optional class ExternalBankAccountCreateParams constructor( - private val plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest?, private val bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest?, + private val plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, ) { - fun plaidCreateBankAccountApiRequest(): Optional = - Optional.ofNullable(plaidCreateBankAccountApiRequest) - fun bankVerifiedCreateBankAccountApiRequest(): Optional = Optional.ofNullable(bankVerifiedCreateBankAccountApiRequest) + fun plaidCreateBankAccountApiRequest(): Optional = + Optional.ofNullable(plaidCreateBankAccountApiRequest) + @JvmSynthetic internal fun getBody(): ExternalBankAccountCreateBody { return ExternalBankAccountCreateBody( - plaidCreateBankAccountApiRequest, - bankVerifiedCreateBankAccountApiRequest + bankVerifiedCreateBankAccountApiRequest, + plaidCreateBankAccountApiRequest ) } @@ -58,40 +58,40 @@ constructor( @JsonSerialize(using = ExternalBankAccountCreateBody.Serializer::class) class ExternalBankAccountCreateBody internal constructor( - private val plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest? = null, private val bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest? = null, + private val plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest? = null, private val _json: JsonValue? = null, ) { - fun plaidCreateBankAccountApiRequest(): Optional = - Optional.ofNullable(plaidCreateBankAccountApiRequest) fun bankVerifiedCreateBankAccountApiRequest(): Optional = Optional.ofNullable(bankVerifiedCreateBankAccountApiRequest) + fun plaidCreateBankAccountApiRequest(): Optional = + Optional.ofNullable(plaidCreateBankAccountApiRequest) - fun isPlaidCreateBankAccountApiRequest(): Boolean = plaidCreateBankAccountApiRequest != null fun isBankVerifiedCreateBankAccountApiRequest(): Boolean = bankVerifiedCreateBankAccountApiRequest != null + fun isPlaidCreateBankAccountApiRequest(): Boolean = plaidCreateBankAccountApiRequest != null - fun asPlaidCreateBankAccountApiRequest(): PlaidCreateBankAccountApiRequest = - plaidCreateBankAccountApiRequest.getOrThrow("plaidCreateBankAccountApiRequest") fun asBankVerifiedCreateBankAccountApiRequest(): BankVerifiedCreateBankAccountApiRequest = bankVerifiedCreateBankAccountApiRequest.getOrThrow( "bankVerifiedCreateBankAccountApiRequest" ) + fun asPlaidCreateBankAccountApiRequest(): PlaidCreateBankAccountApiRequest = + plaidCreateBankAccountApiRequest.getOrThrow("plaidCreateBankAccountApiRequest") fun _json(): Optional = Optional.ofNullable(_json) fun accept(visitor: Visitor): T { return when { - plaidCreateBankAccountApiRequest != null -> - visitor.visitPlaidCreateBankAccountApiRequest(plaidCreateBankAccountApiRequest) bankVerifiedCreateBankAccountApiRequest != null -> visitor.visitBankVerifiedCreateBankAccountApiRequest( bankVerifiedCreateBankAccountApiRequest ) + plaidCreateBankAccountApiRequest != null -> + visitor.visitPlaidCreateBankAccountApiRequest(plaidCreateBankAccountApiRequest) else -> visitor.unknown(_json) } } @@ -102,24 +102,24 @@ constructor( } return other is ExternalBankAccountCreateBody && - this.plaidCreateBankAccountApiRequest == other.plaidCreateBankAccountApiRequest && this.bankVerifiedCreateBankAccountApiRequest == - other.bankVerifiedCreateBankAccountApiRequest + other.bankVerifiedCreateBankAccountApiRequest && + this.plaidCreateBankAccountApiRequest == other.plaidCreateBankAccountApiRequest } override fun hashCode(): Int { return Objects.hash( - plaidCreateBankAccountApiRequest, - bankVerifiedCreateBankAccountApiRequest + bankVerifiedCreateBankAccountApiRequest, + plaidCreateBankAccountApiRequest ) } override fun toString(): String { return when { - plaidCreateBankAccountApiRequest != null -> - "ExternalBankAccountCreateBody{plaidCreateBankAccountApiRequest=$plaidCreateBankAccountApiRequest}" bankVerifiedCreateBankAccountApiRequest != null -> "ExternalBankAccountCreateBody{bankVerifiedCreateBankAccountApiRequest=$bankVerifiedCreateBankAccountApiRequest}" + plaidCreateBankAccountApiRequest != null -> + "ExternalBankAccountCreateBody{plaidCreateBankAccountApiRequest=$plaidCreateBankAccountApiRequest}" _json != null -> "ExternalBankAccountCreateBody{_unknown=$_json}" else -> throw IllegalStateException("Invalid ExternalBankAccountCreateBody") } @@ -128,33 +128,33 @@ constructor( companion object { @JvmStatic - fun ofPlaidCreateBankAccountApiRequest( - plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest + fun ofBankVerifiedCreateBankAccountApiRequest( + bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest ) = ExternalBankAccountCreateBody( - plaidCreateBankAccountApiRequest = plaidCreateBankAccountApiRequest + bankVerifiedCreateBankAccountApiRequest = + bankVerifiedCreateBankAccountApiRequest ) @JvmStatic - fun ofBankVerifiedCreateBankAccountApiRequest( - bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest + fun ofPlaidCreateBankAccountApiRequest( + plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest ) = ExternalBankAccountCreateBody( - bankVerifiedCreateBankAccountApiRequest = - bankVerifiedCreateBankAccountApiRequest + plaidCreateBankAccountApiRequest = plaidCreateBankAccountApiRequest ) } interface Visitor { - fun visitPlaidCreateBankAccountApiRequest( - plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest - ): T - fun visitBankVerifiedCreateBankAccountApiRequest( bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest ): T + fun visitPlaidCreateBankAccountApiRequest( + plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest + ): T + fun unknown(json: JsonValue?): T { throw LithicInvalidDataException("Unknown ExternalBankAccountCreateBody: $json") } @@ -165,12 +165,6 @@ constructor( override fun ObjectCodec.deserialize(node: JsonNode): ExternalBankAccountCreateBody { val json = JsonValue.fromJsonNode(node) - tryDeserialize(node, jacksonTypeRef())?.let { - return ExternalBankAccountCreateBody( - plaidCreateBankAccountApiRequest = it, - _json = json - ) - } tryDeserialize(node, jacksonTypeRef()) ?.let { return ExternalBankAccountCreateBody( @@ -178,6 +172,12 @@ constructor( _json = json ) } + tryDeserialize(node, jacksonTypeRef())?.let { + return ExternalBankAccountCreateBody( + plaidCreateBankAccountApiRequest = it, + _json = json + ) + } return ExternalBankAccountCreateBody(_json = json) } @@ -192,10 +192,10 @@ constructor( provider: SerializerProvider ) { when { - value.plaidCreateBankAccountApiRequest != null -> - generator.writeObject(value.plaidCreateBankAccountApiRequest) value.bankVerifiedCreateBankAccountApiRequest != null -> generator.writeObject(value.bankVerifiedCreateBankAccountApiRequest) + value.plaidCreateBankAccountApiRequest != null -> + generator.writeObject(value.plaidCreateBankAccountApiRequest) value._json != null -> generator.writeObject(value._json) else -> throw IllegalStateException("Invalid ExternalBankAccountCreateBody") } @@ -213,24 +213,24 @@ constructor( } return other is ExternalBankAccountCreateParams && - this.plaidCreateBankAccountApiRequest == other.plaidCreateBankAccountApiRequest && this.bankVerifiedCreateBankAccountApiRequest == other.bankVerifiedCreateBankAccountApiRequest && + this.plaidCreateBankAccountApiRequest == other.plaidCreateBankAccountApiRequest && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders } override fun hashCode(): Int { return Objects.hash( - plaidCreateBankAccountApiRequest, bankVerifiedCreateBankAccountApiRequest, + plaidCreateBankAccountApiRequest, additionalQueryParams, additionalHeaders, ) } override fun toString() = - "ExternalBankAccountCreateParams{plaidCreateBankAccountApiRequest=$plaidCreateBankAccountApiRequest, bankVerifiedCreateBankAccountApiRequest=$bankVerifiedCreateBankAccountApiRequest, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}" + "ExternalBankAccountCreateParams{bankVerifiedCreateBankAccountApiRequest=$bankVerifiedCreateBankAccountApiRequest, plaidCreateBankAccountApiRequest=$plaidCreateBankAccountApiRequest, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders}" fun toBuilder() = Builder().from(this) @@ -242,35 +242,35 @@ constructor( @NoAutoDetect class Builder { - private var plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest? = null private var bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest? = null + private var plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() @JvmSynthetic internal fun from(externalBankAccountCreateParams: ExternalBankAccountCreateParams) = apply { - this.plaidCreateBankAccountApiRequest = - externalBankAccountCreateParams.plaidCreateBankAccountApiRequest this.bankVerifiedCreateBankAccountApiRequest = externalBankAccountCreateParams.bankVerifiedCreateBankAccountApiRequest + this.plaidCreateBankAccountApiRequest = + externalBankAccountCreateParams.plaidCreateBankAccountApiRequest additionalQueryParams(externalBankAccountCreateParams.additionalQueryParams) additionalHeaders(externalBankAccountCreateParams.additionalHeaders) } - fun forPlaidCreateBankAccountApiRequest( - plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest - ) = apply { - this.plaidCreateBankAccountApiRequest = plaidCreateBankAccountApiRequest - this.bankVerifiedCreateBankAccountApiRequest = null - } fun forBankVerifiedCreateBankAccountApiRequest( bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest ) = apply { - this.plaidCreateBankAccountApiRequest = null this.bankVerifiedCreateBankAccountApiRequest = bankVerifiedCreateBankAccountApiRequest + this.plaidCreateBankAccountApiRequest = null + } + fun forPlaidCreateBankAccountApiRequest( + plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest + ) = apply { + this.bankVerifiedCreateBankAccountApiRequest = null + this.plaidCreateBankAccountApiRequest = plaidCreateBankAccountApiRequest } fun additionalQueryParams(additionalQueryParams: Map>) = apply { @@ -315,51 +315,83 @@ constructor( fun build(): ExternalBankAccountCreateParams = ExternalBankAccountCreateParams( - plaidCreateBankAccountApiRequest, bankVerifiedCreateBankAccountApiRequest, + plaidCreateBankAccountApiRequest, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), ) } - @JsonDeserialize(builder = PlaidCreateBankAccountApiRequest.Builder::class) + @JsonDeserialize(builder = BankVerifiedCreateBankAccountApiRequest.Builder::class) @NoAutoDetect - class PlaidCreateBankAccountApiRequest + 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 processorToken: String?, + private val country: String?, + private val currency: String?, private val dob: LocalDate?, private val doingBusinessAs: 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 - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod? = verificationMethod - - @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType - - @JsonProperty("owner") fun owner(): String? = owner + @JsonProperty("account_number") fun accountNumber(): String? = accountNumber @JsonProperty("account_token") fun accountToken(): String? = accountToken + /** + * Address used during Address Verification Service (AVS) checks during transactions if + * enabled via Auth Rules. + */ + @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address + @JsonProperty("company_id") fun companyId(): String? = companyId - @JsonProperty("processor_token") fun processorToken(): String? = processorToken + @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 @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs + @JsonProperty("name") fun name(): String? = name + + @JsonProperty("owner") fun owner(): String? = owner + + @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType + + @JsonProperty("routing_number") fun routingNumber(): String? = routingNumber + + @JsonProperty("type") fun type(): AccountType? = type + @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId + /** + * 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("verification_enforcement") + fun verificationEnforcement(): Boolean? = verificationEnforcement + + @JsonProperty("verification_method") + fun verificationMethod(): VerificationMethod? = verificationMethod + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -371,16 +403,23 @@ constructor( return true } - return other is PlaidCreateBankAccountApiRequest && - this.verificationMethod == other.verificationMethod && - this.ownerType == other.ownerType && - this.owner == other.owner && + return other is BankVerifiedCreateBankAccountApiRequest && + this.accountNumber == other.accountNumber && this.accountToken == other.accountToken && + this.address == other.address && this.companyId == other.companyId && - this.processorToken == other.processorToken && + this.country == other.country && + this.currency == other.currency && this.dob == other.dob && this.doingBusinessAs == other.doingBusinessAs && + 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 } @@ -388,15 +427,22 @@ constructor( if (hashCode == 0) { hashCode = Objects.hash( - verificationMethod, - ownerType, - owner, + accountNumber, accountToken, + address, companyId, - processorToken, + country, + currency, dob, doingBusinessAs, + name, + owner, + ownerType, + routingNumber, + type, userDefinedId, + verificationEnforcement, + verificationMethod, additionalProperties, ) } @@ -404,7 +450,7 @@ constructor( } override fun toString() = - "PlaidCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, processorToken=$processorToken, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "BankVerifiedCreateBankAccountApiRequest{accountNumber=$accountNumber, accountToken=$accountToken, address=$address, companyId=$companyId, country=$country, currency=$currency, dob=$dob, doingBusinessAs=$doingBusinessAs, name=$name, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, type=$type, userDefinedId=$userDefinedId, verificationEnforcement=$verificationEnforcement, verificationMethod=$verificationMethod, additionalProperties=$additionalProperties}" companion object { @@ -413,52 +459,68 @@ 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 processorToken: String? = null + private var country: String? = null + private var currency: String? = null private var dob: LocalDate? = null private var doingBusinessAs: 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(plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest) = - apply { - this.verificationMethod = plaidCreateBankAccountApiRequest.verificationMethod - this.ownerType = plaidCreateBankAccountApiRequest.ownerType - this.owner = plaidCreateBankAccountApiRequest.owner - this.accountToken = plaidCreateBankAccountApiRequest.accountToken - this.companyId = plaidCreateBankAccountApiRequest.companyId - this.processorToken = plaidCreateBankAccountApiRequest.processorToken - this.dob = plaidCreateBankAccountApiRequest.dob - this.doingBusinessAs = plaidCreateBankAccountApiRequest.doingBusinessAs - this.userDefinedId = plaidCreateBankAccountApiRequest.userDefinedId - additionalProperties(plaidCreateBankAccountApiRequest.additionalProperties) - } - - @JsonProperty("verification_method") - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod + internal fun from( + bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest + ) = apply { + this.accountNumber = bankVerifiedCreateBankAccountApiRequest.accountNumber + this.accountToken = bankVerifiedCreateBankAccountApiRequest.accountToken + this.address = bankVerifiedCreateBankAccountApiRequest.address + this.companyId = bankVerifiedCreateBankAccountApiRequest.companyId + this.country = bankVerifiedCreateBankAccountApiRequest.country + this.currency = bankVerifiedCreateBankAccountApiRequest.currency + this.dob = bankVerifiedCreateBankAccountApiRequest.dob + this.doingBusinessAs = bankVerifiedCreateBankAccountApiRequest.doingBusinessAs + 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) } - @JsonProperty("owner_type") - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - - @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + @JsonProperty("account_number") + fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } @JsonProperty("account_token") fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } + /** + * 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 } + @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } - @JsonProperty("processor_token") - fun processorToken(processorToken: String) = apply { - this.processorToken = processorToken - } + @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 } @@ -468,9 +530,37 @@ constructor( this.doingBusinessAs = doingBusinessAs } + @JsonProperty("name") fun name(name: String) = apply { this.name = name } + + @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + + @JsonProperty("owner_type") + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + + @JsonProperty("routing_number") + fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } + + @JsonProperty("type") fun type(type: AccountType) = apply { this.type = type } + @JsonProperty("user_defined_id") fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } + /** + * 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("verification_enforcement") + fun verificationEnforcement(verificationEnforcement: Boolean) = apply { + this.verificationEnforcement = verificationEnforcement + } + + @JsonProperty("verification_method") + fun verificationMethod(verificationMethod: VerificationMethod) = apply { + this.verificationMethod = verificationMethod + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -485,94 +575,126 @@ constructor( this.additionalProperties.putAll(additionalProperties) } - 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" }, + fun build(): BankVerifiedCreateBankAccountApiRequest = + BankVerifiedCreateBankAccountApiRequest( + checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, accountToken, + address, companyId, - checkNotNull(processorToken) { "`processorToken` is required but was not set" }, + checkNotNull(country) { "`country` is required but was not set" }, + checkNotNull(currency) { "`currency` is required but was not set" }, dob, doingBusinessAs, + 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, + checkNotNull(verificationMethod) { + "`verificationMethod` is required but was not set" + }, additionalProperties.toUnmodifiable(), ) } + + class AccountType + @JsonCreator + private constructor( + private val value: JsonField, + ) { + + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AccountType && this.value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + + companion object { + + @JvmField val CHECKING = AccountType(JsonField.of("CHECKING")) + + @JvmField val SAVINGS = AccountType(JsonField.of("SAVINGS")) + + @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) + } + + enum class Known { + CHECKING, + SAVINGS, + } + + enum class Value { + CHECKING, + SAVINGS, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + CHECKING -> Value.CHECKING + SAVINGS -> Value.SAVINGS + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + CHECKING -> Known.CHECKING + SAVINGS -> Known.SAVINGS + else -> throw LithicInvalidDataException("Unknown AccountType: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } } - @JsonDeserialize(builder = BankVerifiedCreateBankAccountApiRequest.Builder::class) + @JsonDeserialize(builder = PlaidCreateBankAccountApiRequest.Builder::class) @NoAutoDetect - class BankVerifiedCreateBankAccountApiRequest + 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 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 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 - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod? = verificationMethod - - @JsonProperty("owner_type") fun ownerType(): OwnerType? = ownerType - - @JsonProperty("owner") fun owner(): String? = owner - @JsonProperty("account_token") fun accountToken(): String? = accountToken @JsonProperty("company_id") fun companyId(): String? = companyId - @JsonProperty("type") fun type(): AccountType? = type - - @JsonProperty("routing_number") fun routingNumber(): String? = routingNumber - - @JsonProperty("account_number") fun accountNumber(): String? = accountNumber - - @JsonProperty("name") fun name(): String? = name - - @JsonProperty("country") fun country(): String? = country - - @JsonProperty("currency") fun currency(): String? = currency - - /** - * 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("verification_enforcement") - fun verificationEnforcement(): Boolean? = verificationEnforcement - - /** - * Address used during Address Verification Service (AVS) checks during transactions if - * enabled via Auth Rules. - */ - @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob @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 @@ -584,23 +706,16 @@ constructor( return true } - return other is BankVerifiedCreateBankAccountApiRequest && - this.verificationMethod == other.verificationMethod && - this.ownerType == other.ownerType && - this.owner == other.owner && + return other is PlaidCreateBankAccountApiRequest && this.accountToken == other.accountToken && this.companyId == other.companyId && - 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.owner == other.owner && + this.ownerType == other.ownerType && + this.processorToken == other.processorToken && this.userDefinedId == other.userDefinedId && + this.verificationMethod == other.verificationMethod && this.additionalProperties == other.additionalProperties } @@ -608,22 +723,15 @@ constructor( if (hashCode == 0) { hashCode = Objects.hash( - verificationMethod, - ownerType, - owner, accountToken, companyId, - type, - routingNumber, - accountNumber, - name, - country, - currency, - verificationEnforcement, - address, dob, doingBusinessAs, + owner, + ownerType, + processorToken, userDefinedId, + verificationMethod, additionalProperties, ) } @@ -631,7 +739,7 @@ constructor( } override fun toString() = - "BankVerifiedCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, type=$type, routingNumber=$routingNumber, accountNumber=$accountNumber, name=$name, country=$country, currency=$currency, verificationEnforcement=$verificationEnforcement, address=$address, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, 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 { @@ -640,57 +748,31 @@ 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 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 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( - bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest - ) = apply { - this.verificationMethod = bankVerifiedCreateBankAccountApiRequest.verificationMethod - this.ownerType = bankVerifiedCreateBankAccountApiRequest.ownerType - this.owner = bankVerifiedCreateBankAccountApiRequest.owner - this.accountToken = bankVerifiedCreateBankAccountApiRequest.accountToken - this.companyId = bankVerifiedCreateBankAccountApiRequest.companyId - 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.userDefinedId = bankVerifiedCreateBankAccountApiRequest.userDefinedId - additionalProperties(bankVerifiedCreateBankAccountApiRequest.additionalProperties) - } - - @JsonProperty("verification_method") - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod - } - - @JsonProperty("owner_type") - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - - @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + internal fun from(plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest) = + apply { + this.accountToken = plaidCreateBankAccountApiRequest.accountToken + this.companyId = plaidCreateBankAccountApiRequest.companyId + this.dob = plaidCreateBankAccountApiRequest.dob + 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) + } @JsonProperty("account_token") fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } @@ -698,39 +780,6 @@ constructor( @JsonProperty("company_id") fun companyId(companyId: String) = apply { this.companyId = companyId } - @JsonProperty("type") fun type(type: AccountType) = apply { this.type = type } - - @JsonProperty("routing_number") - fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } - - @JsonProperty("account_number") - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - - @JsonProperty("name") fun name(name: String) = apply { this.name = name } - - @JsonProperty("country") fun country(country: String) = apply { this.country = country } - - @JsonProperty("currency") - fun currency(currency: String) = apply { this.currency = currency } - - /** - * 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("verification_enforcement") - fun verificationEnforcement(verificationEnforcement: Boolean) = apply { - this.verificationEnforcement = verificationEnforcement - } - - /** - * 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 } - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(dob: LocalDate) = apply { this.dob = dob } @@ -739,9 +788,24 @@ constructor( this.doingBusinessAs = doingBusinessAs } + @JsonProperty("owner") fun owner(owner: String) = apply { this.owner = owner } + + @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) @@ -756,85 +820,21 @@ constructor( this.additionalProperties.putAll(additionalProperties) } - 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" }, + fun build(): PlaidCreateBankAccountApiRequest = + PlaidCreateBankAccountApiRequest( accountToken, companyId, - 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" }, - verificationEnforcement, - address, dob, 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(), ) } - - class AccountType - @JsonCreator - private constructor( - private val value: JsonField, - ) { - - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is AccountType && this.value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - - companion object { - - @JvmField val CHECKING = AccountType(JsonField.of("CHECKING")) - - @JvmField val SAVINGS = AccountType(JsonField.of("SAVINGS")) - - @JvmStatic fun of(value: String) = AccountType(JsonField.of(value)) - } - - enum class Known { - CHECKING, - SAVINGS, - } - - enum class Value { - CHECKING, - SAVINGS, - _UNKNOWN, - } - - fun value(): Value = - when (this) { - CHECKING -> Value.CHECKING - SAVINGS -> Value.SAVINGS - else -> Value._UNKNOWN - } - - fun known(): Known = - when (this) { - CHECKING -> Known.CHECKING - SAVINGS -> Known.SAVINGS - else -> throw LithicInvalidDataException("Unknown AccountType: $value") - } - - fun asString(): String = _value().asStringOrThrow() - } } } 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 a2e1c8b3..e704c299 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 @@ -654,35 +654,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") } @@ -711,40 +711,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") } @@ -894,42 +894,42 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + 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 6ad8f9a8..2b161fcf 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 @@ -336,40 +336,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") } @@ -399,42 +399,42 @@ constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + 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 e0620c65..f774ec61 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 @@ -654,35 +654,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") } @@ -711,40 +711,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") } @@ -894,42 +894,42 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + 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 2c86ebc9..5de69702 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 @@ -655,35 +655,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") } @@ -712,40 +712,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") } @@ -895,42 +895,42 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + PENDING -> Known.PENDING else -> throw LithicInvalidDataException("Unknown VerificationState: $value") } 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 258bfb14..1325f3f7 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 @@ -654,35 +654,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") } @@ -711,40 +711,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") } @@ -894,42 +894,42 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + 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 fdfdade6..5c6b8971 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 @@ -468,40 +468,40 @@ private constructor( companion object { - @JvmField val CARD = Category(JsonField.of("CARD")) - @JvmField val ACH = Category(JsonField.of("ACH")) + @JvmField val CARD = Category(JsonField.of("CARD")) + @JvmField val TRANSFER = Category(JsonField.of("TRANSFER")) @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } enum class Known { - CARD, ACH, + CARD, TRANSFER, } enum class Value { - CARD, ACH, + CARD, TRANSFER, _UNKNOWN, } fun value(): Value = when (this) { - CARD -> Value.CARD ACH -> Value.ACH + CARD -> Value.CARD TRANSFER -> Value.TRANSFER else -> Value._UNKNOWN } fun known(): Known = when (this) { - CARD -> Known.CARD ACH -> Known.ACH + CARD -> Known.CARD TRANSFER -> Known.TRANSFER else -> throw LithicInvalidDataException("Unknown Category: $value") } @@ -970,10 +970,10 @@ private constructor( @JvmField val CLEARING = FinancialEventType(JsonField.of("CLEARING")) @JvmField - val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) + val CORRECTION_CREDIT = FinancialEventType(JsonField.of("CORRECTION_CREDIT")) @JvmField - val CORRECTION_CREDIT = FinancialEventType(JsonField.of("CORRECTION_CREDIT")) + val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) @JvmField val CREDIT_AUTHORIZATION = FinancialEventType(JsonField.of("CREDIT_AUTHORIZATION")) @@ -1016,8 +1016,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1041,8 +1041,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1068,8 +1068,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Value.BALANCE_INQUIRY CLEARING -> Value.CLEARING - CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CORRECTION_CREDIT -> Value.CORRECTION_CREDIT + CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION @@ -1095,8 +1095,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Known.BALANCE_INQUIRY CLEARING -> Known.CLEARING - CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CORRECTION_CREDIT -> Known.CORRECTION_CREDIT + CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION 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 f22c9e4d..acbea6da 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 @@ -21,10 +21,10 @@ import java.util.Optional @NoAutoDetect class Kyb private constructor( - private val businessEntity: JsonField, private val beneficialOwnerEntities: JsonField>, - private val beneficialOwnerIndividuals: JsonField>, - private val controlPerson: JsonField, + private val beneficialOwnerIndividuals: JsonField>, + private val businessEntity: JsonField, + private val controlPerson: JsonField, private val kybPassedTimestamp: JsonField, private val natureOfBusiness: JsonField, private val tosTimestamp: JsonField, @@ -37,9 +37,6 @@ private constructor( private var hashCode: Int = 0 - /** Information for business for which the account is being opened and KYB is being run. */ - fun businessEntity(): BusinessEntity = businessEntity.getRequired("business_entity") - /** * List of all entities with >25% ownership in the company. If no entity or individual owns >25% * of the company, and the largest shareholder is an entity, please identify them in this field. @@ -61,9 +58,12 @@ private constructor( * an entity, pass in an empty list. However, either this parameter or * `beneficial_owner_entities` must be populated. */ - fun beneficialOwnerIndividuals(): List = + fun beneficialOwnerIndividuals(): List = beneficialOwnerIndividuals.getRequired("beneficial_owner_individuals") + /** Information for business for which the account is being opened and KYB is being run. */ + fun businessEntity(): BusinessEntity = businessEntity.getRequired("business_entity") + /** * An individual with significant responsibility for managing the legal entity (e.g., a Chief * Executive Officer, Chief Financial Officer, Chief Operating Officer, Managing Member, General @@ -73,7 +73,7 @@ private constructor( * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section II) for more background. */ - fun controlPerson(): Individual = controlPerson.getRequired("control_person") + fun controlPerson(): KybIndividual = controlPerson.getRequired("control_person") /** * An RFC 3339 timestamp indicating when precomputed KYC was completed on the business with a @@ -100,9 +100,6 @@ private constructor( /** Specifies the type of KYB workflow to run. */ fun workflow(): Workflow = workflow.getRequired("workflow") - /** Information for business for which the account is being opened and KYB is being run. */ - @JsonProperty("business_entity") @ExcludeMissing fun _businessEntity() = businessEntity - /** * List of all entities with >25% ownership in the company. If no entity or individual owns >25% * of the company, and the largest shareholder is an entity, please identify them in this field. @@ -129,6 +126,9 @@ private constructor( @ExcludeMissing fun _beneficialOwnerIndividuals() = beneficialOwnerIndividuals + /** Information for business for which the account is being opened and KYB is being run. */ + @JsonProperty("business_entity") @ExcludeMissing fun _businessEntity() = businessEntity + /** * An individual with significant responsibility for managing the legal entity (e.g., a Chief * Executive Officer, Chief Financial Officer, Chief Operating Officer, Managing Member, General @@ -172,9 +172,9 @@ private constructor( fun validate(): Kyb = apply { if (!validated) { - businessEntity().validate() beneficialOwnerEntities().forEach { it.validate() } beneficialOwnerIndividuals().forEach { it.validate() } + businessEntity().validate() controlPerson().validate() kybPassedTimestamp() natureOfBusiness() @@ -193,9 +193,9 @@ private constructor( } return other is Kyb && - this.businessEntity == other.businessEntity && this.beneficialOwnerEntities == other.beneficialOwnerEntities && this.beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && + this.businessEntity == other.businessEntity && this.controlPerson == other.controlPerson && this.kybPassedTimestamp == other.kybPassedTimestamp && this.natureOfBusiness == other.natureOfBusiness && @@ -209,9 +209,9 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - businessEntity, beneficialOwnerEntities, beneficialOwnerIndividuals, + businessEntity, controlPerson, kybPassedTimestamp, natureOfBusiness, @@ -225,7 +225,7 @@ private constructor( } override fun toString() = - "Kyb{businessEntity=$businessEntity, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, controlPerson=$controlPerson, kybPassedTimestamp=$kybPassedTimestamp, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}" + "Kyb{beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessEntity=$businessEntity, controlPerson=$controlPerson, kybPassedTimestamp=$kybPassedTimestamp, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}" companion object { @@ -234,10 +234,10 @@ private constructor( class Builder { - private var businessEntity: JsonField = JsonMissing.of() private var beneficialOwnerEntities: JsonField> = JsonMissing.of() - private var beneficialOwnerIndividuals: JsonField> = JsonMissing.of() - private var controlPerson: JsonField = JsonMissing.of() + private var beneficialOwnerIndividuals: JsonField> = JsonMissing.of() + private var businessEntity: JsonField = JsonMissing.of() + private var controlPerson: JsonField = JsonMissing.of() private var kybPassedTimestamp: JsonField = JsonMissing.of() private var natureOfBusiness: JsonField = JsonMissing.of() private var tosTimestamp: JsonField = JsonMissing.of() @@ -247,9 +247,9 @@ private constructor( @JvmSynthetic internal fun from(kyb: Kyb) = apply { - this.businessEntity = kyb.businessEntity this.beneficialOwnerEntities = kyb.beneficialOwnerEntities this.beneficialOwnerIndividuals = kyb.beneficialOwnerIndividuals + this.businessEntity = kyb.businessEntity this.controlPerson = kyb.controlPerson this.kybPassedTimestamp = kyb.kybPassedTimestamp this.natureOfBusiness = kyb.natureOfBusiness @@ -259,17 +259,6 @@ private constructor( additionalProperties(kyb.additionalProperties) } - /** Information for business for which the account is being opened and KYB is being run. */ - fun businessEntity(businessEntity: BusinessEntity) = - businessEntity(JsonField.of(businessEntity)) - - /** Information for business for which the account is being opened and KYB is being run. */ - @JsonProperty("business_entity") - @ExcludeMissing - fun businessEntity(businessEntity: JsonField) = apply { - this.businessEntity = businessEntity - } - /** * List of all entities with >25% ownership in the company. If no entity or individual owns * >25% of the company, and the largest shareholder is an entity, please identify them in @@ -307,7 +296,7 @@ private constructor( * is an entity, pass in an empty list. However, either this parameter or * `beneficial_owner_entities` must be populated. */ - fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: List) = + fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: List) = beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) /** @@ -321,11 +310,22 @@ private constructor( */ @JsonProperty("beneficial_owner_individuals") @ExcludeMissing - fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: JsonField>) = + fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: JsonField>) = apply { this.beneficialOwnerIndividuals = beneficialOwnerIndividuals } + /** Information for business for which the account is being opened and KYB is being run. */ + fun businessEntity(businessEntity: BusinessEntity) = + businessEntity(JsonField.of(businessEntity)) + + /** Information for business for which the account is being opened and KYB is being run. */ + @JsonProperty("business_entity") + @ExcludeMissing + fun businessEntity(businessEntity: JsonField) = apply { + this.businessEntity = businessEntity + } + /** * An individual with significant responsibility for managing the legal entity (e.g., a * Chief Executive Officer, Chief Financial Officer, Chief Operating Officer, Managing @@ -336,7 +336,7 @@ private constructor( * [FinCEN requirements](https://www.fincen.gov/sites/default/files/shared/CDD_Rev6.7_Sept_2017_Certificate.pdf) * (Section II) for more background. */ - fun controlPerson(controlPerson: Individual) = controlPerson(JsonField.of(controlPerson)) + fun controlPerson(controlPerson: KybIndividual) = controlPerson(JsonField.of(controlPerson)) /** * An individual with significant responsibility for managing the legal entity (e.g., a @@ -350,7 +350,7 @@ private constructor( */ @JsonProperty("control_person") @ExcludeMissing - fun controlPerson(controlPerson: JsonField) = apply { + fun controlPerson(controlPerson: JsonField) = apply { this.controlPerson = controlPerson } @@ -440,9 +440,9 @@ private constructor( fun build(): Kyb = Kyb( - businessEntity, beneficialOwnerEntities.map { it.toUnmodifiable() }, beneficialOwnerIndividuals.map { it.toUnmodifiable() }, + businessEntity, controlPerson, kybPassedTimestamp, natureOfBusiness, @@ -711,9 +711,10 @@ private constructor( } } - @JsonDeserialize(builder = Individual.Builder::class) + /** Individuals associated with a KYB application. Phone number is optional. */ + @JsonDeserialize(builder = KybIndividual.Builder::class) @NoAutoDetect - class Individual + class KybIndividual private constructor( private val address: JsonField
, private val dob: JsonField, @@ -759,7 +760,8 @@ private constructor( fun lastName(): String = lastName.getRequired("last_name") /** Individual's phone number, entered in E.164 format. */ - fun phoneNumber(): String = phoneNumber.getRequired("phone_number") + fun phoneNumber(): Optional = + Optional.ofNullable(phoneNumber.getNullable("phone_number")) /** * Individual's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; @@ -797,7 +799,7 @@ private constructor( @ExcludeMissing fun _additionalProperties(): Map = additionalProperties - fun validate(): Individual = apply { + fun validate(): KybIndividual = apply { if (!validated) { address().validate() dob() @@ -817,7 +819,7 @@ private constructor( return true } - return other is Individual && + return other is KybIndividual && this.address == other.address && this.dob == other.dob && this.email == other.email && @@ -846,7 +848,7 @@ private constructor( } override fun toString() = - "Individual{address=$address, dob=$dob, email=$email, firstName=$firstName, governmentId=$governmentId, lastName=$lastName, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" + "KybIndividual{address=$address, dob=$dob, email=$email, firstName=$firstName, governmentId=$governmentId, lastName=$lastName, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" companion object { @@ -865,15 +867,15 @@ private constructor( private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(individual: Individual) = apply { - this.address = individual.address - this.dob = individual.dob - this.email = individual.email - this.firstName = individual.firstName - this.governmentId = individual.governmentId - this.lastName = individual.lastName - this.phoneNumber = individual.phoneNumber - additionalProperties(individual.additionalProperties) + internal fun from(kybIndividual: KybIndividual) = apply { + this.address = kybIndividual.address + this.dob = kybIndividual.dob + this.email = kybIndividual.email + this.firstName = kybIndividual.firstName + this.governmentId = kybIndividual.governmentId + this.lastName = kybIndividual.lastName + this.phoneNumber = kybIndividual.phoneNumber + additionalProperties(kybIndividual.additionalProperties) } /** @@ -972,8 +974,8 @@ private constructor( this.additionalProperties.putAll(additionalProperties) } - fun build(): Individual = - Individual( + fun build(): KybIndividual = + KybIndividual( address, dob, email, diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt index 9beee854..f3897112 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt @@ -21,14 +21,14 @@ import java.util.Optional @NoAutoDetect class KycExempt private constructor( - private val workflow: JsonField, - private val kycExemptionType: JsonField, + private val address: JsonField
, + private val businessAccountToken: JsonField, + private val email: JsonField, private val firstName: JsonField, + private val kycExemptionType: JsonField, private val lastName: JsonField, - private val email: JsonField, private val phoneNumber: JsonField, - private val businessAccountToken: JsonField, - private val address: JsonField
, + private val workflow: JsonField, private val additionalProperties: Map, ) { @@ -36,70 +36,70 @@ private constructor( private var hashCode: Int = 0 - /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ - fun workflow(): Workflow = workflow.getRequired("workflow") + /** + * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; + * APO/FPO are acceptable. Only USA addresses are currently supported. + */ + fun address(): Optional
= Optional.ofNullable(address.getNullable("address")) - /** Specifies the type of KYC Exempt user */ - fun kycExemptionType(): KycExemptionType = kycExemptionType.getRequired("kyc_exemption_type") + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + fun businessAccountToken(): Optional = + Optional.ofNullable(businessAccountToken.getNullable("business_account_token")) + + /** The KYC Exempt user's email */ + fun email(): String = email.getRequired("email") /** The KYC Exempt user's first name */ fun firstName(): String = firstName.getRequired("first_name") + /** Specifies the type of KYC Exempt user */ + fun kycExemptionType(): KycExemptionType = kycExemptionType.getRequired("kyc_exemption_type") + /** The KYC Exempt user's last name */ fun lastName(): String = lastName.getRequired("last_name") - /** The KYC Exempt user's email */ - fun email(): String = email.getRequired("email") - /** The KYC Exempt user's phone number */ fun phoneNumber(): String = phoneNumber.getRequired("phone_number") - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - fun businessAccountToken(): Optional = - Optional.ofNullable(businessAccountToken.getNullable("business_account_token")) + /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ + fun workflow(): Workflow = workflow.getRequired("workflow") /** * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; * APO/FPO are acceptable. Only USA addresses are currently supported. */ - fun address(): Optional
= Optional.ofNullable(address.getNullable("address")) + @JsonProperty("address") @ExcludeMissing fun _address() = address - /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ - @JsonProperty("workflow") @ExcludeMissing fun _workflow() = workflow + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + @JsonProperty("business_account_token") + @ExcludeMissing + fun _businessAccountToken() = businessAccountToken - /** Specifies the type of KYC Exempt user */ - @JsonProperty("kyc_exemption_type") @ExcludeMissing fun _kycExemptionType() = kycExemptionType + /** The KYC Exempt user's email */ + @JsonProperty("email") @ExcludeMissing fun _email() = email /** The KYC Exempt user's first name */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName + /** Specifies the type of KYC Exempt user */ + @JsonProperty("kyc_exemption_type") @ExcludeMissing fun _kycExemptionType() = kycExemptionType + /** The KYC Exempt user's last name */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - /** The KYC Exempt user's email */ - @JsonProperty("email") @ExcludeMissing fun _email() = email - /** The KYC Exempt user's phone number */ @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - @JsonProperty("business_account_token") - @ExcludeMissing - fun _businessAccountToken() = businessAccountToken - - /** - * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; - * APO/FPO are acceptable. Only USA addresses are currently supported. - */ - @JsonProperty("address") @ExcludeMissing fun _address() = address + /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ + @JsonProperty("workflow") @ExcludeMissing fun _workflow() = workflow @JsonAnyGetter @ExcludeMissing @@ -107,14 +107,14 @@ private constructor( fun validate(): KycExempt = apply { if (!validated) { - workflow() - kycExemptionType() + address().map { it.validate() } + businessAccountToken() + email() firstName() + kycExemptionType() lastName() - email() phoneNumber() - businessAccountToken() - address().map { it.validate() } + workflow() validated = true } } @@ -127,14 +127,14 @@ private constructor( } return other is KycExempt && - this.workflow == other.workflow && - this.kycExemptionType == other.kycExemptionType && + this.address == other.address && + this.businessAccountToken == other.businessAccountToken && + this.email == other.email && this.firstName == other.firstName && + this.kycExemptionType == other.kycExemptionType && this.lastName == other.lastName && - this.email == other.email && this.phoneNumber == other.phoneNumber && - this.businessAccountToken == other.businessAccountToken && - this.address == other.address && + this.workflow == other.workflow && this.additionalProperties == other.additionalProperties } @@ -142,14 +142,14 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - workflow, - kycExemptionType, + address, + businessAccountToken, + email, firstName, + kycExemptionType, lastName, - email, phoneNumber, - businessAccountToken, - address, + workflow, additionalProperties, ) } @@ -157,7 +157,7 @@ private constructor( } override fun toString() = - "KycExempt{workflow=$workflow, kycExemptionType=$kycExemptionType, firstName=$firstName, lastName=$lastName, email=$email, phoneNumber=$phoneNumber, businessAccountToken=$businessAccountToken, address=$address, additionalProperties=$additionalProperties}" + "KycExempt{address=$address, businessAccountToken=$businessAccountToken, email=$email, firstName=$firstName, kycExemptionType=$kycExemptionType, lastName=$lastName, phoneNumber=$phoneNumber, workflow=$workflow, additionalProperties=$additionalProperties}" companion object { @@ -166,48 +166,70 @@ private constructor( class Builder { - private var workflow: JsonField = JsonMissing.of() - private var kycExemptionType: JsonField = JsonMissing.of() + private var address: JsonField
= JsonMissing.of() + private var businessAccountToken: JsonField = JsonMissing.of() + private var email: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() + private var kycExemptionType: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() - private var email: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() - private var businessAccountToken: JsonField = JsonMissing.of() - private var address: JsonField
= JsonMissing.of() + private var workflow: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(kycExempt: KycExempt) = apply { - this.workflow = kycExempt.workflow - this.kycExemptionType = kycExempt.kycExemptionType + this.address = kycExempt.address + this.businessAccountToken = kycExempt.businessAccountToken + this.email = kycExempt.email this.firstName = kycExempt.firstName + this.kycExemptionType = kycExempt.kycExemptionType this.lastName = kycExempt.lastName - this.email = kycExempt.email this.phoneNumber = kycExempt.phoneNumber - this.businessAccountToken = kycExempt.businessAccountToken - this.address = kycExempt.address + this.workflow = kycExempt.workflow additionalProperties(kycExempt.additionalProperties) } - /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ - fun workflow(workflow: Workflow) = workflow(JsonField.of(workflow)) + /** + * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + */ + fun address(address: Address) = address(JsonField.of(address)) - /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ - @JsonProperty("workflow") + /** + * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not + * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. + */ + @JsonProperty("address") @ExcludeMissing - fun workflow(workflow: JsonField) = apply { this.workflow = workflow } + fun address(address: JsonField
) = apply { this.address = address } - /** Specifies the type of KYC Exempt user */ - fun kycExemptionType(kycExemptionType: KycExemptionType) = - kycExemptionType(JsonField.of(kycExemptionType)) + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + fun businessAccountToken(businessAccountToken: String) = + businessAccountToken(JsonField.of(businessAccountToken)) - /** Specifies the type of KYC Exempt user */ - @JsonProperty("kyc_exemption_type") + /** + * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of + * businesses. Pass the account_token of the enrolled business associated with the + * AUTHORIZED_USER in this field. + */ + @JsonProperty("business_account_token") @ExcludeMissing - fun kycExemptionType(kycExemptionType: JsonField) = apply { - this.kycExemptionType = kycExemptionType + fun businessAccountToken(businessAccountToken: JsonField) = apply { + this.businessAccountToken = businessAccountToken } + /** The KYC Exempt user's email */ + fun email(email: String) = email(JsonField.of(email)) + + /** The KYC Exempt user's email */ + @JsonProperty("email") + @ExcludeMissing + fun email(email: JsonField) = apply { this.email = email } + /** The KYC Exempt user's first name */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) @@ -216,6 +238,17 @@ private constructor( @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } + /** Specifies the type of KYC Exempt user */ + fun kycExemptionType(kycExemptionType: KycExemptionType) = + kycExemptionType(JsonField.of(kycExemptionType)) + + /** Specifies the type of KYC Exempt user */ + @JsonProperty("kyc_exemption_type") + @ExcludeMissing + fun kycExemptionType(kycExemptionType: JsonField) = apply { + this.kycExemptionType = kycExemptionType + } + /** The KYC Exempt user's last name */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) @@ -224,14 +257,6 @@ private constructor( @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - /** The KYC Exempt user's email */ - fun email(email: String) = email(JsonField.of(email)) - - /** The KYC Exempt user's email */ - @JsonProperty("email") - @ExcludeMissing - fun email(email: JsonField) = apply { this.email = email } - /** The KYC Exempt user's phone number */ fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) @@ -240,38 +265,13 @@ private constructor( @ExcludeMissing fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - fun businessAccountToken(businessAccountToken: String) = - businessAccountToken(JsonField.of(businessAccountToken)) - - /** - * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of - * businesses. Pass the account_token of the enrolled business associated with the - * AUTHORIZED_USER in this field. - */ - @JsonProperty("business_account_token") - @ExcludeMissing - fun businessAccountToken(businessAccountToken: JsonField) = apply { - this.businessAccountToken = businessAccountToken - } - - /** - * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not - * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. - */ - fun address(address: Address) = address(JsonField.of(address)) + /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ + fun workflow(workflow: Workflow) = workflow(JsonField.of(workflow)) - /** - * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not - * acceptable; APO/FPO are acceptable. Only USA addresses are currently supported. - */ - @JsonProperty("address") + /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ + @JsonProperty("workflow") @ExcludeMissing - fun address(address: JsonField
) = apply { this.address = address } + fun workflow(workflow: JsonField) = apply { this.workflow = workflow } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -289,14 +289,14 @@ private constructor( fun build(): KycExempt = KycExempt( - workflow, - kycExemptionType, + address, + businessAccountToken, + email, firstName, + kycExemptionType, lastName, - email, phoneNumber, - businessAccountToken, - address, + workflow, additionalProperties.toUnmodifiable(), ) } 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 56a464bf..f9eb0232 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 @@ -485,40 +485,40 @@ private constructor( companion object { - @JvmField val CARD = Category(JsonField.of("CARD")) - @JvmField val ACH = Category(JsonField.of("ACH")) + @JvmField val CARD = Category(JsonField.of("CARD")) + @JvmField val TRANSFER = Category(JsonField.of("TRANSFER")) @JvmStatic fun of(value: String) = Category(JsonField.of(value)) } enum class Known { - CARD, ACH, + CARD, TRANSFER, } enum class Value { - CARD, ACH, + CARD, TRANSFER, _UNKNOWN, } fun value(): Value = when (this) { - CARD -> Value.CARD ACH -> Value.ACH + CARD -> Value.CARD TRANSFER -> Value.TRANSFER else -> Value._UNKNOWN } fun known(): Known = when (this) { - CARD -> Known.CARD ACH -> Known.ACH + CARD -> Known.CARD TRANSFER -> Known.TRANSFER else -> throw LithicInvalidDataException("Unknown Category: $value") } @@ -582,10 +582,10 @@ private constructor( @JvmField val CLEARING = FinancialEventType(JsonField.of("CLEARING")) - @JvmField val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) - @JvmField val CORRECTION_CREDIT = FinancialEventType(JsonField.of("CORRECTION_CREDIT")) + @JvmField val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) + @JvmField val CREDIT_AUTHORIZATION = FinancialEventType(JsonField.of("CREDIT_AUTHORIZATION")) @@ -627,8 +627,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -652,8 +652,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -679,8 +679,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Value.BALANCE_INQUIRY CLEARING -> Value.CLEARING - CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CORRECTION_CREDIT -> Value.CORRECTION_CREDIT + CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION @@ -706,8 +706,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Known.BALANCE_INQUIRY CLEARING -> Known.CLEARING - CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CORRECTION_CREDIT -> Known.CORRECTION_CREDIT + CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt index 2b237995..bbac0904 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt @@ -28,8 +28,8 @@ private constructor( private val response: JsonField, private val responseStatusCode: JsonField, private val status: JsonField, - private val url: JsonField, private val token: JsonField, + private val url: JsonField, private val additionalProperties: Map, ) { @@ -60,11 +60,11 @@ private constructor( /** The status of the event attempt. */ fun status(): Status = status.getRequired("status") - fun url(): String = url.getRequired("url") - /** Globally unique identifier. */ fun token(): String = token.getRequired("token") + fun url(): String = url.getRequired("url") + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -91,11 +91,11 @@ private constructor( /** The status of the event attempt. */ @JsonProperty("status") @ExcludeMissing fun _status() = status - @JsonProperty("url") @ExcludeMissing fun _url() = url - /** Globally unique identifier. */ @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("url") @ExcludeMissing fun _url() = url + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -108,8 +108,8 @@ private constructor( response() responseStatusCode() status() - url() token() + url() validated = true } } @@ -128,8 +128,8 @@ private constructor( this.response == other.response && this.responseStatusCode == other.responseStatusCode && this.status == other.status && - this.url == other.url && this.token == other.token && + this.url == other.url && this.additionalProperties == other.additionalProperties } @@ -143,8 +143,8 @@ private constructor( response, responseStatusCode, status, - url, token, + url, additionalProperties, ) } @@ -152,7 +152,7 @@ private constructor( } override fun toString() = - "MessageAttempt{created=$created, eventSubscriptionToken=$eventSubscriptionToken, eventToken=$eventToken, response=$response, responseStatusCode=$responseStatusCode, status=$status, url=$url, token=$token, additionalProperties=$additionalProperties}" + "MessageAttempt{created=$created, eventSubscriptionToken=$eventSubscriptionToken, eventToken=$eventToken, response=$response, responseStatusCode=$responseStatusCode, status=$status, token=$token, url=$url, additionalProperties=$additionalProperties}" companion object { @@ -167,8 +167,8 @@ private constructor( private var response: JsonField = JsonMissing.of() private var responseStatusCode: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var url: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var url: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -179,8 +179,8 @@ private constructor( this.response = messageAttempt.response this.responseStatusCode = messageAttempt.responseStatusCode this.status = messageAttempt.status - this.url = messageAttempt.url this.token = messageAttempt.token + this.url = messageAttempt.url additionalProperties(messageAttempt.additionalProperties) } @@ -246,12 +246,6 @@ private constructor( @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } - fun url(url: String) = url(JsonField.of(url)) - - @JsonProperty("url") - @ExcludeMissing - fun url(url: JsonField) = apply { this.url = url } - /** Globally unique identifier. */ fun token(token: String) = token(JsonField.of(token)) @@ -260,6 +254,12 @@ private constructor( @ExcludeMissing fun token(token: JsonField) = apply { this.token = token } + fun url(url: String) = url(JsonField.of(url)) + + @JsonProperty("url") + @ExcludeMissing + fun url(url: JsonField) = apply { this.url = url } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -282,8 +282,8 @@ private constructor( response, responseStatusCode, status, - url, token, + url, additionalProperties.toUnmodifiable(), ) } 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 432e14da..a245b04b 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 @@ -652,35 +652,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") } @@ -709,40 +709,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") } @@ -892,42 +892,42 @@ private constructor( companion object { - @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) - @JvmField val ENABLED = VerificationState(JsonField.of("ENABLED")) @JvmField val FAILED_VERIFICATION = VerificationState(JsonField.of("FAILED_VERIFICATION")) + @JvmField val PENDING = VerificationState(JsonField.of("PENDING")) + @JvmStatic fun of(value: String) = VerificationState(JsonField.of(value)) } enum class Known { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, } enum class Value { - PENDING, ENABLED, FAILED_VERIFICATION, + PENDING, _UNKNOWN, } fun value(): Value = when (this) { - PENDING -> Value.PENDING ENABLED -> Value.ENABLED FAILED_VERIFICATION -> Value.FAILED_VERIFICATION + PENDING -> Value.PENDING else -> Value._UNKNOWN } fun known(): Known = when (this) { - PENDING -> Known.PENDING ENABLED -> Known.ENABLED FAILED_VERIFICATION -> Known.FAILED_VERIFICATION + 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 6dc0b619..4827611f 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 @@ -29,35 +29,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/Payment.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt index 30281024..e4dd5925 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Payment.kt @@ -33,11 +33,11 @@ private constructor( private val status: JsonField, private val token: JsonField, private val updated: JsonField, - private val methodAttributes: JsonField, - private val externalBankAccountToken: JsonField, private val direction: JsonField, - private val source: JsonField, + private val externalBankAccountToken: JsonField, private val method: JsonField, + private val methodAttributes: JsonField, + private val source: JsonField, private val userDefinedId: JsonField, private val additionalProperties: Map, ) { @@ -107,17 +107,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun methodAttributes(): PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") + fun direction(): Direction = direction.getRequired("direction") fun externalBankAccountToken(): Optional = Optional.ofNullable(externalBankAccountToken.getNullable("external_bank_account_token")) - fun direction(): Direction = direction.getRequired("direction") + fun method(): Method = method.getRequired("method") - fun source(): Source = source.getRequired("source") + fun methodAttributes(): PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") - fun method(): Method = method.getRequired("method") + fun source(): Source = source.getRequired("source") fun userDefinedId(): Optional = Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) @@ -198,17 +198,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction @JsonProperty("external_bank_account_token") @ExcludeMissing fun _externalBankAccountToken() = externalBankAccountToken - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + @JsonProperty("method") @ExcludeMissing fun _method() = method - @JsonProperty("source") @ExcludeMissing fun _source() = source + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - @JsonProperty("method") @ExcludeMissing fun _method() = method + @JsonProperty("source") @ExcludeMissing fun _source() = source @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -229,11 +229,11 @@ private constructor( status() token() updated() - methodAttributes().validate() - externalBankAccountToken() direction() - source() + externalBankAccountToken() method() + methodAttributes().validate() + source() userDefinedId() validated = true } @@ -258,11 +258,11 @@ private constructor( this.status == other.status && this.token == other.token && this.updated == other.updated && - this.methodAttributes == other.methodAttributes && - this.externalBankAccountToken == other.externalBankAccountToken && this.direction == other.direction && - this.source == other.source && + this.externalBankAccountToken == other.externalBankAccountToken && this.method == other.method && + this.methodAttributes == other.methodAttributes && + this.source == other.source && this.userDefinedId == other.userDefinedId && this.additionalProperties == other.additionalProperties } @@ -282,11 +282,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, additionalProperties, ) @@ -295,7 +295,7 @@ private constructor( } override fun toString() = - "Payment{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, methodAttributes=$methodAttributes, externalBankAccountToken=$externalBankAccountToken, direction=$direction, source=$source, method=$method, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "Payment{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, direction=$direction, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" companion object { @@ -315,11 +315,11 @@ private constructor( private var status: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var methodAttributes: JsonField = JsonMissing.of() - private var externalBankAccountToken: JsonField = JsonMissing.of() private var direction: JsonField = JsonMissing.of() - private var source: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -336,11 +336,11 @@ private constructor( this.status = payment.status this.token = payment.token this.updated = payment.updated - this.methodAttributes = payment.methodAttributes - this.externalBankAccountToken = payment.externalBankAccountToken this.direction = payment.direction - this.source = payment.source + this.externalBankAccountToken = payment.externalBankAccountToken this.method = payment.method + this.methodAttributes = payment.methodAttributes + this.source = payment.source this.userDefinedId = payment.userDefinedId additionalProperties(payment.additionalProperties) } @@ -499,14 +499,11 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - fun methodAttributes(methodAttributes: PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) + fun direction(direction: Direction) = direction(JsonField.of(direction)) - @JsonProperty("method_attributes") + @JsonProperty("direction") @ExcludeMissing - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes - } + fun direction(direction: JsonField) = apply { this.direction = direction } fun externalBankAccountToken(externalBankAccountToken: String) = externalBankAccountToken(JsonField.of(externalBankAccountToken)) @@ -517,23 +514,26 @@ private constructor( this.externalBankAccountToken = externalBankAccountToken } - fun direction(direction: Direction) = direction(JsonField.of(direction)) + fun method(method: Method) = method(JsonField.of(method)) - @JsonProperty("direction") + @JsonProperty("method") @ExcludeMissing - fun direction(direction: JsonField) = apply { this.direction = direction } + fun method(method: JsonField) = apply { this.method = method } - fun source(source: Source) = source(JsonField.of(source)) + fun methodAttributes(methodAttributes: PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) - @JsonProperty("source") + @JsonProperty("method_attributes") @ExcludeMissing - fun source(source: JsonField) = apply { this.source = source } + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes + } - fun method(method: Method) = method(JsonField.of(method)) + fun source(source: Source) = source(JsonField.of(source)) - @JsonProperty("method") + @JsonProperty("source") @ExcludeMissing - fun method(method: JsonField) = apply { this.method = method } + fun source(source: JsonField) = apply { this.source = source } fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -570,11 +570,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, additionalProperties.toUnmodifiable(), ) @@ -698,11 +698,11 @@ private constructor( @NoAutoDetect class PaymentMethodAttributes private constructor( + private val companyId: JsonField, + private val receiptRoutingNumber: JsonField, private val retries: JsonField, private val returnReasonCode: JsonField, private val secCode: JsonField, - private val companyId: JsonField, - private val receiptRoutingNumber: JsonField, private val additionalProperties: Map, ) { @@ -710,6 +710,11 @@ private constructor( private var hashCode: Int = 0 + fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + + fun receiptRoutingNumber(): Optional = + Optional.ofNullable(receiptRoutingNumber.getNullable("receipt_routing_number")) + fun retries(): Optional = Optional.ofNullable(retries.getNullable("retries")) fun returnReasonCode(): Optional = @@ -717,10 +722,11 @@ private constructor( fun secCode(): SecCode = secCode.getRequired("sec_code") - fun companyId(): Optional = Optional.ofNullable(companyId.getNullable("company_id")) + @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - fun receiptRoutingNumber(): Optional = - Optional.ofNullable(receiptRoutingNumber.getNullable("receipt_routing_number")) + @JsonProperty("receipt_routing_number") + @ExcludeMissing + fun _receiptRoutingNumber() = receiptRoutingNumber @JsonProperty("retries") @ExcludeMissing fun _retries() = retries @@ -730,23 +736,17 @@ private constructor( @JsonProperty("sec_code") @ExcludeMissing fun _secCode() = secCode - @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId - - @JsonProperty("receipt_routing_number") - @ExcludeMissing - fun _receiptRoutingNumber() = receiptRoutingNumber - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): PaymentMethodAttributes = apply { if (!validated) { + companyId() + receiptRoutingNumber() retries() returnReasonCode() secCode() - companyId() - receiptRoutingNumber() validated = true } } @@ -759,11 +759,11 @@ private constructor( } return other is PaymentMethodAttributes && + this.companyId == other.companyId && + this.receiptRoutingNumber == other.receiptRoutingNumber && this.retries == other.retries && this.returnReasonCode == other.returnReasonCode && this.secCode == other.secCode && - this.companyId == other.companyId && - this.receiptRoutingNumber == other.receiptRoutingNumber && this.additionalProperties == other.additionalProperties } @@ -771,11 +771,11 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( + companyId, + receiptRoutingNumber, retries, returnReasonCode, secCode, - companyId, - receiptRoutingNumber, additionalProperties, ) } @@ -783,7 +783,7 @@ private constructor( } override fun toString() = - "PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, additionalProperties=$additionalProperties}" + "PaymentMethodAttributes{companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, additionalProperties=$additionalProperties}" companion object { @@ -792,23 +792,38 @@ private constructor( class Builder { + private var companyId: JsonField = JsonMissing.of() + private var receiptRoutingNumber: JsonField = JsonMissing.of() private var retries: JsonField = JsonMissing.of() private var returnReasonCode: JsonField = JsonMissing.of() private var secCode: JsonField = JsonMissing.of() - private var companyId: JsonField = JsonMissing.of() - private var receiptRoutingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentMethodAttributes: PaymentMethodAttributes) = apply { + this.companyId = paymentMethodAttributes.companyId + this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber this.retries = paymentMethodAttributes.retries this.returnReasonCode = paymentMethodAttributes.returnReasonCode this.secCode = paymentMethodAttributes.secCode - this.companyId = paymentMethodAttributes.companyId - this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber additionalProperties(paymentMethodAttributes.additionalProperties) } + fun companyId(companyId: String) = companyId(JsonField.of(companyId)) + + @JsonProperty("company_id") + @ExcludeMissing + fun companyId(companyId: JsonField) = apply { this.companyId = companyId } + + fun receiptRoutingNumber(receiptRoutingNumber: String) = + receiptRoutingNumber(JsonField.of(receiptRoutingNumber)) + + @JsonProperty("receipt_routing_number") + @ExcludeMissing + fun receiptRoutingNumber(receiptRoutingNumber: JsonField) = apply { + this.receiptRoutingNumber = receiptRoutingNumber + } + fun retries(retries: Long) = retries(JsonField.of(retries)) @JsonProperty("retries") @@ -830,21 +845,6 @@ private constructor( @ExcludeMissing fun secCode(secCode: JsonField) = apply { this.secCode = secCode } - fun companyId(companyId: String) = companyId(JsonField.of(companyId)) - - @JsonProperty("company_id") - @ExcludeMissing - fun companyId(companyId: JsonField) = apply { this.companyId = companyId } - - fun receiptRoutingNumber(receiptRoutingNumber: String) = - receiptRoutingNumber(JsonField.of(receiptRoutingNumber)) - - @JsonProperty("receipt_routing_number") - @ExcludeMissing - fun receiptRoutingNumber(receiptRoutingNumber: JsonField) = apply { - this.receiptRoutingNumber = receiptRoutingNumber - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -861,11 +861,11 @@ private constructor( fun build(): PaymentMethodAttributes = PaymentMethodAttributes( + companyId, + receiptRoutingNumber, retries, returnReasonCode, secCode, - companyId, - receiptRoutingNumber, additionalProperties.toUnmodifiable(), ) } @@ -892,40 +892,40 @@ private constructor( companion object { - @JvmField val PPD = SecCode(JsonField.of("PPD")) - @JvmField val CCD = SecCode(JsonField.of("CCD")) + @JvmField val PPD = SecCode(JsonField.of("PPD")) + @JvmField val WEB = SecCode(JsonField.of("WEB")) @JvmStatic fun of(value: String) = SecCode(JsonField.of(value)) } enum class Known { - PPD, CCD, + PPD, WEB, } enum class Value { - PPD, CCD, + PPD, WEB, _UNKNOWN, } fun value(): Value = when (this) { - PPD -> Value.PPD CCD -> Value.CCD + PPD -> Value.PPD WEB -> Value.WEB else -> Value._UNKNOWN } fun known(): Known = when (this) { - PPD -> Known.PPD CCD -> Known.CCD + PPD -> Known.PPD WEB -> Known.WEB else -> throw LithicInvalidDataException("Unknown SecCode: $value") } @@ -956,35 +956,35 @@ private constructor( companion object { - @JvmField val LITHIC = Source(JsonField.of("LITHIC")) - @JvmField val CUSTOMER = Source(JsonField.of("CUSTOMER")) + @JvmField val LITHIC = Source(JsonField.of("LITHIC")) + @JvmStatic fun of(value: String) = Source(JsonField.of(value)) } enum class Known { - LITHIC, CUSTOMER, + LITHIC, } enum class Value { - LITHIC, CUSTOMER, + LITHIC, _UNKNOWN, } fun value(): Value = when (this) { - LITHIC -> Value.LITHIC CUSTOMER -> Value.CUSTOMER + LITHIC -> Value.LITHIC else -> Value._UNKNOWN } fun known(): Known = when (this) { - LITHIC -> Known.LITHIC CUSTOMER -> Known.CUSTOMER + LITHIC -> Known.LITHIC else -> throw LithicInvalidDataException("Unknown Source: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt index 0e341ce3..09c9ca85 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateParams.kt @@ -104,6 +104,10 @@ constructor( @JsonProperty("type") fun type(): Type? = type + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ @JsonProperty("token") fun token(): String? = token @JsonProperty("memo") fun memo(): String? = memo @@ -209,6 +213,10 @@ constructor( @JsonProperty("type") fun type(type: Type) = apply { this.type = type } + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ @JsonProperty("token") fun token(token: String) = apply { this.token = token } @JsonProperty("memo") fun memo(memo: String) = apply { this.memo = memo } @@ -355,6 +363,10 @@ constructor( fun type(type: Type) = apply { this.type = type } + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ fun token(token: String) = apply { this.token = token } fun memo(memo: String) = apply { this.memo = memo } @@ -497,27 +509,27 @@ constructor( @NoAutoDetect class PaymentMethodAttributes private constructor( + private val companyId: String?, + private val receiptRoutingNumber: String?, private val retries: Long?, private val returnReasonCode: String?, private val secCode: SecCode?, - private val companyId: String?, - private val receiptRoutingNumber: String?, private val additionalProperties: Map, ) { private var hashCode: Int = 0 + @JsonProperty("company_id") fun companyId(): String? = companyId + + @JsonProperty("receipt_routing_number") + fun receiptRoutingNumber(): String? = receiptRoutingNumber + @JsonProperty("retries") fun retries(): Long? = retries @JsonProperty("return_reason_code") fun returnReasonCode(): String? = returnReasonCode @JsonProperty("sec_code") fun secCode(): SecCode? = secCode - @JsonProperty("company_id") fun companyId(): String? = companyId - - @JsonProperty("receipt_routing_number") - fun receiptRoutingNumber(): String? = receiptRoutingNumber - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -530,11 +542,11 @@ constructor( } return other is PaymentMethodAttributes && + this.companyId == other.companyId && + this.receiptRoutingNumber == other.receiptRoutingNumber && this.retries == other.retries && this.returnReasonCode == other.returnReasonCode && this.secCode == other.secCode && - this.companyId == other.companyId && - this.receiptRoutingNumber == other.receiptRoutingNumber && this.additionalProperties == other.additionalProperties } @@ -542,11 +554,11 @@ constructor( if (hashCode == 0) { hashCode = Objects.hash( + companyId, + receiptRoutingNumber, retries, returnReasonCode, secCode, - companyId, - receiptRoutingNumber, additionalProperties, ) } @@ -554,7 +566,7 @@ constructor( } override fun toString() = - "PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, additionalProperties=$additionalProperties}" + "PaymentMethodAttributes{companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, additionalProperties=$additionalProperties}" companion object { @@ -563,23 +575,31 @@ constructor( class Builder { + private var companyId: String? = null + private var receiptRoutingNumber: String? = null private var retries: Long? = null private var returnReasonCode: String? = null private var secCode: SecCode? = null - private var companyId: String? = null - private var receiptRoutingNumber: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(paymentMethodAttributes: PaymentMethodAttributes) = apply { + this.companyId = paymentMethodAttributes.companyId + this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber this.retries = paymentMethodAttributes.retries this.returnReasonCode = paymentMethodAttributes.returnReasonCode this.secCode = paymentMethodAttributes.secCode - this.companyId = paymentMethodAttributes.companyId - this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber additionalProperties(paymentMethodAttributes.additionalProperties) } + @JsonProperty("company_id") + fun companyId(companyId: String) = apply { this.companyId = companyId } + + @JsonProperty("receipt_routing_number") + fun receiptRoutingNumber(receiptRoutingNumber: String) = apply { + this.receiptRoutingNumber = receiptRoutingNumber + } + @JsonProperty("retries") fun retries(retries: Long) = apply { this.retries = retries } @JsonProperty("return_reason_code") @@ -590,14 +610,6 @@ constructor( @JsonProperty("sec_code") fun secCode(secCode: SecCode) = apply { this.secCode = secCode } - @JsonProperty("company_id") - fun companyId(companyId: String) = apply { this.companyId = companyId } - - @JsonProperty("receipt_routing_number") - fun receiptRoutingNumber(receiptRoutingNumber: String) = apply { - this.receiptRoutingNumber = receiptRoutingNumber - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -614,11 +626,11 @@ constructor( fun build(): PaymentMethodAttributes = PaymentMethodAttributes( + companyId, + receiptRoutingNumber, retries, returnReasonCode, checkNotNull(secCode) { "`secCode` is required but was not set" }, - companyId, - receiptRoutingNumber, additionalProperties.toUnmodifiable(), ) } @@ -645,40 +657,40 @@ constructor( companion object { - @JvmField val PPD = SecCode(JsonField.of("PPD")) - @JvmField val CCD = SecCode(JsonField.of("CCD")) + @JvmField val PPD = SecCode(JsonField.of("PPD")) + @JvmField val WEB = SecCode(JsonField.of("WEB")) @JvmStatic fun of(value: String) = SecCode(JsonField.of(value)) } enum class Known { - PPD, CCD, + PPD, WEB, } enum class Value { - PPD, CCD, + PPD, WEB, _UNKNOWN, } fun value(): Value = when (this) { - PPD -> Value.PPD CCD -> Value.CCD + PPD -> Value.PPD WEB -> Value.WEB else -> Value._UNKNOWN } fun known(): Known = when (this) { - PPD -> Known.PPD CCD -> Known.CCD + PPD -> Known.PPD WEB -> Known.WEB else -> throw LithicInvalidDataException("Unknown SecCode: $value") } @@ -709,35 +721,35 @@ constructor( companion object { - @JvmField val PAYMENT = Type(JsonField.of("PAYMENT")) - @JvmField val COLLECTION = Type(JsonField.of("COLLECTION")) + @JvmField val PAYMENT = Type(JsonField.of("PAYMENT")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { - PAYMENT, COLLECTION, + PAYMENT, } enum class Value { - PAYMENT, COLLECTION, + PAYMENT, _UNKNOWN, } fun value(): Value = when (this) { - PAYMENT -> Value.PAYMENT COLLECTION -> Value.COLLECTION + PAYMENT -> Value.PAYMENT else -> Value._UNKNOWN } fun known(): Known = when (this) { - PAYMENT -> Known.PAYMENT COLLECTION -> Known.COLLECTION + PAYMENT -> Known.PAYMENT else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt index 94761a8e..1c2b223d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt @@ -31,11 +31,11 @@ private constructor( private val status: JsonField, private val token: JsonField, private val updated: JsonField, - private val methodAttributes: JsonField, - private val externalBankAccountToken: JsonField, private val direction: JsonField, - private val source: JsonField, + private val externalBankAccountToken: JsonField, private val method: JsonField, + private val methodAttributes: JsonField, + private val source: JsonField, private val userDefinedId: JsonField, private val balance: JsonField, private val additionalProperties: Map, @@ -106,17 +106,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun methodAttributes(): Payment.PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") + fun direction(): Payment.Direction = direction.getRequired("direction") fun externalBankAccountToken(): Optional = Optional.ofNullable(externalBankAccountToken.getNullable("external_bank_account_token")) - fun direction(): Payment.Direction = direction.getRequired("direction") + fun method(): Payment.Method = method.getRequired("method") - fun source(): Payment.Source = source.getRequired("source") + fun methodAttributes(): Payment.PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") - fun method(): Payment.Method = method.getRequired("method") + fun source(): Payment.Source = source.getRequired("source") fun userDefinedId(): Optional = Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) @@ -137,11 +137,11 @@ private constructor( .status(status) .token(token) .updated(updated) - .methodAttributes(methodAttributes) - .externalBankAccountToken(externalBankAccountToken) .direction(direction) - .source(source) + .externalBankAccountToken(externalBankAccountToken) .method(method) + .methodAttributes(methodAttributes) + .source(source) .userDefinedId(userDefinedId) .build() @@ -206,17 +206,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction @JsonProperty("external_bank_account_token") @ExcludeMissing fun _externalBankAccountToken() = externalBankAccountToken - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + @JsonProperty("method") @ExcludeMissing fun _method() = method - @JsonProperty("source") @ExcludeMissing fun _source() = source + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - @JsonProperty("method") @ExcludeMissing fun _method() = method + @JsonProperty("source") @ExcludeMissing fun _source() = source @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -240,11 +240,11 @@ private constructor( status() token() updated() - methodAttributes().validate() - externalBankAccountToken() direction() - source() + externalBankAccountToken() method() + methodAttributes().validate() + source() userDefinedId() balance().map { it.validate() } validated = true @@ -270,11 +270,11 @@ private constructor( this.status == other.status && this.token == other.token && this.updated == other.updated && - this.methodAttributes == other.methodAttributes && - this.externalBankAccountToken == other.externalBankAccountToken && this.direction == other.direction && - this.source == other.source && + this.externalBankAccountToken == other.externalBankAccountToken && this.method == other.method && + this.methodAttributes == other.methodAttributes && + this.source == other.source && this.userDefinedId == other.userDefinedId && this.balance == other.balance && this.additionalProperties == other.additionalProperties @@ -295,11 +295,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, balance, additionalProperties, @@ -309,7 +309,7 @@ private constructor( } override fun toString() = - "PaymentCreateResponse{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, methodAttributes=$methodAttributes, externalBankAccountToken=$externalBankAccountToken, direction=$direction, source=$source, method=$method, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentCreateResponse{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, direction=$direction, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" companion object { @@ -329,11 +329,11 @@ private constructor( private var status: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var methodAttributes: JsonField = JsonMissing.of() - private var externalBankAccountToken: JsonField = JsonMissing.of() private var direction: JsonField = JsonMissing.of() - private var source: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var balance: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -351,11 +351,11 @@ private constructor( this.status = paymentCreateResponse.status this.token = paymentCreateResponse.token this.updated = paymentCreateResponse.updated - this.methodAttributes = paymentCreateResponse.methodAttributes - this.externalBankAccountToken = paymentCreateResponse.externalBankAccountToken this.direction = paymentCreateResponse.direction - this.source = paymentCreateResponse.source + this.externalBankAccountToken = paymentCreateResponse.externalBankAccountToken this.method = paymentCreateResponse.method + this.methodAttributes = paymentCreateResponse.methodAttributes + this.source = paymentCreateResponse.source this.userDefinedId = paymentCreateResponse.userDefinedId this.balance = paymentCreateResponse.balance additionalProperties(paymentCreateResponse.additionalProperties) @@ -515,13 +515,12 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) + fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) - @JsonProperty("method_attributes") + @JsonProperty("direction") @ExcludeMissing - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes + fun direction(direction: JsonField) = apply { + this.direction = direction } fun externalBankAccountToken(externalBankAccountToken: String) = @@ -533,12 +532,19 @@ private constructor( this.externalBankAccountToken = externalBankAccountToken } - fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) + fun method(method: Payment.Method) = method(JsonField.of(method)) - @JsonProperty("direction") + @JsonProperty("method") @ExcludeMissing - fun direction(direction: JsonField) = apply { - this.direction = direction + fun method(method: JsonField) = apply { this.method = method } + + fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + @JsonProperty("method_attributes") + @ExcludeMissing + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes } fun source(source: Payment.Source) = source(JsonField.of(source)) @@ -547,12 +553,6 @@ private constructor( @ExcludeMissing fun source(source: JsonField) = apply { this.source = source } - fun method(method: Payment.Method) = method(JsonField.of(method)) - - @JsonProperty("method") - @ExcludeMissing - fun method(method: JsonField) = apply { this.method = method } - fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @JsonProperty("user_defined_id") @@ -596,11 +596,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, balance, additionalProperties.toUnmodifiable(), diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt index df4b6e19..396aca10 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt @@ -31,11 +31,11 @@ private constructor( private val status: JsonField, private val token: JsonField, private val updated: JsonField, - private val methodAttributes: JsonField, - private val externalBankAccountToken: JsonField, private val direction: JsonField, - private val source: JsonField, + private val externalBankAccountToken: JsonField, private val method: JsonField, + private val methodAttributes: JsonField, + private val source: JsonField, private val userDefinedId: JsonField, private val balance: JsonField, private val additionalProperties: Map, @@ -106,17 +106,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun methodAttributes(): Payment.PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") + fun direction(): Payment.Direction = direction.getRequired("direction") fun externalBankAccountToken(): Optional = Optional.ofNullable(externalBankAccountToken.getNullable("external_bank_account_token")) - fun direction(): Payment.Direction = direction.getRequired("direction") + fun method(): Payment.Method = method.getRequired("method") - fun source(): Payment.Source = source.getRequired("source") + fun methodAttributes(): Payment.PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") - fun method(): Payment.Method = method.getRequired("method") + fun source(): Payment.Source = source.getRequired("source") fun userDefinedId(): Optional = Optional.ofNullable(userDefinedId.getNullable("user_defined_id")) @@ -137,11 +137,11 @@ private constructor( .status(status) .token(token) .updated(updated) - .methodAttributes(methodAttributes) - .externalBankAccountToken(externalBankAccountToken) .direction(direction) - .source(source) + .externalBankAccountToken(externalBankAccountToken) .method(method) + .methodAttributes(methodAttributes) + .source(source) .userDefinedId(userDefinedId) .build() @@ -206,17 +206,17 @@ private constructor( /** Date and time when the financial transaction was last updated. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction @JsonProperty("external_bank_account_token") @ExcludeMissing fun _externalBankAccountToken() = externalBankAccountToken - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + @JsonProperty("method") @ExcludeMissing fun _method() = method - @JsonProperty("source") @ExcludeMissing fun _source() = source + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - @JsonProperty("method") @ExcludeMissing fun _method() = method + @JsonProperty("source") @ExcludeMissing fun _source() = source @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -240,11 +240,11 @@ private constructor( status() token() updated() - methodAttributes().validate() - externalBankAccountToken() direction() - source() + externalBankAccountToken() method() + methodAttributes().validate() + source() userDefinedId() balance().map { it.validate() } validated = true @@ -270,11 +270,11 @@ private constructor( this.status == other.status && this.token == other.token && this.updated == other.updated && - this.methodAttributes == other.methodAttributes && - this.externalBankAccountToken == other.externalBankAccountToken && this.direction == other.direction && - this.source == other.source && + this.externalBankAccountToken == other.externalBankAccountToken && this.method == other.method && + this.methodAttributes == other.methodAttributes && + this.source == other.source && this.userDefinedId == other.userDefinedId && this.balance == other.balance && this.additionalProperties == other.additionalProperties @@ -295,11 +295,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, balance, additionalProperties, @@ -309,7 +309,7 @@ private constructor( } override fun toString() = - "PaymentRetryResponse{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, methodAttributes=$methodAttributes, externalBankAccountToken=$externalBankAccountToken, direction=$direction, source=$source, method=$method, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentRetryResponse{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, direction=$direction, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" companion object { @@ -329,11 +329,11 @@ private constructor( private var status: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var methodAttributes: JsonField = JsonMissing.of() - private var externalBankAccountToken: JsonField = JsonMissing.of() private var direction: JsonField = JsonMissing.of() - private var source: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var balance: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @@ -351,11 +351,11 @@ private constructor( this.status = paymentRetryResponse.status this.token = paymentRetryResponse.token this.updated = paymentRetryResponse.updated - this.methodAttributes = paymentRetryResponse.methodAttributes - this.externalBankAccountToken = paymentRetryResponse.externalBankAccountToken this.direction = paymentRetryResponse.direction - this.source = paymentRetryResponse.source + this.externalBankAccountToken = paymentRetryResponse.externalBankAccountToken this.method = paymentRetryResponse.method + this.methodAttributes = paymentRetryResponse.methodAttributes + this.source = paymentRetryResponse.source this.userDefinedId = paymentRetryResponse.userDefinedId this.balance = paymentRetryResponse.balance additionalProperties(paymentRetryResponse.additionalProperties) @@ -515,13 +515,12 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) + fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) - @JsonProperty("method_attributes") + @JsonProperty("direction") @ExcludeMissing - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes + fun direction(direction: JsonField) = apply { + this.direction = direction } fun externalBankAccountToken(externalBankAccountToken: String) = @@ -533,12 +532,19 @@ private constructor( this.externalBankAccountToken = externalBankAccountToken } - fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) + fun method(method: Payment.Method) = method(JsonField.of(method)) - @JsonProperty("direction") + @JsonProperty("method") @ExcludeMissing - fun direction(direction: JsonField) = apply { - this.direction = direction + fun method(method: JsonField) = apply { this.method = method } + + fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + @JsonProperty("method_attributes") + @ExcludeMissing + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes } fun source(source: Payment.Source) = source(JsonField.of(source)) @@ -547,12 +553,6 @@ private constructor( @ExcludeMissing fun source(source: JsonField) = apply { this.source = source } - fun method(method: Payment.Method) = method(JsonField.of(method)) - - @JsonProperty("method") - @ExcludeMissing - fun method(method: JsonField) = apply { this.method = method } - fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @JsonProperty("user_defined_id") @@ -596,11 +596,11 @@ private constructor( status, token, updated, - methodAttributes, - externalBankAccountToken, direction, - source, + externalBankAccountToken, method, + methodAttributes, + source, userDefinedId, balance, additionalProperties.toUnmodifiable(), diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt index 02b85419..67660086 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCheckStatusParams.kt @@ -153,39 +153,39 @@ constructor( @JvmField val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS")) - @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) - @JvmField val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING")) + @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, } enum class Value { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, _UNKNOWN, } fun value(): Value = when (this) { AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING else -> Value._UNKNOWN } fun known(): Known = when (this) { AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt index 741ced36..f3dd7b25 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointCreateParams.kt @@ -290,39 +290,39 @@ constructor( @JvmField val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS")) - @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) - @JvmField val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING")) + @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, } enum class Value { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, _UNKNOWN, } fun value(): Value = when (this) { AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING else -> Value._UNKNOWN } fun known(): Known = when (this) { AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt index d1daa8f2..b0a7d13f 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ResponderEndpointDeleteParams.kt @@ -180,39 +180,39 @@ constructor( @JvmField val AUTH_STREAM_ACCESS = Type(JsonField.of("AUTH_STREAM_ACCESS")) - @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) - @JvmField val THREE_DS_DECISIONING = Type(JsonField.of("THREE_DS_DECISIONING")) + @JvmField val TOKENIZATION_DECISIONING = Type(JsonField.of("TOKENIZATION_DECISIONING")) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } enum class Known { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, } enum class Value { AUTH_STREAM_ACCESS, - TOKENIZATION_DECISIONING, THREE_DS_DECISIONING, + TOKENIZATION_DECISIONING, _UNKNOWN, } fun value(): Value = when (this) { AUTH_STREAM_ACCESS -> Value.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Value.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Value.TOKENIZATION_DECISIONING else -> Value._UNKNOWN } fun known(): Known = when (this) { AUTH_STREAM_ACCESS -> Known.AUTH_STREAM_ACCESS - TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING THREE_DS_DECISIONING -> Known.THREE_DS_DECISIONING + TOKENIZATION_DECISIONING -> Known.TOKENIZATION_DECISIONING else -> throw LithicInvalidDataException("Unknown Type: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt index a7b8f971..3e2e8e77 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt @@ -22,24 +22,24 @@ import java.util.Optional @NoAutoDetect class SettlementDetail private constructor( - private val token: JsonField, - private val institution: JsonField, private val accountToken: JsonField, - private val eventTokens: JsonField>, - private val transactionToken: JsonField, - private val cardToken: JsonField, private val cardProgramToken: JsonField, + private val cardToken: JsonField, + private val created: JsonField, private val currency: JsonField, - private val network: JsonField, - private val transactionsGrossAmount: JsonField, - private val interchangeGrossAmount: JsonField, private val disputesGrossAmount: JsonField, - private val otherFeesGrossAmount: JsonField, + private val eventTokens: JsonField>, + private val institution: JsonField, + private val interchangeGrossAmount: JsonField, + private val network: JsonField, private val otherFeesDetails: JsonField, - private val created: JsonField, - private val updated: JsonField, - private val settlementDate: JsonField, + private val otherFeesGrossAmount: JsonField, private val reportDate: JsonField, + private val settlementDate: JsonField, + private val token: JsonField, + private val transactionToken: JsonField, + private val transactionsGrossAmount: JsonField, + private val updated: JsonField, private val additionalProperties: Map, ) { @@ -47,85 +47,70 @@ private constructor( private var hashCode: Int = 0 - /** Globally unique identifier denoting the Settlement Detail. */ - fun token(): String = token.getRequired("token") - - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - fun institution(): String = institution.getRequired("institution") - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ fun accountToken(): String = accountToken.getRequired("account_token") - /** Globally unique identifiers denoting the Events associated with this settlement. */ - fun eventTokens(): List = eventTokens.getRequired("event_tokens") - - /** Globally unique identifier denoting the associated Transaction object. */ - fun transactionToken(): String = transactionToken.getRequired("transaction_token") - - /** Globally unique identifier denoting the card that the associated Transaction occurred on. */ - fun cardToken(): String = cardToken.getRequired("card_token") - /** * Globally unique identifier denoting the card program that the associated Transaction occurred * on. */ fun cardProgramToken(): String = cardProgramToken.getRequired("card_program_token") + /** Globally unique identifier denoting the card that the associated Transaction occurred on. */ + fun cardToken(): String = cardToken.getRequired("card_token") + + /** Date and time when the transaction first occurred. UTC time zone. */ + fun created(): OffsetDateTime = created.getRequired("created") + /** Three-digit alphabetic ISO 4217 code. */ fun currency(): String = currency.getRequired("currency") - /** Card network where the transaction took place. */ - fun network(): Network = network.getRequired("network") + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(): Long = disputesGrossAmount.getRequired("disputes_gross_amount") - /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). - */ - fun transactionsGrossAmount(): Long = - transactionsGrossAmount.getRequired("transactions_gross_amount") + /** Globally unique identifiers denoting the Events associated with this settlement. */ + fun eventTokens(): List = eventTokens.getRequired("event_tokens") + + /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ + fun institution(): String = institution.getRequired("institution") /** The total amount of interchange. */ fun interchangeGrossAmount(): Long = interchangeGrossAmount.getRequired("interchange_gross_amount") - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(): Long = disputesGrossAmount.getRequired("disputes_gross_amount") - - /** Total amount of gross other fees outside of interchange. */ - fun otherFeesGrossAmount(): Long = otherFeesGrossAmount.getRequired("other_fees_gross_amount") + /** Card network where the transaction took place. */ + fun network(): Network = network.getRequired("network") /** The total gross amount of other fees by type. */ fun otherFeesDetails(): OtherFeesDetails = otherFeesDetails.getRequired("other_fees_details") - /** Date and time when the transaction first occurred. UTC time zone. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Total amount of gross other fees outside of interchange. */ + fun otherFeesGrossAmount(): Long = otherFeesGrossAmount.getRequired("other_fees_gross_amount") - /** Date and time when the transaction first occurred. UTC time zone. */ - fun updated(): OffsetDateTime = updated.getRequired("updated") + /** Date of when the report was first generated. */ + fun reportDate(): String = reportDate.getRequired("report_date") /** Date of when money movement is triggered for the transaction. */ fun settlementDate(): String = settlementDate.getRequired("settlement_date") - /** Date of when the report was first generated. */ - fun reportDate(): String = reportDate.getRequired("report_date") - /** Globally unique identifier denoting the Settlement Detail. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - @JsonProperty("institution") @ExcludeMissing fun _institution() = institution + fun token(): String = token.getRequired("token") - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken + /** Globally unique identifier denoting the associated Transaction object. */ + fun transactionToken(): String = transactionToken.getRequired("transaction_token") - /** Globally unique identifiers denoting the Events associated with this settlement. */ - @JsonProperty("event_tokens") @ExcludeMissing fun _eventTokens() = eventTokens + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + fun transactionsGrossAmount(): Long = + transactionsGrossAmount.getRequired("transactions_gross_amount") - /** Globally unique identifier denoting the associated Transaction object. */ - @JsonProperty("transaction_token") @ExcludeMissing fun _transactionToken() = transactionToken + /** Date and time when the transaction first occurred. UTC time zone. */ + fun updated(): OffsetDateTime = updated.getRequired("updated") - /** Globally unique identifier denoting the card that the associated Transaction occurred on. */ - @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken + /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken /** * Globally unique identifier denoting the card program that the associated Transaction occurred @@ -133,49 +118,64 @@ private constructor( */ @JsonProperty("card_program_token") @ExcludeMissing fun _cardProgramToken() = cardProgramToken + /** Globally unique identifier denoting the card that the associated Transaction occurred on. */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken + + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Three-digit alphabetic ISO 4217 code. */ @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - /** Card network where the transaction took place. */ - @JsonProperty("network") @ExcludeMissing fun _network() = network - - /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). - */ - @JsonProperty("transactions_gross_amount") + /** The total gross amount of disputes settlements. */ + @JsonProperty("disputes_gross_amount") @ExcludeMissing - fun _transactionsGrossAmount() = transactionsGrossAmount + fun _disputesGrossAmount() = disputesGrossAmount + + /** Globally unique identifiers denoting the Events associated with this settlement. */ + @JsonProperty("event_tokens") @ExcludeMissing fun _eventTokens() = eventTokens + + /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ + @JsonProperty("institution") @ExcludeMissing fun _institution() = institution /** The total amount of interchange. */ @JsonProperty("interchange_gross_amount") @ExcludeMissing fun _interchangeGrossAmount() = interchangeGrossAmount - /** The total gross amount of disputes settlements. */ - @JsonProperty("disputes_gross_amount") - @ExcludeMissing - fun _disputesGrossAmount() = disputesGrossAmount + /** Card network where the transaction took place. */ + @JsonProperty("network") @ExcludeMissing fun _network() = network + + /** The total gross amount of other fees by type. */ + @JsonProperty("other_fees_details") @ExcludeMissing fun _otherFeesDetails() = otherFeesDetails /** Total amount of gross other fees outside of interchange. */ @JsonProperty("other_fees_gross_amount") @ExcludeMissing fun _otherFeesGrossAmount() = otherFeesGrossAmount - /** The total gross amount of other fees by type. */ - @JsonProperty("other_fees_details") @ExcludeMissing fun _otherFeesDetails() = otherFeesDetails - - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + /** Date of when the report was first generated. */ + @JsonProperty("report_date") @ExcludeMissing fun _reportDate() = reportDate /** Date of when money movement is triggered for the transaction. */ @JsonProperty("settlement_date") @ExcludeMissing fun _settlementDate() = settlementDate - /** Date of when the report was first generated. */ - @JsonProperty("report_date") @ExcludeMissing fun _reportDate() = reportDate + /** Globally unique identifier denoting the Settlement Detail. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** Globally unique identifier denoting the associated Transaction object. */ + @JsonProperty("transaction_token") @ExcludeMissing fun _transactionToken() = transactionToken + + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + @JsonProperty("transactions_gross_amount") + @ExcludeMissing + fun _transactionsGrossAmount() = transactionsGrossAmount + + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated @JsonAnyGetter @ExcludeMissing @@ -183,24 +183,24 @@ private constructor( fun validate(): SettlementDetail = apply { if (!validated) { - token() - institution() accountToken() - eventTokens() - transactionToken() - cardToken() cardProgramToken() + cardToken() + created() currency() - network() - transactionsGrossAmount() - interchangeGrossAmount() disputesGrossAmount() - otherFeesGrossAmount() + eventTokens() + institution() + interchangeGrossAmount() + network() otherFeesDetails().validate() - created() - updated() - settlementDate() + otherFeesGrossAmount() reportDate() + settlementDate() + token() + transactionToken() + transactionsGrossAmount() + updated() validated = true } } @@ -213,24 +213,24 @@ private constructor( } return other is SettlementDetail && - this.token == other.token && - this.institution == other.institution && this.accountToken == other.accountToken && - this.eventTokens == other.eventTokens && - this.transactionToken == other.transactionToken && - this.cardToken == other.cardToken && this.cardProgramToken == other.cardProgramToken && + this.cardToken == other.cardToken && + this.created == other.created && this.currency == other.currency && - this.network == other.network && - this.transactionsGrossAmount == other.transactionsGrossAmount && - this.interchangeGrossAmount == other.interchangeGrossAmount && this.disputesGrossAmount == other.disputesGrossAmount && - this.otherFeesGrossAmount == other.otherFeesGrossAmount && + this.eventTokens == other.eventTokens && + this.institution == other.institution && + this.interchangeGrossAmount == other.interchangeGrossAmount && + this.network == other.network && this.otherFeesDetails == other.otherFeesDetails && - this.created == other.created && - this.updated == other.updated && - this.settlementDate == other.settlementDate && + this.otherFeesGrossAmount == other.otherFeesGrossAmount && this.reportDate == other.reportDate && + this.settlementDate == other.settlementDate && + this.token == other.token && + this.transactionToken == other.transactionToken && + this.transactionsGrossAmount == other.transactionsGrossAmount && + this.updated == other.updated && this.additionalProperties == other.additionalProperties } @@ -238,24 +238,24 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - institution, accountToken, - eventTokens, - transactionToken, - cardToken, cardProgramToken, + cardToken, + created, currency, - network, - transactionsGrossAmount, - interchangeGrossAmount, disputesGrossAmount, - otherFeesGrossAmount, + eventTokens, + institution, + interchangeGrossAmount, + network, otherFeesDetails, - created, - updated, - settlementDate, + otherFeesGrossAmount, reportDate, + settlementDate, + token, + transactionToken, + transactionsGrossAmount, + updated, additionalProperties, ) } @@ -263,7 +263,7 @@ private constructor( } override fun toString() = - "SettlementDetail{token=$token, institution=$institution, accountToken=$accountToken, eventTokens=$eventTokens, transactionToken=$transactionToken, cardToken=$cardToken, cardProgramToken=$cardProgramToken, currency=$currency, network=$network, transactionsGrossAmount=$transactionsGrossAmount, interchangeGrossAmount=$interchangeGrossAmount, disputesGrossAmount=$disputesGrossAmount, otherFeesGrossAmount=$otherFeesGrossAmount, otherFeesDetails=$otherFeesDetails, created=$created, updated=$updated, settlementDate=$settlementDate, reportDate=$reportDate, additionalProperties=$additionalProperties}" + "SettlementDetail{accountToken=$accountToken, cardProgramToken=$cardProgramToken, cardToken=$cardToken, created=$created, currency=$currency, disputesGrossAmount=$disputesGrossAmount, eventTokens=$eventTokens, institution=$institution, interchangeGrossAmount=$interchangeGrossAmount, network=$network, otherFeesDetails=$otherFeesDetails, otherFeesGrossAmount=$otherFeesGrossAmount, reportDate=$reportDate, settlementDate=$settlementDate, token=$token, transactionToken=$transactionToken, transactionsGrossAmount=$transactionsGrossAmount, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -272,69 +272,49 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var institution: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var eventTokens: JsonField> = JsonMissing.of() - private var transactionToken: JsonField = JsonMissing.of() - private var cardToken: JsonField = JsonMissing.of() private var cardProgramToken: JsonField = JsonMissing.of() + private var cardToken: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() - private var network: JsonField = JsonMissing.of() - private var transactionsGrossAmount: JsonField = JsonMissing.of() - private var interchangeGrossAmount: JsonField = JsonMissing.of() private var disputesGrossAmount: JsonField = JsonMissing.of() - private var otherFeesGrossAmount: JsonField = JsonMissing.of() + private var eventTokens: JsonField> = JsonMissing.of() + private var institution: JsonField = JsonMissing.of() + private var interchangeGrossAmount: JsonField = JsonMissing.of() + private var network: JsonField = JsonMissing.of() private var otherFeesDetails: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() - private var settlementDate: JsonField = JsonMissing.of() + private var otherFeesGrossAmount: JsonField = JsonMissing.of() private var reportDate: JsonField = JsonMissing.of() + private var settlementDate: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var transactionToken: JsonField = JsonMissing.of() + private var transactionsGrossAmount: JsonField = JsonMissing.of() + private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(settlementDetail: SettlementDetail) = apply { - this.token = settlementDetail.token - this.institution = settlementDetail.institution this.accountToken = settlementDetail.accountToken - this.eventTokens = settlementDetail.eventTokens - this.transactionToken = settlementDetail.transactionToken - this.cardToken = settlementDetail.cardToken this.cardProgramToken = settlementDetail.cardProgramToken + this.cardToken = settlementDetail.cardToken + this.created = settlementDetail.created this.currency = settlementDetail.currency + this.disputesGrossAmount = settlementDetail.disputesGrossAmount + this.eventTokens = settlementDetail.eventTokens + this.institution = settlementDetail.institution + this.interchangeGrossAmount = settlementDetail.interchangeGrossAmount this.network = settlementDetail.network + this.otherFeesDetails = settlementDetail.otherFeesDetails + this.otherFeesGrossAmount = settlementDetail.otherFeesGrossAmount + this.reportDate = settlementDetail.reportDate + this.settlementDate = settlementDetail.settlementDate + this.token = settlementDetail.token + this.transactionToken = settlementDetail.transactionToken this.transactionsGrossAmount = settlementDetail.transactionsGrossAmount - this.interchangeGrossAmount = settlementDetail.interchangeGrossAmount - this.disputesGrossAmount = settlementDetail.disputesGrossAmount - this.otherFeesGrossAmount = settlementDetail.otherFeesGrossAmount - this.otherFeesDetails = settlementDetail.otherFeesDetails - this.created = settlementDetail.created this.updated = settlementDetail.updated - this.settlementDate = settlementDetail.settlementDate - this.reportDate = settlementDetail.reportDate additionalProperties(settlementDetail.additionalProperties) } - /** Globally unique identifier denoting the Settlement Detail. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier denoting the Settlement Detail. */ - @JsonProperty("token") - @ExcludeMissing - fun token(token: JsonField) = apply { this.token = token } - - /** - * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). - */ - fun institution(institution: String) = institution(JsonField.of(institution)) - - /** - * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). - */ - @JsonProperty("institution") - @ExcludeMissing - fun institution(institution: JsonField) = apply { this.institution = institution } - /** * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ @@ -349,25 +329,21 @@ private constructor( this.accountToken = accountToken } - /** Globally unique identifiers denoting the Events associated with this settlement. */ - fun eventTokens(eventTokens: List) = eventTokens(JsonField.of(eventTokens)) - - /** Globally unique identifiers denoting the Events associated with this settlement. */ - @JsonProperty("event_tokens") - @ExcludeMissing - fun eventTokens(eventTokens: JsonField>) = apply { - this.eventTokens = eventTokens - } - - /** Globally unique identifier denoting the associated Transaction object. */ - fun transactionToken(transactionToken: String) = - transactionToken(JsonField.of(transactionToken)) + /** + * Globally unique identifier denoting the card program that the associated Transaction + * occurred on. + */ + fun cardProgramToken(cardProgramToken: String) = + cardProgramToken(JsonField.of(cardProgramToken)) - /** Globally unique identifier denoting the associated Transaction object. */ - @JsonProperty("transaction_token") + /** + * Globally unique identifier denoting the card program that the associated Transaction + * occurred on. + */ + @JsonProperty("card_program_token") @ExcludeMissing - fun transactionToken(transactionToken: JsonField) = apply { - this.transactionToken = transactionToken + fun cardProgramToken(cardProgramToken: JsonField) = apply { + this.cardProgramToken = cardProgramToken } /** @@ -382,22 +358,13 @@ private constructor( @ExcludeMissing fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } - /** - * Globally unique identifier denoting the card program that the associated Transaction - * occurred on. - */ - fun cardProgramToken(cardProgramToken: String) = - cardProgramToken(JsonField.of(cardProgramToken)) + /** Date and time when the transaction first occurred. UTC time zone. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** - * Globally unique identifier denoting the card program that the associated Transaction - * occurred on. - */ - @JsonProperty("card_program_token") + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("created") @ExcludeMissing - fun cardProgramToken(cardProgramToken: JsonField) = apply { - this.cardProgramToken = cardProgramToken - } + fun created(created: JsonField) = apply { this.created = created } /** Three-digit alphabetic ISO 4217 code. */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -407,30 +374,38 @@ private constructor( @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } - /** Card network where the transaction took place. */ - fun network(network: Network) = network(JsonField.of(network)) + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(disputesGrossAmount: Long) = + disputesGrossAmount(JsonField.of(disputesGrossAmount)) - /** Card network where the transaction took place. */ - @JsonProperty("network") + /** The total gross amount of disputes settlements. */ + @JsonProperty("disputes_gross_amount") @ExcludeMissing - fun network(network: JsonField) = apply { this.network = network } + fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { + this.disputesGrossAmount = disputesGrossAmount + } + + /** Globally unique identifiers denoting the Events associated with this settlement. */ + fun eventTokens(eventTokens: List) = eventTokens(JsonField.of(eventTokens)) + + /** Globally unique identifiers denoting the Events associated with this settlement. */ + @JsonProperty("event_tokens") + @ExcludeMissing + fun eventTokens(eventTokens: JsonField>) = apply { + this.eventTokens = eventTokens + } /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). + * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - fun transactionsGrossAmount(transactionsGrossAmount: Long) = - transactionsGrossAmount(JsonField.of(transactionsGrossAmount)) + fun institution(institution: String) = institution(JsonField.of(institution)) /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). + * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - @JsonProperty("transactions_gross_amount") + @JsonProperty("institution") @ExcludeMissing - fun transactionsGrossAmount(transactionsGrossAmount: JsonField) = apply { - this.transactionsGrossAmount = transactionsGrossAmount - } + fun institution(institution: JsonField) = apply { this.institution = institution } /** The total amount of interchange. */ fun interchangeGrossAmount(interchangeGrossAmount: Long) = @@ -443,27 +418,13 @@ private constructor( this.interchangeGrossAmount = interchangeGrossAmount } - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(disputesGrossAmount: Long) = - disputesGrossAmount(JsonField.of(disputesGrossAmount)) - - /** The total gross amount of disputes settlements. */ - @JsonProperty("disputes_gross_amount") - @ExcludeMissing - fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { - this.disputesGrossAmount = disputesGrossAmount - } - - /** Total amount of gross other fees outside of interchange. */ - fun otherFeesGrossAmount(otherFeesGrossAmount: Long) = - otherFeesGrossAmount(JsonField.of(otherFeesGrossAmount)) + /** Card network where the transaction took place. */ + fun network(network: Network) = network(JsonField.of(network)) - /** Total amount of gross other fees outside of interchange. */ - @JsonProperty("other_fees_gross_amount") + /** Card network where the transaction took place. */ + @JsonProperty("network") @ExcludeMissing - fun otherFeesGrossAmount(otherFeesGrossAmount: JsonField) = apply { - this.otherFeesGrossAmount = otherFeesGrossAmount - } + fun network(network: JsonField) = apply { this.network = network } /** The total gross amount of other fees by type. */ fun otherFeesDetails(otherFeesDetails: OtherFeesDetails) = @@ -476,21 +437,24 @@ private constructor( this.otherFeesDetails = otherFeesDetails } - /** Date and time when the transaction first occurred. UTC time zone. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Total amount of gross other fees outside of interchange. */ + fun otherFeesGrossAmount(otherFeesGrossAmount: Long) = + otherFeesGrossAmount(JsonField.of(otherFeesGrossAmount)) - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("created") + /** Total amount of gross other fees outside of interchange. */ + @JsonProperty("other_fees_gross_amount") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun otherFeesGrossAmount(otherFeesGrossAmount: JsonField) = apply { + this.otherFeesGrossAmount = otherFeesGrossAmount + } - /** Date and time when the transaction first occurred. UTC time zone. */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + /** Date of when the report was first generated. */ + fun reportDate(reportDate: String) = reportDate(JsonField.of(reportDate)) - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("updated") + /** Date of when the report was first generated. */ + @JsonProperty("report_date") @ExcludeMissing - fun updated(updated: JsonField) = apply { this.updated = updated } + fun reportDate(reportDate: JsonField) = apply { this.reportDate = reportDate } /** Date of when money movement is triggered for the transaction. */ fun settlementDate(settlementDate: String) = settlementDate(JsonField.of(settlementDate)) @@ -502,13 +466,49 @@ private constructor( this.settlementDate = settlementDate } - /** Date of when the report was first generated. */ - fun reportDate(reportDate: String) = reportDate(JsonField.of(reportDate)) + /** Globally unique identifier denoting the Settlement Detail. */ + fun token(token: String) = token(JsonField.of(token)) - /** Date of when the report was first generated. */ - @JsonProperty("report_date") + /** Globally unique identifier denoting the Settlement Detail. */ + @JsonProperty("token") @ExcludeMissing - fun reportDate(reportDate: JsonField) = apply { this.reportDate = reportDate } + fun token(token: JsonField) = apply { this.token = token } + + /** Globally unique identifier denoting the associated Transaction object. */ + fun transactionToken(transactionToken: String) = + transactionToken(JsonField.of(transactionToken)) + + /** Globally unique identifier denoting the associated Transaction object. */ + @JsonProperty("transaction_token") + @ExcludeMissing + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + fun transactionsGrossAmount(transactionsGrossAmount: Long) = + transactionsGrossAmount(JsonField.of(transactionsGrossAmount)) + + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + @JsonProperty("transactions_gross_amount") + @ExcludeMissing + fun transactionsGrossAmount(transactionsGrossAmount: JsonField) = apply { + this.transactionsGrossAmount = transactionsGrossAmount + } + + /** Date and time when the transaction first occurred. UTC time zone. */ + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("updated") + @ExcludeMissing + fun updated(updated: JsonField) = apply { this.updated = updated } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -526,24 +526,24 @@ private constructor( fun build(): SettlementDetail = SettlementDetail( - token, - institution, accountToken, - eventTokens.map { it.toUnmodifiable() }, - transactionToken, - cardToken, cardProgramToken, + cardToken, + created, currency, - network, - transactionsGrossAmount, - interchangeGrossAmount, disputesGrossAmount, - otherFeesGrossAmount, + eventTokens.map { it.toUnmodifiable() }, + institution, + interchangeGrossAmount, + network, otherFeesDetails, - created, - updated, - settlementDate, + otherFeesGrossAmount, reportDate, + settlementDate, + token, + transactionToken, + transactionsGrossAmount, + updated, additionalProperties.toUnmodifiable(), ) } @@ -570,53 +570,53 @@ private constructor( companion object { - @JvmField val MASTERCARD = Network(JsonField.of("MASTERCARD")) - - @JvmField val VISA = Network(JsonField.of("VISA")) - @JvmField val INTERLINK = Network(JsonField.of("INTERLINK")) @JvmField val MAESTRO = Network(JsonField.of("MAESTRO")) + @JvmField val MASTERCARD = Network(JsonField.of("MASTERCARD")) + @JvmField val UNKNOWN = Network(JsonField.of("UNKNOWN")) + @JvmField val VISA = Network(JsonField.of("VISA")) + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } enum class Known { - MASTERCARD, - VISA, INTERLINK, MAESTRO, + MASTERCARD, UNKNOWN, + VISA, } enum class Value { - MASTERCARD, - VISA, INTERLINK, MAESTRO, + MASTERCARD, UNKNOWN, + VISA, _UNKNOWN, } fun value(): Value = when (this) { - MASTERCARD -> Value.MASTERCARD - VISA -> Value.VISA INTERLINK -> Value.INTERLINK MAESTRO -> Value.MAESTRO + MASTERCARD -> Value.MASTERCARD UNKNOWN -> Value.UNKNOWN + VISA -> Value.VISA else -> Value._UNKNOWN } fun known(): Known = when (this) { - MASTERCARD -> Known.MASTERCARD - VISA -> Known.VISA INTERLINK -> Known.INTERLINK MAESTRO -> Known.MAESTRO + MASTERCARD -> Known.MASTERCARD UNKNOWN -> Known.UNKNOWN + VISA -> Known.VISA else -> throw LithicInvalidDataException("Unknown Network: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt index 5e144e52..3bd73c0a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementReport.kt @@ -19,16 +19,16 @@ import java.util.Objects @NoAutoDetect class SettlementReport private constructor( + private val created: JsonField, private val currency: JsonField, - private val settledNetAmount: JsonField, - private val transactionsGrossAmount: JsonField, - private val interchangeGrossAmount: JsonField, + private val details: JsonField>, private val disputesGrossAmount: JsonField, + private val interchangeGrossAmount: JsonField, private val otherFeesGrossAmount: JsonField, - private val details: JsonField>, - private val created: JsonField, - private val updated: JsonField, private val reportDate: JsonField, + private val settledNetAmount: JsonField, + private val transactionsGrossAmount: JsonField, + private val updated: JsonField, private val additionalProperties: Map, ) { @@ -36,100 +36,100 @@ private constructor( private var hashCode: Int = 0 + /** Date and time when the transaction first occurred. UTC time zone. */ + fun created(): OffsetDateTime = created.getRequired("created") + /** Three-digit alphabetic ISO 4217 code. */ fun currency(): String = currency.getRequired("currency") - /** - * The total net amount of cash moved. (net value of settled_gross_amount, interchange, fees). - */ - fun settledNetAmount(): Long = settledNetAmount.getRequired("settled_net_amount") + fun details(): List = details.getRequired("details") - /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). - */ - fun transactionsGrossAmount(): Long = - transactionsGrossAmount.getRequired("transactions_gross_amount") + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(): Long = disputesGrossAmount.getRequired("disputes_gross_amount") /** The total amount of interchange. */ fun interchangeGrossAmount(): Long = interchangeGrossAmount.getRequired("interchange_gross_amount") - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(): Long = disputesGrossAmount.getRequired("disputes_gross_amount") - /** Total amount of gross other fees outside of interchange. */ fun otherFeesGrossAmount(): Long = otherFeesGrossAmount.getRequired("other_fees_gross_amount") - fun details(): List = details.getRequired("details") - - /** Date and time when the transaction first occurred. UTC time zone. */ - fun created(): OffsetDateTime = created.getRequired("created") - - /** Date and time when the transaction first occurred. UTC time zone. */ - fun updated(): OffsetDateTime = updated.getRequired("updated") - /** Date of when the report was first generated. */ fun reportDate(): String = reportDate.getRequired("report_date") - /** Three-digit alphabetic ISO 4217 code. */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - /** * The total net amount of cash moved. (net value of settled_gross_amount, interchange, fees). */ - @JsonProperty("settled_net_amount") @ExcludeMissing fun _settledNetAmount() = settledNetAmount + fun settledNetAmount(): Long = settledNetAmount.getRequired("settled_net_amount") /** * The total amount of settlement impacting transactions (excluding interchange, fees, and * disputes). */ - @JsonProperty("transactions_gross_amount") - @ExcludeMissing - fun _transactionsGrossAmount() = transactionsGrossAmount + fun transactionsGrossAmount(): Long = + transactionsGrossAmount.getRequired("transactions_gross_amount") - /** The total amount of interchange. */ - @JsonProperty("interchange_gross_amount") - @ExcludeMissing - fun _interchangeGrossAmount() = interchangeGrossAmount + /** Date and time when the transaction first occurred. UTC time zone. */ + fun updated(): OffsetDateTime = updated.getRequired("updated") + + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Three-digit alphabetic ISO 4217 code. */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + @JsonProperty("details") @ExcludeMissing fun _details() = details /** The total gross amount of disputes settlements. */ @JsonProperty("disputes_gross_amount") @ExcludeMissing fun _disputesGrossAmount() = disputesGrossAmount + /** The total amount of interchange. */ + @JsonProperty("interchange_gross_amount") + @ExcludeMissing + fun _interchangeGrossAmount() = interchangeGrossAmount + /** Total amount of gross other fees outside of interchange. */ @JsonProperty("other_fees_gross_amount") @ExcludeMissing fun _otherFeesGrossAmount() = otherFeesGrossAmount - @JsonProperty("details") @ExcludeMissing fun _details() = details + /** Date of when the report was first generated. */ + @JsonProperty("report_date") @ExcludeMissing fun _reportDate() = reportDate - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** + * The total net amount of cash moved. (net value of settled_gross_amount, interchange, fees). + */ + @JsonProperty("settled_net_amount") @ExcludeMissing fun _settledNetAmount() = settledNetAmount + + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + @JsonProperty("transactions_gross_amount") + @ExcludeMissing + fun _transactionsGrossAmount() = transactionsGrossAmount /** Date and time when the transaction first occurred. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - /** Date of when the report was first generated. */ - @JsonProperty("report_date") @ExcludeMissing fun _reportDate() = reportDate - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): SettlementReport = apply { if (!validated) { + created() currency() - settledNetAmount() - transactionsGrossAmount() - interchangeGrossAmount() + details().forEach { it.validate() } disputesGrossAmount() + interchangeGrossAmount() otherFeesGrossAmount() - details().forEach { it.validate() } - created() - updated() reportDate() + settledNetAmount() + transactionsGrossAmount() + updated() validated = true } } @@ -142,16 +142,16 @@ private constructor( } return other is SettlementReport && + this.created == other.created && this.currency == other.currency && - this.settledNetAmount == other.settledNetAmount && - this.transactionsGrossAmount == other.transactionsGrossAmount && - this.interchangeGrossAmount == other.interchangeGrossAmount && + this.details == other.details && this.disputesGrossAmount == other.disputesGrossAmount && + this.interchangeGrossAmount == other.interchangeGrossAmount && this.otherFeesGrossAmount == other.otherFeesGrossAmount && - this.details == other.details && - this.created == other.created && - this.updated == other.updated && this.reportDate == other.reportDate && + this.settledNetAmount == other.settledNetAmount && + this.transactionsGrossAmount == other.transactionsGrossAmount && + this.updated == other.updated && this.additionalProperties == other.additionalProperties } @@ -159,16 +159,16 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( + created, currency, - settledNetAmount, - transactionsGrossAmount, - interchangeGrossAmount, + details, disputesGrossAmount, + interchangeGrossAmount, otherFeesGrossAmount, - details, - created, - updated, reportDate, + settledNetAmount, + transactionsGrossAmount, + updated, additionalProperties, ) } @@ -176,7 +176,7 @@ private constructor( } override fun toString() = - "SettlementReport{currency=$currency, settledNetAmount=$settledNetAmount, transactionsGrossAmount=$transactionsGrossAmount, interchangeGrossAmount=$interchangeGrossAmount, disputesGrossAmount=$disputesGrossAmount, otherFeesGrossAmount=$otherFeesGrossAmount, details=$details, created=$created, updated=$updated, reportDate=$reportDate, additionalProperties=$additionalProperties}" + "SettlementReport{created=$created, currency=$currency, details=$details, disputesGrossAmount=$disputesGrossAmount, interchangeGrossAmount=$interchangeGrossAmount, otherFeesGrossAmount=$otherFeesGrossAmount, reportDate=$reportDate, settledNetAmount=$settledNetAmount, transactionsGrossAmount=$transactionsGrossAmount, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -185,33 +185,41 @@ private constructor( class Builder { + private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() - private var settledNetAmount: JsonField = JsonMissing.of() - private var transactionsGrossAmount: JsonField = JsonMissing.of() - private var interchangeGrossAmount: JsonField = JsonMissing.of() + private var details: JsonField> = JsonMissing.of() private var disputesGrossAmount: JsonField = JsonMissing.of() + private var interchangeGrossAmount: JsonField = JsonMissing.of() private var otherFeesGrossAmount: JsonField = JsonMissing.of() - private var details: JsonField> = JsonMissing.of() - private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() private var reportDate: JsonField = JsonMissing.of() + private var settledNetAmount: JsonField = JsonMissing.of() + private var transactionsGrossAmount: JsonField = JsonMissing.of() + private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(settlementReport: SettlementReport) = apply { + this.created = settlementReport.created this.currency = settlementReport.currency - this.settledNetAmount = settlementReport.settledNetAmount - this.transactionsGrossAmount = settlementReport.transactionsGrossAmount - this.interchangeGrossAmount = settlementReport.interchangeGrossAmount + this.details = settlementReport.details this.disputesGrossAmount = settlementReport.disputesGrossAmount + this.interchangeGrossAmount = settlementReport.interchangeGrossAmount this.otherFeesGrossAmount = settlementReport.otherFeesGrossAmount - this.details = settlementReport.details - this.created = settlementReport.created - this.updated = settlementReport.updated this.reportDate = settlementReport.reportDate + this.settledNetAmount = settlementReport.settledNetAmount + this.transactionsGrossAmount = settlementReport.transactionsGrossAmount + this.updated = settlementReport.updated additionalProperties(settlementReport.additionalProperties) } + /** Date and time when the transaction first occurred. UTC time zone. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Date and time when the transaction first occurred. UTC time zone. */ + @JsonProperty("created") + @ExcludeMissing + fun created(created: JsonField) = apply { this.created = created } + /** Three-digit alphabetic ISO 4217 code. */ fun currency(currency: String) = currency(JsonField.of(currency)) @@ -220,38 +228,23 @@ private constructor( @ExcludeMissing fun currency(currency: JsonField) = apply { this.currency = currency } - /** - * The total net amount of cash moved. (net value of settled_gross_amount, interchange, - * fees). - */ - fun settledNetAmount(settledNetAmount: Long) = - settledNetAmount(JsonField.of(settledNetAmount)) + fun details(details: List) = details(JsonField.of(details)) - /** - * The total net amount of cash moved. (net value of settled_gross_amount, interchange, - * fees). - */ - @JsonProperty("settled_net_amount") + @JsonProperty("details") @ExcludeMissing - fun settledNetAmount(settledNetAmount: JsonField) = apply { - this.settledNetAmount = settledNetAmount + fun details(details: JsonField>) = apply { + this.details = details } - /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). - */ - fun transactionsGrossAmount(transactionsGrossAmount: Long) = - transactionsGrossAmount(JsonField.of(transactionsGrossAmount)) + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(disputesGrossAmount: Long) = + disputesGrossAmount(JsonField.of(disputesGrossAmount)) - /** - * The total amount of settlement impacting transactions (excluding interchange, fees, and - * disputes). - */ - @JsonProperty("transactions_gross_amount") + /** The total gross amount of disputes settlements. */ + @JsonProperty("disputes_gross_amount") @ExcludeMissing - fun transactionsGrossAmount(transactionsGrossAmount: JsonField) = apply { - this.transactionsGrossAmount = transactionsGrossAmount + fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { + this.disputesGrossAmount = disputesGrossAmount } /** The total amount of interchange. */ @@ -265,17 +258,6 @@ private constructor( this.interchangeGrossAmount = interchangeGrossAmount } - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(disputesGrossAmount: Long) = - disputesGrossAmount(JsonField.of(disputesGrossAmount)) - - /** The total gross amount of disputes settlements. */ - @JsonProperty("disputes_gross_amount") - @ExcludeMissing - fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { - this.disputesGrossAmount = disputesGrossAmount - } - /** Total amount of gross other fees outside of interchange. */ fun otherFeesGrossAmount(otherFeesGrossAmount: Long) = otherFeesGrossAmount(JsonField.of(otherFeesGrossAmount)) @@ -287,21 +269,47 @@ private constructor( this.otherFeesGrossAmount = otherFeesGrossAmount } - fun details(details: List) = details(JsonField.of(details)) + /** Date of when the report was first generated. */ + fun reportDate(reportDate: String) = reportDate(JsonField.of(reportDate)) - @JsonProperty("details") + /** Date of when the report was first generated. */ + @JsonProperty("report_date") @ExcludeMissing - fun details(details: JsonField>) = apply { - this.details = details + fun reportDate(reportDate: JsonField) = apply { this.reportDate = reportDate } + + /** + * The total net amount of cash moved. (net value of settled_gross_amount, interchange, + * fees). + */ + fun settledNetAmount(settledNetAmount: Long) = + settledNetAmount(JsonField.of(settledNetAmount)) + + /** + * The total net amount of cash moved. (net value of settled_gross_amount, interchange, + * fees). + */ + @JsonProperty("settled_net_amount") + @ExcludeMissing + fun settledNetAmount(settledNetAmount: JsonField) = apply { + this.settledNetAmount = settledNetAmount } - /** Date and time when the transaction first occurred. UTC time zone. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + fun transactionsGrossAmount(transactionsGrossAmount: Long) = + transactionsGrossAmount(JsonField.of(transactionsGrossAmount)) - /** Date and time when the transaction first occurred. UTC time zone. */ - @JsonProperty("created") + /** + * The total amount of settlement impacting transactions (excluding interchange, fees, and + * disputes). + */ + @JsonProperty("transactions_gross_amount") @ExcludeMissing - fun created(created: JsonField) = apply { this.created = created } + fun transactionsGrossAmount(transactionsGrossAmount: JsonField) = apply { + this.transactionsGrossAmount = transactionsGrossAmount + } /** Date and time when the transaction first occurred. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -311,14 +319,6 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - /** Date of when the report was first generated. */ - fun reportDate(reportDate: String) = reportDate(JsonField.of(reportDate)) - - /** Date of when the report was first generated. */ - @JsonProperty("report_date") - @ExcludeMissing - fun reportDate(reportDate: JsonField) = apply { this.reportDate = reportDate } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -335,16 +335,16 @@ private constructor( fun build(): SettlementReport = SettlementReport( + created, currency, - settledNetAmount, - transactionsGrossAmount, - interchangeGrossAmount, + details.map { it.toUnmodifiable() }, disputesGrossAmount, + interchangeGrossAmount, otherFeesGrossAmount, - details.map { it.toUnmodifiable() }, - created, - updated, reportDate, + settledNetAmount, + transactionsGrossAmount, + updated, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt index 2fdf5ee4..2334cf9d 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryDetails.kt @@ -21,13 +21,13 @@ import java.util.Optional @NoAutoDetect class SettlementSummaryDetails private constructor( - private val network: JsonField, + private val disputesGrossAmount: JsonField, private val institution: JsonField, - private val settledNetAmount: JsonField, - private val transactionsGrossAmount: JsonField, private val interchangeGrossAmount: JsonField, - private val disputesGrossAmount: JsonField, + private val network: JsonField, private val otherFeesGrossAmount: JsonField, + private val settledNetAmount: JsonField, + private val transactionsGrossAmount: JsonField, private val additionalProperties: Map, ) { @@ -35,13 +35,25 @@ private constructor( private var hashCode: Int = 0 - /** Card network where the transaction took place */ - fun network(): Optional = Optional.ofNullable(network.getNullable("network")) + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(): Optional = + Optional.ofNullable(disputesGrossAmount.getNullable("disputes_gross_amount")) /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ fun institution(): Optional = Optional.ofNullable(institution.getNullable("institution")) + /** The total amount of interchange. */ + fun interchangeGrossAmount(): Optional = + Optional.ofNullable(interchangeGrossAmount.getNullable("interchange_gross_amount")) + + /** Card network where the transaction took place */ + fun network(): Optional = Optional.ofNullable(network.getNullable("network")) + + /** Total amount of gross other fees outside of interchange. */ + fun otherFeesGrossAmount(): Optional = + Optional.ofNullable(otherFeesGrossAmount.getNullable("other_fees_gross_amount")) + /** * The total net amount of cash moved. (net value of settled_gross_amount, interchange, fees). */ @@ -55,23 +67,26 @@ private constructor( fun transactionsGrossAmount(): Optional = Optional.ofNullable(transactionsGrossAmount.getNullable("transactions_gross_amount")) - /** The total amount of interchange. */ - fun interchangeGrossAmount(): Optional = - Optional.ofNullable(interchangeGrossAmount.getNullable("interchange_gross_amount")) - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(): Optional = - Optional.ofNullable(disputesGrossAmount.getNullable("disputes_gross_amount")) + @JsonProperty("disputes_gross_amount") + @ExcludeMissing + fun _disputesGrossAmount() = disputesGrossAmount - /** Total amount of gross other fees outside of interchange. */ - fun otherFeesGrossAmount(): Optional = - Optional.ofNullable(otherFeesGrossAmount.getNullable("other_fees_gross_amount")) + /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ + @JsonProperty("institution") @ExcludeMissing fun _institution() = institution + + /** The total amount of interchange. */ + @JsonProperty("interchange_gross_amount") + @ExcludeMissing + fun _interchangeGrossAmount() = interchangeGrossAmount /** Card network where the transaction took place */ @JsonProperty("network") @ExcludeMissing fun _network() = network - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ - @JsonProperty("institution") @ExcludeMissing fun _institution() = institution + /** Total amount of gross other fees outside of interchange. */ + @JsonProperty("other_fees_gross_amount") + @ExcludeMissing + fun _otherFeesGrossAmount() = otherFeesGrossAmount /** * The total net amount of cash moved. (net value of settled_gross_amount, interchange, fees). @@ -86,34 +101,19 @@ private constructor( @ExcludeMissing fun _transactionsGrossAmount() = transactionsGrossAmount - /** The total amount of interchange. */ - @JsonProperty("interchange_gross_amount") - @ExcludeMissing - fun _interchangeGrossAmount() = interchangeGrossAmount - - /** The total gross amount of disputes settlements. */ - @JsonProperty("disputes_gross_amount") - @ExcludeMissing - fun _disputesGrossAmount() = disputesGrossAmount - - /** Total amount of gross other fees outside of interchange. */ - @JsonProperty("other_fees_gross_amount") - @ExcludeMissing - fun _otherFeesGrossAmount() = otherFeesGrossAmount - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): SettlementSummaryDetails = apply { if (!validated) { - network() + disputesGrossAmount() institution() - settledNetAmount() - transactionsGrossAmount() interchangeGrossAmount() - disputesGrossAmount() + network() otherFeesGrossAmount() + settledNetAmount() + transactionsGrossAmount() validated = true } } @@ -126,13 +126,13 @@ private constructor( } return other is SettlementSummaryDetails && - this.network == other.network && + this.disputesGrossAmount == other.disputesGrossAmount && this.institution == other.institution && - this.settledNetAmount == other.settledNetAmount && - this.transactionsGrossAmount == other.transactionsGrossAmount && this.interchangeGrossAmount == other.interchangeGrossAmount && - this.disputesGrossAmount == other.disputesGrossAmount && + this.network == other.network && this.otherFeesGrossAmount == other.otherFeesGrossAmount && + this.settledNetAmount == other.settledNetAmount && + this.transactionsGrossAmount == other.transactionsGrossAmount && this.additionalProperties == other.additionalProperties } @@ -140,13 +140,13 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - network, + disputesGrossAmount, institution, - settledNetAmount, - transactionsGrossAmount, interchangeGrossAmount, - disputesGrossAmount, + network, otherFeesGrossAmount, + settledNetAmount, + transactionsGrossAmount, additionalProperties, ) } @@ -154,7 +154,7 @@ private constructor( } override fun toString() = - "SettlementSummaryDetails{network=$network, institution=$institution, settledNetAmount=$settledNetAmount, transactionsGrossAmount=$transactionsGrossAmount, interchangeGrossAmount=$interchangeGrossAmount, disputesGrossAmount=$disputesGrossAmount, otherFeesGrossAmount=$otherFeesGrossAmount, additionalProperties=$additionalProperties}" + "SettlementSummaryDetails{disputesGrossAmount=$disputesGrossAmount, institution=$institution, interchangeGrossAmount=$interchangeGrossAmount, network=$network, otherFeesGrossAmount=$otherFeesGrossAmount, settledNetAmount=$settledNetAmount, transactionsGrossAmount=$transactionsGrossAmount, additionalProperties=$additionalProperties}" companion object { @@ -163,34 +163,37 @@ private constructor( class Builder { - private var network: JsonField = JsonMissing.of() + private var disputesGrossAmount: JsonField = JsonMissing.of() private var institution: JsonField = JsonMissing.of() - private var settledNetAmount: JsonField = JsonMissing.of() - private var transactionsGrossAmount: JsonField = JsonMissing.of() private var interchangeGrossAmount: JsonField = JsonMissing.of() - private var disputesGrossAmount: JsonField = JsonMissing.of() + private var network: JsonField = JsonMissing.of() private var otherFeesGrossAmount: JsonField = JsonMissing.of() + private var settledNetAmount: JsonField = JsonMissing.of() + private var transactionsGrossAmount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(settlementSummaryDetails: SettlementSummaryDetails) = apply { - this.network = settlementSummaryDetails.network + this.disputesGrossAmount = settlementSummaryDetails.disputesGrossAmount this.institution = settlementSummaryDetails.institution - this.settledNetAmount = settlementSummaryDetails.settledNetAmount - this.transactionsGrossAmount = settlementSummaryDetails.transactionsGrossAmount this.interchangeGrossAmount = settlementSummaryDetails.interchangeGrossAmount - this.disputesGrossAmount = settlementSummaryDetails.disputesGrossAmount + this.network = settlementSummaryDetails.network this.otherFeesGrossAmount = settlementSummaryDetails.otherFeesGrossAmount + this.settledNetAmount = settlementSummaryDetails.settledNetAmount + this.transactionsGrossAmount = settlementSummaryDetails.transactionsGrossAmount additionalProperties(settlementSummaryDetails.additionalProperties) } - /** Card network where the transaction took place */ - fun network(network: Network) = network(JsonField.of(network)) + /** The total gross amount of disputes settlements. */ + fun disputesGrossAmount(disputesGrossAmount: Long) = + disputesGrossAmount(JsonField.of(disputesGrossAmount)) - /** Card network where the transaction took place */ - @JsonProperty("network") + /** The total gross amount of disputes settlements. */ + @JsonProperty("disputes_gross_amount") @ExcludeMissing - fun network(network: JsonField) = apply { this.network = network } + fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { + this.disputesGrossAmount = disputesGrossAmount + } /** * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). @@ -204,6 +207,36 @@ private constructor( @ExcludeMissing fun institution(institution: JsonField) = apply { this.institution = institution } + /** The total amount of interchange. */ + fun interchangeGrossAmount(interchangeGrossAmount: Long) = + interchangeGrossAmount(JsonField.of(interchangeGrossAmount)) + + /** The total amount of interchange. */ + @JsonProperty("interchange_gross_amount") + @ExcludeMissing + fun interchangeGrossAmount(interchangeGrossAmount: JsonField) = apply { + this.interchangeGrossAmount = interchangeGrossAmount + } + + /** Card network where the transaction took place */ + fun network(network: Network) = network(JsonField.of(network)) + + /** Card network where the transaction took place */ + @JsonProperty("network") + @ExcludeMissing + fun network(network: JsonField) = apply { this.network = network } + + /** Total amount of gross other fees outside of interchange. */ + fun otherFeesGrossAmount(otherFeesGrossAmount: Long) = + otherFeesGrossAmount(JsonField.of(otherFeesGrossAmount)) + + /** Total amount of gross other fees outside of interchange. */ + @JsonProperty("other_fees_gross_amount") + @ExcludeMissing + fun otherFeesGrossAmount(otherFeesGrossAmount: JsonField) = apply { + this.otherFeesGrossAmount = otherFeesGrossAmount + } + /** * The total net amount of cash moved. (net value of settled_gross_amount, interchange, * fees). @@ -238,39 +271,6 @@ private constructor( this.transactionsGrossAmount = transactionsGrossAmount } - /** The total amount of interchange. */ - fun interchangeGrossAmount(interchangeGrossAmount: Long) = - interchangeGrossAmount(JsonField.of(interchangeGrossAmount)) - - /** The total amount of interchange. */ - @JsonProperty("interchange_gross_amount") - @ExcludeMissing - fun interchangeGrossAmount(interchangeGrossAmount: JsonField) = apply { - this.interchangeGrossAmount = interchangeGrossAmount - } - - /** The total gross amount of disputes settlements. */ - fun disputesGrossAmount(disputesGrossAmount: Long) = - disputesGrossAmount(JsonField.of(disputesGrossAmount)) - - /** The total gross amount of disputes settlements. */ - @JsonProperty("disputes_gross_amount") - @ExcludeMissing - fun disputesGrossAmount(disputesGrossAmount: JsonField) = apply { - this.disputesGrossAmount = disputesGrossAmount - } - - /** Total amount of gross other fees outside of interchange. */ - fun otherFeesGrossAmount(otherFeesGrossAmount: Long) = - otherFeesGrossAmount(JsonField.of(otherFeesGrossAmount)) - - /** Total amount of gross other fees outside of interchange. */ - @JsonProperty("other_fees_gross_amount") - @ExcludeMissing - fun otherFeesGrossAmount(otherFeesGrossAmount: JsonField) = apply { - this.otherFeesGrossAmount = otherFeesGrossAmount - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -287,13 +287,13 @@ private constructor( fun build(): SettlementSummaryDetails = SettlementSummaryDetails( - network, + disputesGrossAmount, institution, - settledNetAmount, - transactionsGrossAmount, interchangeGrossAmount, - disputesGrossAmount, + network, otherFeesGrossAmount, + settledNetAmount, + transactionsGrossAmount, additionalProperties.toUnmodifiable(), ) } @@ -320,53 +320,53 @@ private constructor( companion object { - @JvmField val MASTERCARD = Network(JsonField.of("MASTERCARD")) - - @JvmField val VISA = Network(JsonField.of("VISA")) - @JvmField val INTERLINK = Network(JsonField.of("INTERLINK")) @JvmField val MAESTRO = Network(JsonField.of("MAESTRO")) + @JvmField val MASTERCARD = Network(JsonField.of("MASTERCARD")) + @JvmField val UNKNOWN = Network(JsonField.of("UNKNOWN")) + @JvmField val VISA = Network(JsonField.of("VISA")) + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } enum class Known { - MASTERCARD, - VISA, INTERLINK, MAESTRO, + MASTERCARD, UNKNOWN, + VISA, } enum class Value { - MASTERCARD, - VISA, INTERLINK, MAESTRO, + MASTERCARD, UNKNOWN, + VISA, _UNKNOWN, } fun value(): Value = when (this) { - MASTERCARD -> Value.MASTERCARD - VISA -> Value.VISA INTERLINK -> Value.INTERLINK MAESTRO -> Value.MAESTRO + MASTERCARD -> Value.MASTERCARD UNKNOWN -> Value.UNKNOWN + VISA -> Value.VISA else -> Value._UNKNOWN } fun known(): Known = when (this) { - MASTERCARD -> Known.MASTERCARD - VISA -> Known.VISA INTERLINK -> Known.INTERLINK MAESTRO -> Known.MAESTRO + MASTERCARD -> Known.MASTERCARD UNKNOWN -> Known.UNKNOWN + VISA -> Known.VISA else -> throw LithicInvalidDataException("Unknown Network: $value") } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryResponse.kt deleted file mode 100644 index 96e3615d..00000000 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/SettlementSummaryResponse.kt +++ /dev/null @@ -1,108 +0,0 @@ -// 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.JsonProperty -import com.fasterxml.jackson.databind.annotation.JsonDeserialize -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 java.util.Objects - -@JsonDeserialize(builder = SettlementSummaryResponse.Builder::class) -@NoAutoDetect -class SettlementSummaryResponse -private constructor( - private val data: JsonField>, - private val additionalProperties: Map, -) { - - private var validated: Boolean = false - - private var hashCode: Int = 0 - - fun data(): List = data.getRequired("data") - - @JsonProperty("data") @ExcludeMissing fun _data() = data - - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties - - fun validate(): SettlementSummaryResponse = apply { - if (!validated) { - data().forEach { it.validate() } - validated = true - } - } - - fun toBuilder() = Builder().from(this) - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is SettlementSummaryResponse && - this.data == other.data && - this.additionalProperties == other.additionalProperties - } - - override fun hashCode(): Int { - if (hashCode == 0) { - hashCode = Objects.hash(data, additionalProperties) - } - return hashCode - } - - override fun toString() = - "SettlementSummaryResponse{data=$data, additionalProperties=$additionalProperties}" - - companion object { - - @JvmStatic fun builder() = Builder() - } - - class Builder { - - private var data: JsonField> = JsonMissing.of() - private var additionalProperties: MutableMap = mutableMapOf() - - @JvmSynthetic - internal fun from(settlementSummaryResponse: SettlementSummaryResponse) = apply { - this.data = settlementSummaryResponse.data - additionalProperties(settlementSummaryResponse.additionalProperties) - } - - fun data(data: List) = data(JsonField.of(data)) - - @JsonProperty("data") - @ExcludeMissing - fun data(data: JsonField>) = apply { this.data = data } - - 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(): SettlementSummaryResponse = - SettlementSummaryResponse( - data.map { it.toUnmodifiable() }, - additionalProperties.toUnmodifiable() - ) - } -} diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt index cf8af07b..4d358fb3 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt @@ -19,17 +19,17 @@ import java.util.Optional @NoAutoDetect class ShippingAddress private constructor( - private val firstName: JsonField, - private val lastName: JsonField, - private val line2Text: JsonField, 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 email: JsonField, + private val firstName: JsonField, + private val lastName: JsonField, + private val line2Text: JsonField, private val phoneNumber: JsonField, + private val postalCode: JsonField, + private val state: JsonField, private val additionalProperties: Map, ) { @@ -37,6 +37,24 @@ private constructor( private var hashCode: Int = 0 + /** Valid USPS routable address. */ + fun address1(): String = address1.getRequired("address1") + + /** Unit number (if applicable). */ + fun address2(): Optional = Optional.ofNullable(address2.getNullable("address2")) + + /** City */ + fun city(): String = city.getRequired("city") + + /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ + fun country(): String = country.getRequired("country") + + /** + * Email address to be contacted for expedited shipping process purposes. Required if + * `shipping_method` is `EXPEDITED`. + */ + fun email(): Optional = Optional.ofNullable(email.getNullable("email")) + /** Customer's first name. This will be the first name printed on the physical card. */ fun firstName(): String = firstName.getRequired("first_name") @@ -51,20 +69,12 @@ private constructor( */ fun line2Text(): Optional = Optional.ofNullable(line2Text.getNullable("line2_text")) - /** Valid USPS routable address. */ - fun address1(): String = address1.getRequired("address1") - - /** Unit number (if applicable). */ - fun address2(): Optional = Optional.ofNullable(address2.getNullable("address2")) - - /** City */ - fun city(): String = city.getRequired("city") - /** - * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 - * characters for other countries. + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. */ - fun state(): String = state.getRequired("state") + fun phoneNumber(): Optional = + Optional.ofNullable(phoneNumber.getNullable("phone_number")) /** * Postal code (formerly zipcode). For US addresses, either five-digit zipcode or nine-digit @@ -72,21 +82,29 @@ private constructor( */ fun postalCode(): String = postalCode.getRequired("postal_code") + /** + * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 + * characters for other countries. + */ + fun state(): String = state.getRequired("state") + + /** Valid USPS routable address. */ + @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 + + /** Unit number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + + /** City */ + @JsonProperty("city") @ExcludeMissing fun _city() = city + /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ - fun country(): String = country.getRequired("country") + @JsonProperty("country") @ExcludeMissing fun _country() = country /** * Email address to be contacted for expedited shipping process purposes. Required if * `shipping_method` is `EXPEDITED`. */ - fun email(): Optional = Optional.ofNullable(email.getNullable("email")) - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. - */ - fun phoneNumber(): Optional = - Optional.ofNullable(phoneNumber.getNullable("phone_number")) + @JsonProperty("email") @ExcludeMissing fun _email() = email /** Customer's first name. This will be the first name printed on the physical card. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @@ -102,20 +120,11 @@ private constructor( */ @JsonProperty("line2_text") @ExcludeMissing fun _line2Text() = line2Text - /** Valid USPS routable address. */ - @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 - - /** Unit number (if applicable). */ - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 - - /** City */ - @JsonProperty("city") @ExcludeMissing fun _city() = city - /** - * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 - * characters for other countries. + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. */ - @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber /** * Postal code (formerly zipcode). For US addresses, either five-digit zipcode or nine-digit @@ -123,20 +132,11 @@ private constructor( */ @JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode - /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ - @JsonProperty("country") @ExcludeMissing fun _country() = country - /** - * Email address to be contacted for expedited shipping process purposes. Required if - * `shipping_method` is `EXPEDITED`. - */ - @JsonProperty("email") @ExcludeMissing fun _email() = email - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. + * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of 24 + * characters for other countries. */ - @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + @JsonProperty("state") @ExcludeMissing fun _state() = state @JsonAnyGetter @ExcludeMissing @@ -144,17 +144,17 @@ private constructor( fun validate(): ShippingAddress = apply { if (!validated) { - firstName() - lastName() - line2Text() address1() address2() city() - state() - postalCode() country() email() + firstName() + lastName() + line2Text() phoneNumber() + postalCode() + state() validated = true } } @@ -167,17 +167,17 @@ private constructor( } return other is ShippingAddress && - this.firstName == other.firstName && - this.lastName == other.lastName && - this.line2Text == other.line2Text && 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.email == other.email && + this.firstName == other.firstName && + this.lastName == other.lastName && + this.line2Text == other.line2Text && this.phoneNumber == other.phoneNumber && + this.postalCode == other.postalCode && + this.state == other.state && this.additionalProperties == other.additionalProperties } @@ -185,17 +185,17 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - firstName, - lastName, - line2Text, address1, address2, city, - state, - postalCode, country, email, + firstName, + lastName, + line2Text, phoneNumber, + postalCode, + state, additionalProperties, ) } @@ -203,7 +203,7 @@ private constructor( } override fun toString() = - "ShippingAddress{firstName=$firstName, lastName=$lastName, line2Text=$line2Text, address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, email=$email, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" + "ShippingAddress{address1=$address1, address2=$address2, city=$city, country=$country, email=$email, firstName=$firstName, lastName=$lastName, line2Text=$line2Text, phoneNumber=$phoneNumber, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" companion object { @@ -212,35 +212,81 @@ private constructor( class Builder { - private var firstName: JsonField = JsonMissing.of() - private var lastName: JsonField = JsonMissing.of() - private var line2Text: JsonField = JsonMissing.of() 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 email: JsonField = JsonMissing.of() + private var firstName: JsonField = JsonMissing.of() + private var lastName: JsonField = JsonMissing.of() + private var line2Text: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() + private var postalCode: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(shippingAddress: ShippingAddress) = apply { - this.firstName = shippingAddress.firstName - this.lastName = shippingAddress.lastName - this.line2Text = shippingAddress.line2Text this.address1 = shippingAddress.address1 this.address2 = shippingAddress.address2 this.city = shippingAddress.city - this.state = shippingAddress.state - this.postalCode = shippingAddress.postalCode this.country = shippingAddress.country this.email = shippingAddress.email + this.firstName = shippingAddress.firstName + this.lastName = shippingAddress.lastName + this.line2Text = shippingAddress.line2Text this.phoneNumber = shippingAddress.phoneNumber + this.postalCode = shippingAddress.postalCode + this.state = shippingAddress.state additionalProperties(shippingAddress.additionalProperties) } + /** Valid USPS routable address. */ + fun address1(address1: String) = address1(JsonField.of(address1)) + + /** Valid USPS routable address. */ + @JsonProperty("address1") + @ExcludeMissing + fun address1(address1: JsonField) = apply { this.address1 = address1 } + + /** Unit number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit number (if applicable). */ + @JsonProperty("address2") + @ExcludeMissing + fun address2(address2: JsonField) = apply { this.address2 = address2 } + + /** City */ + fun city(city: String) = city(JsonField.of(city)) + + /** City */ + @JsonProperty("city") + @ExcludeMissing + fun city(city: JsonField) = apply { this.city = city } + + /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ + fun country(country: String) = country(JsonField.of(country)) + + /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ + @JsonProperty("country") + @ExcludeMissing + fun country(country: JsonField) = apply { this.country = country } + + /** + * Email address to be contacted for expedited shipping process purposes. Required if + * `shipping_method` is `EXPEDITED`. + */ + fun email(email: String) = email(JsonField.of(email)) + + /** + * Email address to be contacted for expedited shipping process purposes. Required if + * `shipping_method` is `EXPEDITED`. + */ + @JsonProperty("email") + @ExcludeMissing + fun email(email: JsonField) = apply { this.email = email } + /** Customer's first name. This will be the first name printed on the physical card. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) @@ -277,43 +323,19 @@ private constructor( @ExcludeMissing fun line2Text(line2Text: JsonField) = apply { this.line2Text = line2Text } - /** Valid USPS routable address. */ - fun address1(address1: String) = address1(JsonField.of(address1)) - - /** Valid USPS routable address. */ - @JsonProperty("address1") - @ExcludeMissing - fun address1(address1: JsonField) = apply { this.address1 = address1 } - - /** Unit number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit number (if applicable). */ - @JsonProperty("address2") - @ExcludeMissing - fun address2(address2: JsonField) = apply { this.address2 = address2 } - - /** City */ - fun city(city: String) = city(JsonField.of(city)) - - /** City */ - @JsonProperty("city") - @ExcludeMissing - fun city(city: JsonField) = apply { this.city = city } - /** - * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of - * 24 characters for other countries. + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. */ - fun state(state: String) = state(JsonField.of(state)) + fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) /** - * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of - * 24 characters for other countries. + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. */ - @JsonProperty("state") + @JsonProperty("phone_number") @ExcludeMissing - fun state(state: JsonField) = apply { this.state = state } + fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } /** * Postal code (formerly zipcode). For US addresses, either five-digit zipcode or nine-digit @@ -329,41 +351,19 @@ private constructor( @ExcludeMissing fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ - fun country(country: String) = country(JsonField.of(country)) - - /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ - @JsonProperty("country") - @ExcludeMissing - fun country(country: JsonField) = apply { this.country = country } - - /** - * Email address to be contacted for expedited shipping process purposes. Required if - * `shipping_method` is `EXPEDITED`. - */ - fun email(email: String) = email(JsonField.of(email)) - - /** - * Email address to be contacted for expedited shipping process purposes. Required if - * `shipping_method` is `EXPEDITED`. - */ - @JsonProperty("email") - @ExcludeMissing - fun email(email: JsonField) = apply { this.email = email } - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. + * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of + * 24 characters for other countries. */ - fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) + fun state(state: String) = state(JsonField.of(state)) /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. + * Uppercase ISO 3166-2 two character abbreviation for US and CA. Optional with a limit of + * 24 characters for other countries. */ - @JsonProperty("phone_number") + @JsonProperty("state") @ExcludeMissing - fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } + fun state(state: JsonField) = apply { this.state = state } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -381,17 +381,17 @@ private constructor( fun build(): ShippingAddress = ShippingAddress( - firstName, - lastName, - line2Text, address1, address2, city, - state, - postalCode, country, email, + firstName, + lastName, + line2Text, phoneNumber, + postalCode, + state, additionalProperties.toUnmodifiable(), ) } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt index cf478ce2..d3ec385a 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt @@ -291,8 +291,8 @@ constructor( class Merchant private constructor( private val country: String?, - private val mcc: String?, private val id: String?, + private val mcc: String?, private val name: String?, private val additionalProperties: Map, ) { @@ -304,6 +304,12 @@ constructor( */ @JsonProperty("country") fun country(): String? = country + /** + * Unique identifier to identify the payment card acceptor. Corresponds to + * `merchant_acceptor_id` in authorization. + */ + @JsonProperty("id") fun id(): String? = id + /** * Merchant category code for the transaction to be simulated. A four-digit number listed in * ISO 18245. Supported merchant category codes can be found @@ -311,12 +317,6 @@ constructor( */ @JsonProperty("mcc") fun mcc(): String? = mcc - /** - * Unique identifier to identify the payment card acceptor. Corresponds to - * `merchant_acceptor_id` in authorization. - */ - @JsonProperty("id") fun id(): String? = id - /** Merchant descriptor, corresponds to `descriptor` in authorization. */ @JsonProperty("name") fun name(): String? = name @@ -333,8 +333,8 @@ constructor( return other is Merchant && this.country == other.country && - this.mcc == other.mcc && this.id == other.id && + this.mcc == other.mcc && this.name == other.name && this.additionalProperties == other.additionalProperties } @@ -344,8 +344,8 @@ constructor( hashCode = Objects.hash( country, - mcc, id, + mcc, name, additionalProperties, ) @@ -354,7 +354,7 @@ constructor( } override fun toString() = - "Merchant{country=$country, mcc=$mcc, id=$id, name=$name, additionalProperties=$additionalProperties}" + "Merchant{country=$country, id=$id, mcc=$mcc, name=$name, additionalProperties=$additionalProperties}" companion object { @@ -364,16 +364,16 @@ constructor( class Builder { private var country: String? = null - private var mcc: String? = null private var id: String? = null + private var mcc: String? = null private var name: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(merchant: Merchant) = apply { this.country = merchant.country - this.mcc = merchant.mcc this.id = merchant.id + this.mcc = merchant.mcc this.name = merchant.name additionalProperties(merchant.additionalProperties) } @@ -384,6 +384,12 @@ constructor( */ @JsonProperty("country") fun country(country: String) = apply { this.country = country } + /** + * Unique identifier to identify the payment card acceptor. Corresponds to + * `merchant_acceptor_id` in authorization. + */ + @JsonProperty("id") fun id(id: String) = apply { this.id = id } + /** * Merchant category code for the transaction to be simulated. A four-digit number * listed in ISO 18245. Supported merchant category codes can be found @@ -391,12 +397,6 @@ constructor( */ @JsonProperty("mcc") fun mcc(mcc: String) = apply { this.mcc = mcc } - /** - * Unique identifier to identify the payment card acceptor. Corresponds to - * `merchant_acceptor_id` in authorization. - */ - @JsonProperty("id") fun id(id: String) = apply { this.id = id } - /** Merchant descriptor, corresponds to `descriptor` in authorization. */ @JsonProperty("name") fun name(name: String) = apply { this.name = name } @@ -417,8 +417,8 @@ constructor( fun build(): Merchant = Merchant( checkNotNull(country) { "`country` is required but was not set" }, - checkNotNull(mcc) { "`mcc` is required but was not set" }, checkNotNull(id) { "`id` is required but was not set" }, + checkNotNull(mcc) { "`mcc` is required but was not set" }, checkNotNull(name) { "`name` is required but was not set" }, additionalProperties.toUnmodifiable(), ) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt index 029142d5..dfc8834e 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt @@ -21,13 +21,13 @@ import java.util.Objects @NoAutoDetect class Tokenization private constructor( - private val token: JsonField, - private val tokenRequestorName: JsonField, private val accountToken: JsonField, private val cardToken: JsonField, - private val tokenUniqueReference: JsonField, - private val status: JsonField, private val createdAt: JsonField, + private val status: JsonField, + private val token: JsonField, + private val tokenRequestorName: JsonField, + private val tokenUniqueReference: JsonField, private val updatedAt: JsonField, private val additionalProperties: Map, ) { @@ -36,6 +36,18 @@ private constructor( private var hashCode: Int = 0 + /** The account token associated with the card being tokenized. */ + fun accountToken(): String = accountToken.getRequired("account_token") + + /** The card token associated with the card being tokenized. */ + fun cardToken(): String = cardToken.getRequired("card_token") + + /** Date and time when the tokenization first occurred. UTC time zone. */ + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + + /** The status of the tokenization request */ + fun status(): Status = status.getRequired("status") + /** * A fixed-width 23-digit numeric identifier for the Transaction that may be set if the * transaction originated from the Mastercard network. This number may be used for dispute @@ -47,23 +59,23 @@ private constructor( fun tokenRequestorName(): TokenRequestorName = tokenRequestorName.getRequired("token_requestor_name") - /** The account token associated with the card being tokenized. */ - fun accountToken(): String = accountToken.getRequired("account_token") - - /** The card token associated with the card being tokenized. */ - fun cardToken(): String = cardToken.getRequired("card_token") - /** The network's unique reference for the tokenization. */ fun tokenUniqueReference(): String = tokenUniqueReference.getRequired("token_unique_reference") - /** The status of the tokenization request */ - fun status(): Status = status.getRequired("status") + /** Latest date and time when the tokenization was updated. UTC time zone. */ + fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") + + /** The account token associated with the card being tokenized. */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken + + /** The card token associated with the card being tokenized. */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken /** Date and time when the tokenization first occurred. UTC time zone. */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") + @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - /** Latest date and time when the tokenization was updated. UTC time zone. */ - fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") + /** The status of the tokenization request */ + @JsonProperty("status") @ExcludeMissing fun _status() = status /** * A fixed-width 23-digit numeric identifier for the Transaction that may be set if the @@ -77,23 +89,11 @@ private constructor( @ExcludeMissing fun _tokenRequestorName() = tokenRequestorName - /** The account token associated with the card being tokenized. */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - - /** The card token associated with the card being tokenized. */ - @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken - /** The network's unique reference for the tokenization. */ @JsonProperty("token_unique_reference") @ExcludeMissing fun _tokenUniqueReference() = tokenUniqueReference - /** The status of the tokenization request */ - @JsonProperty("status") @ExcludeMissing fun _status() = status - - /** Date and time when the tokenization first occurred. UTC time zone. */ - @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - /** Latest date and time when the tokenization was updated. UTC time zone. */ @JsonProperty("updated_at") @ExcludeMissing fun _updatedAt() = updatedAt @@ -103,13 +103,13 @@ private constructor( fun validate(): Tokenization = apply { if (!validated) { - token() - tokenRequestorName() accountToken() cardToken() - tokenUniqueReference() - status() createdAt() + status() + token() + tokenRequestorName() + tokenUniqueReference() updatedAt() validated = true } @@ -123,13 +123,13 @@ private constructor( } return other is Tokenization && - this.token == other.token && - this.tokenRequestorName == other.tokenRequestorName && this.accountToken == other.accountToken && this.cardToken == other.cardToken && - this.tokenUniqueReference == other.tokenUniqueReference && - this.status == other.status && this.createdAt == other.createdAt && + this.status == other.status && + this.token == other.token && + this.tokenRequestorName == other.tokenRequestorName && + this.tokenUniqueReference == other.tokenUniqueReference && this.updatedAt == other.updatedAt && this.additionalProperties == other.additionalProperties } @@ -138,13 +138,13 @@ private constructor( if (hashCode == 0) { hashCode = Objects.hash( - token, - tokenRequestorName, accountToken, cardToken, - tokenUniqueReference, - status, createdAt, + status, + token, + tokenRequestorName, + tokenUniqueReference, updatedAt, additionalProperties, ) @@ -153,7 +153,7 @@ private constructor( } override fun toString() = - "Tokenization{token=$token, tokenRequestorName=$tokenRequestorName, accountToken=$accountToken, cardToken=$cardToken, tokenUniqueReference=$tokenUniqueReference, status=$status, createdAt=$createdAt, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "Tokenization{accountToken=$accountToken, cardToken=$cardToken, createdAt=$createdAt, status=$status, token=$token, tokenRequestorName=$tokenRequestorName, tokenUniqueReference=$tokenUniqueReference, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" companion object { @@ -162,29 +162,63 @@ private constructor( class Builder { - private var token: JsonField = JsonMissing.of() - private var tokenRequestorName: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() private var cardToken: JsonField = JsonMissing.of() - private var tokenUniqueReference: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() + private var status: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() + private var tokenRequestorName: JsonField = JsonMissing.of() + private var tokenUniqueReference: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(tokenization: Tokenization) = apply { - this.token = tokenization.token - this.tokenRequestorName = tokenization.tokenRequestorName this.accountToken = tokenization.accountToken this.cardToken = tokenization.cardToken - this.tokenUniqueReference = tokenization.tokenUniqueReference - this.status = tokenization.status this.createdAt = tokenization.createdAt + this.status = tokenization.status + this.token = tokenization.token + this.tokenRequestorName = tokenization.tokenRequestorName + this.tokenUniqueReference = tokenization.tokenUniqueReference this.updatedAt = tokenization.updatedAt additionalProperties(tokenization.additionalProperties) } + /** The account token associated with the card being tokenized. */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** The account token associated with the card being tokenized. */ + @JsonProperty("account_token") + @ExcludeMissing + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + + /** The card token associated with the card being tokenized. */ + fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) + + /** The card token associated with the card being tokenized. */ + @JsonProperty("card_token") + @ExcludeMissing + fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } + + /** Date and time when the tokenization first occurred. UTC time zone. */ + fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) + + /** Date and time when the tokenization first occurred. UTC time zone. */ + @JsonProperty("created_at") + @ExcludeMissing + fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } + + /** The status of the tokenization request */ + fun status(status: Status) = status(JsonField.of(status)) + + /** The status of the tokenization request */ + @JsonProperty("status") + @ExcludeMissing + fun status(status: JsonField) = apply { this.status = status } + /** * A fixed-width 23-digit numeric identifier for the Transaction that may be set if the * transaction originated from the Mastercard network. This number may be used for dispute @@ -212,24 +246,6 @@ private constructor( this.tokenRequestorName = tokenRequestorName } - /** The account token associated with the card being tokenized. */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) - - /** The account token associated with the card being tokenized. */ - @JsonProperty("account_token") - @ExcludeMissing - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } - - /** The card token associated with the card being tokenized. */ - fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) - - /** The card token associated with the card being tokenized. */ - @JsonProperty("card_token") - @ExcludeMissing - fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } - /** The network's unique reference for the tokenization. */ fun tokenUniqueReference(tokenUniqueReference: String) = tokenUniqueReference(JsonField.of(tokenUniqueReference)) @@ -241,22 +257,6 @@ private constructor( this.tokenUniqueReference = tokenUniqueReference } - /** The status of the tokenization request */ - fun status(status: Status) = status(JsonField.of(status)) - - /** The status of the tokenization request */ - @JsonProperty("status") - @ExcludeMissing - fun status(status: JsonField) = apply { this.status = status } - - /** Date and time when the tokenization first occurred. UTC time zone. */ - fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) - - /** Date and time when the tokenization first occurred. UTC time zone. */ - @JsonProperty("created_at") - @ExcludeMissing - fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - /** Latest date and time when the tokenization was updated. UTC time zone. */ fun updatedAt(updatedAt: OffsetDateTime) = updatedAt(JsonField.of(updatedAt)) @@ -281,13 +281,13 @@ private constructor( fun build(): Tokenization = Tokenization( - token, - tokenRequestorName, accountToken, cardToken, - tokenUniqueReference, - status, createdAt, + status, + token, + tokenRequestorName, + tokenUniqueReference, updatedAt, 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 6113b1b4..872794a4 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 @@ -660,6 +660,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, @@ -676,6 +677,9 @@ private constructor( /** RFC 3339 date and time this event entered the system. UTC time zone. */ fun created(): OffsetDateTime = created.getRequired("created") + fun detailedResults(): List = + detailedResults.getRequired("detailed_results") + /** * `APPROVED` or decline reason. * @@ -743,6 +747,8 @@ private constructor( /** RFC 3339 date and time this event entered the system. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + /** * `APPROVED` or decline reason. * @@ -812,6 +818,7 @@ private constructor( if (!validated) { amount() created() + detailedResults() result() token() type() @@ -829,6 +836,7 @@ private constructor( return other is TransactionEvent && this.amount == other.amount && this.created == other.created && + this.detailedResults == other.detailedResults && this.result == other.result && this.token == other.token && this.type == other.type && @@ -841,6 +849,7 @@ private constructor( Objects.hash( amount, created, + detailedResults, result, token, type, @@ -851,7 +860,7 @@ private constructor( } override fun toString() = - "TransactionEvent{amount=$amount, created=$created, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "TransactionEvent{amount=$amount, created=$created, detailedResults=$detailedResults, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" companion object { @@ -862,6 +871,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() @@ -871,6 +881,7 @@ private constructor( internal fun from(transactionEvent: TransactionEvent) = apply { this.amount = transactionEvent.amount this.created = transactionEvent.created + this.detailedResults = transactionEvent.detailedResults this.result = transactionEvent.result this.token = transactionEvent.token this.type = transactionEvent.type @@ -893,6 +904,15 @@ private constructor( @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + @JsonProperty("detailed_results") + @ExcludeMissing + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + /** * `APPROVED` or decline reason. * @@ -1041,6 +1061,7 @@ private constructor( TransactionEvent( amount, created, + detailedResults.map { it.toUnmodifiable() }, result, token, type, @@ -1048,6 +1069,399 @@ private constructor( ) } + class DetailedResult + @JsonCreator + private constructor( + private val value: JsonField, + ) { + + @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 ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED = + DetailedResult(JsonField.of("ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED")) + + @JvmField val ACCOUNT_INACTIVE = DetailedResult(JsonField.of("ACCOUNT_INACTIVE")) + + @JvmField + val ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED = + DetailedResult(JsonField.of("ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED")) + + @JvmField + val ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED = + DetailedResult(JsonField.of("ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED")) + + @JvmField + val ACCOUNT_UNDER_REVIEW = DetailedResult(JsonField.of("ACCOUNT_UNDER_REVIEW")) + + @JvmField val ADDRESS_INCORRECT = DetailedResult(JsonField.of("ADDRESS_INCORRECT")) + + @JvmField val APPROVED = DetailedResult(JsonField.of("APPROVED")) + + @JvmField + val AUTH_RULE_ALLOWED_COUNTRY = + DetailedResult(JsonField.of("AUTH_RULE_ALLOWED_COUNTRY")) + + @JvmField + val AUTH_RULE_ALLOWED_MCC = DetailedResult(JsonField.of("AUTH_RULE_ALLOWED_MCC")) + + @JvmField + val AUTH_RULE_BLOCKED_COUNTRY = + DetailedResult(JsonField.of("AUTH_RULE_BLOCKED_COUNTRY")) + + @JvmField + val AUTH_RULE_BLOCKED_MCC = DetailedResult(JsonField.of("AUTH_RULE_BLOCKED_MCC")) + + @JvmField val CARD_CLOSED = DetailedResult(JsonField.of("CARD_CLOSED")) + + @JvmField + val CARD_CRYPTOGRAM_VALIDATION_FAILURE = + DetailedResult(JsonField.of("CARD_CRYPTOGRAM_VALIDATION_FAILURE")) + + @JvmField val CARD_EXPIRED = DetailedResult(JsonField.of("CARD_EXPIRED")) + + @JvmField + val CARD_EXPIRY_DATE_INCORRECT = + DetailedResult(JsonField.of("CARD_EXPIRY_DATE_INCORRECT")) + + @JvmField val CARD_INVALID = DetailedResult(JsonField.of("CARD_INVALID")) + + @JvmField val CARD_PAUSED = DetailedResult(JsonField.of("CARD_PAUSED")) + + @JvmField + val CARD_PIN_INCORRECT = DetailedResult(JsonField.of("CARD_PIN_INCORRECT")) + + @JvmField val CARD_RESTRICTED = DetailedResult(JsonField.of("CARD_RESTRICTED")) + + @JvmField + val CARD_SECURITY_CODE_INCORRECT = + DetailedResult(JsonField.of("CARD_SECURITY_CODE_INCORRECT")) + + @JvmField + val CARD_SPEND_LIMIT_EXCEEDED = + DetailedResult(JsonField.of("CARD_SPEND_LIMIT_EXCEEDED")) + + @JvmField + val CONTACT_CARD_ISSUER = DetailedResult(JsonField.of("CONTACT_CARD_ISSUER")) + + @JvmField + val CUSTOMER_ASA_TIMEOUT = DetailedResult(JsonField.of("CUSTOMER_ASA_TIMEOUT")) + + @JvmField val CUSTOM_ASA_RESULT = DetailedResult(JsonField.of("CUSTOM_ASA_RESULT")) + + @JvmField val DECLINED = DetailedResult(JsonField.of("DECLINED")) + + @JvmField val DO_NOT_HONOR = DetailedResult(JsonField.of("DO_NOT_HONOR")) + + @JvmField val FORMAT_ERROR = DetailedResult(JsonField.of("FORMAT_ERROR")) + + @JvmField + val INSUFFICIENT_FUNDING_SOURCE_BALANCE = + DetailedResult(JsonField.of("INSUFFICIENT_FUNDING_SOURCE_BALANCE")) + + @JvmField + val INSUFFICIENT_FUNDS = DetailedResult(JsonField.of("INSUFFICIENT_FUNDS")) + + @JvmField + val LITHIC_SYSTEM_ERROR = DetailedResult(JsonField.of("LITHIC_SYSTEM_ERROR")) + + @JvmField + val LITHIC_SYSTEM_RATE_LIMIT = + DetailedResult(JsonField.of("LITHIC_SYSTEM_RATE_LIMIT")) + + @JvmField + val MALFORMED_ASA_RESPONSE = DetailedResult(JsonField.of("MALFORMED_ASA_RESPONSE")) + + @JvmField val MERCHANT_INVALID = DetailedResult(JsonField.of("MERCHANT_INVALID")) + + @JvmField + val MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE = + DetailedResult(JsonField.of("MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE")) + + @JvmField + val MERCHANT_NOT_PERMITTED = DetailedResult(JsonField.of("MERCHANT_NOT_PERMITTED")) + + @JvmField + val OVER_REVERSAL_ATTEMPTED = + DetailedResult(JsonField.of("OVER_REVERSAL_ATTEMPTED")) + + @JvmField + val PROGRAM_CARD_SPEND_LIMIT_EXCEEDED = + DetailedResult(JsonField.of("PROGRAM_CARD_SPEND_LIMIT_EXCEEDED")) + + @JvmField val PROGRAM_SUSPENDED = DetailedResult(JsonField.of("PROGRAM_SUSPENDED")) + + @JvmField + val PROGRAM_USAGE_RESTRICTION = + DetailedResult(JsonField.of("PROGRAM_USAGE_RESTRICTION")) + + @JvmField + val REVERSAL_UNMATCHED = DetailedResult(JsonField.of("REVERSAL_UNMATCHED")) + + @JvmField + val SECURITY_VIOLATION = DetailedResult(JsonField.of("SECURITY_VIOLATION")) + + @JvmField + val SINGLE_USE_CARD_REATTEMPTED = + DetailedResult(JsonField.of("SINGLE_USE_CARD_REATTEMPTED")) + + @JvmField + val TRANSACTION_INVALID = DetailedResult(JsonField.of("TRANSACTION_INVALID")) + + @JvmField + val TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL = + DetailedResult( + JsonField.of("TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL") + ) + + @JvmField + val TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER = + DetailedResult( + JsonField.of("TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER") + ) + + @JvmField + val TRANSACTION_PREVIOUSLY_COMPLETED = + DetailedResult(JsonField.of("TRANSACTION_PREVIOUSLY_COMPLETED")) + + @JvmField + val UNAUTHORIZED_MERCHANT = DetailedResult(JsonField.of("UNAUTHORIZED_MERCHANT")) + + @JvmStatic fun of(value: String) = DetailedResult(JsonField.of(value)) + } + + enum class Known { + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + ACCOUNT_INACTIVE, + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + ACCOUNT_UNDER_REVIEW, + ADDRESS_INCORRECT, + APPROVED, + AUTH_RULE_ALLOWED_COUNTRY, + AUTH_RULE_ALLOWED_MCC, + AUTH_RULE_BLOCKED_COUNTRY, + AUTH_RULE_BLOCKED_MCC, + CARD_CLOSED, + CARD_CRYPTOGRAM_VALIDATION_FAILURE, + CARD_EXPIRED, + CARD_EXPIRY_DATE_INCORRECT, + CARD_INVALID, + CARD_PAUSED, + CARD_PIN_INCORRECT, + CARD_RESTRICTED, + CARD_SECURITY_CODE_INCORRECT, + CARD_SPEND_LIMIT_EXCEEDED, + CONTACT_CARD_ISSUER, + CUSTOMER_ASA_TIMEOUT, + CUSTOM_ASA_RESULT, + DECLINED, + DO_NOT_HONOR, + FORMAT_ERROR, + INSUFFICIENT_FUNDING_SOURCE_BALANCE, + INSUFFICIENT_FUNDS, + LITHIC_SYSTEM_ERROR, + LITHIC_SYSTEM_RATE_LIMIT, + MALFORMED_ASA_RESPONSE, + MERCHANT_INVALID, + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + MERCHANT_NOT_PERMITTED, + OVER_REVERSAL_ATTEMPTED, + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + PROGRAM_SUSPENDED, + PROGRAM_USAGE_RESTRICTION, + REVERSAL_UNMATCHED, + SECURITY_VIOLATION, + SINGLE_USE_CARD_REATTEMPTED, + TRANSACTION_INVALID, + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + TRANSACTION_PREVIOUSLY_COMPLETED, + UNAUTHORIZED_MERCHANT, + } + + enum class Value { + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED, + ACCOUNT_INACTIVE, + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED, + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED, + ACCOUNT_UNDER_REVIEW, + ADDRESS_INCORRECT, + APPROVED, + AUTH_RULE_ALLOWED_COUNTRY, + AUTH_RULE_ALLOWED_MCC, + AUTH_RULE_BLOCKED_COUNTRY, + AUTH_RULE_BLOCKED_MCC, + CARD_CLOSED, + CARD_CRYPTOGRAM_VALIDATION_FAILURE, + CARD_EXPIRED, + CARD_EXPIRY_DATE_INCORRECT, + CARD_INVALID, + CARD_PAUSED, + CARD_PIN_INCORRECT, + CARD_RESTRICTED, + CARD_SECURITY_CODE_INCORRECT, + CARD_SPEND_LIMIT_EXCEEDED, + CONTACT_CARD_ISSUER, + CUSTOMER_ASA_TIMEOUT, + CUSTOM_ASA_RESULT, + DECLINED, + DO_NOT_HONOR, + FORMAT_ERROR, + INSUFFICIENT_FUNDING_SOURCE_BALANCE, + INSUFFICIENT_FUNDS, + LITHIC_SYSTEM_ERROR, + LITHIC_SYSTEM_RATE_LIMIT, + MALFORMED_ASA_RESPONSE, + MERCHANT_INVALID, + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE, + MERCHANT_NOT_PERMITTED, + OVER_REVERSAL_ATTEMPTED, + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED, + PROGRAM_SUSPENDED, + PROGRAM_USAGE_RESTRICTION, + REVERSAL_UNMATCHED, + SECURITY_VIOLATION, + SINGLE_USE_CARD_REATTEMPTED, + TRANSACTION_INVALID, + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL, + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER, + TRANSACTION_PREVIOUSLY_COMPLETED, + UNAUTHORIZED_MERCHANT, + _UNKNOWN, + } + + fun value(): Value = + when (this) { + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> Value.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_INACTIVE -> Value.ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED -> + Value.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED -> + Value.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW -> Value.ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT -> Value.ADDRESS_INCORRECT + APPROVED -> Value.APPROVED + AUTH_RULE_ALLOWED_COUNTRY -> Value.AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC -> Value.AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY -> Value.AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC -> Value.AUTH_RULE_BLOCKED_MCC + CARD_CLOSED -> Value.CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Value.CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED -> Value.CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT -> Value.CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID -> Value.CARD_INVALID + CARD_PAUSED -> Value.CARD_PAUSED + CARD_PIN_INCORRECT -> Value.CARD_PIN_INCORRECT + CARD_RESTRICTED -> Value.CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT -> Value.CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED -> Value.CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER -> Value.CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT -> Value.CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT -> Value.CUSTOM_ASA_RESULT + DECLINED -> Value.DECLINED + DO_NOT_HONOR -> Value.DO_NOT_HONOR + FORMAT_ERROR -> Value.FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Value.INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR -> Value.LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT -> Value.LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE -> Value.MALFORMED_ASA_RESPONSE + MERCHANT_INVALID -> Value.MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE -> + Value.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED -> Value.MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED -> Value.OVER_REVERSAL_ATTEMPTED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> Value.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED -> Value.PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION -> Value.PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED -> Value.REVERSAL_UNMATCHED + SECURITY_VIOLATION -> Value.SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED -> Value.SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID -> Value.TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL -> + Value.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER -> + Value.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED -> Value.TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT -> Value.UNAUTHORIZED_MERCHANT + else -> Value._UNKNOWN + } + + fun known(): Known = + when (this) { + ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> Known.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ACCOUNT_INACTIVE -> Known.ACCOUNT_INACTIVE + ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED -> + Known.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED + ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED -> + Known.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED + ACCOUNT_UNDER_REVIEW -> Known.ACCOUNT_UNDER_REVIEW + ADDRESS_INCORRECT -> Known.ADDRESS_INCORRECT + APPROVED -> Known.APPROVED + AUTH_RULE_ALLOWED_COUNTRY -> Known.AUTH_RULE_ALLOWED_COUNTRY + AUTH_RULE_ALLOWED_MCC -> Known.AUTH_RULE_ALLOWED_MCC + AUTH_RULE_BLOCKED_COUNTRY -> Known.AUTH_RULE_BLOCKED_COUNTRY + AUTH_RULE_BLOCKED_MCC -> Known.AUTH_RULE_BLOCKED_MCC + CARD_CLOSED -> Known.CARD_CLOSED + CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Known.CARD_CRYPTOGRAM_VALIDATION_FAILURE + CARD_EXPIRED -> Known.CARD_EXPIRED + CARD_EXPIRY_DATE_INCORRECT -> Known.CARD_EXPIRY_DATE_INCORRECT + CARD_INVALID -> Known.CARD_INVALID + CARD_PAUSED -> Known.CARD_PAUSED + CARD_PIN_INCORRECT -> Known.CARD_PIN_INCORRECT + CARD_RESTRICTED -> Known.CARD_RESTRICTED + CARD_SECURITY_CODE_INCORRECT -> Known.CARD_SECURITY_CODE_INCORRECT + CARD_SPEND_LIMIT_EXCEEDED -> Known.CARD_SPEND_LIMIT_EXCEEDED + CONTACT_CARD_ISSUER -> Known.CONTACT_CARD_ISSUER + CUSTOMER_ASA_TIMEOUT -> Known.CUSTOMER_ASA_TIMEOUT + CUSTOM_ASA_RESULT -> Known.CUSTOM_ASA_RESULT + DECLINED -> Known.DECLINED + DO_NOT_HONOR -> Known.DO_NOT_HONOR + FORMAT_ERROR -> Known.FORMAT_ERROR + INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Known.INSUFFICIENT_FUNDING_SOURCE_BALANCE + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + LITHIC_SYSTEM_ERROR -> Known.LITHIC_SYSTEM_ERROR + LITHIC_SYSTEM_RATE_LIMIT -> Known.LITHIC_SYSTEM_RATE_LIMIT + MALFORMED_ASA_RESPONSE -> Known.MALFORMED_ASA_RESPONSE + MERCHANT_INVALID -> Known.MERCHANT_INVALID + MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE -> + Known.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE + MERCHANT_NOT_PERMITTED -> Known.MERCHANT_NOT_PERMITTED + OVER_REVERSAL_ATTEMPTED -> Known.OVER_REVERSAL_ATTEMPTED + PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> Known.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED + PROGRAM_SUSPENDED -> Known.PROGRAM_SUSPENDED + PROGRAM_USAGE_RESTRICTION -> Known.PROGRAM_USAGE_RESTRICTION + REVERSAL_UNMATCHED -> Known.REVERSAL_UNMATCHED + SECURITY_VIOLATION -> Known.SECURITY_VIOLATION + SINGLE_USE_CARD_REATTEMPTED -> Known.SINGLE_USE_CARD_REATTEMPTED + TRANSACTION_INVALID -> Known.TRANSACTION_INVALID + TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL -> + Known.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL + TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER -> + Known.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER + TRANSACTION_PREVIOUSLY_COMPLETED -> Known.TRANSACTION_PREVIOUSLY_COMPLETED + UNAUTHORIZED_MERCHANT -> Known.UNAUTHORIZED_MERCHANT + else -> throw LithicInvalidDataException("Unknown DetailedResult: $value") + } + + fun asString(): String = _value().asStringOrThrow() + } + class Result @JsonCreator private constructor( @@ -1085,21 +1499,21 @@ private constructor( @JvmField val FRAUD_ADVICE = Result(JsonField.of("FRAUD_ADVICE")) + @JvmField val GLOBAL_MONTHLY_LIMIT = Result(JsonField.of("GLOBAL_MONTHLY_LIMIT")) + @JvmField val GLOBAL_TRANSACTION_LIMIT = Result(JsonField.of("GLOBAL_TRANSACTION_LIMIT")) @JvmField val GLOBAL_WEEKLY_LIMIT = Result(JsonField.of("GLOBAL_WEEKLY_LIMIT")) - @JvmField val GLOBAL_MONTHLY_LIMIT = Result(JsonField.of("GLOBAL_MONTHLY_LIMIT")) - @JvmField val INACTIVE_ACCOUNT = Result(JsonField.of("INACTIVE_ACCOUNT")) @JvmField val INCORRECT_PIN = Result(JsonField.of("INCORRECT_PIN")) - @JvmField val INVALID_CARD_DETAILS = Result(JsonField.of("INVALID_CARD_DETAILS")) - @JvmField val INSUFFICIENT_FUNDS = Result(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val INVALID_CARD_DETAILS = Result(JsonField.of("INVALID_CARD_DETAILS")) + @JvmField val MERCHANT_BLACKLIST = Result(JsonField.of("MERCHANT_BLACKLIST")) @JvmField val SINGLE_USE_RECHARGED = Result(JsonField.of("SINGLE_USE_RECHARGED")) @@ -1125,13 +1539,13 @@ private constructor( CARD_CLOSED, CARD_PAUSED, FRAUD_ADVICE, + GLOBAL_MONTHLY_LIMIT, GLOBAL_TRANSACTION_LIMIT, GLOBAL_WEEKLY_LIMIT, - GLOBAL_MONTHLY_LIMIT, INACTIVE_ACCOUNT, INCORRECT_PIN, - INVALID_CARD_DETAILS, INSUFFICIENT_FUNDS, + INVALID_CARD_DETAILS, MERCHANT_BLACKLIST, SINGLE_USE_RECHARGED, SWITCH_INOPERATIVE_ADVICE, @@ -1148,13 +1562,13 @@ private constructor( CARD_CLOSED, CARD_PAUSED, FRAUD_ADVICE, + GLOBAL_MONTHLY_LIMIT, GLOBAL_TRANSACTION_LIMIT, GLOBAL_WEEKLY_LIMIT, - GLOBAL_MONTHLY_LIMIT, INACTIVE_ACCOUNT, INCORRECT_PIN, - INVALID_CARD_DETAILS, INSUFFICIENT_FUNDS, + INVALID_CARD_DETAILS, MERCHANT_BLACKLIST, SINGLE_USE_RECHARGED, SWITCH_INOPERATIVE_ADVICE, @@ -1173,13 +1587,13 @@ private constructor( CARD_CLOSED -> Value.CARD_CLOSED CARD_PAUSED -> Value.CARD_PAUSED FRAUD_ADVICE -> Value.FRAUD_ADVICE + GLOBAL_MONTHLY_LIMIT -> Value.GLOBAL_MONTHLY_LIMIT GLOBAL_TRANSACTION_LIMIT -> Value.GLOBAL_TRANSACTION_LIMIT GLOBAL_WEEKLY_LIMIT -> Value.GLOBAL_WEEKLY_LIMIT - GLOBAL_MONTHLY_LIMIT -> Value.GLOBAL_MONTHLY_LIMIT INACTIVE_ACCOUNT -> Value.INACTIVE_ACCOUNT INCORRECT_PIN -> Value.INCORRECT_PIN - INVALID_CARD_DETAILS -> Value.INVALID_CARD_DETAILS INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + INVALID_CARD_DETAILS -> Value.INVALID_CARD_DETAILS MERCHANT_BLACKLIST -> Value.MERCHANT_BLACKLIST SINGLE_USE_RECHARGED -> Value.SINGLE_USE_RECHARGED SWITCH_INOPERATIVE_ADVICE -> Value.SWITCH_INOPERATIVE_ADVICE @@ -1198,13 +1612,13 @@ private constructor( CARD_CLOSED -> Known.CARD_CLOSED CARD_PAUSED -> Known.CARD_PAUSED FRAUD_ADVICE -> Known.FRAUD_ADVICE + GLOBAL_MONTHLY_LIMIT -> Known.GLOBAL_MONTHLY_LIMIT GLOBAL_TRANSACTION_LIMIT -> Known.GLOBAL_TRANSACTION_LIMIT GLOBAL_WEEKLY_LIMIT -> Known.GLOBAL_WEEKLY_LIMIT - GLOBAL_MONTHLY_LIMIT -> Known.GLOBAL_MONTHLY_LIMIT INACTIVE_ACCOUNT -> Known.INACTIVE_ACCOUNT INCORRECT_PIN -> Known.INCORRECT_PIN - INVALID_CARD_DETAILS -> Known.INVALID_CARD_DETAILS INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + INVALID_CARD_DETAILS -> Known.INVALID_CARD_DETAILS MERCHANT_BLACKLIST -> Known.MERCHANT_BLACKLIST SINGLE_USE_RECHARGED -> Known.SINGLE_USE_RECHARGED SWITCH_INOPERATIVE_ADVICE -> Known.SWITCH_INOPERATIVE_ADVICE @@ -1251,10 +1665,10 @@ private constructor( @JvmField val CLEARING = Type(JsonField.of("CLEARING")) - @JvmField val CORRECTION_DEBIT = Type(JsonField.of("CORRECTION_DEBIT")) - @JvmField val CORRECTION_CREDIT = Type(JsonField.of("CORRECTION_CREDIT")) + @JvmField val CORRECTION_DEBIT = Type(JsonField.of("CORRECTION_DEBIT")) + @JvmField val CREDIT_AUTHORIZATION = Type(JsonField.of("CREDIT_AUTHORIZATION")) @JvmField @@ -1283,8 +1697,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1301,8 +1715,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1321,8 +1735,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Value.BALANCE_INQUIRY CLEARING -> Value.CLEARING - CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CORRECTION_CREDIT -> Value.CORRECTION_CREDIT + CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION @@ -1341,8 +1755,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Known.BALANCE_INQUIRY CLEARING -> Known.CLEARING - CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CORRECTION_CREDIT -> Known.CORRECTION_CREDIT + CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION @@ -1605,10 +2019,10 @@ private constructor( @JvmField val MASTERCARD = Network(JsonField.of("MASTERCARD")) - @JvmField val VISA = Network(JsonField.of("VISA")) - @JvmField val UNKNOWN = Network(JsonField.of("UNKNOWN")) + @JvmField val VISA = Network(JsonField.of("VISA")) + @JvmStatic fun of(value: String) = Network(JsonField.of(value)) } @@ -1616,16 +2030,16 @@ private constructor( INTERLINK, MAESTRO, MASTERCARD, - VISA, UNKNOWN, + VISA, } enum class Value { INTERLINK, MAESTRO, MASTERCARD, - VISA, UNKNOWN, + VISA, _UNKNOWN, } @@ -1634,8 +2048,8 @@ private constructor( INTERLINK -> Value.INTERLINK MAESTRO -> Value.MAESTRO MASTERCARD -> Value.MASTERCARD - VISA -> Value.VISA UNKNOWN -> Value.UNKNOWN + VISA -> Value.VISA else -> Value._UNKNOWN } @@ -1644,8 +2058,8 @@ private constructor( INTERLINK -> Known.INTERLINK MAESTRO -> Known.MAESTRO MASTERCARD -> Known.MASTERCARD - VISA -> Known.VISA UNKNOWN -> Known.UNKNOWN + VISA -> Known.VISA else -> throw LithicInvalidDataException("Unknown Network: $value") } @@ -1689,21 +2103,21 @@ private constructor( @JvmField val FRAUD_ADVICE = Result(JsonField.of("FRAUD_ADVICE")) + @JvmField val GLOBAL_MONTHLY_LIMIT = Result(JsonField.of("GLOBAL_MONTHLY_LIMIT")) + @JvmField val GLOBAL_TRANSACTION_LIMIT = Result(JsonField.of("GLOBAL_TRANSACTION_LIMIT")) @JvmField val GLOBAL_WEEKLY_LIMIT = Result(JsonField.of("GLOBAL_WEEKLY_LIMIT")) - @JvmField val GLOBAL_MONTHLY_LIMIT = Result(JsonField.of("GLOBAL_MONTHLY_LIMIT")) - @JvmField val INACTIVE_ACCOUNT = Result(JsonField.of("INACTIVE_ACCOUNT")) @JvmField val INCORRECT_PIN = Result(JsonField.of("INCORRECT_PIN")) - @JvmField val INVALID_CARD_DETAILS = Result(JsonField.of("INVALID_CARD_DETAILS")) - @JvmField val INSUFFICIENT_FUNDS = Result(JsonField.of("INSUFFICIENT_FUNDS")) + @JvmField val INVALID_CARD_DETAILS = Result(JsonField.of("INVALID_CARD_DETAILS")) + @JvmField val MERCHANT_BLACKLIST = Result(JsonField.of("MERCHANT_BLACKLIST")) @JvmField val SINGLE_USE_RECHARGED = Result(JsonField.of("SINGLE_USE_RECHARGED")) @@ -1728,13 +2142,13 @@ private constructor( CARD_CLOSED, CARD_PAUSED, FRAUD_ADVICE, + GLOBAL_MONTHLY_LIMIT, GLOBAL_TRANSACTION_LIMIT, GLOBAL_WEEKLY_LIMIT, - GLOBAL_MONTHLY_LIMIT, INACTIVE_ACCOUNT, INCORRECT_PIN, - INVALID_CARD_DETAILS, INSUFFICIENT_FUNDS, + INVALID_CARD_DETAILS, MERCHANT_BLACKLIST, SINGLE_USE_RECHARGED, SWITCH_INOPERATIVE_ADVICE, @@ -1751,13 +2165,13 @@ private constructor( CARD_CLOSED, CARD_PAUSED, FRAUD_ADVICE, + GLOBAL_MONTHLY_LIMIT, GLOBAL_TRANSACTION_LIMIT, GLOBAL_WEEKLY_LIMIT, - GLOBAL_MONTHLY_LIMIT, INACTIVE_ACCOUNT, INCORRECT_PIN, - INVALID_CARD_DETAILS, INSUFFICIENT_FUNDS, + INVALID_CARD_DETAILS, MERCHANT_BLACKLIST, SINGLE_USE_RECHARGED, SWITCH_INOPERATIVE_ADVICE, @@ -1776,13 +2190,13 @@ private constructor( CARD_CLOSED -> Value.CARD_CLOSED CARD_PAUSED -> Value.CARD_PAUSED FRAUD_ADVICE -> Value.FRAUD_ADVICE + GLOBAL_MONTHLY_LIMIT -> Value.GLOBAL_MONTHLY_LIMIT GLOBAL_TRANSACTION_LIMIT -> Value.GLOBAL_TRANSACTION_LIMIT GLOBAL_WEEKLY_LIMIT -> Value.GLOBAL_WEEKLY_LIMIT - GLOBAL_MONTHLY_LIMIT -> Value.GLOBAL_MONTHLY_LIMIT INACTIVE_ACCOUNT -> Value.INACTIVE_ACCOUNT INCORRECT_PIN -> Value.INCORRECT_PIN - INVALID_CARD_DETAILS -> Value.INVALID_CARD_DETAILS INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + INVALID_CARD_DETAILS -> Value.INVALID_CARD_DETAILS MERCHANT_BLACKLIST -> Value.MERCHANT_BLACKLIST SINGLE_USE_RECHARGED -> Value.SINGLE_USE_RECHARGED SWITCH_INOPERATIVE_ADVICE -> Value.SWITCH_INOPERATIVE_ADVICE @@ -1801,13 +2215,13 @@ private constructor( CARD_CLOSED -> Known.CARD_CLOSED CARD_PAUSED -> Known.CARD_PAUSED FRAUD_ADVICE -> Known.FRAUD_ADVICE + GLOBAL_MONTHLY_LIMIT -> Known.GLOBAL_MONTHLY_LIMIT GLOBAL_TRANSACTION_LIMIT -> Known.GLOBAL_TRANSACTION_LIMIT GLOBAL_WEEKLY_LIMIT -> Known.GLOBAL_WEEKLY_LIMIT - GLOBAL_MONTHLY_LIMIT -> Known.GLOBAL_MONTHLY_LIMIT INACTIVE_ACCOUNT -> Known.INACTIVE_ACCOUNT INCORRECT_PIN -> Known.INCORRECT_PIN - INVALID_CARD_DETAILS -> Known.INVALID_CARD_DETAILS INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + INVALID_CARD_DETAILS -> Known.INVALID_CARD_DETAILS MERCHANT_BLACKLIST -> Known.MERCHANT_BLACKLIST SINGLE_USE_RECHARGED -> Known.SINGLE_USE_RECHARGED SWITCH_INOPERATIVE_ADVICE -> Known.SWITCH_INOPERATIVE_ADVICE @@ -1910,9 +2324,9 @@ private constructor( private val authenticationResult: JsonField, private val decisionMadeBy: JsonField, private val liabilityShift: JsonField, + private val threeDSAuthenticationToken: JsonField, private val verificationAttempted: JsonField, private val verificationResult: JsonField, - private val threeDSAuthenticationToken: JsonField, private val additionalProperties: Map, ) { @@ -1998,6 +2412,14 @@ private constructor( */ fun liabilityShift(): LiabilityShift = liabilityShift.getRequired("liability_shift") + /** + * Unique identifier you can use to match a given 3DS authentication and the transaction. + * Note that in cases where liability shift does not occur, this token is matched to the + * transaction on a best-effort basis. + */ + fun threeDSAuthenticationToken(): String = + threeDSAuthenticationToken.getRequired("three_ds_authentication_token") + /** * Verification attempted values: * @@ -2045,14 +2467,6 @@ private constructor( fun verificationResult(): VerificationResult = verificationResult.getRequired("verification_result") - /** - * Unique identifier you can use to match a given 3DS authentication and the transaction. - * Note that in cases where liability shift does not occur, this token is matched to the - * transaction on a best-effort basis. - */ - fun threeDSAuthenticationToken(): String = - threeDSAuthenticationToken.getRequired("three_ds_authentication_token") - /** * 3-D Secure Protocol version. Possible enum values: * @@ -2132,6 +2546,15 @@ private constructor( */ @JsonProperty("liability_shift") @ExcludeMissing fun _liabilityShift() = liabilityShift + /** + * Unique identifier you can use to match a given 3DS authentication and the transaction. + * Note that in cases where liability shift does not occur, this token is matched to the + * transaction on a best-effort basis. + */ + @JsonProperty("three_ds_authentication_token") + @ExcludeMissing + fun _threeDSAuthenticationToken() = threeDSAuthenticationToken + /** * Verification attempted values: * @@ -2181,15 +2604,6 @@ private constructor( @ExcludeMissing fun _verificationResult() = verificationResult - /** - * Unique identifier you can use to match a given 3DS authentication and the transaction. - * Note that in cases where liability shift does not occur, this token is matched to the - * transaction on a best-effort basis. - */ - @JsonProperty("three_ds_authentication_token") - @ExcludeMissing - fun _threeDSAuthenticationToken() = threeDSAuthenticationToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -2201,9 +2615,9 @@ private constructor( authenticationResult() decisionMadeBy() liabilityShift() + threeDSAuthenticationToken() verificationAttempted() verificationResult() - threeDSAuthenticationToken() validated = true } } @@ -2221,9 +2635,9 @@ private constructor( this.authenticationResult == other.authenticationResult && this.decisionMadeBy == other.decisionMadeBy && this.liabilityShift == other.liabilityShift && + this.threeDSAuthenticationToken == other.threeDSAuthenticationToken && this.verificationAttempted == other.verificationAttempted && this.verificationResult == other.verificationResult && - this.threeDSAuthenticationToken == other.threeDSAuthenticationToken && this.additionalProperties == other.additionalProperties } @@ -2236,9 +2650,9 @@ private constructor( authenticationResult, decisionMadeBy, liabilityShift, + threeDSAuthenticationToken, verificationAttempted, verificationResult, - threeDSAuthenticationToken, additionalProperties, ) } @@ -2246,7 +2660,7 @@ private constructor( } override fun toString() = - "CardholderAuthentication{_3dsVersion=$_3dsVersion, acquirerExemption=$acquirerExemption, authenticationResult=$authenticationResult, decisionMadeBy=$decisionMadeBy, liabilityShift=$liabilityShift, verificationAttempted=$verificationAttempted, verificationResult=$verificationResult, threeDSAuthenticationToken=$threeDSAuthenticationToken, additionalProperties=$additionalProperties}" + "CardholderAuthentication{_3dsVersion=$_3dsVersion, acquirerExemption=$acquirerExemption, authenticationResult=$authenticationResult, decisionMadeBy=$decisionMadeBy, liabilityShift=$liabilityShift, threeDSAuthenticationToken=$threeDSAuthenticationToken, verificationAttempted=$verificationAttempted, verificationResult=$verificationResult, additionalProperties=$additionalProperties}" companion object { @@ -2260,9 +2674,9 @@ private constructor( private var authenticationResult: JsonField = JsonMissing.of() private var decisionMadeBy: JsonField = JsonMissing.of() private var liabilityShift: JsonField = JsonMissing.of() + private var threeDSAuthenticationToken: JsonField = JsonMissing.of() private var verificationAttempted: JsonField = JsonMissing.of() private var verificationResult: JsonField = JsonMissing.of() - private var threeDSAuthenticationToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -2272,10 +2686,10 @@ private constructor( this.authenticationResult = cardholderAuthentication.authenticationResult this.decisionMadeBy = cardholderAuthentication.decisionMadeBy this.liabilityShift = cardholderAuthentication.liabilityShift - this.verificationAttempted = cardholderAuthentication.verificationAttempted - this.verificationResult = cardholderAuthentication.verificationResult this.threeDSAuthenticationToken = cardholderAuthentication.threeDSAuthenticationToken + this.verificationAttempted = cardholderAuthentication.verificationAttempted + this.verificationResult = cardholderAuthentication.verificationResult additionalProperties(cardholderAuthentication.additionalProperties) } @@ -2458,6 +2872,25 @@ private constructor( this.liabilityShift = liabilityShift } + /** + * Unique identifier you can use to match a given 3DS authentication and the + * transaction. Note that in cases where liability shift does not occur, this token is + * matched to the transaction on a best-effort basis. + */ + fun threeDSAuthenticationToken(threeDSAuthenticationToken: String) = + threeDSAuthenticationToken(JsonField.of(threeDSAuthenticationToken)) + + /** + * Unique identifier you can use to match a given 3DS authentication and the + * transaction. Note that in cases where liability shift does not occur, this token is + * matched to the transaction on a best-effort basis. + */ + @JsonProperty("three_ds_authentication_token") + @ExcludeMissing + fun threeDSAuthenticationToken(threeDSAuthenticationToken: JsonField) = apply { + this.threeDSAuthenticationToken = threeDSAuthenticationToken + } + /** * Verification attempted values: * @@ -2561,25 +2994,6 @@ private constructor( this.verificationResult = verificationResult } - /** - * Unique identifier you can use to match a given 3DS authentication and the - * transaction. Note that in cases where liability shift does not occur, this token is - * matched to the transaction on a best-effort basis. - */ - fun threeDSAuthenticationToken(threeDSAuthenticationToken: String) = - threeDSAuthenticationToken(JsonField.of(threeDSAuthenticationToken)) - - /** - * Unique identifier you can use to match a given 3DS authentication and the - * transaction. Note that in cases where liability shift does not occur, this token is - * matched to the transaction on a best-effort basis. - */ - @JsonProperty("three_ds_authentication_token") - @ExcludeMissing - fun threeDSAuthenticationToken(threeDSAuthenticationToken: JsonField) = apply { - this.threeDSAuthenticationToken = threeDSAuthenticationToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -2601,9 +3015,9 @@ private constructor( authenticationResult, decisionMadeBy, liabilityShift, + threeDSAuthenticationToken, verificationAttempted, verificationResult, - threeDSAuthenticationToken, additionalProperties.toUnmodifiable(), ) } @@ -2736,47 +3150,47 @@ private constructor( companion object { - @JvmField val SUCCESS = AuthenticationResult(JsonField.of("SUCCESS")) + @JvmField val ATTEMPTS = AuthenticationResult(JsonField.of("ATTEMPTS")) @JvmField val DECLINE = AuthenticationResult(JsonField.of("DECLINE")) - @JvmField val ATTEMPTS = AuthenticationResult(JsonField.of("ATTEMPTS")) - @JvmField val NONE = AuthenticationResult(JsonField.of("NONE")) + @JvmField val SUCCESS = AuthenticationResult(JsonField.of("SUCCESS")) + @JvmStatic fun of(value: String) = AuthenticationResult(JsonField.of(value)) } enum class Known { - SUCCESS, - DECLINE, ATTEMPTS, + DECLINE, NONE, + SUCCESS, } enum class Value { - SUCCESS, - DECLINE, ATTEMPTS, + DECLINE, NONE, + SUCCESS, _UNKNOWN, } fun value(): Value = when (this) { - SUCCESS -> Value.SUCCESS - DECLINE -> Value.DECLINE ATTEMPTS -> Value.ATTEMPTS + DECLINE -> Value.DECLINE NONE -> Value.NONE + SUCCESS -> Value.SUCCESS else -> Value._UNKNOWN } fun known(): Known = when (this) { - SUCCESS -> Known.SUCCESS - DECLINE -> Known.DECLINE ATTEMPTS -> Known.ATTEMPTS + DECLINE -> Known.DECLINE NONE -> Known.NONE + SUCCESS -> Known.SUCCESS else -> throw LithicInvalidDataException("Unknown AuthenticationResult: $value") } @@ -2805,13 +3219,13 @@ private constructor( companion object { - @JvmField val NETWORK = DecisionMadeBy(JsonField.of("NETWORK")) + @JvmField val CUSTOMER_ENDPOINT = DecisionMadeBy(JsonField.of("CUSTOMER_ENDPOINT")) @JvmField val LITHIC_DEFAULT = DecisionMadeBy(JsonField.of("LITHIC_DEFAULT")) @JvmField val LITHIC_RULES = DecisionMadeBy(JsonField.of("LITHIC_RULES")) - @JvmField val CUSTOMER_ENDPOINT = DecisionMadeBy(JsonField.of("CUSTOMER_ENDPOINT")) + @JvmField val NETWORK = DecisionMadeBy(JsonField.of("NETWORK")) @JvmField val UNKNOWN = DecisionMadeBy(JsonField.of("UNKNOWN")) @@ -2819,38 +3233,38 @@ private constructor( } enum class Known { - NETWORK, + CUSTOMER_ENDPOINT, LITHIC_DEFAULT, LITHIC_RULES, - CUSTOMER_ENDPOINT, + NETWORK, UNKNOWN, } enum class Value { - NETWORK, + CUSTOMER_ENDPOINT, LITHIC_DEFAULT, LITHIC_RULES, - CUSTOMER_ENDPOINT, + NETWORK, UNKNOWN, _UNKNOWN, } fun value(): Value = when (this) { - NETWORK -> Value.NETWORK + CUSTOMER_ENDPOINT -> Value.CUSTOMER_ENDPOINT LITHIC_DEFAULT -> Value.LITHIC_DEFAULT LITHIC_RULES -> Value.LITHIC_RULES - CUSTOMER_ENDPOINT -> Value.CUSTOMER_ENDPOINT + NETWORK -> Value.NETWORK UNKNOWN -> Value.UNKNOWN else -> Value._UNKNOWN } fun known(): Known = when (this) { - NETWORK -> Known.NETWORK + CUSTOMER_ENDPOINT -> Known.CUSTOMER_ENDPOINT LITHIC_DEFAULT -> Known.LITHIC_DEFAULT LITHIC_RULES -> Known.LITHIC_RULES - CUSTOMER_ENDPOINT -> Known.CUSTOMER_ENDPOINT + NETWORK -> Known.NETWORK UNKNOWN -> Known.UNKNOWN else -> throw LithicInvalidDataException("Unknown DecisionMadeBy: $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 512bf958..b2c83a6e 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 @@ -27,14 +27,14 @@ private constructor( private val currency: JsonField, private val descriptor: JsonField, private val events: JsonField>, + private val fromBalance: JsonField>, private val pendingAmount: JsonField, private val result: JsonField, private val settledAmount: JsonField, private val status: JsonField, + private val toBalance: JsonField>, private val token: JsonField, private val updated: JsonField, - private val fromBalance: JsonField>, - private val toBalance: JsonField>, private val additionalProperties: Map, ) { @@ -61,6 +61,10 @@ private constructor( /** A list of all financial events that have modified this trasnfer. */ fun events(): Optional> = Optional.ofNullable(events.getNullable("events")) + /** The updated balance of the sending financial account. */ + fun fromBalance(): Optional> = + Optional.ofNullable(fromBalance.getNullable("from_balance")) + /** * Pending amount of the transaction in the currency's smallest unit (e.g., cents), including * any acquirer fees. The value of this field will go to zero over time once the financial @@ -93,20 +97,16 @@ private constructor( */ fun status(): Optional = Optional.ofNullable(status.getNullable("status")) + /** The updated balance of the receiving financial account. */ + fun toBalance(): Optional> = + Optional.ofNullable(toBalance.getNullable("to_balance")) + /** Globally unique identifier for the transfer event. */ fun token(): Optional = Optional.ofNullable(token.getNullable("token")) /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): Optional = Optional.ofNullable(updated.getNullable("updated")) - /** The updated balance of the sending financial account. */ - fun fromBalance(): Optional> = - Optional.ofNullable(fromBalance.getNullable("from_balance")) - - /** The updated balance of the receiving financial account. */ - fun toBalance(): Optional> = - Optional.ofNullable(toBalance.getNullable("to_balance")) - /** * Status types: * @@ -126,6 +126,9 @@ private constructor( /** A list of all financial events that have modified this trasnfer. */ @JsonProperty("events") @ExcludeMissing fun _events() = events + /** The updated balance of the sending financial account. */ + @JsonProperty("from_balance") @ExcludeMissing fun _fromBalance() = fromBalance + /** * Pending amount of the transaction in the currency's smallest unit (e.g., cents), including * any acquirer fees. The value of this field will go to zero over time once the financial @@ -156,18 +159,15 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status + /** The updated balance of the receiving financial account. */ + @JsonProperty("to_balance") @ExcludeMissing fun _toBalance() = toBalance + /** Globally unique identifier for the transfer event. */ @JsonProperty("token") @ExcludeMissing fun _token() = token /** Date and time when the financial transaction was last updated. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - /** The updated balance of the sending financial account. */ - @JsonProperty("from_balance") @ExcludeMissing fun _fromBalance() = fromBalance - - /** The updated balance of the receiving financial account. */ - @JsonProperty("to_balance") @ExcludeMissing fun _toBalance() = toBalance - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -179,14 +179,14 @@ private constructor( currency() descriptor() events().map { it.forEach { it.validate() } } + fromBalance().map { it.forEach { it.validate() } } pendingAmount() result() settledAmount() status() + toBalance().map { it.forEach { it.validate() } } token() updated() - fromBalance().map { it.forEach { it.validate() } } - toBalance().map { it.forEach { it.validate() } } validated = true } } @@ -204,14 +204,14 @@ private constructor( this.currency == other.currency && this.descriptor == other.descriptor && this.events == other.events && + this.fromBalance == other.fromBalance && this.pendingAmount == other.pendingAmount && this.result == other.result && this.settledAmount == other.settledAmount && this.status == other.status && + this.toBalance == other.toBalance && this.token == other.token && this.updated == other.updated && - this.fromBalance == other.fromBalance && - this.toBalance == other.toBalance && this.additionalProperties == other.additionalProperties } @@ -224,14 +224,14 @@ private constructor( currency, descriptor, events, + fromBalance, pendingAmount, result, settledAmount, status, + toBalance, token, updated, - fromBalance, - toBalance, additionalProperties, ) } @@ -239,7 +239,7 @@ private constructor( } override fun toString() = - "Transfer{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, fromBalance=$fromBalance, toBalance=$toBalance, additionalProperties=$additionalProperties}" + "Transfer{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, fromBalance=$fromBalance, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, toBalance=$toBalance, token=$token, updated=$updated, additionalProperties=$additionalProperties}" companion object { @@ -253,14 +253,14 @@ private constructor( private var currency: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() + private var fromBalance: JsonField> = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() + private var toBalance: JsonField> = JsonMissing.of() private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var fromBalance: JsonField> = JsonMissing.of() - private var toBalance: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -270,14 +270,14 @@ private constructor( this.currency = transfer.currency this.descriptor = transfer.descriptor this.events = transfer.events + this.fromBalance = transfer.fromBalance this.pendingAmount = transfer.pendingAmount this.result = transfer.result this.settledAmount = transfer.settledAmount this.status = transfer.status + this.toBalance = transfer.toBalance this.token = transfer.token this.updated = transfer.updated - this.fromBalance = transfer.fromBalance - this.toBalance = transfer.toBalance additionalProperties(transfer.additionalProperties) } @@ -333,6 +333,16 @@ private constructor( @ExcludeMissing fun events(events: JsonField>) = apply { this.events = events } + /** The updated balance of the sending financial account. */ + fun fromBalance(fromBalance: List) = fromBalance(JsonField.of(fromBalance)) + + /** The updated balance of the sending financial account. */ + @JsonProperty("from_balance") + @ExcludeMissing + fun fromBalance(fromBalance: JsonField>) = apply { + this.fromBalance = fromBalance + } + /** * Pending amount of the transaction in the currency's smallest unit (e.g., cents), * including any acquirer fees. The value of this field will go to zero over time once the @@ -405,6 +415,14 @@ private constructor( @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } + /** The updated balance of the receiving financial account. */ + fun toBalance(toBalance: List) = toBalance(JsonField.of(toBalance)) + + /** The updated balance of the receiving financial account. */ + @JsonProperty("to_balance") + @ExcludeMissing + fun toBalance(toBalance: JsonField>) = apply { this.toBalance = toBalance } + /** Globally unique identifier for the transfer event. */ fun token(token: String) = token(JsonField.of(token)) @@ -421,24 +439,6 @@ private constructor( @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } - /** The updated balance of the sending financial account. */ - fun fromBalance(fromBalance: List) = fromBalance(JsonField.of(fromBalance)) - - /** The updated balance of the sending financial account. */ - @JsonProperty("from_balance") - @ExcludeMissing - fun fromBalance(fromBalance: JsonField>) = apply { - this.fromBalance = fromBalance - } - - /** The updated balance of the receiving financial account. */ - fun toBalance(toBalance: List) = toBalance(JsonField.of(toBalance)) - - /** The updated balance of the receiving financial account. */ - @JsonProperty("to_balance") - @ExcludeMissing - fun toBalance(toBalance: JsonField>) = apply { this.toBalance = toBalance } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -460,14 +460,14 @@ private constructor( currency, descriptor, events.map { it.toUnmodifiable() }, + fromBalance.map { it.toUnmodifiable() }, pendingAmount, result, settledAmount, status, + toBalance.map { it.toUnmodifiable() }, token, updated, - fromBalance.map { it.toUnmodifiable() }, - toBalance.map { it.toUnmodifiable() }, additionalProperties.toUnmodifiable(), ) } @@ -984,10 +984,10 @@ private constructor( @JvmField val CLEARING = FinancialEventType(JsonField.of("CLEARING")) @JvmField - val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) + val CORRECTION_CREDIT = FinancialEventType(JsonField.of("CORRECTION_CREDIT")) @JvmField - val CORRECTION_CREDIT = FinancialEventType(JsonField.of("CORRECTION_CREDIT")) + val CORRECTION_DEBIT = FinancialEventType(JsonField.of("CORRECTION_DEBIT")) @JvmField val CREDIT_AUTHORIZATION = FinancialEventType(JsonField.of("CREDIT_AUTHORIZATION")) @@ -1030,8 +1030,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1055,8 +1055,8 @@ private constructor( AUTHORIZATION_REVERSAL, BALANCE_INQUIRY, CLEARING, - CORRECTION_DEBIT, CORRECTION_CREDIT, + CORRECTION_DEBIT, CREDIT_AUTHORIZATION, CREDIT_AUTHORIZATION_ADVICE, FINANCIAL_AUTHORIZATION, @@ -1082,8 +1082,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Value.BALANCE_INQUIRY CLEARING -> Value.CLEARING - CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CORRECTION_CREDIT -> Value.CORRECTION_CREDIT + CORRECTION_DEBIT -> Value.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION @@ -1109,8 +1109,8 @@ private constructor( AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL BALANCE_INQUIRY -> Known.BALANCE_INQUIRY CLEARING -> Known.CLEARING - CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CORRECTION_CREDIT -> Known.CORRECTION_CREDIT + CORRECTION_DEBIT -> Known.CORRECTION_DEBIT CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt index 3e137a46..01411a65 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/TransferCreateParams.kt @@ -19,8 +19,8 @@ constructor( private val amount: Long, private val from: String, private val to: String, + private val token: String?, private val memo: String?, - private val transactionToken: String?, private val additionalQueryParams: Map>, private val additionalHeaders: Map>, private val additionalBodyProperties: Map, @@ -32,9 +32,9 @@ constructor( fun to(): String = to - fun memo(): Optional = Optional.ofNullable(memo) + fun token(): Optional = Optional.ofNullable(token) - fun transactionToken(): Optional = Optional.ofNullable(transactionToken) + fun memo(): Optional = Optional.ofNullable(memo) @JvmSynthetic internal fun getBody(): TransferCreateBody { @@ -42,8 +42,8 @@ constructor( amount, from, to, + token, memo, - transactionToken, additionalBodyProperties, ) } @@ -59,8 +59,8 @@ constructor( private val amount: Long?, private val from: String?, private val to: String?, + private val token: String?, private val memo: String?, - private val transactionToken: String?, private val additionalProperties: Map, ) { @@ -84,12 +84,15 @@ constructor( */ @JsonProperty("to") fun to(): String? = to + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ + @JsonProperty("token") fun token(): String? = token + /** Optional descriptor for the transfer. */ @JsonProperty("memo") fun memo(): String? = memo - /** Customer-provided transaction_token that will serve as an idempotency token. */ - @JsonProperty("transaction_token") fun transactionToken(): String? = transactionToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -105,8 +108,8 @@ constructor( this.amount == other.amount && this.from == other.from && this.to == other.to && + this.token == other.token && this.memo == other.memo && - this.transactionToken == other.transactionToken && this.additionalProperties == other.additionalProperties } @@ -117,8 +120,8 @@ constructor( amount, from, to, + token, memo, - transactionToken, additionalProperties, ) } @@ -126,7 +129,7 @@ constructor( } override fun toString() = - "TransferCreateBody{amount=$amount, from=$from, to=$to, memo=$memo, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" + "TransferCreateBody{amount=$amount, from=$from, to=$to, token=$token, memo=$memo, additionalProperties=$additionalProperties}" companion object { @@ -138,8 +141,8 @@ constructor( private var amount: Long? = null private var from: String? = null private var to: String? = null + private var token: String? = null private var memo: String? = null - private var transactionToken: String? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -147,8 +150,8 @@ constructor( this.amount = transferCreateBody.amount this.from = transferCreateBody.from this.to = transferCreateBody.to + this.token = transferCreateBody.token this.memo = transferCreateBody.memo - this.transactionToken = transferCreateBody.transactionToken additionalProperties(transferCreateBody.additionalProperties) } @@ -170,15 +173,15 @@ constructor( */ @JsonProperty("to") fun to(to: String) = apply { this.to = to } + /** + * Customer-provided token that will serve as an idempotency token. This token will + * become the transaction token. + */ + @JsonProperty("token") fun token(token: String) = apply { this.token = token } + /** Optional descriptor for the transfer. */ @JsonProperty("memo") fun memo(memo: String) = apply { this.memo = memo } - /** Customer-provided transaction_token that will serve as an idempotency token. */ - @JsonProperty("transaction_token") - fun transactionToken(transactionToken: String) = apply { - this.transactionToken = transactionToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) @@ -198,8 +201,8 @@ constructor( checkNotNull(amount) { "`amount` is required but was not set" }, checkNotNull(from) { "`from` is required but was not set" }, checkNotNull(to) { "`to` is required but was not set" }, + token, memo, - transactionToken, additionalProperties.toUnmodifiable(), ) } @@ -220,8 +223,8 @@ constructor( this.amount == other.amount && this.from == other.from && this.to == other.to && + this.token == other.token && this.memo == other.memo && - this.transactionToken == other.transactionToken && this.additionalQueryParams == other.additionalQueryParams && this.additionalHeaders == other.additionalHeaders && this.additionalBodyProperties == other.additionalBodyProperties @@ -232,8 +235,8 @@ constructor( amount, from, to, + token, memo, - transactionToken, additionalQueryParams, additionalHeaders, additionalBodyProperties, @@ -241,7 +244,7 @@ constructor( } override fun toString() = - "TransferCreateParams{amount=$amount, from=$from, to=$to, memo=$memo, transactionToken=$transactionToken, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" + "TransferCreateParams{amount=$amount, from=$from, to=$to, token=$token, memo=$memo, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}" fun toBuilder() = Builder().from(this) @@ -256,8 +259,8 @@ constructor( private var amount: Long? = null private var from: String? = null private var to: String? = null + private var token: String? = null private var memo: String? = null - private var transactionToken: String? = null private var additionalQueryParams: MutableMap> = mutableMapOf() private var additionalHeaders: MutableMap> = mutableMapOf() private var additionalBodyProperties: MutableMap = mutableMapOf() @@ -267,8 +270,8 @@ constructor( this.amount = transferCreateParams.amount this.from = transferCreateParams.from this.to = transferCreateParams.to + this.token = transferCreateParams.token this.memo = transferCreateParams.memo - this.transactionToken = transferCreateParams.transactionToken additionalQueryParams(transferCreateParams.additionalQueryParams) additionalHeaders(transferCreateParams.additionalHeaders) additionalBodyProperties(transferCreateParams.additionalBodyProperties) @@ -292,14 +295,15 @@ constructor( */ fun to(to: String) = apply { this.to = to } + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ + fun token(token: String) = apply { this.token = token } + /** Optional descriptor for the transfer. */ fun memo(memo: String) = apply { this.memo = memo } - /** Customer-provided transaction_token that will serve as an idempotency token. */ - fun transactionToken(transactionToken: String) = apply { - this.transactionToken = transactionToken - } - fun additionalQueryParams(additionalQueryParams: Map>) = apply { this.additionalQueryParams.clear() putAllQueryParams(additionalQueryParams) @@ -359,8 +363,8 @@ constructor( checkNotNull(amount) { "`amount` is required but was not set" }, checkNotNull(from) { "`from` is required but was not set" }, checkNotNull(to) { "`to` is required but was not set" }, + token, memo, - transactionToken, additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(), additionalBodyProperties.toUnmodifiable(), diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt index defe0155..0a388142 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsync.kt @@ -15,6 +15,7 @@ import com.lithic.api.models.CardListParams import com.lithic.api.models.CardProvisionParams import com.lithic.api.models.CardProvisionResponse import com.lithic.api.models.CardReissueParams +import com.lithic.api.models.CardRenewParams import com.lithic.api.models.CardRetrieveParams import com.lithic.api.models.CardRetrieveSpendLimitsParams import com.lithic.api.models.CardSpendLimits @@ -124,6 +125,17 @@ interface CardServiceAsync { requestOptions: RequestOptions = RequestOptions.none() ): CompletableFuture + /** + * Initiate print and shipment of a renewed physical card. + * + * Only applies to cards of type `PHYSICAL`. + */ + @JvmOverloads + fun renew( + params: CardRenewParams, + requestOptions: RequestOptions = RequestOptions.none() + ): CompletableFuture + /** * Get a Card's available spend limit, which is based on the spend limit configured on the Card * and the amount already spent over the spend limit's duration. For example, if the Card has a diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt index be8a9229..f5aae4c0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/CardServiceAsyncImpl.kt @@ -18,6 +18,7 @@ import com.lithic.api.models.CardListParams import com.lithic.api.models.CardProvisionParams import com.lithic.api.models.CardProvisionResponse import com.lithic.api.models.CardReissueParams +import com.lithic.api.models.CardRenewParams import com.lithic.api.models.CardRetrieveParams import com.lithic.api.models.CardRetrieveSpendLimitsParams import com.lithic.api.models.CardSpendLimits @@ -301,6 +302,39 @@ constructor( } } + private val renewHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** + * Initiate print and shipment of a renewed physical card. + * + * Only applies to cards of type `PHYSICAL`. + */ + override fun renew( + params: CardRenewParams, + requestOptions: RequestOptions + ): CompletableFuture { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("cards", params.getPathParam(0), "renew") + .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 { renewHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + private val retrieveSpendLimitsHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsync.kt index c09c77c9..b1208707 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsync.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsync.kt @@ -8,7 +8,7 @@ import com.lithic.api.core.RequestOptions import com.lithic.api.models.ReportSettlementListDetailsPageAsync import com.lithic.api.models.ReportSettlementListDetailsParams import com.lithic.api.models.ReportSettlementSummaryParams -import com.lithic.api.models.SettlementSummaryResponse +import com.lithic.api.models.SettlementReport import java.util.concurrent.CompletableFuture interface SettlementServiceAsync { @@ -25,5 +25,5 @@ interface SettlementServiceAsync { fun summary( params: ReportSettlementSummaryParams, requestOptions: RequestOptions = RequestOptions.none() - ): CompletableFuture + ): CompletableFuture } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsyncImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsyncImpl.kt index 7db9a46f..6d560513 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsyncImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/async/reports/SettlementServiceAsyncImpl.kt @@ -11,7 +11,7 @@ import com.lithic.api.errors.LithicError import com.lithic.api.models.ReportSettlementListDetailsPageAsync import com.lithic.api.models.ReportSettlementListDetailsParams import com.lithic.api.models.ReportSettlementSummaryParams -import com.lithic.api.models.SettlementSummaryResponse +import com.lithic.api.models.SettlementReport import com.lithic.api.services.errorHandler import com.lithic.api.services.jsonHandler import com.lithic.api.services.withErrorHandler @@ -54,15 +54,14 @@ constructor( } } - private val summaryHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) + private val summaryHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the settlement report for a specified report date. */ override fun summary( params: ReportSettlementSummaryParams, requestOptions: RequestOptions - ): CompletableFuture { + ): CompletableFuture { val request = HttpRequest.builder() .method(HttpMethod.GET) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt index ac3f4117..13b74f9c 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardService.kt @@ -15,6 +15,7 @@ import com.lithic.api.models.CardListParams import com.lithic.api.models.CardProvisionParams import com.lithic.api.models.CardProvisionResponse import com.lithic.api.models.CardReissueParams +import com.lithic.api.models.CardRenewParams import com.lithic.api.models.CardRetrieveParams import com.lithic.api.models.CardRetrieveSpendLimitsParams import com.lithic.api.models.CardSpendLimits @@ -123,6 +124,14 @@ interface CardService { requestOptions: RequestOptions = RequestOptions.none() ): Card + /** + * Initiate print and shipment of a renewed physical card. + * + * Only applies to cards of type `PHYSICAL`. + */ + @JvmOverloads + fun renew(params: CardRenewParams, requestOptions: RequestOptions = RequestOptions.none()): Card + /** * Get a Card's available spend limit, which is based on the spend limit configured on the Card * and the amount already spent over the spend limit's duration. For example, if the Card has a diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt index 6a20f9ee..e5f183a0 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/CardServiceImpl.kt @@ -18,6 +18,7 @@ import com.lithic.api.models.CardListParams import com.lithic.api.models.CardProvisionParams import com.lithic.api.models.CardProvisionResponse import com.lithic.api.models.CardReissueParams +import com.lithic.api.models.CardRenewParams import com.lithic.api.models.CardRetrieveParams import com.lithic.api.models.CardRetrieveSpendLimitsParams import com.lithic.api.models.CardSpendLimits @@ -274,6 +275,35 @@ constructor( } } + private val renewHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) + + /** + * Initiate print and shipment of a renewed physical card. + * + * Only applies to cards of type `PHYSICAL`. + */ + override fun renew(params: CardRenewParams, requestOptions: RequestOptions): Card { + val request = + HttpRequest.builder() + .method(HttpMethod.POST) + .addPathSegments("cards", params.getPathParam(0), "renew") + .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 { renewHandler.handle(it) } + .apply { + if (requestOptions.responseValidation ?: clientOptions.responseValidation) { + validate() + } + } + } + } + private val retrieveSpendLimitsHandler: Handler = jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementService.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementService.kt index 870b43ce..e3b77dde 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementService.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementService.kt @@ -8,7 +8,7 @@ import com.lithic.api.core.RequestOptions import com.lithic.api.models.ReportSettlementListDetailsPage import com.lithic.api.models.ReportSettlementListDetailsParams import com.lithic.api.models.ReportSettlementSummaryParams -import com.lithic.api.models.SettlementSummaryResponse +import com.lithic.api.models.SettlementReport interface SettlementService { @@ -24,5 +24,5 @@ interface SettlementService { fun summary( params: ReportSettlementSummaryParams, requestOptions: RequestOptions = RequestOptions.none() - ): SettlementSummaryResponse + ): SettlementReport } diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceImpl.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceImpl.kt index 73cf9c75..d347abbc 100644 --- a/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceImpl.kt +++ b/lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceImpl.kt @@ -11,7 +11,7 @@ import com.lithic.api.errors.LithicError import com.lithic.api.models.ReportSettlementListDetailsPage import com.lithic.api.models.ReportSettlementListDetailsParams import com.lithic.api.models.ReportSettlementSummaryParams -import com.lithic.api.models.SettlementSummaryResponse +import com.lithic.api.models.SettlementReport import com.lithic.api.services.errorHandler import com.lithic.api.services.jsonHandler import com.lithic.api.services.withErrorHandler @@ -52,15 +52,14 @@ constructor( } } - private val summaryHandler: Handler = - jsonHandler(clientOptions.jsonMapper) - .withErrorHandler(errorHandler) + private val summaryHandler: Handler = + jsonHandler(clientOptions.jsonMapper).withErrorHandler(errorHandler) /** Get the settlement report for a specified report date. */ override fun summary( params: ReportSettlementSummaryParams, requestOptions: RequestOptions - ): SettlementSummaryResponse { + ): SettlementReport { val request = HttpRequest.builder() .method(HttpMethod.GET) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderCreateParamsTest.kt index 92a2fce5..d48088fe 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountHolderCreateParamsTest.kt @@ -35,7 +35,7 @@ class AccountHolderCreateParamsTest { ) .beneficialOwnerIndividuals( listOf( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") @@ -75,7 +75,7 @@ class AccountHolderCreateParamsTest { .build() ) .controlPerson( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountSpendLimitsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountSpendLimitsTest.kt index 8828e80f..5326a6ce 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountSpendLimitsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AccountSpendLimitsTest.kt @@ -2,7 +2,6 @@ package com.lithic.api.models -import com.lithic.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -19,17 +18,15 @@ class AccountSpendLimitsTest { .monthly(123L) .build() ) - .required(JsonValue.from(mapOf())) .build() assertThat(accountSpendLimits).isNotNull assertThat(accountSpendLimits.availableSpendLimit()) - .contains( + .isEqualTo( AccountSpendLimits.AvailableSpendLimit.builder() .daily(123L) .lifetime(123L) .monthly(123L) .build() ) - assertThat(accountSpendLimits._required()).isEqualTo(JsonValue.from(mapOf())) } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt index c2f4aeae..ab411f21 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/AuthenticationRetrieveResponseTest.kt @@ -13,8 +13,8 @@ class AuthenticationRetrieveResponseTest { val authenticationRetrieveResponse = AuthenticationRetrieveResponse.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .accountType(AuthenticationRetrieveResponse.AccountType.NOT_APPLICABLE) - .authenticationResult(AuthenticationRetrieveResponse.AuthenticationResult.SUCCESS) + .accountType(AuthenticationRetrieveResponse.AccountType.CREDIT) + .authenticationResult(AuthenticationRetrieveResponse.AuthenticationResult.DECLINE) .cardExpiryCheck(AuthenticationRetrieveResponse.CardExpiryCheck.MATCH) .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardholder( @@ -49,7 +49,7 @@ class AuthenticationRetrieveResponseTest { ) .channel(AuthenticationRetrieveResponse.Channel.APP_BASED) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .decisionMadeBy(AuthenticationRetrieveResponse.DecisionMadeBy.NETWORK) + .decisionMadeBy(AuthenticationRetrieveResponse.DecisionMadeBy.CUSTOMER_ENDPOINT) .merchant( AuthenticationRetrieveResponse.Merchant.builder() .id("string") @@ -70,7 +70,7 @@ class AuthenticationRetrieveResponseTest { .orderAvailability( AuthenticationRetrieveResponse.Merchant.RiskIndicator .OrderAvailability - .MERCHANDISE_AVAILABLE + .FUTURE_AVAILABILITY ) .preOrderAvailableDate( OffsetDateTime.parse("2019-12-27T18:11:19.117Z") @@ -83,14 +83,14 @@ class AuthenticationRetrieveResponseTest { .shippingMethod( AuthenticationRetrieveResponse.Merchant.RiskIndicator .ShippingMethod - .SHIP_TO_BILLING_ADDRESS + .DIGITAL_GOODS ) .build() ) .build() ) .messageCategory( - AuthenticationRetrieveResponse.MessageCategory.PAYMENT_AUTHENTICATION + AuthenticationRetrieveResponse.MessageCategory.NON_PAYMENT_AUTHENTICATION ) .additionalData( AuthenticationRetrieveResponse.AdditionalData.builder() @@ -107,7 +107,7 @@ class AuthenticationRetrieveResponseTest { .build() ) .authenticationRequestType( - AuthenticationRetrieveResponse.AuthenticationRequestType.PAYMENT_TRANSACTION + AuthenticationRetrieveResponse.AuthenticationRequestType.ADD_CARD ) .browser( AuthenticationRetrieveResponse.Browser.builder() @@ -120,7 +120,7 @@ class AuthenticationRetrieveResponseTest { .build() ) .threeRiRequestType( - AuthenticationRetrieveResponse.ThreeRiRequestType.RECURRING_TRANSACTION + AuthenticationRetrieveResponse.ThreeRiRequestType.ACCOUNT_VERIFICATION ) .transaction( AuthenticationRetrieveResponse.Transaction.builder() @@ -128,9 +128,7 @@ class AuthenticationRetrieveResponseTest { .currency("xxx") .currencyExponent(42.23) .dateTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .type( - AuthenticationRetrieveResponse.Transaction.Type.GOODS_SERVICE_PURCHASE - ) + .type(AuthenticationRetrieveResponse.Transaction.Type.ACCOUNT_FUNDING) .build() ) .build() @@ -138,9 +136,9 @@ class AuthenticationRetrieveResponseTest { assertThat(authenticationRetrieveResponse.token()) .isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(authenticationRetrieveResponse.accountType()) - .contains(AuthenticationRetrieveResponse.AccountType.NOT_APPLICABLE) + .contains(AuthenticationRetrieveResponse.AccountType.CREDIT) assertThat(authenticationRetrieveResponse.authenticationResult()) - .contains(AuthenticationRetrieveResponse.AuthenticationResult.SUCCESS) + .contains(AuthenticationRetrieveResponse.AuthenticationResult.DECLINE) assertThat(authenticationRetrieveResponse.cardExpiryCheck()) .isEqualTo(AuthenticationRetrieveResponse.CardExpiryCheck.MATCH) assertThat(authenticationRetrieveResponse.cardToken()) @@ -181,7 +179,7 @@ class AuthenticationRetrieveResponseTest { assertThat(authenticationRetrieveResponse.created()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(authenticationRetrieveResponse.decisionMadeBy()) - .contains(AuthenticationRetrieveResponse.DecisionMadeBy.NETWORK) + .contains(AuthenticationRetrieveResponse.DecisionMadeBy.CUSTOMER_ENDPOINT) assertThat(authenticationRetrieveResponse.merchant()) .isEqualTo( AuthenticationRetrieveResponse.Merchant.builder() @@ -203,7 +201,7 @@ class AuthenticationRetrieveResponseTest { .orderAvailability( AuthenticationRetrieveResponse.Merchant.RiskIndicator .OrderAvailability - .MERCHANDISE_AVAILABLE + .FUTURE_AVAILABILITY ) .preOrderAvailableDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .reorderItems( @@ -212,14 +210,14 @@ class AuthenticationRetrieveResponseTest { ) .shippingMethod( AuthenticationRetrieveResponse.Merchant.RiskIndicator.ShippingMethod - .SHIP_TO_BILLING_ADDRESS + .DIGITAL_GOODS ) .build() ) .build() ) assertThat(authenticationRetrieveResponse.messageCategory()) - .isEqualTo(AuthenticationRetrieveResponse.MessageCategory.PAYMENT_AUTHENTICATION) + .isEqualTo(AuthenticationRetrieveResponse.MessageCategory.NON_PAYMENT_AUTHENTICATION) assertThat(authenticationRetrieveResponse.additionalData()) .contains( AuthenticationRetrieveResponse.AdditionalData.builder() @@ -237,7 +235,7 @@ class AuthenticationRetrieveResponseTest { .build() ) assertThat(authenticationRetrieveResponse.authenticationRequestType()) - .contains(AuthenticationRetrieveResponse.AuthenticationRequestType.PAYMENT_TRANSACTION) + .contains(AuthenticationRetrieveResponse.AuthenticationRequestType.ADD_CARD) assertThat(authenticationRetrieveResponse.browser()) .contains( AuthenticationRetrieveResponse.Browser.builder() @@ -250,7 +248,7 @@ class AuthenticationRetrieveResponseTest { .build() ) assertThat(authenticationRetrieveResponse.threeRiRequestType()) - .contains(AuthenticationRetrieveResponse.ThreeRiRequestType.RECURRING_TRANSACTION) + .contains(AuthenticationRetrieveResponse.ThreeRiRequestType.ACCOUNT_VERIFICATION) assertThat(authenticationRetrieveResponse.transaction()) .contains( AuthenticationRetrieveResponse.Transaction.builder() @@ -258,7 +256,7 @@ class AuthenticationRetrieveResponseTest { .currency("xxx") .currencyExponent(42.23) .dateTime(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) - .type(AuthenticationRetrieveResponse.Transaction.Type.GOODS_SERVICE_PURCHASE) + .type(AuthenticationRetrieveResponse.Transaction.Type.ACCOUNT_FUNDING) .build() ) } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt index 40fb0271..2f981eb9 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardCreateParamsTest.kt @@ -11,7 +11,7 @@ class CardCreateParamsTest { @Test fun createCardCreateParams() { CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -21,6 +21,7 @@ class CardCreateParamsTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -36,7 +37,7 @@ class CardCreateParamsTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -47,7 +48,7 @@ class CardCreateParamsTest { fun getBody() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -57,6 +58,7 @@ class CardCreateParamsTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -72,14 +74,14 @@ class CardCreateParamsTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) .build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.type()).isEqualTo(CardCreateParams.Type.VIRTUAL) + assertThat(body.type()).isEqualTo(CardCreateParams.Type.MERCHANT_LOCKED) assertThat(body.accountToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.cardProgramToken()).isEqualTo("00000000-0000-0000-1000-000000000000") assertThat(body.carrier()).isEqualTo(Carrier.builder().qrCodeUrl("string").build()) @@ -89,6 +91,7 @@ class CardCreateParamsTest { assertThat(body.memo()).isEqualTo("New Card") assertThat(body.pin()).isEqualTo("string") assertThat(body.productId()).isEqualTo("1") + assertThat(body.replacementFor()).isEqualTo("00000000-0000-0000-1000-000000000000") assertThat(body.shippingAddress()) .isEqualTo( ShippingAddress.builder() @@ -105,7 +108,7 @@ class CardCreateParamsTest { .phoneNumber("+12124007676") .build() ) - assertThat(body.shippingMethod()).isEqualTo(CardCreateParams.ShippingMethod.STANDARD) + assertThat(body.shippingMethod()).isEqualTo(CardCreateParams.ShippingMethod._2_DAY) assertThat(body.spendLimit()).isEqualTo(123L) assertThat(body.spendLimitDuration()).isEqualTo(SpendLimitDuration.ANNUALLY) assertThat(body.state()).isEqualTo(CardCreateParams.State.OPEN) @@ -113,9 +116,9 @@ class CardCreateParamsTest { @Test fun getBodyWithoutOptionalFields() { - val params = CardCreateParams.builder().type(CardCreateParams.Type.VIRTUAL).build() + val params = CardCreateParams.builder().type(CardCreateParams.Type.MERCHANT_LOCKED).build() val body = params.getBody() assertThat(body).isNotNull - assertThat(body.type()).isEqualTo(CardCreateParams.Type.VIRTUAL) + assertThat(body.type()).isEqualTo(CardCreateParams.Type.MERCHANT_LOCKED) } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardListParamsTest.kt index d9117396..dc14dbae 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardListParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardListParamsTest.kt @@ -18,7 +18,7 @@ class CardListParamsTest { .endingBefore("string") .pageSize(123L) .startingAfter("string") - .state(CardListParams.State.OPEN) + .state(CardListParams.State.CLOSED) .build() } @@ -32,7 +32,7 @@ class CardListParamsTest { .endingBefore("string") .pageSize(123L) .startingAfter("string") - .state(CardListParams.State.OPEN) + .state(CardListParams.State.CLOSED) .build() val expected = mutableMapOf>() expected.put("account_token", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) @@ -41,7 +41,7 @@ class CardListParamsTest { expected.put("ending_before", listOf("string")) expected.put("page_size", listOf("123")) expected.put("starting_after", listOf("string")) - expected.put("state", listOf(CardListParams.State.OPEN.toString())) + expected.put("state", listOf(CardListParams.State.CLOSED.toString())) assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardReissueParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardReissueParamsTest.kt index 94e6e909..19526aa6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardReissueParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardReissueParamsTest.kt @@ -29,7 +29,7 @@ class CardReissueParamsTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardReissueParams.ShippingMethod.STANDARD) + .shippingMethod(CardReissueParams.ShippingMethod._2_DAY) .build() } @@ -55,7 +55,7 @@ class CardReissueParamsTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardReissueParams.ShippingMethod.STANDARD) + .shippingMethod(CardReissueParams.ShippingMethod._2_DAY) .build() val body = params.getBody() assertThat(body).isNotNull @@ -77,7 +77,7 @@ class CardReissueParamsTest { .phoneNumber("+12124007676") .build() ) - assertThat(body.shippingMethod()).isEqualTo(CardReissueParams.ShippingMethod.STANDARD) + assertThat(body.shippingMethod()).isEqualTo(CardReissueParams.ShippingMethod._2_DAY) } @Test diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardRenewParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardRenewParamsTest.kt new file mode 100644 index 00000000..2b03111d --- /dev/null +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardRenewParamsTest.kt @@ -0,0 +1,145 @@ +// 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 CardRenewParamsTest { + + @Test + fun createCardRenewParams() { + CardRenewParams.builder() + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .shippingAddress( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .address2("Unit 25A") + .email("johnny@appleseed.com") + .line2Text("The Bluth Company") + .phoneNumber("+12124007676") + .build() + ) + .carrier(Carrier.builder().qrCodeUrl("string").build()) + .expMonth("06") + .expYear("2027") + .productId("string") + .shippingMethod(CardRenewParams.ShippingMethod._2_DAY) + .build() + } + + @Test + fun getBody() { + val params = + CardRenewParams.builder() + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .shippingAddress( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .address2("Unit 25A") + .email("johnny@appleseed.com") + .line2Text("The Bluth Company") + .phoneNumber("+12124007676") + .build() + ) + .carrier(Carrier.builder().qrCodeUrl("string").build()) + .expMonth("06") + .expYear("2027") + .productId("string") + .shippingMethod(CardRenewParams.ShippingMethod._2_DAY) + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.shippingAddress()) + .isEqualTo( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .address2("Unit 25A") + .email("johnny@appleseed.com") + .line2Text("The Bluth Company") + .phoneNumber("+12124007676") + .build() + ) + assertThat(body.carrier()).isEqualTo(Carrier.builder().qrCodeUrl("string").build()) + assertThat(body.expMonth()).isEqualTo("06") + assertThat(body.expYear()).isEqualTo("2027") + assertThat(body.productId()).isEqualTo("string") + assertThat(body.shippingMethod()).isEqualTo(CardRenewParams.ShippingMethod._2_DAY) + } + + @Test + fun getBodyWithoutOptionalFields() { + val params = + CardRenewParams.builder() + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .shippingAddress( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .build() + ) + .build() + val body = params.getBody() + assertThat(body).isNotNull + assertThat(body.shippingAddress()) + .isEqualTo( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .build() + ) + } + + @Test + fun getPathParam() { + val params = + CardRenewParams.builder() + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .shippingAddress( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .build() + ) + .build() + assertThat(params).isNotNull + // path param "cardToken" + 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/CardSpendLimitsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardSpendLimitsTest.kt index eb14a5bf..66ced308 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardSpendLimitsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardSpendLimitsTest.kt @@ -2,7 +2,6 @@ package com.lithic.api.models -import com.lithic.api.core.JsonValue import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -19,17 +18,15 @@ class CardSpendLimitsTest { .monthly(123L) .build() ) - .required(JsonValue.from(mapOf())) .build() assertThat(cardSpendLimits).isNotNull assertThat(cardSpendLimits.availableSpendLimit()) - .contains( + .isEqualTo( CardSpendLimits.AvailableSpendLimit.builder() .annually(123L) .forever(123L) .monthly(123L) .build() ) - assertThat(cardSpendLimits._required()).isEqualTo(JsonValue.from(mapOf())) } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt index 76a975f2..f76073a7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/CardTest.kt @@ -19,7 +19,7 @@ class CardTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .lastFour("xxxx") - .state(Card.FundingAccount.State.ENABLED) + .state(Card.FundingAccount.State.DELETED) .type(Card.FundingAccount.Type.DEPOSITORY_CHECKING) .accountName("string") .nickname("x") @@ -29,7 +29,7 @@ class CardTest { .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(Card.State.CLOSED) - .type(Card.Type.VIRTUAL) + .type(Card.Type.MERCHANT_LOCKED) .authRuleTokens(listOf("string")) .cvv("776") .digitalCardArtToken("00000000-0000-0000-1000-000000000000") @@ -48,7 +48,7 @@ class CardTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .lastFour("xxxx") - .state(Card.FundingAccount.State.ENABLED) + .state(Card.FundingAccount.State.DELETED) .type(Card.FundingAccount.Type.DEPOSITORY_CHECKING) .accountName("string") .nickname("x") @@ -58,7 +58,7 @@ class CardTest { assertThat(card.spendLimit()).isEqualTo(123L) assertThat(card.spendLimitDuration()).isEqualTo(SpendLimitDuration.ANNUALLY) assertThat(card.state()).isEqualTo(Card.State.CLOSED) - assertThat(card.type()).isEqualTo(Card.Type.VIRTUAL) + assertThat(card.type()).isEqualTo(Card.Type.MERCHANT_LOCKED) assertThat(card.authRuleTokens().get()).containsExactly("string") assertThat(card.cvv()).contains("776") assertThat(card.digitalCardArtToken()).contains("00000000-0000-0000-1000-000000000000") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeListParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeListParamsTest.kt index 8baac841..7e3d47db 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeListParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeListParamsTest.kt @@ -17,7 +17,7 @@ class DisputeListParamsTest { .endingBefore("string") .pageSize(123L) .startingAfter("string") - .status(DisputeListParams.Status.NEW) + .status(DisputeListParams.Status.ARBITRATION) .transactionTokens(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() } @@ -31,7 +31,7 @@ class DisputeListParamsTest { .endingBefore("string") .pageSize(123L) .startingAfter("string") - .status(DisputeListParams.Status.NEW) + .status(DisputeListParams.Status.ARBITRATION) .transactionTokens(listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) .build() val expected = mutableMapOf>() @@ -40,7 +40,7 @@ class DisputeListParamsTest { expected.put("ending_before", listOf("string")) expected.put("page_size", listOf("123")) expected.put("starting_after", listOf("string")) - expected.put("status", listOf(DisputeListParams.Status.NEW.toString())) + expected.put("status", listOf(DisputeListParams.Status.ARBITRATION.toString())) expected.put("transaction_tokens", listOf("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")) assertThat(params.getQueryParams()).isEqualTo(expected) } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTest.kt index 909f9a3e..9492b5ad 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/DisputeTest.kt @@ -29,7 +29,7 @@ class DisputeTest { .resolutionDate(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .resolutionNote("string") .resolutionReason(Dispute.ResolutionReason.CASE_LOST) - .status(Dispute.Status.NEW) + .status(Dispute.Status.ARBITRATION) .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() assertThat(dispute).isNotNull @@ -56,7 +56,7 @@ class DisputeTest { .contains(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(dispute.resolutionNote()).contains("string") assertThat(dispute.resolutionReason()).contains(Dispute.ResolutionReason.CASE_LOST) - assertThat(dispute.status()).isEqualTo(Dispute.Status.NEW) + assertThat(dispute.status()).isEqualTo(Dispute.Status.ARBITRATION) assertThat(dispute.transactionToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } } 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 9e096961..bcb9082b 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 @@ -11,17 +11,37 @@ class ExternalBankAccountCreateParamsTest { @Test fun createExternalBankAccountCreateParams() { ExternalBankAccountCreateParams.builder() - .forPlaidCreateBankAccountApiRequest( - ExternalBankAccountCreateParams.PlaidCreateBankAccountApiRequest.builder() + .forBankVerifiedCreateBankAccountApiRequest( + ExternalBankAccountCreateParams.BankVerifiedCreateBankAccountApiRequest.builder() + .accountNumber("string") + .country("USD") + .currency("USD") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) - .processorToken("x") + .ownerType(OwnerType.BUSINESS) + .routingNumber("123456789") + .type( + ExternalBankAccountCreateParams.BankVerifiedCreateBankAccountApiRequest + .AccountType + .CHECKING + ) .verificationMethod(VerificationMethod.MANUAL) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .address( + ExternalBankAccountAddress.builder() + .address1("x") + .city("x") + .country("USD") + .postalCode("11201") + .state("xx") + .address2("x") + .build() + ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) .doingBusinessAs("string") + .name("x") .userDefinedId("string") + .verificationEnforcement(true) .build() ) .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 5d9306eb..5d182f6d 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 @@ -19,13 +19,13 @@ class ExternalBankAccountCreateResponseTest { .currency("string") .lastFour("string") .owner("string") - .ownerType(ExternalBankAccountCreateResponse.OwnerType.INDIVIDUAL) + .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() @@ -54,17 +54,17 @@ class ExternalBankAccountCreateResponseTest { assertThat(externalBankAccountCreateResponse.lastFour()).isEqualTo("string") assertThat(externalBankAccountCreateResponse.owner()).isEqualTo("string") assertThat(externalBankAccountCreateResponse.ownerType()) - .isEqualTo(ExternalBankAccountCreateResponse.OwnerType.INDIVIDUAL) + .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 a0b49baa..5b878f08 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 89e5c41b..6753e4d5 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 @@ -19,13 +19,13 @@ class ExternalBankAccountListResponseTest { .currency("string") .lastFour("string") .owner("string") - .ownerType(ExternalBankAccountListResponse.OwnerType.INDIVIDUAL) + .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() @@ -54,17 +54,17 @@ class ExternalBankAccountListResponseTest { assertThat(externalBankAccountListResponse.lastFour()).isEqualTo("string") assertThat(externalBankAccountListResponse.owner()).isEqualTo("string") assertThat(externalBankAccountListResponse.ownerType()) - .isEqualTo(ExternalBankAccountListResponse.OwnerType.INDIVIDUAL) + .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/ExternalBankAccountRetrieveResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponseTest.kt index fc3a3bbf..73eb7c6d 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 @@ -19,13 +19,13 @@ class ExternalBankAccountRetrieveResponseTest { .currency("string") .lastFour("string") .owner("string") - .ownerType(ExternalBankAccountRetrieveResponse.OwnerType.INDIVIDUAL) + .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() @@ -54,17 +54,17 @@ class ExternalBankAccountRetrieveResponseTest { assertThat(externalBankAccountRetrieveResponse.lastFour()).isEqualTo("string") assertThat(externalBankAccountRetrieveResponse.owner()).isEqualTo("string") assertThat(externalBankAccountRetrieveResponse.ownerType()) - .isEqualTo(ExternalBankAccountRetrieveResponse.OwnerType.INDIVIDUAL) + .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/ExternalBankAccountUpdateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/ExternalBankAccountUpdateParamsTest.kt index 561301c1..ccb50778 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 @@ -28,7 +28,7 @@ class ExternalBankAccountUpdateParamsTest { .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) + .ownerType(OwnerType.BUSINESS) .userDefinedId("string") .build() } @@ -53,7 +53,7 @@ class ExternalBankAccountUpdateParamsTest { .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) + .ownerType(OwnerType.BUSINESS) .userDefinedId("string") .build() val body = params.getBody() @@ -74,7 +74,7 @@ class ExternalBankAccountUpdateParamsTest { assertThat(body.doingBusinessAs()).isEqualTo("string") assertThat(body.name()).isEqualTo("x") assertThat(body.owner()).isEqualTo("x") - assertThat(body.ownerType()).isEqualTo(OwnerType.INDIVIDUAL) + assertThat(body.ownerType()).isEqualTo(OwnerType.BUSINESS) assertThat(body.userDefinedId()).isEqualTo("string") } 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 99c30d4a..f68404ab 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 @@ -19,13 +19,13 @@ class ExternalBankAccountUpdateResponseTest { .currency("string") .lastFour("string") .owner("string") - .ownerType(ExternalBankAccountUpdateResponse.OwnerType.INDIVIDUAL) + .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() @@ -54,17 +54,17 @@ class ExternalBankAccountUpdateResponseTest { assertThat(externalBankAccountUpdateResponse.lastFour()).isEqualTo("string") assertThat(externalBankAccountUpdateResponse.owner()).isEqualTo("string") assertThat(externalBankAccountUpdateResponse.ownerType()) - .isEqualTo(ExternalBankAccountUpdateResponse.OwnerType.INDIVIDUAL) + .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 39b279cb..472f47f3 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 @@ -13,7 +13,7 @@ class FinancialTransactionTest { val financialTransaction = FinancialTransaction.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - .category(FinancialTransaction.Category.CARD) + .category(FinancialTransaction.Category.ACH) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("string") .descriptor("string") @@ -39,7 +39,7 @@ class FinancialTransactionTest { .build() assertThat(financialTransaction).isNotNull assertThat(financialTransaction.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") - assertThat(financialTransaction.category()).isEqualTo(FinancialTransaction.Category.CARD) + assertThat(financialTransaction.category()).isEqualTo(FinancialTransaction.Category.ACH) assertThat(financialTransaction.created()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(financialTransaction.currency()).isEqualTo("string") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/KybTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/KybTest.kt index f51633ff..c429bb7d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/KybTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/KybTest.kt @@ -34,7 +34,7 @@ class KybTest { ) .beneficialOwnerIndividuals( listOf( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") @@ -74,7 +74,7 @@ class KybTest { .build() ) .controlPerson( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") @@ -122,7 +122,7 @@ class KybTest { ) assertThat(kyb.beneficialOwnerIndividuals()) .containsExactly( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") @@ -163,7 +163,7 @@ class KybTest { ) assertThat(kyb.controlPerson()) .isEqualTo( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") 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 471f421a..b28e4228 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 @@ -15,7 +15,7 @@ class LineItemListResponseTest { LineItemListResponse.builder() .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .amount(123L) - .category(LineItemListResponse.Category.CARD) + .category(LineItemListResponse.Category.ACH) .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .currency("string") .eventType(LineItemListResponse.FinancialEventType.ACH_INSUFFICIENT_FUNDS) @@ -28,7 +28,7 @@ class LineItemListResponseTest { assertThat(lineItemListResponse).isNotNull assertThat(lineItemListResponse.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(lineItemListResponse.amount()).isEqualTo(123L) - assertThat(lineItemListResponse.category()).isEqualTo(LineItemListResponse.Category.CARD) + assertThat(lineItemListResponse.category()).isEqualTo(LineItemListResponse.Category.ACH) assertThat(lineItemListResponse.created()) .isEqualTo(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) assertThat(lineItemListResponse.currency()).isEqualTo("string") 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 75887f76..7cf747c4 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 @@ -19,13 +19,13 @@ class MicroDepositCreateResponseTest { .currency("string") .lastFour("string") .owner("string") - .ownerType(MicroDepositCreateResponse.OwnerType.INDIVIDUAL) + .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() @@ -54,17 +54,17 @@ class MicroDepositCreateResponseTest { assertThat(microDepositCreateResponse.lastFour()).isEqualTo("string") assertThat(microDepositCreateResponse.owner()).isEqualTo("string") assertThat(microDepositCreateResponse.ownerType()) - .isEqualTo(MicroDepositCreateResponse.OwnerType.INDIVIDUAL) + .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/PaymentCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt index 2a886b72..364390e1 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt @@ -17,14 +17,14 @@ class PaymentCreateParamsTest { .method(PaymentCreateParams.Method.ACH_NEXT_DAY) .methodAttributes( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .companyId("string") .receiptRoutingNumber("string") .retries(123L) .returnReasonCode("string") .build() ) - .type(PaymentCreateParams.Type.PAYMENT) + .type(PaymentCreateParams.Type.COLLECTION) .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") .userDefinedId("string") @@ -41,14 +41,14 @@ class PaymentCreateParamsTest { .method(PaymentCreateParams.Method.ACH_NEXT_DAY) .methodAttributes( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .companyId("string") .receiptRoutingNumber("string") .retries(123L) .returnReasonCode("string") .build() ) - .type(PaymentCreateParams.Type.PAYMENT) + .type(PaymentCreateParams.Type.COLLECTION) .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") .userDefinedId("string") @@ -63,14 +63,14 @@ class PaymentCreateParamsTest { assertThat(body.methodAttributes()) .isEqualTo( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .companyId("string") .receiptRoutingNumber("string") .retries(123L) .returnReasonCode("string") .build() ) - assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.PAYMENT) + assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.COLLECTION) assertThat(body.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.memo()).isEqualTo("string") assertThat(body.userDefinedId()).isEqualTo("string") @@ -86,10 +86,10 @@ class PaymentCreateParamsTest { .method(PaymentCreateParams.Method.ACH_NEXT_DAY) .methodAttributes( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .build() ) - .type(PaymentCreateParams.Type.PAYMENT) + .type(PaymentCreateParams.Type.COLLECTION) .build() val body = params.getBody() assertThat(body).isNotNull @@ -101,9 +101,9 @@ class PaymentCreateParamsTest { assertThat(body.methodAttributes()) .isEqualTo( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .build() ) - assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.PAYMENT) + assertThat(body.type()).isEqualTo(PaymentCreateParams.Type.COLLECTION) } } diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementDetailTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementDetailTest.kt index 49027a84..d2d25056 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementDetailTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementDetailTest.kt @@ -22,7 +22,7 @@ class SettlementDetailTest { .eventTokens(listOf("string")) .institution("00001") .interchangeGrossAmount(123L) - .network(SettlementDetail.Network.MASTERCARD) + .network(SettlementDetail.Network.INTERLINK) .otherFeesDetails(SettlementDetail.OtherFeesDetails.builder().isa(123L).build()) .otherFeesGrossAmount(123L) .reportDate("2023-06-01") @@ -45,7 +45,7 @@ class SettlementDetailTest { assertThat(settlementDetail.eventTokens()).containsExactly("string") assertThat(settlementDetail.institution()).isEqualTo("00001") assertThat(settlementDetail.interchangeGrossAmount()).isEqualTo(123L) - assertThat(settlementDetail.network()).isEqualTo(SettlementDetail.Network.MASTERCARD) + assertThat(settlementDetail.network()).isEqualTo(SettlementDetail.Network.INTERLINK) assertThat(settlementDetail.otherFeesDetails()) .isEqualTo(SettlementDetail.OtherFeesDetails.builder().isa(123L).build()) assertThat(settlementDetail.otherFeesGrossAmount()).isEqualTo(123L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementReportTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementReportTest.kt index 3c1b1294..f052891d 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementReportTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementReportTest.kt @@ -20,7 +20,7 @@ class SettlementReportTest { .disputesGrossAmount(123L) .institution("00001") .interchangeGrossAmount(123L) - .network(SettlementSummaryDetails.Network.MASTERCARD) + .network(SettlementSummaryDetails.Network.INTERLINK) .otherFeesGrossAmount(123L) .settledNetAmount(123L) .transactionsGrossAmount(123L) @@ -45,7 +45,7 @@ class SettlementReportTest { .disputesGrossAmount(123L) .institution("00001") .interchangeGrossAmount(123L) - .network(SettlementSummaryDetails.Network.MASTERCARD) + .network(SettlementSummaryDetails.Network.INTERLINK) .otherFeesGrossAmount(123L) .settledNetAmount(123L) .transactionsGrossAmount(123L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryDetailsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryDetailsTest.kt index 8fe2dd24..a63a72c7 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryDetailsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryDetailsTest.kt @@ -14,7 +14,7 @@ class SettlementSummaryDetailsTest { .disputesGrossAmount(123L) .institution("00001") .interchangeGrossAmount(123L) - .network(SettlementSummaryDetails.Network.MASTERCARD) + .network(SettlementSummaryDetails.Network.INTERLINK) .otherFeesGrossAmount(123L) .settledNetAmount(123L) .transactionsGrossAmount(123L) @@ -24,7 +24,7 @@ class SettlementSummaryDetailsTest { assertThat(settlementSummaryDetails.institution()).contains("00001") assertThat(settlementSummaryDetails.interchangeGrossAmount()).contains(123L) assertThat(settlementSummaryDetails.network()) - .contains(SettlementSummaryDetails.Network.MASTERCARD) + .contains(SettlementSummaryDetails.Network.INTERLINK) assertThat(settlementSummaryDetails.otherFeesGrossAmount()).contains(123L) assertThat(settlementSummaryDetails.settledNetAmount()).contains(123L) assertThat(settlementSummaryDetails.transactionsGrossAmount()).contains(123L) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryResponseTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryResponseTest.kt deleted file mode 100644 index 86b16796..00000000 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/SettlementSummaryResponseTest.kt +++ /dev/null @@ -1,73 +0,0 @@ -// File generated from our OpenAPI spec by Stainless. - -package com.lithic.api.models - -import java.time.OffsetDateTime -import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.Test - -class SettlementSummaryResponseTest { - - @Test - fun createSettlementSummaryResponse() { - val settlementSummaryResponse = - SettlementSummaryResponse.builder() - .data( - listOf( - SettlementReport.builder() - .created(OffsetDateTime.parse("2023-06-01T00:00:00Z")) - .currency("840") - .details( - listOf( - SettlementSummaryDetails.builder() - .disputesGrossAmount(123L) - .institution("00001") - .interchangeGrossAmount(123L) - .network(SettlementSummaryDetails.Network.MASTERCARD) - .otherFeesGrossAmount(123L) - .settledNetAmount(123L) - .transactionsGrossAmount(123L) - .build() - ) - ) - .disputesGrossAmount(123L) - .interchangeGrossAmount(123L) - .otherFeesGrossAmount(123L) - .reportDate("2023-06-01") - .settledNetAmount(123L) - .transactionsGrossAmount(123L) - .updated(OffsetDateTime.parse("2023-06-01T00:00:00Z")) - .build() - ) - ) - .build() - assertThat(settlementSummaryResponse).isNotNull - assertThat(settlementSummaryResponse.data()) - .containsExactly( - SettlementReport.builder() - .created(OffsetDateTime.parse("2023-06-01T00:00:00Z")) - .currency("840") - .details( - listOf( - SettlementSummaryDetails.builder() - .disputesGrossAmount(123L) - .institution("00001") - .interchangeGrossAmount(123L) - .network(SettlementSummaryDetails.Network.MASTERCARD) - .otherFeesGrossAmount(123L) - .settledNetAmount(123L) - .transactionsGrossAmount(123L) - .build() - ) - ) - .disputesGrossAmount(123L) - .interchangeGrossAmount(123L) - .otherFeesGrossAmount(123L) - .reportDate("2023-06-01") - .settledNetAmount(123L) - .transactionsGrossAmount(123L) - .updated(OffsetDateTime.parse("2023-06-01T00:00:00Z")) - .build() - ) - } -} diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionTest.kt index 1bf02e79..812e8d69 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransactionTest.kt @@ -26,6 +26,12 @@ class TransactionTest { .token("0c2adae9-f535-4505-8c35-421dad9bd0b6") .amount(123L) .created(OffsetDateTime.parse("2018-05-29T21:16:05Z")) + .detailedResults( + listOf( + Transaction.TransactionEvent.DetailedResult + .ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ) + ) .result(Transaction.TransactionEvent.Result.ACCOUNT_STATE_TRANSACTION) .type(Transaction.TransactionEvent.Type.AUTHORIZATION) .build() @@ -56,9 +62,11 @@ class TransactionTest { .AUTHENTICATION_OUTAGE_EXCEPTION ) .authenticationResult( - Transaction.CardholderAuthentication.AuthenticationResult.SUCCESS + Transaction.CardholderAuthentication.AuthenticationResult.ATTEMPTS + ) + .decisionMadeBy( + Transaction.CardholderAuthentication.DecisionMadeBy.CUSTOMER_ENDPOINT ) - .decisionMadeBy(Transaction.CardholderAuthentication.DecisionMadeBy.NETWORK) .liabilityShift( Transaction.CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED ) @@ -88,6 +96,12 @@ class TransactionTest { .token("0c2adae9-f535-4505-8c35-421dad9bd0b6") .amount(123L) .created(OffsetDateTime.parse("2018-05-29T21:16:05Z")) + .detailedResults( + listOf( + Transaction.TransactionEvent.DetailedResult + .ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED + ) + ) .result(Transaction.TransactionEvent.Result.ACCOUNT_STATE_TRANSACTION) .type(Transaction.TransactionEvent.Type.AUTHORIZATION) .build() @@ -119,9 +133,11 @@ class TransactionTest { .AUTHENTICATION_OUTAGE_EXCEPTION ) .authenticationResult( - Transaction.CardholderAuthentication.AuthenticationResult.SUCCESS + Transaction.CardholderAuthentication.AuthenticationResult.ATTEMPTS + ) + .decisionMadeBy( + Transaction.CardholderAuthentication.DecisionMadeBy.CUSTOMER_ENDPOINT ) - .decisionMadeBy(Transaction.CardholderAuthentication.DecisionMadeBy.NETWORK) .liabilityShift( Transaction.CardholderAuthentication.LiabilityShift._3DS_AUTHENTICATED ) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferCreateParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferCreateParamsTest.kt index 6542ebfc..83667ea6 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferCreateParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/models/TransferCreateParamsTest.kt @@ -14,8 +14,8 @@ class TransferCreateParamsTest { .amount(123L) .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() } @@ -26,16 +26,16 @@ class TransferCreateParamsTest { .amount(123L) .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() val body = params.getBody() assertThat(body).isNotNull assertThat(body.amount()).isEqualTo(123L) assertThat(body.from()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.to()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + assertThat(body.token()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") assertThat(body.memo()).isEqualTo("string") - assertThat(body.transactionToken()).isEqualTo("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") } @Test diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt index e1a0841e..2c90b475 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ErrorHandlingTest.kt @@ -60,7 +60,7 @@ class ErrorHandlingTest { fun cardsCreate200() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -70,6 +70,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -85,7 +86,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -100,7 +101,7 @@ class ErrorHandlingTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .lastFour("xxxx") - .state(Card.FundingAccount.State.ENABLED) + .state(Card.FundingAccount.State.DELETED) .type(Card.FundingAccount.Type.DEPOSITORY_CHECKING) .accountName("string") .nickname("x") @@ -110,7 +111,7 @@ class ErrorHandlingTest { .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(Card.State.CLOSED) - .type(Card.Type.VIRTUAL) + .type(Card.Type.MERCHANT_LOCKED) .authRuleTokens(listOf("string")) .cvv("776") .digitalCardArtToken("00000000-0000-0000-1000-000000000000") @@ -130,7 +131,7 @@ class ErrorHandlingTest { fun cardsCreate400() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -140,6 +141,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -155,7 +157,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -176,7 +178,7 @@ class ErrorHandlingTest { fun cardsCreate401() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -186,6 +188,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -201,7 +204,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -222,7 +225,7 @@ class ErrorHandlingTest { fun cardsCreate403() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -232,6 +235,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -247,7 +251,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -268,7 +272,7 @@ class ErrorHandlingTest { fun cardsCreate404() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -278,6 +282,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -293,7 +298,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -314,7 +319,7 @@ class ErrorHandlingTest { fun cardsCreate422() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -324,6 +329,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -339,7 +345,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -360,7 +366,7 @@ class ErrorHandlingTest { fun cardsCreate429() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -370,6 +376,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -385,7 +392,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -406,7 +413,7 @@ class ErrorHandlingTest { fun cardsCreate500() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -416,6 +423,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -431,7 +439,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -452,7 +460,7 @@ class ErrorHandlingTest { fun unexpectedStatusCode() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -462,6 +470,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -477,7 +486,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -503,7 +512,7 @@ class ErrorHandlingTest { fun invalidBody() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -513,6 +522,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -528,7 +538,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -548,7 +558,7 @@ class ErrorHandlingTest { fun invalidErrorBody() { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -558,6 +568,7 @@ class ErrorHandlingTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -573,7 +584,7 @@ class ErrorHandlingTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt index 7a3f85c2..2c713984 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/ServiceParamsTest.kt @@ -57,7 +57,7 @@ class ServiceParamsTest { val params = CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -67,6 +67,7 @@ class ServiceParamsTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -82,7 +83,7 @@ class ServiceParamsTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -100,7 +101,7 @@ class ServiceParamsTest { .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .created(OffsetDateTime.parse("2019-12-27T18:11:19.117Z")) .lastFour("xxxx") - .state(Card.FundingAccount.State.ENABLED) + .state(Card.FundingAccount.State.DELETED) .type(Card.FundingAccount.Type.DEPOSITORY_CHECKING) .accountName("string") .nickname("x") @@ -110,7 +111,7 @@ class ServiceParamsTest { .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(Card.State.CLOSED) - .type(Card.Type.VIRTUAL) + .type(Card.Type.MERCHANT_LOCKED) .authRuleTokens(listOf("string")) .cvv("776") .digitalCardArtToken("00000000-0000-0000-1000-000000000000") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AccountHolderServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AccountHolderServiceTest.kt index 48908cf1..6944b203 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AccountHolderServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/AccountHolderServiceTest.kt @@ -47,7 +47,7 @@ class AccountHolderServiceTest { ) .beneficialOwnerIndividuals( listOf( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") @@ -87,7 +87,7 @@ class AccountHolderServiceTest { .build() ) .controlPerson( - Kyb.Individual.builder() + Kyb.KybIndividual.builder() .address( Address.builder() .address1("123 Old Forest Way") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt index 9ac6f8fc..a3f9c146 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/CardServiceTest.kt @@ -24,7 +24,7 @@ class CardServiceTest { val card = cardService.create( CardCreateParams.builder() - .type(CardCreateParams.Type.VIRTUAL) + .type(CardCreateParams.Type.MERCHANT_LOCKED) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .cardProgramToken("00000000-0000-0000-1000-000000000000") .carrier(Carrier.builder().qrCodeUrl("string").build()) @@ -34,6 +34,7 @@ class CardServiceTest { .memo("New Card") .pin("string") .productId("1") + .replacementFor("00000000-0000-0000-1000-000000000000") .shippingAddress( ShippingAddress.builder() .address1("5 Broad Street") @@ -49,7 +50,7 @@ class CardServiceTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardCreateParams.ShippingMethod.STANDARD) + .shippingMethod(CardCreateParams.ShippingMethod._2_DAY) .spendLimit(123L) .spendLimitDuration(SpendLimitDuration.ANNUALLY) .state(CardCreateParams.State.OPEN) @@ -182,7 +183,45 @@ class CardServiceTest { .phoneNumber("+12124007676") .build() ) - .shippingMethod(CardReissueParams.ShippingMethod.STANDARD) + .shippingMethod(CardReissueParams.ShippingMethod._2_DAY) + .build() + ) + println(card) + card.validate() + } + + @Test + fun callRenew() { + val client = + LithicOkHttpClient.builder() + .baseUrl(TestServerExtension.BASE_URL) + .apiKey("My Lithic API Key") + .build() + val cardService = client.cards() + val card = + cardService.renew( + CardRenewParams.builder() + .cardToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .shippingAddress( + ShippingAddress.builder() + .address1("5 Broad Street") + .city("NEW YORK") + .country("USA") + .firstName("Michael") + .lastName("Bluth") + .postalCode("10001-1809") + .state("NY") + .address2("Unit 25A") + .email("johnny@appleseed.com") + .line2Text("The Bluth Company") + .phoneNumber("+12124007676") + .build() + ) + .carrier(Carrier.builder().qrCodeUrl("string").build()) + .expMonth("06") + .expYear("2027") + .productId("string") + .shippingMethod(CardRenewParams.ShippingMethod._2_DAY) .build() ) println(card) 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 1227e8bf..418506dd 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 @@ -24,17 +24,39 @@ class ExternalBankAccountServiceTest { val externalBankAccountCreateResponse = externalBankAccountService.create( ExternalBankAccountCreateParams.builder() - .forPlaidCreateBankAccountApiRequest( - ExternalBankAccountCreateParams.PlaidCreateBankAccountApiRequest.builder() + .forBankVerifiedCreateBankAccountApiRequest( + ExternalBankAccountCreateParams.BankVerifiedCreateBankAccountApiRequest + .builder() + .accountNumber("string") + .country("USD") + .currency("USD") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) - .processorToken("x") + .ownerType(OwnerType.BUSINESS) + .routingNumber("123456789") + .type( + ExternalBankAccountCreateParams + .BankVerifiedCreateBankAccountApiRequest + .AccountType + .CHECKING + ) .verificationMethod(VerificationMethod.MANUAL) .accountToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .address( + ExternalBankAccountAddress.builder() + .address1("x") + .city("x") + .country("USD") + .postalCode("11201") + .state("xx") + .address2("x") + .build() + ) .companyId("x") .dob(LocalDate.parse("2019-12-27")) .doingBusinessAs("string") + .name("x") .userDefinedId("string") + .verificationEnforcement(true) .build() ) .build() @@ -88,7 +110,7 @@ class ExternalBankAccountServiceTest { .doingBusinessAs("string") .name("x") .owner("x") - .ownerType(OwnerType.INDIVIDUAL) + .ownerType(OwnerType.BUSINESS) .userDefinedId("string") .build() ) 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 8fa172be..059428c2 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 @@ -29,14 +29,14 @@ class PaymentServiceTest { .method(PaymentCreateParams.Method.ACH_NEXT_DAY) .methodAttributes( PaymentCreateParams.PaymentMethodAttributes.builder() - .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD) + .secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.CCD) .companyId("string") .receiptRoutingNumber("string") .retries(123L) .returnReasonCode("string") .build() ) - .type(PaymentCreateParams.Type.PAYMENT) + .type(PaymentCreateParams.Type.COLLECTION) .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") .userDefinedId("string") diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferServiceTest.kt index b9d89903..c6c844c8 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/TransferServiceTest.kt @@ -25,8 +25,8 @@ class TransferServiceTest { .amount(123L) .from("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .to("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") + .token("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .memo("string") - .transactionToken("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e") .build() ) println(transferCreateResponse) diff --git a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceTest.kt b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceTest.kt index 2e5193a6..b2dfa119 100644 --- a/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceTest.kt +++ b/lithic-java-core/src/test/kotlin/com/lithic/api/services/blocking/reports/SettlementServiceTest.kt @@ -39,13 +39,13 @@ class SettlementServiceTest { .apiKey("My Lithic API Key") .build() val settlementService = client.reports().settlement() - val settlementSummaryResponse = + val settlementReport = settlementService.summary( ReportSettlementSummaryParams.builder() .reportDate(LocalDate.parse("2019-12-27")) .build() ) - println(settlementSummaryResponse) - settlementSummaryResponse.validate() + println(settlementReport) + settlementReport.validate() } }