diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Account.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Account.kt index 5b64db66..936aef65 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Account.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Account.kt @@ -22,6 +22,14 @@ import java.util.Objects class Account @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("spend_limit") + @ExcludeMissing + private val spendLimit: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), @JsonProperty("account_holder") @ExcludeMissing private val accountHolder: JsonField = JsonMissing.of(), @@ -31,32 +39,23 @@ private constructor( @JsonProperty("cardholder_currency") @ExcludeMissing private val cardholderCurrency: JsonField = JsonMissing.of(), - @JsonProperty("spend_limit") - @ExcludeMissing - private val spendLimit: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("verification_address") @ExcludeMissing private val verificationAddress: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun accountHolder(): AccountHolder? = accountHolder.getNullable("account_holder") - /** - * List of identifiers for the Auth Rule(s) that are applied on the account. This field is - * deprecated and will no longer be populated in the `account_holder` object. The key will be - * removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth - * Rule information instead. + * Globally unique identifier for the account. This is the same as the account_token returned by + * the enroll endpoint. If using this parameter, do not include pagination. */ - fun authRuleTokens(): List? = authRuleTokens.getNullable("auth_rule_tokens") + fun token(): String = token.getRequired("token") - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") + /** + * Timestamp of when the account was created. For accounts created before 2023-05-11, this field + * will be null. + */ + fun created(): OffsetDateTime? = created.getNullable("created") /** * Spend limit information for the user containing the daily, monthly, and lifetime spend limit @@ -78,35 +77,33 @@ private constructor( */ fun state(): State = state.getRequired("state") + fun accountHolder(): AccountHolder? = accountHolder.getNullable("account_holder") + /** - * Globally unique identifier for the account. This is the same as the account_token returned by - * the enroll endpoint. If using this parameter, do not include pagination. + * List of identifiers for the Auth Rule(s) that are applied on the account. This field is + * deprecated and will no longer be populated in the `account_holder` object. The key will be + * removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth + * Rule information instead. */ - fun token(): String = token.getRequired("token") + fun authRuleTokens(): List? = authRuleTokens.getNullable("auth_rule_tokens") + + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") fun verificationAddress(): VerificationAddress? = verificationAddress.getNullable("verification_address") /** - * Timestamp of when the account was created. For accounts created before 2023-05-11, this field - * will be null. + * Globally unique identifier for the account. This is the same as the account_token returned by + * the enroll endpoint. If using this parameter, do not include pagination. */ - fun created(): OffsetDateTime? = created.getNullable("created") - - @JsonProperty("account_holder") @ExcludeMissing fun _accountHolder() = accountHolder + @JsonProperty("token") @ExcludeMissing fun _token() = token /** - * List of identifiers for the Auth Rule(s) that are applied on the account. This field is - * deprecated and will no longer be populated in the `account_holder` object. The key will be - * removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth - * Rule information instead. + * Timestamp of when the account was created. For accounts created before 2023-05-11, this field + * will be null. */ - @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens - - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - @JsonProperty("cardholder_currency") - @ExcludeMissing - fun _cardholderCurrency() = cardholderCurrency + @JsonProperty("created") @ExcludeMissing fun _created() = created /** * Spend limit information for the user containing the daily, monthly, and lifetime spend limit @@ -128,22 +125,25 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + @JsonProperty("account_holder") @ExcludeMissing fun _accountHolder() = accountHolder + /** - * Globally unique identifier for the account. This is the same as the account_token returned by - * the enroll endpoint. If using this parameter, do not include pagination. + * List of identifiers for the Auth Rule(s) that are applied on the account. This field is + * deprecated and will no longer be populated in the `account_holder` object. The key will be + * removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth + * Rule information instead. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens + + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + @JsonProperty("cardholder_currency") + @ExcludeMissing + fun _cardholderCurrency() = cardholderCurrency @JsonProperty("verification_address") @ExcludeMissing fun _verificationAddress() = verificationAddress - /** - * Timestamp of when the account was created. For accounts created before 2023-05-11, this field - * will be null. - */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -152,14 +152,14 @@ private constructor( fun validate(): Account = apply { if (!validated) { + token() + created() + spendLimit().validate() + state() accountHolder()?.validate() authRuleTokens() cardholderCurrency() - spendLimit().validate() - state() - token() verificationAddress()?.validate() - created() validated = true } } @@ -173,61 +173,51 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var spendLimit: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() private var accountHolder: JsonField = JsonMissing.of() private var authRuleTokens: JsonField> = JsonMissing.of() private var cardholderCurrency: JsonField = JsonMissing.of() - private var spendLimit: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var verificationAddress: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(account: Account) = apply { + token = account.token + created = account.created + spendLimit = account.spendLimit + state = account.state accountHolder = account.accountHolder authRuleTokens = account.authRuleTokens cardholderCurrency = account.cardholderCurrency - spendLimit = account.spendLimit - state = account.state - token = account.token verificationAddress = account.verificationAddress - created = account.created additionalProperties = account.additionalProperties.toMutableMap() } - fun accountHolder(accountHolder: AccountHolder) = accountHolder(JsonField.of(accountHolder)) - - fun accountHolder(accountHolder: JsonField) = apply { - this.accountHolder = accountHolder - } - /** - * List of identifiers for the Auth Rule(s) that are applied on the account. This field is - * deprecated and will no longer be populated in the `account_holder` object. The key will - * be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch - * Auth Rule information instead. + * Globally unique identifier for the account. This is the same as the account_token + * returned by the enroll endpoint. If using this parameter, do not include pagination. */ - fun authRuleTokens(authRuleTokens: List) = - authRuleTokens(JsonField.of(authRuleTokens)) + fun token(token: String) = token(JsonField.of(token)) /** - * List of identifiers for the Auth Rule(s) that are applied on the account. This field is - * deprecated and will no longer be populated in the `account_holder` object. The key will - * be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch - * Auth Rule information instead. + * Globally unique identifier for the account. This is the same as the account_token + * returned by the enroll endpoint. If using this parameter, do not include pagination. */ - fun authRuleTokens(authRuleTokens: JsonField>) = apply { - this.authRuleTokens = authRuleTokens - } + fun token(token: JsonField) = apply { this.token = token } - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(cardholderCurrency: String) = - cardholderCurrency(JsonField.of(cardholderCurrency)) + /** + * Timestamp of when the account was created. For accounts created before 2023-05-11, this + * field will be null. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(cardholderCurrency: JsonField) = apply { - this.cardholderCurrency = cardholderCurrency - } + /** + * Timestamp of when the account was created. For accounts created before 2023-05-11, this + * field will be null. + */ + fun created(created: JsonField) = apply { this.created = created } /** * Spend limit information for the user containing the daily, monthly, and lifetime spend @@ -271,17 +261,39 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + fun accountHolder(accountHolder: AccountHolder) = accountHolder(JsonField.of(accountHolder)) + + fun accountHolder(accountHolder: JsonField) = apply { + this.accountHolder = accountHolder + } + /** - * Globally unique identifier for the account. This is the same as the account_token - * returned by the enroll endpoint. If using this parameter, do not include pagination. + * List of identifiers for the Auth Rule(s) that are applied on the account. This field is + * deprecated and will no longer be populated in the `account_holder` object. The key will + * be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch + * Auth Rule information instead. */ - fun token(token: String) = token(JsonField.of(token)) + fun authRuleTokens(authRuleTokens: List) = + authRuleTokens(JsonField.of(authRuleTokens)) /** - * Globally unique identifier for the account. This is the same as the account_token - * returned by the enroll endpoint. If using this parameter, do not include pagination. + * List of identifiers for the Auth Rule(s) that are applied on the account. This field is + * deprecated and will no longer be populated in the `account_holder` object. The key will + * be removed from the schema in a future release. Use the `/auth_rules` endpoints to fetch + * Auth Rule information instead. */ - fun token(token: JsonField) = apply { this.token = token } + fun authRuleTokens(authRuleTokens: JsonField>) = apply { + this.authRuleTokens = authRuleTokens + } + + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(cardholderCurrency: String) = + cardholderCurrency(JsonField.of(cardholderCurrency)) + + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(cardholderCurrency: JsonField) = apply { + this.cardholderCurrency = cardholderCurrency + } fun verificationAddress(verificationAddress: VerificationAddress) = verificationAddress(JsonField.of(verificationAddress)) @@ -290,18 +302,6 @@ private constructor( this.verificationAddress = verificationAddress } - /** - * Timestamp of when the account was created. For accounts created before 2023-05-11, this - * field will be null. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** - * Timestamp of when the account was created. For accounts created before 2023-05-11, this - * field will be null. - */ - fun created(created: JsonField) = apply { this.created = created } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -323,14 +323,14 @@ private constructor( fun build(): Account = Account( + token, + created, + spendLimit, + state, accountHolder, authRuleTokens.map { it.toImmutable() }, cardholderCurrency, - spendLimit, - state, - token, verificationAddress, - created, additionalProperties.toImmutable(), ) } @@ -543,6 +543,9 @@ private constructor( class AccountHolder @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("business_account_token") @ExcludeMissing private val businessAccountToken: JsonField = JsonMissing.of(), @@ -552,13 +555,13 @@ private constructor( @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** 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 * businesses. Account_token of the enrolled business associated with an enrolled @@ -574,7 +577,7 @@ private constructor( fun phoneNumber(): String = phoneNumber.getRequired("phone_number") /** Globally unique identifier for the account holder. */ - fun token(): String = token.getRequired("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of @@ -591,9 +594,6 @@ private constructor( /** 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 @@ -602,10 +602,10 @@ private constructor( fun validate(): AccountHolder = apply { if (!validated) { + token() businessAccountToken() email() phoneNumber() - token() validated = true } } @@ -619,20 +619,26 @@ 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 token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolder: AccountHolder) = apply { + token = accountHolder.token businessAccountToken = accountHolder.businessAccountToken email = accountHolder.email phoneNumber = accountHolder.phoneNumber - token = accountHolder.token additionalProperties = accountHolder.additionalProperties.toMutableMap() } + /** Globally unique identifier for the account holder. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the account holder. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Only applicable for customers using the KYC-Exempt workflow to enroll authorized * users of businesses. Account_token of the enrolled business associated with an @@ -664,12 +670,6 @@ private constructor( 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. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -691,10 +691,10 @@ private constructor( fun build(): AccountHolder = AccountHolder( + token, businessAccountToken, email, phoneNumber, - token, additionalProperties.toImmutable(), ) } @@ -704,17 +704,17 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolder && businessAccountToken == other.businessAccountToken && email == other.email && phoneNumber == other.phoneNumber && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolder && token == other.token && businessAccountToken == other.businessAccountToken && email == other.email && phoneNumber == other.phoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(businessAccountToken, email, phoneNumber, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, businessAccountToken, email, phoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolder{businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, token=$token, additionalProperties=$additionalProperties}" + "AccountHolder{token=$token, businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -724,9 +724,6 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), @@ -739,6 +736,9 @@ private constructor( @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") + @ExcludeMissing + private val address2: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -746,9 +746,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(): String = address1.getRequired("address1") - /** Unit or apartment number (if applicable). */ - fun address2(): String? = address2.getNullable("address2") - /** City name. */ fun city(): String = city.getRequired("city") @@ -767,12 +764,12 @@ private constructor( */ fun state(): String = state.getRequired("state") + /** Unit or apartment number (if applicable). */ + fun address2(): String? = address2.getNullable("address2") + /** Valid deliverable address (no PO boxes). */ @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 - /** Unit or apartment number (if applicable). */ - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 - /** City name. */ @JsonProperty("city") @ExcludeMissing fun _city() = city @@ -791,6 +788,9 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Unit or apartment number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -800,11 +800,11 @@ private constructor( fun validate(): VerificationAddress = apply { if (!validated) { address1() - address2() city() country() postalCode() state() + address2() validated = true } } @@ -819,20 +819,20 @@ private constructor( class Builder { private var address1: JsonField = JsonMissing.of() - private var address2: JsonField = JsonMissing.of() private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() private var postalCode: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var address2: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(verificationAddress: VerificationAddress) = apply { address1 = verificationAddress.address1 - address2 = verificationAddress.address2 city = verificationAddress.city country = verificationAddress.country postalCode = verificationAddress.postalCode state = verificationAddress.state + address2 = verificationAddress.address2 additionalProperties = verificationAddress.additionalProperties.toMutableMap() } @@ -842,12 +842,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(address1: JsonField) = apply { this.address1 = address1 } - /** Unit or apartment number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit or apartment number (if applicable). */ - fun address2(address2: JsonField) = apply { this.address2 = address2 } - /** City name. */ fun city(city: String) = city(JsonField.of(city)) @@ -886,6 +880,12 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + /** Unit or apartment number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit or apartment number (if applicable). */ + fun address2(address2: JsonField) = apply { this.address2 = address2 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -908,11 +908,11 @@ private constructor( fun build(): VerificationAddress = VerificationAddress( address1, - address2, city, country, postalCode, state, + address2, additionalProperties.toImmutable(), ) } @@ -922,17 +922,17 @@ private constructor( return true } - return /* spotless:off */ other is VerificationAddress && address1 == other.address1 && address2 == other.address2 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is VerificationAddress && address1 == other.address1 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && address2 == other.address2 && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, country, postalCode, state, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, postalCode, state, address2, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "VerificationAddress{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" + "VerificationAddress{address1=$address1, city=$city, country=$country, postalCode=$postalCode, state=$state, address2=$address2, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -940,15 +940,15 @@ private constructor( return true } - return /* spotless:off */ other is Account && accountHolder == other.accountHolder && authRuleTokens == other.authRuleTokens && cardholderCurrency == other.cardholderCurrency && spendLimit == other.spendLimit && state == other.state && token == other.token && verificationAddress == other.verificationAddress && created == other.created && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Account && token == other.token && created == other.created && spendLimit == other.spendLimit && state == other.state && accountHolder == other.accountHolder && authRuleTokens == other.authRuleTokens && cardholderCurrency == other.cardholderCurrency && verificationAddress == other.verificationAddress && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountHolder, authRuleTokens, cardholderCurrency, spendLimit, state, token, verificationAddress, created, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, spendLimit, state, accountHolder, authRuleTokens, cardholderCurrency, verificationAddress, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Account{accountHolder=$accountHolder, authRuleTokens=$authRuleTokens, cardholderCurrency=$cardholderCurrency, spendLimit=$spendLimit, state=$state, token=$token, verificationAddress=$verificationAddress, created=$created, additionalProperties=$additionalProperties}" + "Account{token=$token, created=$created, spendLimit=$spendLimit, state=$state, accountHolder=$accountHolder, authRuleTokens=$authRuleTokens, cardholderCurrency=$cardholderCurrency, verificationAddress=$verificationAddress, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt index db82aa32..c26d21a2 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolder.kt @@ -22,6 +22,10 @@ import java.util.Objects class AccountHolder @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), @@ -42,9 +46,6 @@ private constructor( @JsonProperty("control_person") @ExcludeMissing private val controlPerson: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), @JsonProperty("exemption_type") @ExcludeMissing @@ -61,13 +62,15 @@ private constructor( @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("required_documents") + @ExcludeMissing + private val requiredDocuments: JsonField> = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), @JsonProperty("status_reasons") @ExcludeMissing private val statusReasons: JsonField> = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("user_type") @ExcludeMissing private val userType: JsonField = JsonMissing.of(), @@ -75,15 +78,18 @@ private constructor( @ExcludeMissing private val verificationApplication: JsonField = JsonMissing.of(), - @JsonProperty("required_documents") - @ExcludeMissing - private val requiredDocuments: JsonField> = JsonMissing.of(), @JsonProperty("website_url") @ExcludeMissing private val websiteUrl: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for the account holder. */ + fun token(): String = token.getRequired("token") + + /** Timestamp of when the account holder was created. */ + fun created(): OffsetDateTime = created.getRequired("created") + /** Globally unique identifier for the account. */ fun accountToken(): String? = accountToken.getNullable("account_token") @@ -126,9 +132,6 @@ private constructor( fun controlPerson(): AccountHolderIndividualResponse? = controlPerson.getNullable("control_person") - /** Timestamp of when the account holder was created. */ - fun created(): OffsetDateTime = created.getRequired("created") - /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -161,6 +164,13 @@ private constructor( */ fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") + /** + * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to + * be approved. + */ + fun requiredDocuments(): List? = + requiredDocuments.getNullable("required_documents") + /** * * @@ -176,9 +186,6 @@ private constructor( */ fun statusReasons(): List? = statusReasons.getNullable("status_reasons") - /** Globally unique identifier for the account holder. */ - fun token(): String = token.getRequired("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", @@ -191,16 +198,15 @@ private constructor( fun verificationApplication(): AccountHolderVerificationApplication? = verificationApplication.getNullable("verification_application") - /** - * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to - * be approved. - */ - fun requiredDocuments(): List? = - requiredDocuments.getNullable("required_documents") - /** Only present when user_type == "BUSINESS". Business's primary website. */ fun websiteUrl(): String? = websiteUrl.getNullable("website_url") + /** Globally unique identifier for the account holder. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** Timestamp of when the account holder was created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Globally unique identifier for the account. */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken @@ -245,9 +251,6 @@ private constructor( */ @JsonProperty("control_person") @ExcludeMissing fun _controlPerson() = controlPerson - /** Timestamp of when the account holder was created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -280,6 +283,12 @@ private constructor( */ @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + /** + * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to + * be approved. + */ + @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments + /** * * @@ -295,9 +304,6 @@ 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", @@ -311,12 +317,6 @@ private constructor( @ExcludeMissing fun _verificationApplication() = verificationApplication - /** - * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to - * be approved. - */ - @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments - /** Only present when user_type == "BUSINESS". Business's primary website. */ @JsonProperty("website_url") @ExcludeMissing fun _websiteUrl() = websiteUrl @@ -328,25 +328,25 @@ private constructor( fun validate(): AccountHolder = apply { if (!validated) { + token() + created() accountToken() beneficialOwnerEntities()?.forEach { it.validate() } beneficialOwnerIndividuals()?.forEach { it.validate() } businessAccountToken() businessEntity()?.validate() controlPerson()?.validate() - created() email() exemptionType() externalId() individual()?.validate() natureOfBusiness() phoneNumber() + requiredDocuments()?.forEach { it.validate() } status() statusReasons() - token() userType() verificationApplication()?.validate() - requiredDocuments()?.forEach { it.validate() } websiteUrl() validated = true } @@ -361,6 +361,8 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() private var beneficialOwnerEntities: JsonField> = JsonMissing.of() @@ -369,47 +371,57 @@ private constructor( private var businessAccountToken: JsonField = JsonMissing.of() private var businessEntity: JsonField = JsonMissing.of() private var controlPerson: 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 requiredDocuments: 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 requiredDocuments: JsonField> = JsonMissing.of() private var websiteUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolder: AccountHolder) = apply { + token = accountHolder.token + created = accountHolder.created accountToken = accountHolder.accountToken beneficialOwnerEntities = accountHolder.beneficialOwnerEntities beneficialOwnerIndividuals = accountHolder.beneficialOwnerIndividuals businessAccountToken = accountHolder.businessAccountToken businessEntity = accountHolder.businessEntity controlPerson = accountHolder.controlPerson - created = accountHolder.created email = accountHolder.email exemptionType = accountHolder.exemptionType externalId = accountHolder.externalId individual = accountHolder.individual natureOfBusiness = accountHolder.natureOfBusiness phoneNumber = accountHolder.phoneNumber + requiredDocuments = accountHolder.requiredDocuments status = accountHolder.status statusReasons = accountHolder.statusReasons - token = accountHolder.token userType = accountHolder.userType verificationApplication = accountHolder.verificationApplication - requiredDocuments = accountHolder.requiredDocuments websiteUrl = accountHolder.websiteUrl additionalProperties = accountHolder.additionalProperties.toMutableMap() } + /** Globally unique identifier for the account holder. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the account holder. */ + fun token(token: JsonField) = apply { this.token = token } + + /** Timestamp of when the account holder was created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Timestamp of when the account holder was created. */ + fun created(created: JsonField) = apply { this.created = created } + /** Globally unique identifier for the account. */ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) @@ -504,12 +516,6 @@ private constructor( this.controlPerson = controlPerson } - /** Timestamp of when the account holder was created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Timestamp of when the account holder was created. */ - fun created(created: JsonField) = apply { this.created = created } - /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use * individual.phone_number when user_type == "INDIVIDUAL". @@ -586,6 +592,21 @@ private constructor( */ fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } + /** + * Only present for "KYB_BASIC" workflow. A list of documents required for the account + * holder to be approved. + */ + fun requiredDocuments(requiredDocuments: List) = + requiredDocuments(JsonField.of(requiredDocuments)) + + /** + * Only present for "KYB_BASIC" workflow. A list of documents required for the account + * holder to be approved. + */ + fun requiredDocuments(requiredDocuments: JsonField>) = apply { + this.requiredDocuments = requiredDocuments + } + /** * * @@ -621,12 +642,6 @@ 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. */ - 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", @@ -652,21 +667,6 @@ private constructor( verificationApplication: JsonField ) = apply { this.verificationApplication = verificationApplication } - /** - * Only present for "KYB_BASIC" workflow. A list of documents required for the account - * holder to be approved. - */ - fun requiredDocuments(requiredDocuments: List) = - requiredDocuments(JsonField.of(requiredDocuments)) - - /** - * Only present for "KYB_BASIC" workflow. A list of documents required for the account - * holder to be approved. - */ - fun requiredDocuments(requiredDocuments: JsonField>) = apply { - this.requiredDocuments = requiredDocuments - } - /** Only present when user_type == "BUSINESS". Business's primary website. */ fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) @@ -694,25 +694,25 @@ private constructor( fun build(): AccountHolder = AccountHolder( + token, + created, accountToken, beneficialOwnerEntities.map { it.toImmutable() }, beneficialOwnerIndividuals.map { it.toImmutable() }, businessAccountToken, businessEntity, controlPerson, - created, email, exemptionType, externalId, individual, natureOfBusiness, phoneNumber, + requiredDocuments.map { it.toImmutable() }, status, statusReasons.map { it.toImmutable() }, - token, userType, verificationApplication, - requiredDocuments.map { it.toImmutable() }, websiteUrl, additionalProperties.toImmutable(), ) @@ -728,21 +728,21 @@ private constructor( @JsonProperty("dba_business_name") @ExcludeMissing private val dbaBusinessName: JsonField = JsonMissing.of(), + @JsonProperty("entity_token") + @ExcludeMissing + private val entityToken: JsonField = JsonMissing.of(), @JsonProperty("government_id") @ExcludeMissing private val governmentId: JsonField = JsonMissing.of(), @JsonProperty("legal_business_name") @ExcludeMissing private val legalBusinessName: JsonField = JsonMissing.of(), - @JsonProperty("parent_company") - @ExcludeMissing - private val parentCompany: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField> = JsonMissing.of(), - @JsonProperty("entity_token") + @JsonProperty("parent_company") @ExcludeMissing - private val entityToken: JsonField = JsonMissing.of(), + private val parentCompany: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -759,6 +759,9 @@ private constructor( */ fun dbaBusinessName(): String = dbaBusinessName.getRequired("dba_business_name") + /** Globally unique identifier for the entity. */ + fun entityToken(): String = entityToken.getRequired("entity_token") + /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. @@ -768,14 +771,11 @@ private constructor( /** Legal (formal) business name. */ fun legalBusinessName(): String = legalBusinessName.getRequired("legal_business_name") - /** Parent company name (if applicable). */ - fun parentCompany(): String? = parentCompany.getNullable("parent_company") - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(): List = phoneNumbers.getRequired("phone_numbers") - /** Globally unique identifier for the entity. */ - fun entityToken(): String = entityToken.getRequired("entity_token") + /** Parent company name (if applicable). */ + fun parentCompany(): String? = parentCompany.getNullable("parent_company") /** * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; @@ -789,6 +789,9 @@ private constructor( */ @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName + /** Globally unique identifier for the entity. */ + @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken + /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. @@ -800,14 +803,11 @@ private constructor( @ExcludeMissing fun _legalBusinessName() = legalBusinessName - /** Parent company name (if applicable). */ - @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers - /** Globally unique identifier for the entity. */ - @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken + /** Parent company name (if applicable). */ + @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany @JsonAnyGetter @ExcludeMissing @@ -819,11 +819,11 @@ private constructor( if (!validated) { address().validate() dbaBusinessName() + entityToken() governmentId() legalBusinessName() - parentCompany() phoneNumbers() - entityToken() + parentCompany() validated = true } } @@ -839,22 +839,22 @@ private constructor( private var address: JsonField
= JsonMissing.of() private var dbaBusinessName: JsonField = JsonMissing.of() + private var entityToken: JsonField = JsonMissing.of() private var governmentId: JsonField = JsonMissing.of() private var legalBusinessName: JsonField = JsonMissing.of() - private var parentCompany: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() - private var entityToken: JsonField = JsonMissing.of() + private var parentCompany: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolderBusinessResponse: AccountHolderBusinessResponse) = apply { address = accountHolderBusinessResponse.address dbaBusinessName = accountHolderBusinessResponse.dbaBusinessName + entityToken = accountHolderBusinessResponse.entityToken governmentId = accountHolderBusinessResponse.governmentId legalBusinessName = accountHolderBusinessResponse.legalBusinessName - parentCompany = accountHolderBusinessResponse.parentCompany phoneNumbers = accountHolderBusinessResponse.phoneNumbers - entityToken = accountHolderBusinessResponse.entityToken + parentCompany = accountHolderBusinessResponse.parentCompany additionalProperties = accountHolderBusinessResponse.additionalProperties.toMutableMap() } @@ -886,6 +886,14 @@ private constructor( this.dbaBusinessName = dbaBusinessName } + /** Globally unique identifier for the entity. */ + fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) + + /** Globally unique identifier for the entity. */ + fun entityToken(entityToken: JsonField) = apply { + this.entityToken = entityToken + } + /** * Government-issued identification number. US Federal Employer Identification Numbers * (EIN) are currently supported, entered as full nine-digits, with or without hyphens. @@ -909,14 +917,6 @@ private constructor( this.legalBusinessName = legalBusinessName } - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) - - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: JsonField) = apply { - this.parentCompany = parentCompany - } - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -925,12 +925,12 @@ private constructor( this.phoneNumbers = phoneNumbers } - /** Globally unique identifier for the entity. */ - fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) - /** Globally unique identifier for the entity. */ - fun entityToken(entityToken: JsonField) = apply { - this.entityToken = entityToken + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: JsonField) = apply { + this.parentCompany = parentCompany } fun additionalProperties(additionalProperties: Map) = apply { @@ -956,11 +956,11 @@ private constructor( AccountHolderBusinessResponse( address, dbaBusinessName, + entityToken, governmentId, legalBusinessName, - parentCompany, phoneNumbers.map { it.toImmutable() }, - entityToken, + parentCompany, additionalProperties.toImmutable(), ) } @@ -970,17 +970,17 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolderBusinessResponse && address == other.address && dbaBusinessName == other.dbaBusinessName && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && parentCompany == other.parentCompany && phoneNumbers == other.phoneNumbers && entityToken == other.entityToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolderBusinessResponse && address == other.address && dbaBusinessName == other.dbaBusinessName && entityToken == other.entityToken && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && phoneNumbers == other.phoneNumbers && parentCompany == other.parentCompany && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, dbaBusinessName, governmentId, legalBusinessName, parentCompany, phoneNumbers, entityToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, dbaBusinessName, entityToken, governmentId, legalBusinessName, phoneNumbers, parentCompany, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolderBusinessResponse{address=$address, dbaBusinessName=$dbaBusinessName, governmentId=$governmentId, legalBusinessName=$legalBusinessName, parentCompany=$parentCompany, phoneNumbers=$phoneNumbers, entityToken=$entityToken, additionalProperties=$additionalProperties}" + "AccountHolderBusinessResponse{address=$address, dbaBusinessName=$dbaBusinessName, entityToken=$entityToken, governmentId=$governmentId, legalBusinessName=$legalBusinessName, phoneNumbers=$phoneNumbers, parentCompany=$parentCompany, additionalProperties=$additionalProperties}" } /** @@ -998,6 +998,9 @@ private constructor( @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), + @JsonProperty("entity_token") + @ExcludeMissing + private val entityToken: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), @@ -1007,9 +1010,6 @@ private constructor( @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("entity_token") - @ExcludeMissing - private val entityToken: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -1023,6 +1023,9 @@ private constructor( /** Individual's email address. */ fun email(): String = email.getRequired("email") + /** Globally unique identifier for the entity. */ + fun entityToken(): String = entityToken.getRequired("entity_token") + /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(): String = firstName.getRequired("first_name") @@ -1032,9 +1035,6 @@ private constructor( /** Individual's phone number, entered in E.164 format. */ fun phoneNumber(): String = phoneNumber.getRequired("phone_number") - /** Globally unique identifier for the entity. */ - fun entityToken(): String = entityToken.getRequired("entity_token") - /** Individual's current address */ @JsonProperty("address") @ExcludeMissing fun _address() = address @@ -1044,6 +1044,9 @@ private constructor( /** Individual's email address. */ @JsonProperty("email") @ExcludeMissing fun _email() = email + /** Globally unique identifier for the entity. */ + @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken + /** Individual's first name, as it appears on government-issued identity documents. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @@ -1053,9 +1056,6 @@ private constructor( /** Individual's phone number, entered in E.164 format. */ @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber - /** Globally unique identifier for the entity. */ - @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1067,10 +1067,10 @@ private constructor( address().validate() dob() email() + entityToken() firstName() lastName() phoneNumber() - entityToken() validated = true } } @@ -1087,10 +1087,10 @@ private constructor( private var address: JsonField
= JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() + private var entityToken: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() - private var entityToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolderIndividualResponse: AccountHolderIndividualResponse) = @@ -1098,10 +1098,10 @@ private constructor( address = accountHolderIndividualResponse.address dob = accountHolderIndividualResponse.dob email = accountHolderIndividualResponse.email + entityToken = accountHolderIndividualResponse.entityToken firstName = accountHolderIndividualResponse.firstName lastName = accountHolderIndividualResponse.lastName phoneNumber = accountHolderIndividualResponse.phoneNumber - entityToken = accountHolderIndividualResponse.entityToken additionalProperties = accountHolderIndividualResponse.additionalProperties.toMutableMap() } @@ -1124,6 +1124,14 @@ private constructor( /** Individual's email address. */ fun email(email: JsonField) = apply { this.email = email } + /** Globally unique identifier for the entity. */ + fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) + + /** Globally unique identifier for the entity. */ + fun entityToken(entityToken: JsonField) = apply { + this.entityToken = entityToken + } + /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) @@ -1144,14 +1152,6 @@ private constructor( this.phoneNumber = phoneNumber } - /** Globally unique identifier for the entity. */ - fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) - - /** Globally unique identifier for the entity. */ - fun entityToken(entityToken: JsonField) = apply { - this.entityToken = entityToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1176,10 +1176,10 @@ private constructor( address, dob, email, + entityToken, firstName, lastName, phoneNumber, - entityToken, additionalProperties.toImmutable(), ) } @@ -1189,17 +1189,17 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolderIndividualResponse && address == other.address && dob == other.dob && email == other.email && firstName == other.firstName && lastName == other.lastName && phoneNumber == other.phoneNumber && entityToken == other.entityToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolderIndividualResponse && address == other.address && dob == other.dob && email == other.email && entityToken == other.entityToken && firstName == other.firstName && lastName == other.lastName && phoneNumber == other.phoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, dob, email, firstName, lastName, phoneNumber, entityToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, dob, email, entityToken, firstName, lastName, phoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolderIndividualResponse{address=$address, dob=$dob, email=$email, firstName=$firstName, lastName=$lastName, phoneNumber=$phoneNumber, entityToken=$entityToken, additionalProperties=$additionalProperties}" + "AccountHolderIndividualResponse{address=$address, dob=$dob, email=$email, entityToken=$entityToken, firstName=$firstName, lastName=$lastName, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } class ExemptionType @@ -1874,15 +1874,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolder && accountToken == other.accountToken && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && businessAccountToken == other.businessAccountToken && businessEntity == other.businessEntity && controlPerson == other.controlPerson && created == other.created && email == other.email && exemptionType == other.exemptionType && externalId == other.externalId && individual == other.individual && natureOfBusiness == other.natureOfBusiness && phoneNumber == other.phoneNumber && status == other.status && statusReasons == other.statusReasons && token == other.token && userType == other.userType && verificationApplication == other.verificationApplication && requiredDocuments == other.requiredDocuments && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolder && token == other.token && created == other.created && accountToken == other.accountToken && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && businessAccountToken == other.businessAccountToken && businessEntity == other.businessEntity && controlPerson == other.controlPerson && email == other.email && exemptionType == other.exemptionType && externalId == other.externalId && individual == other.individual && natureOfBusiness == other.natureOfBusiness && phoneNumber == other.phoneNumber && requiredDocuments == other.requiredDocuments && status == other.status && statusReasons == other.statusReasons && userType == other.userType && verificationApplication == other.verificationApplication && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, beneficialOwnerEntities, beneficialOwnerIndividuals, businessAccountToken, businessEntity, controlPerson, created, email, exemptionType, externalId, individual, natureOfBusiness, phoneNumber, status, statusReasons, token, userType, verificationApplication, requiredDocuments, websiteUrl, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, accountToken, beneficialOwnerEntities, beneficialOwnerIndividuals, businessAccountToken, businessEntity, controlPerson, email, exemptionType, externalId, individual, natureOfBusiness, phoneNumber, requiredDocuments, status, statusReasons, userType, verificationApplication, websiteUrl, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "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, requiredDocuments=$requiredDocuments, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}" + "AccountHolder{token=$token, created=$created, accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt index 82059881..9693420c 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderCreateResponse.kt @@ -22,40 +22,34 @@ import java.util.Objects class AccountHolderCreateResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), - @JsonProperty("external_id") - @ExcludeMissing - private val externalId: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), @JsonProperty("status_reasons") @ExcludeMissing private val statusReasons: JsonField> = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + private val externalId: JsonField = JsonMissing.of(), @JsonProperty("required_documents") @ExcludeMissing private val requiredDocuments: JsonField> = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for the account holder. */ + fun token(): String = token.getRequired("token") + /** Globally unique identifier for the account. */ fun accountToken(): String = accountToken.getRequired("account_token") - /** Timestamp of when the account holder was created. */ - fun created(): OffsetDateTime? = created.getNullable("created") - - /** - * Customer-provided token that indicates a relationship with an object outside of the Lithic - * ecosystem. - */ - fun externalId(): String? = externalId.getNullable("external_id") - /** * KYC and KYB evaluation states. * @@ -67,6 +61,15 @@ private constructor( /** Reason for the evaluation status. */ fun statusReasons(): List = statusReasons.getRequired("status_reasons") + /** Timestamp of when the account holder was created. */ + fun created(): OffsetDateTime? = created.getNullable("created") + + /** + * Customer-provided token that indicates a relationship with an object outside of the Lithic + * ecosystem. + */ + fun externalId(): String? = externalId.getNullable("external_id") + /** * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to * be approved. @@ -75,20 +78,11 @@ private constructor( requiredDocuments.getNullable("required_documents") /** Globally unique identifier for the account holder. */ - fun token(): String = token.getRequired("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Globally unique identifier for the account. */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** 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 - /** * KYC and KYB evaluation states. * @@ -100,15 +94,21 @@ private constructor( /** Reason for the evaluation status. */ @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons + /** 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 + /** * Only present for "KYB_BASIC" workflow. A list of documents required for the account holder to * be approved. */ @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments - /** Globally unique identifier for the account holder. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -117,13 +117,13 @@ private constructor( fun validate(): AccountHolderCreateResponse = apply { if (!validated) { + token() accountToken() - created() - externalId() status() statusReasons() + created() + externalId() requiredDocuments()?.forEach { it.validate() } - token() validated = true } } @@ -137,26 +137,32 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() - private var externalId: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var requiredDocuments: JsonField> = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolderCreateResponse: AccountHolderCreateResponse) = apply { + token = accountHolderCreateResponse.token accountToken = accountHolderCreateResponse.accountToken - created = accountHolderCreateResponse.created - externalId = accountHolderCreateResponse.externalId status = accountHolderCreateResponse.status statusReasons = accountHolderCreateResponse.statusReasons + created = accountHolderCreateResponse.created + externalId = accountHolderCreateResponse.externalId requiredDocuments = accountHolderCreateResponse.requiredDocuments - token = accountHolderCreateResponse.token additionalProperties = accountHolderCreateResponse.additionalProperties.toMutableMap() } + /** Globally unique identifier for the account holder. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the account holder. */ + fun token(token: JsonField) = apply { this.token = token } + /** Globally unique identifier for the account. */ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) @@ -165,24 +171,6 @@ private constructor( this.accountToken = accountToken } - /** Timestamp of when the account holder was created. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Timestamp of when the account holder was created. */ - 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. - */ - fun externalId(externalId: JsonField) = apply { this.externalId = externalId } - /** * KYC and KYB evaluation states. * @@ -208,6 +196,24 @@ private constructor( this.statusReasons = statusReasons } + /** Timestamp of when the account holder was created. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Timestamp of when the account holder was created. */ + 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. + */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + /** * Only present for "KYB_BASIC" workflow. A list of documents required for the account * holder to be approved. @@ -223,12 +229,6 @@ private constructor( this.requiredDocuments = requiredDocuments } - /** Globally unique identifier for the account holder. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the account holder. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -250,13 +250,13 @@ private constructor( fun build(): AccountHolderCreateResponse = AccountHolderCreateResponse( + token, accountToken, - created, - externalId, status, statusReasons.map { it.toImmutable() }, + created, + externalId, requiredDocuments.map { it.toImmutable() }, - token, additionalProperties.toImmutable(), ) } @@ -566,15 +566,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolderCreateResponse && accountToken == other.accountToken && created == other.created && externalId == other.externalId && status == other.status && statusReasons == other.statusReasons && requiredDocuments == other.requiredDocuments && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolderCreateResponse && token == other.token && accountToken == other.accountToken && status == other.status && statusReasons == other.statusReasons && created == other.created && externalId == other.externalId && requiredDocuments == other.requiredDocuments && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, created, externalId, status, statusReasons, requiredDocuments, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, status, statusReasons, created, externalId, requiredDocuments, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolderCreateResponse{accountToken=$accountToken, created=$created, externalId=$externalId, status=$status, statusReasons=$statusReasons, requiredDocuments=$requiredDocuments, token=$token, additionalProperties=$additionalProperties}" + "AccountHolderCreateResponse{token=$token, accountToken=$accountToken, status=$status, statusReasons=$statusReasons, created=$created, externalId=$externalId, requiredDocuments=$requiredDocuments, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt index 940fa58a..d790fc39 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderSimulateEnrollmentReviewResponse.kt @@ -26,58 +26,58 @@ private constructor( @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), + @JsonProperty("beneficial_owner_entities") + @ExcludeMissing + private val beneficialOwnerEntities: JsonField> = JsonMissing.of(), + @JsonProperty("beneficial_owner_individuals") + @ExcludeMissing + private val beneficialOwnerIndividuals: JsonField> = JsonMissing.of(), @JsonProperty("business_account_token") @ExcludeMissing private val businessAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("business_entity") + @ExcludeMissing + private val businessEntity: JsonField = JsonMissing.of(), + @JsonProperty("control_person") + @ExcludeMissing + private val controlPerson: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), + @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), @JsonProperty("exemption_type") @ExcludeMissing private val exemptionType: JsonField = JsonMissing.of(), @JsonProperty("external_id") @ExcludeMissing private val externalId: JsonField = JsonMissing.of(), - @JsonProperty("user_type") - @ExcludeMissing - private val userType: JsonField = JsonMissing.of(), - @JsonProperty("verification_application") - @ExcludeMissing - private val verificationApplication: JsonField = JsonMissing.of(), @JsonProperty("individual") @ExcludeMissing private val individual: JsonField = JsonMissing.of(), - @JsonProperty("business_entity") - @ExcludeMissing - private val businessEntity: JsonField = JsonMissing.of(), - @JsonProperty("beneficial_owner_entities") - @ExcludeMissing - private val beneficialOwnerEntities: JsonField> = JsonMissing.of(), - @JsonProperty("beneficial_owner_individuals") - @ExcludeMissing - private val beneficialOwnerIndividuals: JsonField> = JsonMissing.of(), - @JsonProperty("control_person") - @ExcludeMissing - private val controlPerson: JsonField = JsonMissing.of(), @JsonProperty("nature_of_business") @ExcludeMissing private val natureOfBusiness: JsonField = JsonMissing.of(), - @JsonProperty("website_url") - @ExcludeMissing - private val websiteUrl: JsonField = JsonMissing.of(), - @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), + @JsonProperty("required_documents") + @ExcludeMissing + private val requiredDocuments: JsonField> = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), @JsonProperty("status_reasons") @ExcludeMissing private val statusReasons: JsonField> = JsonMissing.of(), - @JsonProperty("required_documents") + @JsonProperty("user_type") @ExcludeMissing - private val requiredDocuments: JsonField> = JsonMissing.of(), + private val userType: JsonField = JsonMissing.of(), + @JsonProperty("verification_application") + @ExcludeMissing + private val verificationApplication: JsonField = JsonMissing.of(), + @JsonProperty("website_url") + @ExcludeMissing + private val websiteUrl: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -88,47 +88,25 @@ private constructor( fun accountToken(): String? = 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(): String? = businessAccountToken.getNullable("business_account_token") - - /** Timestamp of when the account holder was created. */ - fun created(): OffsetDateTime? = created.getNullable("created") - - /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is - * not KYC-Exempt. - */ - fun exemptionType(): ExemptionType? = exemptionType.getNullable("exemption_type") - - /** - * 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(): String? = externalId.getNullable("external_id") + fun beneficialOwnerEntities(): List? = + 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(): UserType? = userType.getNullable("user_type") - - /** Information about the most recent identity verification attempt */ - fun verificationApplication(): VerificationApplication? = - verificationApplication.getNullable("verification_application") + fun beneficialOwnerIndividuals(): List? = + 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(): Individual? = individual.getNullable("individual") + fun businessAccountToken(): String? = businessAccountToken.getNullable("business_account_token") /** * Only present when user_type == "BUSINESS". Information about the business for which the @@ -136,20 +114,6 @@ private constructor( */ fun businessEntity(): KybBusinessEntity? = businessEntity.getNullable("business_entity") - /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the - * company. - */ - fun beneficialOwnerEntities(): List? = - beneficialOwnerEntities.getNullable("beneficial_owner_entities") - - /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in the - * company. - */ - fun beneficialOwnerIndividuals(): List? = - beneficialOwnerIndividuals.getNullable("beneficial_owner_individuals") - /** * Only present when user_type == "BUSINESS". * @@ -164,11 +128,8 @@ private constructor( */ fun controlPerson(): Individual? = controlPerson.getNullable("control_person") - /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ - fun natureOfBusiness(): String? = natureOfBusiness.getNullable("nature_of_business") - - /** Only present when user_type == "BUSINESS". Business's primary website. */ - fun websiteUrl(): String? = websiteUrl.getNullable("website_url") + /** Timestamp of when the account holder was created. */ + fun created(): OffsetDateTime? = created.getNullable("created") /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use @@ -178,26 +139,32 @@ private constructor( fun email(): String? = email.getNullable("email") /** - * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use - * individual.phone_number when user_type == "INDIVIDUAL". - * > Primary phone of Account Holder, entered in E.164 format. + * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is + * not KYC-Exempt. */ - fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") + fun exemptionType(): ExemptionType? = exemptionType.getNullable("exemption_type") /** - * - * - * KYC and KYB evaluation states. - * - * Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `ADVANCED` - * workflow. + * Customer-provided token that indicates a relationship with an object outside of the Lithic + * ecosystem. */ - fun status(): Status? = status.getNullable("status") + fun externalId(): String? = externalId.getNullable("external_id") /** - * Reason for the evaluation status. + * Only present when user_type == "INDIVIDUAL". Information about the individual for which the + * account is being opened and KYC is being run. */ - fun statusReasons(): List? = statusReasons.getNullable("status_reasons") + fun individual(): Individual? = individual.getNullable("individual") + + /** Only present when user_type == "BUSINESS". User-submitted description of the business. */ + fun natureOfBusiness(): String? = natureOfBusiness.getNullable("nature_of_business") + + /** + * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use + * individual.phone_number when user_type == "INDIVIDUAL". + * > Primary phone of Account Holder, entered in E.164 format. + */ + fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") /** * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required for @@ -206,35 +173,20 @@ private constructor( fun requiredDocuments(): List? = requiredDocuments.getNullable("required_documents") - /** 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 - /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is - * not KYC-Exempt. + * + * + * KYC and KYB evaluation states. + * + * Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `ADVANCED` + * workflow. */ - @JsonProperty("exemption_type") @ExcludeMissing fun _exemptionType() = exemptionType + fun status(): Status? = status.getNullable("status") /** - * Customer-provided token that indicates a relationship with an object outside of the Lithic - * ecosystem. + * Reason for the evaluation status. */ - @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId + fun statusReasons(): List? = statusReasons.getNullable("status_reasons") /** * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be @@ -245,24 +197,20 @@ private constructor( * * "nature_of_business", and "website_url" attributes will be present. */ - @JsonProperty("user_type") @ExcludeMissing fun _userType() = userType + fun userType(): UserType? = userType.getNullable("user_type") /** Information about the most recent identity verification attempt */ - @JsonProperty("verification_application") - @ExcludeMissing - fun _verificationApplication() = verificationApplication + fun verificationApplication(): VerificationApplication? = + 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(): String? = 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 holder. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** 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 @@ -280,6 +228,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". * @@ -294,11 +257,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 @@ -307,6 +267,27 @@ private constructor( */ @JsonProperty("email") @ExcludeMissing fun _email() = email + /** + * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder is + * not KYC-Exempt. + */ + @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". @@ -314,6 +295,12 @@ private constructor( */ @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + /** + * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required for + * the account holder to be approved. + */ + @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments + /** * * @@ -330,10 +317,23 @@ private constructor( @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons /** - * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required for - * the account holder to be approved. - */ - @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments + * 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 @@ -345,24 +345,24 @@ private constructor( if (!validated) { token() accountToken() + beneficialOwnerEntities()?.forEach { it.validate() } + beneficialOwnerIndividuals()?.forEach { it.validate() } businessAccountToken() + businessEntity()?.validate() + controlPerson()?.validate() created() + email() exemptionType() externalId() - userType() - verificationApplication()?.validate() individual()?.validate() - businessEntity()?.validate() - beneficialOwnerEntities()?.forEach { it.validate() } - beneficialOwnerIndividuals()?.forEach { it.validate() } - controlPerson()?.validate() natureOfBusiness() - websiteUrl() - email() phoneNumber() + requiredDocuments()?.forEach { it.validate() } status() statusReasons() - requiredDocuments()?.forEach { it.validate() } + userType() + verificationApplication()?.validate() + websiteUrl() validated = true } } @@ -378,24 +378,24 @@ private constructor( private var token: JsonField = JsonMissing.of() private var accountToken: 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 created: JsonField = JsonMissing.of() + private var email: JsonField = JsonMissing.of() private var exemptionType: JsonField = JsonMissing.of() private var externalId: 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 controlPerson: JsonField = JsonMissing.of() private var natureOfBusiness: JsonField = JsonMissing.of() - private var websiteUrl: JsonField = JsonMissing.of() - private var email: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() + private var requiredDocuments: JsonField> = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() - private var requiredDocuments: 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() internal fun from( @@ -404,28 +404,28 @@ private constructor( ) = apply { token = accountHolderSimulateEnrollmentReviewResponse.token accountToken = accountHolderSimulateEnrollmentReviewResponse.accountToken + beneficialOwnerEntities = + accountHolderSimulateEnrollmentReviewResponse.beneficialOwnerEntities + beneficialOwnerIndividuals = + accountHolderSimulateEnrollmentReviewResponse.beneficialOwnerIndividuals businessAccountToken = accountHolderSimulateEnrollmentReviewResponse.businessAccountToken + businessEntity = accountHolderSimulateEnrollmentReviewResponse.businessEntity + controlPerson = accountHolderSimulateEnrollmentReviewResponse.controlPerson created = accountHolderSimulateEnrollmentReviewResponse.created + email = accountHolderSimulateEnrollmentReviewResponse.email exemptionType = accountHolderSimulateEnrollmentReviewResponse.exemptionType externalId = accountHolderSimulateEnrollmentReviewResponse.externalId - userType = accountHolderSimulateEnrollmentReviewResponse.userType - verificationApplication = - accountHolderSimulateEnrollmentReviewResponse.verificationApplication individual = accountHolderSimulateEnrollmentReviewResponse.individual - businessEntity = accountHolderSimulateEnrollmentReviewResponse.businessEntity - beneficialOwnerEntities = - accountHolderSimulateEnrollmentReviewResponse.beneficialOwnerEntities - beneficialOwnerIndividuals = - accountHolderSimulateEnrollmentReviewResponse.beneficialOwnerIndividuals - controlPerson = accountHolderSimulateEnrollmentReviewResponse.controlPerson natureOfBusiness = accountHolderSimulateEnrollmentReviewResponse.natureOfBusiness - websiteUrl = accountHolderSimulateEnrollmentReviewResponse.websiteUrl - email = accountHolderSimulateEnrollmentReviewResponse.email phoneNumber = accountHolderSimulateEnrollmentReviewResponse.phoneNumber + requiredDocuments = accountHolderSimulateEnrollmentReviewResponse.requiredDocuments status = accountHolderSimulateEnrollmentReviewResponse.status statusReasons = accountHolderSimulateEnrollmentReviewResponse.statusReasons - requiredDocuments = accountHolderSimulateEnrollmentReviewResponse.requiredDocuments + userType = accountHolderSimulateEnrollmentReviewResponse.userType + verificationApplication = + accountHolderSimulateEnrollmentReviewResponse.verificationApplication + websiteUrl = accountHolderSimulateEnrollmentReviewResponse.websiteUrl additionalProperties = accountHolderSimulateEnrollmentReviewResponse.additionalProperties.toMutableMap() } @@ -445,97 +445,53 @@ 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. - */ - 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. */ - fun created(created: JsonField) = apply { this.created = created } - - /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder - * is not KYC-Exempt. - */ - fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType)) - - /** - * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder - * is not KYC-Exempt. - */ - fun exemptionType(exemptionType: JsonField) = apply { - this.exemptionType = exemptionType - } - - /** - * 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(externalId: String) = externalId(JsonField.of(externalId)) + fun beneficialOwnerEntities(beneficialOwnerEntities: List) = + beneficialOwnerEntities(JsonField.of(beneficialOwnerEntities)) /** - * 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(externalId: JsonField) = apply { this.externalId = externalId } + fun beneficialOwnerEntities(beneficialOwnerEntities: JsonField>) = + apply { + this.beneficialOwnerEntities = beneficialOwnerEntities + } /** - * 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(userType: UserType) = userType(JsonField.of(userType)) + fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: List) = + beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) /** - * 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(userType: JsonField) = apply { this.userType = userType } - - /** Information about the most recent identity verification attempt */ - fun verificationApplication(verificationApplication: VerificationApplication) = - verificationApplication(JsonField.of(verificationApplication)) - - /** Information about the most recent identity verification attempt */ - fun verificationApplication(verificationApplication: JsonField) = + fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: JsonField>) = apply { - this.verificationApplication = verificationApplication + this.beneficialOwnerIndividuals = beneficialOwnerIndividuals } /** - * 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(individual: Individual) = individual(JsonField.of(individual)) + fun businessAccountToken(businessAccountToken: String) = + businessAccountToken(JsonField.of(businessAccountToken)) /** - * 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(individual: JsonField) = apply { this.individual = individual } + fun businessAccountToken(businessAccountToken: JsonField) = apply { + this.businessAccountToken = businessAccountToken + } /** * Only present when user_type == "BUSINESS". Information about the business for which the @@ -552,38 +508,6 @@ private constructor( this.businessEntity = businessEntity } - /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in - * the company. - */ - fun beneficialOwnerEntities(beneficialOwnerEntities: List) = - beneficialOwnerEntities(JsonField.of(beneficialOwnerEntities)) - - /** - * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in - * the company. - */ - fun beneficialOwnerEntities(beneficialOwnerEntities: JsonField>) = - apply { - this.beneficialOwnerEntities = beneficialOwnerEntities - } - - /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in - * the company. - */ - fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: List) = - beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals)) - - /** - * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in - * the company. - */ - fun beneficialOwnerIndividuals(beneficialOwnerIndividuals: JsonField>) = - apply { - this.beneficialOwnerIndividuals = beneficialOwnerIndividuals - } - /** * Only present when user_type == "BUSINESS". * @@ -614,24 +538,11 @@ 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. - */ - 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. */ - fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } + /** Timestamp of when the account holder was created. */ + fun created(created: JsonField) = apply { this.created = created } /** * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use @@ -647,6 +558,57 @@ private constructor( */ fun email(email: JsonField) = apply { this.email = email } + /** + * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder + * is not KYC-Exempt. + */ + fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType)) + + /** + * The type of KYC exemption for a KYC-Exempt Account Holder. "None" if the account holder + * is not KYC-Exempt. + */ + 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. + */ + 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: Individual) = 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. + */ + 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. + */ + 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". @@ -661,6 +623,21 @@ private constructor( */ fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } + /** + * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required + * for the account holder to be approved. + */ + fun requiredDocuments(requiredDocuments: List) = + requiredDocuments(JsonField.of(requiredDocuments)) + + /** + * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required + * for the account holder to be approved. + */ + fun requiredDocuments(requiredDocuments: JsonField>) = apply { + this.requiredDocuments = requiredDocuments + } + /** * * @@ -697,19 +674,42 @@ private constructor( } /** - * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required - * for the account holder to be approved. + * 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 requiredDocuments(requiredDocuments: List) = - requiredDocuments(JsonField.of(requiredDocuments)) + fun userType(userType: UserType) = userType(JsonField.of(userType)) /** - * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required - * for the account holder to be approved. + * 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 requiredDocuments(requiredDocuments: JsonField>) = apply { - this.requiredDocuments = requiredDocuments - } + fun userType(userType: JsonField) = apply { this.userType = userType } + + /** Information about the most recent identity verification attempt */ + fun verificationApplication(verificationApplication: VerificationApplication) = + verificationApplication(JsonField.of(verificationApplication)) + + /** Information about the most recent identity verification attempt */ + 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. */ + fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -734,24 +734,24 @@ private constructor( AccountHolderSimulateEnrollmentReviewResponse( token, accountToken, + beneficialOwnerEntities.map { it.toImmutable() }, + beneficialOwnerIndividuals.map { it.toImmutable() }, businessAccountToken, + businessEntity, + controlPerson, created, + email, exemptionType, externalId, - userType, - verificationApplication, individual, - businessEntity, - beneficialOwnerEntities.map { it.toImmutable() }, - beneficialOwnerIndividuals.map { it.toImmutable() }, - controlPerson, natureOfBusiness, - websiteUrl, - email, phoneNumber, + requiredDocuments.map { it.toImmutable() }, status, statusReasons.map { it.toImmutable() }, - requiredDocuments.map { it.toImmutable() }, + userType, + verificationApplication, + websiteUrl, additionalProperties.toImmutable(), ) } @@ -763,21 +763,21 @@ private constructor( @JsonProperty("address") @ExcludeMissing private val address: JsonField = JsonMissing.of(), - @JsonProperty("dba_business_name") - @ExcludeMissing - private val dbaBusinessName: JsonField = JsonMissing.of(), @JsonProperty("government_id") @ExcludeMissing private val governmentId: JsonField = JsonMissing.of(), @JsonProperty("legal_business_name") @ExcludeMissing private val legalBusinessName: JsonField = JsonMissing.of(), - @JsonProperty("parent_company") - @ExcludeMissing - private val parentCompany: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField> = JsonMissing.of(), + @JsonProperty("dba_business_name") + @ExcludeMissing + private val dbaBusinessName: JsonField = JsonMissing.of(), + @JsonProperty("parent_company") + @ExcludeMissing + private val parentCompany: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -788,12 +788,6 @@ private constructor( */ fun address(): Address2 = address.getRequired("address") - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(): String? = dbaBusinessName.getNullable("dba_business_name") - /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. @@ -803,23 +797,23 @@ private constructor( /** Legal (formal) business name. */ fun legalBusinessName(): String = legalBusinessName.getRequired("legal_business_name") - /** Parent company name (if applicable). */ - fun parentCompany(): String? = parentCompany.getNullable("parent_company") - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(): List = phoneNumbers.getRequired("phone_numbers") /** - * Business''s physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; - * APO/FPO are acceptable. + * Any name that the business operates under that is not its legal business name (if + * applicable). */ - @JsonProperty("address") @ExcludeMissing fun _address() = address + fun dbaBusinessName(): String? = dbaBusinessName.getNullable("dba_business_name") + + /** Parent company name (if applicable). */ + fun parentCompany(): String? = parentCompany.getNullable("parent_company") /** - * Any name that the business operates under that is not its legal business name (if - * applicable). + * Business''s physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; + * APO/FPO are acceptable. */ - @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName + @JsonProperty("address") @ExcludeMissing fun _address() = address /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) @@ -832,12 +826,18 @@ private constructor( @ExcludeMissing fun _legalBusinessName() = legalBusinessName - /** Parent company name (if applicable). */ - @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName + + /** Parent company name (if applicable). */ + @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -847,11 +847,11 @@ private constructor( fun validate(): KybBusinessEntity = apply { if (!validated) { address().validate() - dbaBusinessName() governmentId() legalBusinessName() - parentCompany() phoneNumbers() + dbaBusinessName() + parentCompany() validated = true } } @@ -866,20 +866,20 @@ private constructor( class Builder { private var address: JsonField = JsonMissing.of() - private var dbaBusinessName: JsonField = JsonMissing.of() private var governmentId: JsonField = JsonMissing.of() private var legalBusinessName: JsonField = JsonMissing.of() - private var parentCompany: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() + private var dbaBusinessName: JsonField = JsonMissing.of() + private var parentCompany: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(kybBusinessEntity: KybBusinessEntity) = apply { address = kybBusinessEntity.address - dbaBusinessName = kybBusinessEntity.dbaBusinessName governmentId = kybBusinessEntity.governmentId legalBusinessName = kybBusinessEntity.legalBusinessName - parentCompany = kybBusinessEntity.parentCompany phoneNumbers = kybBusinessEntity.phoneNumbers + dbaBusinessName = kybBusinessEntity.dbaBusinessName + parentCompany = kybBusinessEntity.parentCompany additionalProperties = kybBusinessEntity.additionalProperties.toMutableMap() } @@ -895,21 +895,6 @@ private constructor( */ fun address(address: JsonField) = apply { this.address = address } - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(dbaBusinessName: String) = - dbaBusinessName(JsonField.of(dbaBusinessName)) - - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(dbaBusinessName: JsonField) = apply { - this.dbaBusinessName = dbaBusinessName - } - /** * Government-issued identification number. US Federal Employer Identification Numbers * (EIN) are currently supported, entered as full nine-digits, with or without hyphens. @@ -933,14 +918,6 @@ private constructor( this.legalBusinessName = legalBusinessName } - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) - - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: JsonField) = apply { - this.parentCompany = parentCompany - } - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -949,6 +926,29 @@ private constructor( this.phoneNumbers = phoneNumbers } + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + fun dbaBusinessName(dbaBusinessName: String) = + dbaBusinessName(JsonField.of(dbaBusinessName)) + + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + fun dbaBusinessName(dbaBusinessName: JsonField) = apply { + this.dbaBusinessName = dbaBusinessName + } + + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) + + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: JsonField) = apply { + this.parentCompany = parentCompany + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -971,11 +971,11 @@ private constructor( fun build(): KybBusinessEntity = KybBusinessEntity( address, - dbaBusinessName, governmentId, legalBusinessName, - parentCompany, phoneNumbers.map { it.toImmutable() }, + dbaBusinessName, + parentCompany, additionalProperties.toImmutable(), ) } @@ -991,9 +991,6 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), @@ -1006,6 +1003,9 @@ private constructor( @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") + @ExcludeMissing + private val address2: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -1013,9 +1013,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(): String = address1.getRequired("address1") - /** Unit or apartment number (if applicable). */ - fun address2(): String? = address2.getNullable("address2") - /** Name of city. */ fun city(): String = city.getRequired("city") @@ -1037,12 +1034,12 @@ private constructor( */ fun state(): String = state.getRequired("state") + /** Unit or apartment number (if applicable). */ + fun address2(): String? = address2.getNullable("address2") + /** Valid deliverable address (no PO boxes). */ @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 - /** Unit or apartment number (if applicable). */ - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 - /** Name of city. */ @JsonProperty("city") @ExcludeMissing fun _city() = city @@ -1064,6 +1061,9 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Unit or apartment number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1073,11 +1073,11 @@ private constructor( fun validate(): Address2 = apply { if (!validated) { address1() - address2() city() country() postalCode() state() + address2() validated = true } } @@ -1092,20 +1092,20 @@ private constructor( class Builder { private var address1: JsonField = JsonMissing.of() - private var address2: JsonField = JsonMissing.of() private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() private var postalCode: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var address2: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address2: Address2) = apply { address1 = address2.address1 - this.address2 = address2.address2 city = address2.city country = address2.country postalCode = address2.postalCode state = address2.state + this.address2 = address2.address2 additionalProperties = address2.additionalProperties.toMutableMap() } @@ -1115,12 +1115,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(address1: JsonField) = apply { this.address1 = address1 } - /** Unit or apartment number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit or apartment number (if applicable). */ - fun address2(address2: JsonField) = apply { this.address2 = address2 } - /** Name of city. */ fun city(city: String) = city(JsonField.of(city)) @@ -1165,6 +1159,12 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + /** Unit or apartment number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit or apartment number (if applicable). */ + fun address2(address2: JsonField) = apply { this.address2 = address2 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1190,11 +1190,11 @@ private constructor( fun build(): Address2 = Address2( address1, - address2, city, country, postalCode, state, + address2, additionalProperties.toImmutable(), ) } @@ -1204,17 +1204,17 @@ private constructor( return true } - return /* spotless:off */ other is Address2 && address1 == other.address1 && address2 == other.address2 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Address2 && address1 == other.address1 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && address2 == other.address2 && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, country, postalCode, state, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, postalCode, state, address2, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Address2{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" + "Address2{address1=$address1, city=$city, country=$country, postalCode=$postalCode, state=$state, address2=$address2, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1222,17 +1222,17 @@ private constructor( return true } - return /* spotless:off */ other is KybBusinessEntity && address == other.address && dbaBusinessName == other.dbaBusinessName && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && parentCompany == other.parentCompany && phoneNumbers == other.phoneNumbers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is KybBusinessEntity && address == other.address && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && phoneNumbers == other.phoneNumbers && dbaBusinessName == other.dbaBusinessName && parentCompany == other.parentCompany && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, dbaBusinessName, governmentId, legalBusinessName, parentCompany, phoneNumbers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, governmentId, legalBusinessName, phoneNumbers, dbaBusinessName, parentCompany, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "KybBusinessEntity{address=$address, dbaBusinessName=$dbaBusinessName, governmentId=$governmentId, legalBusinessName=$legalBusinessName, parentCompany=$parentCompany, phoneNumbers=$phoneNumbers, additionalProperties=$additionalProperties}" + "KybBusinessEntity{address=$address, governmentId=$governmentId, legalBusinessName=$legalBusinessName, phoneNumbers=$phoneNumbers, dbaBusinessName=$dbaBusinessName, parentCompany=$parentCompany, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1249,15 +1249,15 @@ private constructor( @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), + @JsonProperty("government_id") + @ExcludeMissing + private val governmentId: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing private val lastName: JsonField = JsonMissing.of(), @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("government_id") - @ExcludeMissing - private val governmentId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -1280,12 +1280,6 @@ private constructor( /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(): String? = firstName.getNullable("first_name") - /** Individual's last name, as it appears on government-issued identity documents. */ - fun lastName(): String? = lastName.getNullable("last_name") - - /** Individual's phone number, entered in E.164 format. */ - fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") - /** * Government-issued identification number (required for identity verification and * compliance with banking regulations). Social Security Numbers (SSN) and Individual @@ -1294,6 +1288,12 @@ private constructor( */ fun governmentId(): String? = governmentId.getNullable("government_id") + /** Individual's last name, as it appears on government-issued identity documents. */ + fun lastName(): String? = lastName.getNullable("last_name") + + /** Individual's phone number, entered in E.164 format. */ + fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") + /** * Individual's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; * APO/FPO are acceptable. Only USA addresses are currently supported. @@ -1312,12 +1312,6 @@ private constructor( /** Individual's first name, as it appears on government-issued identity documents. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName - /** Individual's last name, as it appears on government-issued identity documents. */ - @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - - /** Individual's phone number, entered in E.164 format. */ - @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber - /** * Government-issued identification number (required for identity verification and * compliance with banking regulations). Social Security Numbers (SSN) and Individual @@ -1326,6 +1320,12 @@ private constructor( */ @JsonProperty("government_id") @ExcludeMissing fun _governmentId() = governmentId + /** Individual's last name, as it appears on government-issued identity documents. */ + @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName + + /** Individual's phone number, entered in E.164 format. */ + @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1338,9 +1338,9 @@ private constructor( dob() email() firstName() + governmentId() lastName() phoneNumber() - governmentId() validated = true } } @@ -1358,9 +1358,9 @@ private constructor( private var dob: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() + private var governmentId: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() - private var governmentId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(individual: Individual) = apply { @@ -1368,9 +1368,9 @@ private constructor( dob = individual.dob email = individual.email firstName = individual.firstName + governmentId = individual.governmentId lastName = individual.lastName phoneNumber = individual.phoneNumber - governmentId = individual.governmentId additionalProperties = individual.additionalProperties.toMutableMap() } @@ -1410,20 +1410,6 @@ private constructor( /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(firstName: JsonField) = apply { this.firstName = firstName } - /** Individual's last name, as it appears on government-issued identity documents. */ - fun lastName(lastName: String) = lastName(JsonField.of(lastName)) - - /** Individual's last name, as it appears on government-issued identity documents. */ - fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - - /** Individual's phone number, entered in E.164 format. */ - fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) - - /** Individual's phone number, entered in E.164 format. */ - fun phoneNumber(phoneNumber: JsonField) = apply { - this.phoneNumber = phoneNumber - } - /** * Government-issued identification number (required for identity verification and * compliance with banking regulations). Social Security Numbers (SSN) and Individual @@ -1442,6 +1428,20 @@ private constructor( this.governmentId = governmentId } + /** Individual's last name, as it appears on government-issued identity documents. */ + fun lastName(lastName: String) = lastName(JsonField.of(lastName)) + + /** Individual's last name, as it appears on government-issued identity documents. */ + fun lastName(lastName: JsonField) = apply { this.lastName = lastName } + + /** Individual's phone number, entered in E.164 format. */ + fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) + + /** Individual's phone number, entered in E.164 format. */ + fun phoneNumber(phoneNumber: JsonField) = apply { + this.phoneNumber = phoneNumber + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1467,9 +1467,9 @@ private constructor( dob, email, firstName, + governmentId, lastName, phoneNumber, - governmentId, additionalProperties.toImmutable(), ) } @@ -1485,9 +1485,6 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), @@ -1500,6 +1497,9 @@ private constructor( @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") + @ExcludeMissing + private val address2: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -1507,9 +1507,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(): String = address1.getRequired("address1") - /** Unit or apartment number (if applicable). */ - fun address2(): String? = address2.getNullable("address2") - /** Name of city. */ fun city(): String = city.getRequired("city") @@ -1531,12 +1528,12 @@ private constructor( */ fun state(): String = state.getRequired("state") + /** Unit or apartment number (if applicable). */ + fun address2(): String? = address2.getNullable("address2") + /** Valid deliverable address (no PO boxes). */ @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 - /** Unit or apartment number (if applicable). */ - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 - /** Name of city. */ @JsonProperty("city") @ExcludeMissing fun _city() = city @@ -1558,6 +1555,9 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Unit or apartment number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1567,11 +1567,11 @@ private constructor( fun validate(): Address2 = apply { if (!validated) { address1() - address2() city() country() postalCode() state() + address2() validated = true } } @@ -1586,20 +1586,20 @@ private constructor( class Builder { private var address1: JsonField = JsonMissing.of() - private var address2: JsonField = JsonMissing.of() private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() private var postalCode: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var address2: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address2: Address2) = apply { address1 = address2.address1 - this.address2 = address2.address2 city = address2.city country = address2.country postalCode = address2.postalCode state = address2.state + this.address2 = address2.address2 additionalProperties = address2.additionalProperties.toMutableMap() } @@ -1609,12 +1609,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(address1: JsonField) = apply { this.address1 = address1 } - /** Unit or apartment number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit or apartment number (if applicable). */ - fun address2(address2: JsonField) = apply { this.address2 = address2 } - /** Name of city. */ fun city(city: String) = city(JsonField.of(city)) @@ -1659,6 +1653,12 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + /** Unit or apartment number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit or apartment number (if applicable). */ + fun address2(address2: JsonField) = apply { this.address2 = address2 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1684,11 +1684,11 @@ private constructor( fun build(): Address2 = Address2( address1, - address2, city, country, postalCode, state, + address2, additionalProperties.toImmutable(), ) } @@ -1698,17 +1698,17 @@ private constructor( return true } - return /* spotless:off */ other is Address2 && address1 == other.address1 && address2 == other.address2 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Address2 && address1 == other.address1 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && address2 == other.address2 && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, country, postalCode, state, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, postalCode, state, address2, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Address2{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" + "Address2{address1=$address1, city=$city, country=$country, postalCode=$postalCode, state=$state, address2=$address2, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1716,17 +1716,17 @@ private constructor( return true } - return /* spotless:off */ other is Individual && address == other.address && dob == other.dob && email == other.email && firstName == other.firstName && lastName == other.lastName && phoneNumber == other.phoneNumber && governmentId == other.governmentId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Individual && address == other.address && dob == other.dob && email == other.email && firstName == other.firstName && governmentId == other.governmentId && lastName == other.lastName && phoneNumber == other.phoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, dob, email, firstName, lastName, phoneNumber, governmentId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, dob, email, firstName, governmentId, lastName, phoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Individual{address=$address, dob=$dob, email=$email, firstName=$firstName, lastName=$lastName, phoneNumber=$phoneNumber, governmentId=$governmentId, additionalProperties=$additionalProperties}" + "Individual{address=$address, dob=$dob, email=$email, firstName=$firstName, governmentId=$governmentId, lastName=$lastName, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } class ExemptionType @@ -2617,15 +2617,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolderSimulateEnrollmentReviewResponse && token == other.token && accountToken == other.accountToken && businessAccountToken == other.businessAccountToken && created == other.created && exemptionType == other.exemptionType && externalId == other.externalId && userType == other.userType && verificationApplication == other.verificationApplication && individual == other.individual && businessEntity == other.businessEntity && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && controlPerson == other.controlPerson && natureOfBusiness == other.natureOfBusiness && websiteUrl == other.websiteUrl && email == other.email && phoneNumber == other.phoneNumber && status == other.status && statusReasons == other.statusReasons && requiredDocuments == other.requiredDocuments && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolderSimulateEnrollmentReviewResponse && token == other.token && accountToken == other.accountToken && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && businessAccountToken == other.businessAccountToken && businessEntity == other.businessEntity && controlPerson == other.controlPerson && created == other.created && email == other.email && exemptionType == other.exemptionType && externalId == other.externalId && individual == other.individual && natureOfBusiness == other.natureOfBusiness && phoneNumber == other.phoneNumber && requiredDocuments == other.requiredDocuments && status == other.status && statusReasons == other.statusReasons && userType == other.userType && verificationApplication == other.verificationApplication && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, accountToken, businessAccountToken, created, exemptionType, externalId, userType, verificationApplication, individual, businessEntity, beneficialOwnerEntities, beneficialOwnerIndividuals, controlPerson, natureOfBusiness, websiteUrl, email, phoneNumber, status, statusReasons, requiredDocuments, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, beneficialOwnerEntities, beneficialOwnerIndividuals, businessAccountToken, businessEntity, controlPerson, created, email, exemptionType, externalId, individual, natureOfBusiness, phoneNumber, requiredDocuments, status, statusReasons, userType, verificationApplication, websiteUrl, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolderSimulateEnrollmentReviewResponse{token=$token, accountToken=$accountToken, businessAccountToken=$businessAccountToken, created=$created, exemptionType=$exemptionType, externalId=$externalId, 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, requiredDocuments=$requiredDocuments, additionalProperties=$additionalProperties}" + "AccountHolderSimulateEnrollmentReviewResponse{token=$token, 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, requiredDocuments=$requiredDocuments, status=$status, statusReasons=$statusReasons, userType=$userType, verificationApplication=$verificationApplication, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt index c6f9071c..803dc586 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AccountHolderUpdateResponse.kt @@ -19,6 +19,7 @@ import java.util.Objects class AccountHolderUpdateResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("business_account_token") @ExcludeMissing private val businessAccountToken: JsonField = JsonMissing.of(), @@ -26,10 +27,12 @@ private constructor( @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** The token for the account holder that was updated */ + fun token(): String? = token.getNullable("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 @@ -44,7 +47,7 @@ private constructor( fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") /** The token for the account holder that was updated */ - fun token(): String? = token.getNullable("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** * Only applicable for customers using the KYC-Exempt workflow to enroll businesses with @@ -61,9 +64,6 @@ private constructor( /** 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 @@ -72,10 +72,10 @@ private constructor( fun validate(): AccountHolderUpdateResponse = apply { if (!validated) { + token() businessAccountToken() email() phoneNumber() - token() validated = true } } @@ -89,20 +89,26 @@ 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 token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolderUpdateResponse: AccountHolderUpdateResponse) = apply { + token = accountHolderUpdateResponse.token businessAccountToken = accountHolderUpdateResponse.businessAccountToken email = accountHolderUpdateResponse.email phoneNumber = accountHolderUpdateResponse.phoneNumber - token = accountHolderUpdateResponse.token additionalProperties = accountHolderUpdateResponse.additionalProperties.toMutableMap() } + /** The token for the account holder that was updated */ + fun token(token: String) = token(JsonField.of(token)) + + /** The token for the account holder that was updated */ + fun token(token: JsonField) = apply { this.token = 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 @@ -132,12 +138,6 @@ private constructor( /** The newly updated phone_number for the account holder */ fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } - /** The token for the account holder that was updated */ - fun token(token: String) = token(JsonField.of(token)) - - /** The token for the account holder that was updated */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -159,10 +159,10 @@ private constructor( fun build(): AccountHolderUpdateResponse = AccountHolderUpdateResponse( + token, businessAccountToken, email, phoneNumber, - token, additionalProperties.toImmutable(), ) } @@ -172,15 +172,15 @@ private constructor( return true } - return /* spotless:off */ other is AccountHolderUpdateResponse && businessAccountToken == other.businessAccountToken && email == other.email && phoneNumber == other.phoneNumber && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountHolderUpdateResponse && token == other.token && businessAccountToken == other.businessAccountToken && email == other.email && phoneNumber == other.phoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(businessAccountToken, email, phoneNumber, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, businessAccountToken, email, phoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountHolderUpdateResponse{businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, token=$token, additionalProperties=$additionalProperties}" + "AccountHolderUpdateResponse{token=$token, businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Address.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Address.kt index 2a6a10f5..6ee354b2 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Address.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Address.kt @@ -22,9 +22,6 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), @JsonProperty("country") @ExcludeMissing @@ -33,15 +30,15 @@ private constructor( @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") + @ExcludeMissing + private val address2: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Valid deliverable address (no PO boxes). */ fun address1(): String = address1.getRequired("address1") - /** Unit or apartment number (if applicable). */ - fun address2(): String? = address2.getNullable("address2") - /** Name of city. */ fun city(): String = city.getRequired("city") @@ -64,12 +61,12 @@ private constructor( */ fun state(): String = state.getRequired("state") + /** Unit or apartment number (if applicable). */ + fun address2(): String? = address2.getNullable("address2") + /** Valid deliverable address (no PO boxes). */ @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 - /** Unit or apartment number (if applicable). */ - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 - /** Name of city. */ @JsonProperty("city") @ExcludeMissing fun _city() = city @@ -92,6 +89,9 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Unit or apartment number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -101,11 +101,11 @@ private constructor( fun validate(): Address = apply { if (!validated) { address1() - address2() city() country() postalCode() state() + address2() validated = true } } @@ -120,20 +120,20 @@ private constructor( class Builder { private var address1: JsonField = JsonMissing.of() - private var address2: JsonField = JsonMissing.of() private var city: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() private var postalCode: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var address2: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { address1 = address.address1 - address2 = address.address2 city = address.city country = address.country postalCode = address.postalCode state = address.state + address2 = address.address2 additionalProperties = address.additionalProperties.toMutableMap() } @@ -143,12 +143,6 @@ private constructor( /** Valid deliverable address (no PO boxes). */ fun address1(address1: JsonField) = apply { this.address1 = address1 } - /** Unit or apartment number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit or apartment number (if applicable). */ - fun address2(address2: JsonField) = apply { this.address2 = address2 } - /** Name of city. */ fun city(city: String) = city(JsonField.of(city)) @@ -193,6 +187,12 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + /** Unit or apartment number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit or apartment number (if applicable). */ + fun address2(address2: JsonField) = apply { this.address2 = address2 } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -215,11 +215,11 @@ private constructor( fun build(): Address = Address( address1, - address2, city, country, postalCode, state, + address2, additionalProperties.toImmutable(), ) } @@ -229,15 +229,15 @@ private constructor( return true } - return /* spotless:off */ other is Address && address1 == other.address1 && address2 == other.address2 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Address && address1 == other.address1 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && address2 == other.address2 && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, country, postalCode, state, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, postalCode, state, address2, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Address{address1=$address1, address2=$address2, city=$city, country=$country, postalCode=$postalCode, state=$state, additionalProperties=$additionalProperties}" + "Address{address1=$address1, city=$city, country=$country, postalCode=$postalCode, state=$state, address2=$address2, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt index 838044c2..28f4ff24 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRule.kt @@ -21,6 +21,8 @@ import java.util.Objects class AuthRule @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), @@ -42,11 +44,15 @@ private constructor( @JsonProperty("program_level") @ExcludeMissing private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + + /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ + fun state(): State = state.getRequired("state") + /** * 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. @@ -78,11 +84,11 @@ private constructor( /** Boolean indicating whether the Auth Rule is applied at the program level. */ fun programLevel(): Boolean? = programLevel.getNullable("program_level") - /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ - fun state(): State = state.getRequired("state") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** Indicates whether the Auth Rule is ACTIVE or INACTIVE */ + @JsonProperty("state") @ExcludeMissing fun _state() = state /** * Array of account_token(s) identifying the accounts that the Auth Rule applies to. Note that @@ -115,12 +121,6 @@ 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 @@ -129,6 +129,8 @@ private constructor( fun validate(): AuthRule = apply { if (!validated) { + token() + state() accountTokens() allowedCountries() allowedMcc() @@ -136,8 +138,6 @@ private constructor( blockedMcc() cardTokens() programLevel() - state() - token() validated = true } } @@ -151,6 +151,8 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() private var allowedCountries: JsonField> = JsonMissing.of() private var allowedMcc: JsonField> = JsonMissing.of() @@ -158,11 +160,11 @@ private constructor( 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() internal fun from(authRule: AuthRule) = apply { + token = authRule.token + state = authRule.state accountTokens = authRule.accountTokens allowedCountries = authRule.allowedCountries allowedMcc = authRule.allowedMcc @@ -170,11 +172,21 @@ private constructor( blockedMcc = authRule.blockedMcc cardTokens = authRule.cardTokens programLevel = authRule.programLevel - state = authRule.state - token = authRule.token additionalProperties = authRule.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + 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 */ + fun state(state: JsonField) = apply { this.state = state } + /** * 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. @@ -247,18 +259,6 @@ 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 */ - fun state(state: JsonField) = apply { this.state = state } - - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -280,6 +280,8 @@ private constructor( fun build(): AuthRule = AuthRule( + token, + state, accountTokens.map { it.toImmutable() }, allowedCountries.map { it.toImmutable() }, allowedMcc.map { it.toImmutable() }, @@ -287,8 +289,6 @@ private constructor( blockedMcc.map { it.toImmutable() }, cardTokens.map { it.toImmutable() }, programLevel, - state, - token, additionalProperties.toImmutable(), ) } @@ -355,15 +355,15 @@ private constructor( return true } - return /* spotless:off */ other is AuthRule && accountTokens == other.accountTokens && allowedCountries == other.allowedCountries && allowedMcc == other.allowedMcc && blockedCountries == other.blockedCountries && blockedMcc == other.blockedMcc && cardTokens == other.cardTokens && programLevel == other.programLevel && state == other.state && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AuthRule && token == other.token && state == other.state && accountTokens == other.accountTokens && allowedCountries == other.allowedCountries && allowedMcc == other.allowedMcc && blockedCountries == other.blockedCountries && blockedMcc == other.blockedMcc && cardTokens == other.cardTokens && programLevel == other.programLevel && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountTokens, allowedCountries, allowedMcc, blockedCountries, blockedMcc, cardTokens, programLevel, state, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, state, accountTokens, allowedCountries, allowedMcc, blockedCountries, blockedMcc, cardTokens, programLevel, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AuthRule{accountTokens=$accountTokens, allowedCountries=$allowedCountries, allowedMcc=$allowedMcc, blockedCountries=$blockedCountries, blockedMcc=$blockedMcc, cardTokens=$cardTokens, programLevel=$programLevel, state=$state, token=$token, additionalProperties=$additionalProperties}" + "AuthRule{token=$token, state=$state, accountTokens=$accountTokens, allowedCountries=$allowedCountries, allowedMcc=$allowedMcc, blockedCountries=$blockedCountries, blockedMcc=$blockedMcc, cardTokens=$cardTokens, programLevel=$programLevel, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt index 78825d62..e31f7d08 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthRuleV2CreateParams.kt @@ -377,9 +377,9 @@ constructor( @JsonCreator private constructor( @JsonProperty("account_tokens") private val accountTokens: List, - @JsonProperty("type") private val type: AuthRuleType?, - @JsonProperty("parameters") private val parameters: Parameters?, @JsonProperty("name") private val name: String?, + @JsonProperty("parameters") private val parameters: Parameters?, + @JsonProperty("type") private val type: AuthRuleType?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -387,14 +387,14 @@ constructor( /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") fun accountTokens(): List = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") fun type(): AuthRuleType? = type + /** Auth Rule Name */ + @JsonProperty("name") fun name(): String? = name /** Parameters for the current version of the Auth Rule */ @JsonProperty("parameters") fun parameters(): Parameters? = parameters - /** Auth Rule Name */ - @JsonProperty("name") fun name(): String? = name + /** The type of Auth Rule */ + @JsonProperty("type") fun type(): AuthRuleType? = type @JsonAnyGetter @ExcludeMissing @@ -410,18 +410,18 @@ constructor( class Builder { private var accountTokens: MutableList? = null - private var type: AuthRuleType? = null - private var parameters: Parameters? = null private var name: String? = null + private var parameters: Parameters? = null + private var type: AuthRuleType? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from( createAuthRuleRequestAccountTokens: CreateAuthRuleRequestAccountTokens ) = apply { accountTokens = createAuthRuleRequestAccountTokens.accountTokens.toMutableList() - type = createAuthRuleRequestAccountTokens.type - parameters = createAuthRuleRequestAccountTokens.parameters name = createAuthRuleRequestAccountTokens.name + parameters = createAuthRuleRequestAccountTokens.parameters + type = createAuthRuleRequestAccountTokens.type additionalProperties = createAuthRuleRequestAccountTokens.additionalProperties.toMutableMap() } @@ -436,8 +436,8 @@ constructor( accountTokens = (accountTokens ?: mutableListOf()).apply { add(accountToken) } } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = apply { this.type = type } + /** Auth Rule Name */ + fun name(name: String) = apply { this.name = name } /** Parameters for the current version of the Auth Rule */ fun parameters(parameters: Parameters) = apply { this.parameters = parameters } @@ -452,8 +452,8 @@ constructor( this.parameters = Parameters.ofVelocityLimitParams(velocityLimitParams) } - /** Auth Rule Name */ - fun name(name: String) = apply { this.name = name } + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -478,9 +478,9 @@ constructor( CreateAuthRuleRequestAccountTokens( checkNotNull(accountTokens) { "`accountTokens` is required but was not set" } .toImmutable(), - type, - parameters, name, + parameters, + type, additionalProperties.toImmutable(), ) } @@ -1259,17 +1259,17 @@ constructor( return true } - return /* spotless:off */ other is CreateAuthRuleRequestAccountTokens && accountTokens == other.accountTokens && type == other.type && parameters == other.parameters && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateAuthRuleRequestAccountTokens && accountTokens == other.accountTokens && name == other.name && parameters == other.parameters && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountTokens, type, parameters, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountTokens, name, parameters, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreateAuthRuleRequestAccountTokens{accountTokens=$accountTokens, type=$type, parameters=$parameters, name=$name, additionalProperties=$additionalProperties}" + "CreateAuthRuleRequestAccountTokens{accountTokens=$accountTokens, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1277,9 +1277,9 @@ constructor( @JsonCreator private constructor( @JsonProperty("card_tokens") private val cardTokens: List, - @JsonProperty("type") private val type: AuthRuleType?, - @JsonProperty("parameters") private val parameters: Parameters?, @JsonProperty("name") private val name: String?, + @JsonProperty("parameters") private val parameters: Parameters?, + @JsonProperty("type") private val type: AuthRuleType?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -1287,14 +1287,14 @@ constructor( /** Card tokens to which the Auth Rule applies. */ @JsonProperty("card_tokens") fun cardTokens(): List = cardTokens - /** The type of Auth Rule */ - @JsonProperty("type") fun type(): AuthRuleType? = type + /** Auth Rule Name */ + @JsonProperty("name") fun name(): String? = name /** Parameters for the current version of the Auth Rule */ @JsonProperty("parameters") fun parameters(): Parameters? = parameters - /** Auth Rule Name */ - @JsonProperty("name") fun name(): String? = name + /** The type of Auth Rule */ + @JsonProperty("type") fun type(): AuthRuleType? = type @JsonAnyGetter @ExcludeMissing @@ -1310,17 +1310,17 @@ constructor( class Builder { private var cardTokens: MutableList? = null - private var type: AuthRuleType? = null - private var parameters: Parameters? = null private var name: String? = null + private var parameters: Parameters? = null + private var type: AuthRuleType? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from(createAuthRuleRequestCardTokens: CreateAuthRuleRequestCardTokens) = apply { cardTokens = createAuthRuleRequestCardTokens.cardTokens.toMutableList() - type = createAuthRuleRequestCardTokens.type - parameters = createAuthRuleRequestCardTokens.parameters name = createAuthRuleRequestCardTokens.name + parameters = createAuthRuleRequestCardTokens.parameters + type = createAuthRuleRequestCardTokens.type additionalProperties = createAuthRuleRequestCardTokens.additionalProperties.toMutableMap() } @@ -1335,8 +1335,8 @@ constructor( cardTokens = (cardTokens ?: mutableListOf()).apply { add(cardToken) } } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = apply { this.type = type } + /** Auth Rule Name */ + fun name(name: String) = apply { this.name = name } /** Parameters for the current version of the Auth Rule */ fun parameters(parameters: Parameters) = apply { this.parameters = parameters } @@ -1351,8 +1351,8 @@ constructor( this.parameters = Parameters.ofVelocityLimitParams(velocityLimitParams) } - /** Auth Rule Name */ - fun name(name: String) = apply { this.name = name } + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1377,9 +1377,9 @@ constructor( CreateAuthRuleRequestCardTokens( checkNotNull(cardTokens) { "`cardTokens` is required but was not set" } .toImmutable(), - type, - parameters, name, + parameters, + type, additionalProperties.toImmutable(), ) } @@ -2158,17 +2158,17 @@ constructor( return true } - return /* spotless:off */ other is CreateAuthRuleRequestCardTokens && cardTokens == other.cardTokens && type == other.type && parameters == other.parameters && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateAuthRuleRequestCardTokens && cardTokens == other.cardTokens && name == other.name && parameters == other.parameters && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(cardTokens, type, parameters, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(cardTokens, name, parameters, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreateAuthRuleRequestCardTokens{cardTokens=$cardTokens, type=$type, parameters=$parameters, name=$name, additionalProperties=$additionalProperties}" + "CreateAuthRuleRequestCardTokens{cardTokens=$cardTokens, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -2177,9 +2177,9 @@ constructor( private constructor( @JsonProperty("program_level") private val programLevel: Boolean, @JsonProperty("excluded_card_tokens") private val excludedCardTokens: List?, - @JsonProperty("type") private val type: AuthRuleType?, - @JsonProperty("parameters") private val parameters: Parameters?, @JsonProperty("name") private val name: String?, + @JsonProperty("parameters") private val parameters: Parameters?, + @JsonProperty("type") private val type: AuthRuleType?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -2191,14 +2191,14 @@ constructor( @JsonProperty("excluded_card_tokens") fun excludedCardTokens(): List? = excludedCardTokens - /** The type of Auth Rule */ - @JsonProperty("type") fun type(): AuthRuleType? = type + /** Auth Rule Name */ + @JsonProperty("name") fun name(): String? = name /** Parameters for the current version of the Auth Rule */ @JsonProperty("parameters") fun parameters(): Parameters? = parameters - /** Auth Rule Name */ - @JsonProperty("name") fun name(): String? = name + /** The type of Auth Rule */ + @JsonProperty("type") fun type(): AuthRuleType? = type @JsonAnyGetter @ExcludeMissing @@ -2215,9 +2215,9 @@ constructor( private var programLevel: Boolean? = null private var excludedCardTokens: MutableList? = null - private var type: AuthRuleType? = null - private var parameters: Parameters? = null private var name: String? = null + private var parameters: Parameters? = null + private var type: AuthRuleType? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from( @@ -2226,9 +2226,9 @@ constructor( programLevel = createAuthRuleRequestProgramLevel.programLevel excludedCardTokens = createAuthRuleRequestProgramLevel.excludedCardTokens?.toMutableList() - type = createAuthRuleRequestProgramLevel.type - parameters = createAuthRuleRequestProgramLevel.parameters name = createAuthRuleRequestProgramLevel.name + parameters = createAuthRuleRequestProgramLevel.parameters + type = createAuthRuleRequestProgramLevel.type additionalProperties = createAuthRuleRequestProgramLevel.additionalProperties.toMutableMap() } @@ -2247,8 +2247,8 @@ constructor( (excludedCardTokens ?: mutableListOf()).apply { add(excludedCardToken) } } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = apply { this.type = type } + /** Auth Rule Name */ + fun name(name: String) = apply { this.name = name } /** Parameters for the current version of the Auth Rule */ fun parameters(parameters: Parameters) = apply { this.parameters = parameters } @@ -2263,8 +2263,8 @@ constructor( this.parameters = Parameters.ofVelocityLimitParams(velocityLimitParams) } - /** Auth Rule Name */ - fun name(name: String) = apply { this.name = name } + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -2289,9 +2289,9 @@ constructor( CreateAuthRuleRequestProgramLevel( checkNotNull(programLevel) { "`programLevel` is required but was not set" }, excludedCardTokens?.toImmutable(), - type, - parameters, name, + parameters, + type, additionalProperties.toImmutable(), ) } @@ -3070,17 +3070,17 @@ constructor( return true } - return /* spotless:off */ other is CreateAuthRuleRequestProgramLevel && programLevel == other.programLevel && excludedCardTokens == other.excludedCardTokens && type == other.type && parameters == other.parameters && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CreateAuthRuleRequestProgramLevel && programLevel == other.programLevel && excludedCardTokens == other.excludedCardTokens && name == other.name && parameters == other.parameters && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(programLevel, excludedCardTokens, type, parameters, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(programLevel, excludedCardTokens, name, parameters, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CreateAuthRuleRequestProgramLevel{programLevel=$programLevel, excludedCardTokens=$excludedCardTokens, type=$type, parameters=$parameters, name=$name, additionalProperties=$additionalProperties}" + "CreateAuthRuleRequestProgramLevel{programLevel=$programLevel, excludedCardTokens=$excludedCardTokens, name=$name, parameters=$parameters, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt index 49581be6..305aeb7b 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/AuthenticationRetrieveResponse.kt @@ -22,22 +22,13 @@ import java.util.Objects class AuthenticationRetrieveResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("account_type") @ExcludeMissing private val accountType: JsonField = JsonMissing.of(), - @JsonProperty("additional_data") - @ExcludeMissing - private val additionalData: JsonField = JsonMissing.of(), - @JsonProperty("app") @ExcludeMissing private val app: JsonField = JsonMissing.of(), - @JsonProperty("authentication_request_type") - @ExcludeMissing - private val authenticationRequestType: JsonField = JsonMissing.of(), @JsonProperty("authentication_result") @ExcludeMissing private val authenticationResult: JsonField = JsonMissing.of(), - @JsonProperty("browser") - @ExcludeMissing - private val browser: JsonField = JsonMissing.of(), @JsonProperty("card_expiry_check") @ExcludeMissing private val cardExpiryCheck: JsonField = JsonMissing.of(), @@ -62,53 +53,38 @@ private constructor( @JsonProperty("message_category") @ExcludeMissing private val messageCategory: JsonField = JsonMissing.of(), + @JsonProperty("additional_data") + @ExcludeMissing + private val additionalData: JsonField = JsonMissing.of(), + @JsonProperty("app") @ExcludeMissing private val app: JsonField = JsonMissing.of(), + @JsonProperty("authentication_request_type") + @ExcludeMissing + private val authenticationRequestType: JsonField = JsonMissing.of(), + @JsonProperty("browser") + @ExcludeMissing + private val browser: JsonField = JsonMissing.of(), @JsonProperty("three_ri_request_type") @ExcludeMissing private val threeRiRequestType: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("transaction") @ExcludeMissing private val transaction: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for the 3DS authentication. */ + fun token(): String = token.getRequired("token") + /** * Type of account/card that is being used for the transaction. Maps to EMV 3DS field * `acctType`. */ fun accountType(): AccountType? = accountType.getNullable("account_type") - /** - * Object containing additional data about the 3DS request that is beyond the EMV 3DS standard - * spec (e.g., specific fields that only certain card networks send but are not required across - * all 3DS requests). - */ - fun additionalData(): AdditionalData? = additionalData.getNullable("additional_data") - - /** - * Object containing data about the app used in the e-commerce transaction. Present if the - * channel is 'APP_BASED'. - */ - fun app(): App? = app.getNullable("app") - - /** - * Type of authentication request - i.e., the type of transaction or interaction is causing the - * merchant to request an authentication. Maps to EMV 3DS field - * threeDSRequestorAuthenticationInd. - */ - fun authenticationRequestType(): AuthenticationRequestType? = - authenticationRequestType.getNullable("authentication_request_type") - /** Indicates the outcome of the 3DS authentication process. */ fun authenticationResult(): AuthenticationResult? = authenticationResult.getNullable("authentication_result") - /** - * Object containing data about the browser used in the e-commerce transaction. Present if the - * channel is 'BROWSER'. - */ - fun browser(): Browser? = browser.getNullable("browser") - /** * Indicates whether the expiration date provided by the cardholder during checkout matches * Lithic's record of the card's expiration date. @@ -139,6 +115,33 @@ private constructor( */ fun messageCategory(): MessageCategory = messageCategory.getRequired("message_category") + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS standard + * spec (e.g., specific fields that only certain card networks send but are not required across + * all 3DS requests). + */ + fun additionalData(): AdditionalData? = additionalData.getNullable("additional_data") + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + */ + fun app(): App? = app.getNullable("app") + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing the + * merchant to request an authentication. Maps to EMV 3DS field + * threeDSRequestorAuthenticationInd. + */ + fun authenticationRequestType(): AuthenticationRequestType? = + authenticationRequestType.getNullable("authentication_request_type") + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if the + * channel is 'BROWSER'. + */ + fun browser(): Browser? = browser.getNullable("browser") + /** * Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that takes place at * the initiation of the merchant rather than the cardholder. The most common example of this is @@ -148,54 +151,26 @@ private constructor( fun threeRiRequestType(): ThreeRiRequestType? = threeRiRequestType.getNullable("three_ri_request_type") - /** Globally unique identifier for the 3DS authentication. */ - fun token(): String = token.getRequired("token") - /** * Object containing data about the e-commerce transaction for which the merchant is requesting * authentication. */ fun transaction(): Transaction? = transaction.getNullable("transaction") + /** Globally unique identifier for the 3DS authentication. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Type of account/card that is being used for the transaction. Maps to EMV 3DS field * `acctType`. */ @JsonProperty("account_type") @ExcludeMissing fun _accountType() = accountType - /** - * Object containing additional data about the 3DS request that is beyond the EMV 3DS standard - * spec (e.g., specific fields that only certain card networks send but are not required across - * all 3DS requests). - */ - @JsonProperty("additional_data") @ExcludeMissing fun _additionalData() = additionalData - - /** - * Object containing data about the app used in the e-commerce transaction. Present if the - * channel is 'APP_BASED'. - */ - @JsonProperty("app") @ExcludeMissing fun _app() = app - - /** - * Type of authentication request - i.e., the type of transaction or interaction is causing the - * merchant to request an authentication. Maps to EMV 3DS field - * threeDSRequestorAuthenticationInd. - */ - @JsonProperty("authentication_request_type") - @ExcludeMissing - fun _authenticationRequestType() = authenticationRequestType - /** Indicates the outcome of the 3DS authentication process. */ @JsonProperty("authentication_result") @ExcludeMissing fun _authenticationResult() = authenticationResult - /** - * Object containing data about the browser used in the e-commerce transaction. Present if the - * channel is 'BROWSER'. - */ - @JsonProperty("browser") @ExcludeMissing fun _browser() = browser - /** * Indicates whether the expiration date provided by the cardholder during checkout matches * Lithic's record of the card's expiration date. @@ -226,6 +201,34 @@ private constructor( */ @JsonProperty("message_category") @ExcludeMissing fun _messageCategory() = messageCategory + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS standard + * spec (e.g., specific fields that only certain card networks send but are not required across + * all 3DS requests). + */ + @JsonProperty("additional_data") @ExcludeMissing fun _additionalData() = additionalData + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + */ + @JsonProperty("app") @ExcludeMissing fun _app() = app + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing the + * merchant to request an authentication. Maps to EMV 3DS field + * threeDSRequestorAuthenticationInd. + */ + @JsonProperty("authentication_request_type") + @ExcludeMissing + fun _authenticationRequestType() = authenticationRequestType + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if the + * channel is 'BROWSER'. + */ + @JsonProperty("browser") @ExcludeMissing fun _browser() = browser + /** * Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that takes place at * the initiation of the merchant rather than the cardholder. The most common example of this is @@ -236,9 +239,6 @@ private constructor( @ExcludeMissing fun _threeRiRequestType() = threeRiRequestType - /** Globally unique identifier for the 3DS authentication. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * Object containing data about the e-commerce transaction for which the merchant is requesting * authentication. @@ -253,12 +253,9 @@ private constructor( fun validate(): AuthenticationRetrieveResponse = apply { if (!validated) { + token() accountType() - additionalData()?.validate() - app()?.validate() - authenticationRequestType() authenticationResult() - browser()?.validate() cardExpiryCheck() cardToken() cardholder().validate() @@ -267,8 +264,11 @@ private constructor( decisionMadeBy() merchant().validate() messageCategory() + additionalData()?.validate() + app()?.validate() + authenticationRequestType() + browser()?.validate() threeRiRequestType() - token() transaction()?.validate() validated = true } @@ -283,13 +283,9 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var accountType: JsonField = JsonMissing.of() - private var additionalData: JsonField = JsonMissing.of() - private var app: JsonField = JsonMissing.of() - private var authenticationRequestType: JsonField = - JsonMissing.of() private var authenticationResult: JsonField = JsonMissing.of() - private var browser: JsonField = JsonMissing.of() private var cardExpiryCheck: JsonField = JsonMissing.of() private var cardToken: JsonField = JsonMissing.of() private var cardholder: JsonField = JsonMissing.of() @@ -298,18 +294,19 @@ private constructor( private var decisionMadeBy: JsonField = JsonMissing.of() private var merchant: JsonField = JsonMissing.of() private var messageCategory: JsonField = JsonMissing.of() + private var additionalData: JsonField = JsonMissing.of() + private var app: JsonField = JsonMissing.of() + private var authenticationRequestType: JsonField = + JsonMissing.of() + private var browser: JsonField = JsonMissing.of() private var threeRiRequestType: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var transaction: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(authenticationRetrieveResponse: AuthenticationRetrieveResponse) = apply { + token = authenticationRetrieveResponse.token accountType = authenticationRetrieveResponse.accountType - additionalData = authenticationRetrieveResponse.additionalData - app = authenticationRetrieveResponse.app - authenticationRequestType = authenticationRetrieveResponse.authenticationRequestType authenticationResult = authenticationRetrieveResponse.authenticationResult - browser = authenticationRetrieveResponse.browser cardExpiryCheck = authenticationRetrieveResponse.cardExpiryCheck cardToken = authenticationRetrieveResponse.cardToken cardholder = authenticationRetrieveResponse.cardholder @@ -318,13 +315,22 @@ private constructor( decisionMadeBy = authenticationRetrieveResponse.decisionMadeBy merchant = authenticationRetrieveResponse.merchant messageCategory = authenticationRetrieveResponse.messageCategory + additionalData = authenticationRetrieveResponse.additionalData + app = authenticationRetrieveResponse.app + authenticationRequestType = authenticationRetrieveResponse.authenticationRequestType + browser = authenticationRetrieveResponse.browser threeRiRequestType = authenticationRetrieveResponse.threeRiRequestType - token = authenticationRetrieveResponse.token transaction = authenticationRetrieveResponse.transaction additionalProperties = authenticationRetrieveResponse.additionalProperties.toMutableMap() } + /** Globally unique identifier for the 3DS authentication. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the 3DS authentication. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Type of account/card that is being used for the transaction. Maps to EMV 3DS field * `acctType`. @@ -339,52 +345,6 @@ private constructor( this.accountType = accountType } - /** - * Object containing additional data about the 3DS request that is beyond the EMV 3DS - * standard spec (e.g., specific fields that only certain card networks send but are not - * required across all 3DS requests). - */ - fun additionalData(additionalData: AdditionalData) = - additionalData(JsonField.of(additionalData)) - - /** - * Object containing additional data about the 3DS request that is beyond the EMV 3DS - * standard spec (e.g., specific fields that only certain card networks send but are not - * required across all 3DS requests). - */ - fun additionalData(additionalData: JsonField) = apply { - this.additionalData = additionalData - } - - /** - * Object containing data about the app used in the e-commerce transaction. Present if the - * channel is 'APP_BASED'. - */ - fun app(app: App) = app(JsonField.of(app)) - - /** - * Object containing data about the app used in the e-commerce transaction. Present if the - * channel is 'APP_BASED'. - */ - fun app(app: JsonField) = apply { this.app = app } - - /** - * Type of authentication request - i.e., the type of transaction or interaction is causing - * the merchant to request an authentication. Maps to EMV 3DS field - * threeDSRequestorAuthenticationInd. - */ - fun authenticationRequestType(authenticationRequestType: AuthenticationRequestType) = - authenticationRequestType(JsonField.of(authenticationRequestType)) - - /** - * Type of authentication request - i.e., the type of transaction or interaction is causing - * the merchant to request an authentication. Maps to EMV 3DS field - * threeDSRequestorAuthenticationInd. - */ - fun authenticationRequestType( - authenticationRequestType: JsonField - ) = apply { this.authenticationRequestType = authenticationRequestType } - /** Indicates the outcome of the 3DS authentication process. */ fun authenticationResult(authenticationResult: AuthenticationResult) = authenticationResult(JsonField.of(authenticationResult)) @@ -394,18 +354,6 @@ private constructor( this.authenticationResult = authenticationResult } - /** - * Object containing data about the browser used in the e-commerce transaction. Present if - * the channel is 'BROWSER'. - */ - fun browser(browser: Browser) = browser(JsonField.of(browser)) - - /** - * Object containing data about the browser used in the e-commerce transaction. Present if - * the channel is 'BROWSER'. - */ - fun browser(browser: JsonField) = apply { this.browser = browser } - /** * Indicates whether the expiration date provided by the cardholder during checkout matches * Lithic's record of the card's expiration date. @@ -475,6 +423,64 @@ private constructor( this.messageCategory = messageCategory } + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS + * standard spec (e.g., specific fields that only certain card networks send but are not + * required across all 3DS requests). + */ + fun additionalData(additionalData: AdditionalData) = + additionalData(JsonField.of(additionalData)) + + /** + * Object containing additional data about the 3DS request that is beyond the EMV 3DS + * standard spec (e.g., specific fields that only certain card networks send but are not + * required across all 3DS requests). + */ + fun additionalData(additionalData: JsonField) = apply { + this.additionalData = additionalData + } + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + */ + fun app(app: App) = app(JsonField.of(app)) + + /** + * Object containing data about the app used in the e-commerce transaction. Present if the + * channel is 'APP_BASED'. + */ + fun app(app: JsonField) = apply { this.app = app } + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing + * the merchant to request an authentication. Maps to EMV 3DS field + * threeDSRequestorAuthenticationInd. + */ + fun authenticationRequestType(authenticationRequestType: AuthenticationRequestType) = + authenticationRequestType(JsonField.of(authenticationRequestType)) + + /** + * Type of authentication request - i.e., the type of transaction or interaction is causing + * the merchant to request an authentication. Maps to EMV 3DS field + * threeDSRequestorAuthenticationInd. + */ + fun authenticationRequestType( + authenticationRequestType: JsonField + ) = apply { this.authenticationRequestType = authenticationRequestType } + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if + * the channel is 'BROWSER'. + */ + fun browser(browser: Browser) = browser(JsonField.of(browser)) + + /** + * Object containing data about the browser used in the e-commerce transaction. Present if + * the channel is 'BROWSER'. + */ + fun browser(browser: JsonField) = apply { this.browser = browser } + /** * Type of 3DS Requestor Initiated (3RI) request i.e., a 3DS authentication that takes place * at the initiation of the merchant rather than the cardholder. The most common example of @@ -494,12 +500,6 @@ private constructor( this.threeRiRequestType = threeRiRequestType } - /** Globally unique identifier for the 3DS authentication. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the 3DS authentication. */ - fun token(token: JsonField) = apply { this.token = token } - /** * Object containing data about the e-commerce transaction for which the merchant is * requesting authentication. @@ -535,12 +535,9 @@ private constructor( fun build(): AuthenticationRetrieveResponse = AuthenticationRetrieveResponse( + token, accountType, - additionalData, - app, - authenticationRequestType, authenticationResult, - browser, cardExpiryCheck, cardToken, cardholder, @@ -549,8 +546,11 @@ private constructor( decisionMadeBy, merchant, messageCategory, + additionalData, + app, + authenticationRequestType, + browser, threeRiRequestType, - token, transaction, additionalProperties.toImmutable(), ) @@ -1410,10 +1410,10 @@ private constructor( class Merchant @JsonCreator private constructor( + @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @JsonProperty("country") @ExcludeMissing private val country: JsonField = JsonMissing.of(), - @JsonProperty("id") @ExcludeMissing private val id: JsonField = JsonMissing.of(), @JsonProperty("mcc") @ExcludeMissing private val mcc: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing @@ -1425,18 +1425,18 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field - * merchantCountryCode. - */ - fun country(): String = country.getRequired("country") - /** * Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field * acquirerMerchantId. */ fun id(): String = id.getRequired("id") + /** + * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field + * merchantCountryCode. + */ + fun country(): String = country.getRequired("country") + /** * Merchant category code assigned to the merchant that describes its business activity * type. Maps to EMV 3DS field mcc. @@ -1452,18 +1452,18 @@ private constructor( */ fun riskIndicator(): RiskIndicator = riskIndicator.getRequired("risk_indicator") - /** - * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field - * merchantCountryCode. - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country - /** * Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field * acquirerMerchantId. */ @JsonProperty("id") @ExcludeMissing fun _id() = id + /** + * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field + * merchantCountryCode. + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + /** * Merchant category code assigned to the merchant that describes its business activity * type. Maps to EMV 3DS field mcc. @@ -1487,8 +1487,8 @@ private constructor( fun validate(): Merchant = apply { if (!validated) { - country() id() + country() mcc() name() riskIndicator().validate() @@ -1505,34 +1505,22 @@ private constructor( class Builder { - private var country: JsonField = JsonMissing.of() private var id: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() private var mcc: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var riskIndicator: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(merchant: Merchant) = apply { - country = merchant.country id = merchant.id + country = merchant.country mcc = merchant.mcc name = merchant.name riskIndicator = merchant.riskIndicator additionalProperties = merchant.additionalProperties.toMutableMap() } - /** - * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field - * merchantCountryCode. - */ - fun country(country: String) = country(JsonField.of(country)) - - /** - * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field - * merchantCountryCode. - */ - fun country(country: JsonField) = apply { this.country = country } - /** * Merchant identifier as assigned by the acquirer. Maps to EMV 3DS field * acquirerMerchantId. @@ -1545,6 +1533,18 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } + /** + * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field + * merchantCountryCode. + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * Country code of the merchant requesting 3DS authentication. Maps to EMV 3DS field + * merchantCountryCode. + */ + fun country(country: JsonField) = apply { this.country = country } + /** * Merchant category code assigned to the merchant that describes its business activity * type. Maps to EMV 3DS field mcc. @@ -1599,8 +1599,8 @@ private constructor( fun build(): Merchant = Merchant( - country, id, + country, mcc, name, riskIndicator, @@ -2310,17 +2310,17 @@ private constructor( return true } - return /* spotless:off */ other is Merchant && country == other.country && id == other.id && mcc == other.mcc && name == other.name && riskIndicator == other.riskIndicator && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Merchant && id == other.id && country == other.country && mcc == other.mcc && name == other.name && riskIndicator == other.riskIndicator && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(country, id, mcc, name, riskIndicator, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, country, mcc, name, riskIndicator, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Merchant{country=$country, id=$id, mcc=$mcc, name=$name, riskIndicator=$riskIndicator, additionalProperties=$additionalProperties}" + "Merchant{id=$id, country=$country, mcc=$mcc, name=$name, riskIndicator=$riskIndicator, additionalProperties=$additionalProperties}" } class MessageCategory @@ -3552,15 +3552,15 @@ private constructor( return true } - return /* spotless:off */ other is AuthenticationRetrieveResponse && accountType == other.accountType && additionalData == other.additionalData && app == other.app && authenticationRequestType == other.authenticationRequestType && authenticationResult == other.authenticationResult && browser == other.browser && cardExpiryCheck == other.cardExpiryCheck && cardToken == other.cardToken && cardholder == other.cardholder && channel == other.channel && created == other.created && decisionMadeBy == other.decisionMadeBy && merchant == other.merchant && messageCategory == other.messageCategory && threeRiRequestType == other.threeRiRequestType && token == other.token && transaction == other.transaction && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AuthenticationRetrieveResponse && token == other.token && accountType == other.accountType && authenticationResult == other.authenticationResult && cardExpiryCheck == other.cardExpiryCheck && cardToken == other.cardToken && cardholder == other.cardholder && channel == other.channel && created == other.created && decisionMadeBy == other.decisionMadeBy && merchant == other.merchant && messageCategory == other.messageCategory && additionalData == other.additionalData && app == other.app && authenticationRequestType == other.authenticationRequestType && browser == other.browser && threeRiRequestType == other.threeRiRequestType && transaction == other.transaction && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountType, additionalData, app, authenticationRequestType, authenticationResult, browser, cardExpiryCheck, cardToken, cardholder, channel, created, decisionMadeBy, merchant, messageCategory, threeRiRequestType, token, transaction, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountType, authenticationResult, cardExpiryCheck, cardToken, cardholder, channel, created, decisionMadeBy, merchant, messageCategory, additionalData, app, authenticationRequestType, browser, threeRiRequestType, transaction, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AuthenticationRetrieveResponse{accountType=$accountType, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, authenticationResult=$authenticationResult, browser=$browser, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, decisionMadeBy=$decisionMadeBy, merchant=$merchant, messageCategory=$messageCategory, threeRiRequestType=$threeRiRequestType, token=$token, transaction=$transaction, additionalProperties=$additionalProperties}" + "AuthenticationRetrieveResponse{token=$token, accountType=$accountType, authenticationResult=$authenticationResult, cardExpiryCheck=$cardExpiryCheck, cardToken=$cardToken, cardholder=$cardholder, channel=$channel, created=$created, decisionMadeBy=$decisionMadeBy, merchant=$merchant, messageCategory=$messageCategory, additionalData=$additionalData, app=$app, authenticationRequestType=$authenticationRequestType, browser=$browser, threeRiRequestType=$threeRiRequestType, transaction=$transaction, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt index a731f01b..01a760e6 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BacktestResults.kt @@ -23,32 +23,32 @@ private constructor( @JsonProperty("backtest_token") @ExcludeMissing private val backtestToken: JsonField = JsonMissing.of(), - @JsonProperty("simulation_parameters") - @ExcludeMissing - private val simulationParameters: JsonField = JsonMissing.of(), @JsonProperty("results") @ExcludeMissing private val results: JsonField = JsonMissing.of(), + @JsonProperty("simulation_parameters") + @ExcludeMissing + private val simulationParameters: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Backtest Token */ fun backtestToken(): String = backtestToken.getRequired("backtest_token") + fun results(): Results = results.getRequired("results") + fun simulationParameters(): SimulationParameters = simulationParameters.getRequired("simulation_parameters") - fun results(): Results = results.getRequired("results") - /** Auth Rule Backtest Token */ @JsonProperty("backtest_token") @ExcludeMissing fun _backtestToken() = backtestToken + @JsonProperty("results") @ExcludeMissing fun _results() = results + @JsonProperty("simulation_parameters") @ExcludeMissing fun _simulationParameters() = simulationParameters - @JsonProperty("results") @ExcludeMissing fun _results() = results - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -58,8 +58,8 @@ private constructor( fun validate(): BacktestResults = apply { if (!validated) { backtestToken() - simulationParameters().validate() results().validate() + simulationParameters().validate() validated = true } } @@ -74,14 +74,14 @@ private constructor( class Builder { private var backtestToken: JsonField = JsonMissing.of() - private var simulationParameters: JsonField = JsonMissing.of() private var results: JsonField = JsonMissing.of() + private var simulationParameters: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(backtestResults: BacktestResults) = apply { backtestToken = backtestResults.backtestToken - simulationParameters = backtestResults.simulationParameters results = backtestResults.results + simulationParameters = backtestResults.simulationParameters additionalProperties = backtestResults.additionalProperties.toMutableMap() } @@ -93,6 +93,10 @@ private constructor( this.backtestToken = backtestToken } + fun results(results: Results) = results(JsonField.of(results)) + + fun results(results: JsonField) = apply { this.results = results } + fun simulationParameters(simulationParameters: SimulationParameters) = simulationParameters(JsonField.of(simulationParameters)) @@ -100,10 +104,6 @@ private constructor( this.simulationParameters = simulationParameters } - fun results(results: Results) = results(JsonField.of(results)) - - fun results(results: JsonField) = apply { this.results = results } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -126,8 +126,8 @@ private constructor( fun build(): BacktestResults = BacktestResults( backtestToken, - simulationParameters, results, + simulationParameters, additionalProperties.toImmutable(), ) } @@ -231,9 +231,6 @@ private constructor( class RuleStats @JsonCreator private constructor( - @JsonProperty("version") - @ExcludeMissing - private val version: JsonField = JsonMissing.of(), @JsonProperty("approved") @ExcludeMissing private val approved: JsonField = JsonMissing.of(), @@ -243,15 +240,13 @@ private constructor( @JsonProperty("examples") @ExcludeMissing private val examples: JsonField> = JsonMissing.of(), + @JsonProperty("version") + @ExcludeMissing + private val version: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * The version of the rule, this is incremented whenever the rule's parameters change. - */ - fun version(): Long? = version.getNullable("version") - /** * The total number of historical transactions approved by this rule during the backtest * period, or the number of transactions that would have been approved if the rule was @@ -272,7 +267,7 @@ private constructor( /** * The version of the rule, this is incremented whenever the rule's parameters change. */ - @JsonProperty("version") @ExcludeMissing fun _version() = version + fun version(): Long? = version.getNullable("version") /** * The total number of historical transactions approved by this rule during the backtest @@ -291,6 +286,11 @@ private constructor( /** Example authorization request events that would have been approved or declined. */ @JsonProperty("examples") @ExcludeMissing fun _examples() = examples + /** + * The version of the rule, this is incremented whenever the rule's parameters change. + */ + @JsonProperty("version") @ExcludeMissing fun _version() = version + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -299,10 +299,10 @@ private constructor( fun validate(): RuleStats = apply { if (!validated) { - version() approved() declined() examples()?.forEach { it.validate() } + version() validated = true } } @@ -316,32 +316,20 @@ private constructor( class Builder { - private var version: JsonField = JsonMissing.of() private var approved: JsonField = JsonMissing.of() private var declined: JsonField = JsonMissing.of() private var examples: JsonField> = JsonMissing.of() + private var version: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(ruleStats: RuleStats) = apply { - version = ruleStats.version approved = ruleStats.approved declined = ruleStats.declined examples = ruleStats.examples + version = ruleStats.version additionalProperties = ruleStats.additionalProperties.toMutableMap() } - /** - * The version of the rule, this is incremented whenever the rule's parameters - * change. - */ - fun version(version: Long) = version(JsonField.of(version)) - - /** - * The version of the rule, this is incremented whenever the rule's parameters - * change. - */ - fun version(version: JsonField) = apply { this.version = version } - /** * The total number of historical transactions approved by this rule during the * backtest period, or the number of transactions that would have been approved if @@ -382,6 +370,18 @@ private constructor( this.examples = examples } + /** + * The version of the rule, this is incremented whenever the rule's parameters + * change. + */ + fun version(version: Long) = version(JsonField.of(version)) + + /** + * The version of the rule, this is incremented whenever the rule's parameters + * change. + */ + fun version(version: JsonField) = apply { this.version = version } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -406,10 +406,10 @@ private constructor( fun build(): RuleStats = RuleStats( - version, approved, declined, examples.map { it.toImmutable() }, + version, additionalProperties.toImmutable(), ) } @@ -418,19 +418,22 @@ private constructor( class Example @JsonCreator private constructor( + @JsonProperty("approved") + @ExcludeMissing + private val approved: JsonField = JsonMissing.of(), @JsonProperty("event_token") @ExcludeMissing private val eventToken: JsonField = JsonMissing.of(), @JsonProperty("timestamp") @ExcludeMissing private val timestamp: JsonField = JsonMissing.of(), - @JsonProperty("approved") - @ExcludeMissing - private val approved: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Whether the rule would have approved the authorization request. */ + fun approved(): Boolean? = approved.getNullable("approved") + /** The authorization request event token. */ fun eventToken(): String? = eventToken.getNullable("event_token") @@ -438,7 +441,7 @@ private constructor( fun timestamp(): OffsetDateTime? = timestamp.getNullable("timestamp") /** Whether the rule would have approved the authorization request. */ - fun approved(): Boolean? = approved.getNullable("approved") + @JsonProperty("approved") @ExcludeMissing fun _approved() = approved /** The authorization request event token. */ @JsonProperty("event_token") @ExcludeMissing fun _eventToken() = eventToken @@ -446,9 +449,6 @@ private constructor( /** The timestamp of the authorization request event. */ @JsonProperty("timestamp") @ExcludeMissing fun _timestamp() = timestamp - /** Whether the rule would have approved the authorization request. */ - @JsonProperty("approved") @ExcludeMissing fun _approved() = approved - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -457,9 +457,9 @@ private constructor( fun validate(): Example = apply { if (!validated) { + approved() eventToken() timestamp() - approved() validated = true } } @@ -473,18 +473,24 @@ private constructor( class Builder { + private var approved: JsonField = JsonMissing.of() private var eventToken: JsonField = JsonMissing.of() private var timestamp: JsonField = JsonMissing.of() - private var approved: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(example: Example) = apply { + approved = example.approved eventToken = example.eventToken timestamp = example.timestamp - approved = example.approved additionalProperties = example.additionalProperties.toMutableMap() } + /** Whether the rule would have approved the authorization request. */ + fun approved(approved: Boolean) = approved(JsonField.of(approved)) + + /** Whether the rule would have approved the authorization request. */ + fun approved(approved: JsonField) = apply { this.approved = approved } + /** The authorization request event token. */ fun eventToken(eventToken: String) = eventToken(JsonField.of(eventToken)) @@ -501,12 +507,6 @@ private constructor( this.timestamp = timestamp } - /** Whether the rule would have approved the authorization request. */ - fun approved(approved: Boolean) = approved(JsonField.of(approved)) - - /** Whether the rule would have approved the authorization request. */ - fun approved(approved: JsonField) = apply { this.approved = approved } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -531,9 +531,9 @@ private constructor( fun build(): Example = Example( + approved, eventToken, timestamp, - approved, additionalProperties.toImmutable(), ) } @@ -543,17 +543,17 @@ private constructor( return true } - return /* spotless:off */ other is Example && eventToken == other.eventToken && timestamp == other.timestamp && approved == other.approved && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Example && approved == other.approved && eventToken == other.eventToken && timestamp == other.timestamp && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(eventToken, timestamp, approved, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(approved, eventToken, timestamp, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Example{eventToken=$eventToken, timestamp=$timestamp, approved=$approved, additionalProperties=$additionalProperties}" + "Example{approved=$approved, eventToken=$eventToken, timestamp=$timestamp, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -561,17 +561,17 @@ private constructor( return true } - return /* spotless:off */ other is RuleStats && version == other.version && approved == other.approved && declined == other.declined && examples == other.examples && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is RuleStats && approved == other.approved && declined == other.declined && examples == other.examples && version == other.version && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(version, approved, declined, examples, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(approved, declined, examples, version, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "RuleStats{version=$version, approved=$approved, declined=$declined, examples=$examples, additionalProperties=$additionalProperties}" + "RuleStats{approved=$approved, declined=$declined, examples=$examples, version=$version, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -599,12 +599,12 @@ private constructor( @JsonProperty("auth_rule_token") @ExcludeMissing private val authRuleToken: JsonField = JsonMissing.of(), - @JsonProperty("start") - @ExcludeMissing - private val start: JsonField = JsonMissing.of(), @JsonProperty("end") @ExcludeMissing private val end: JsonField = JsonMissing.of(), + @JsonProperty("start") + @ExcludeMissing + private val start: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -612,21 +612,21 @@ private constructor( /** Auth Rule Token */ fun authRuleToken(): String? = authRuleToken.getNullable("auth_rule_token") - /** The start time of the simulation. */ - fun start(): OffsetDateTime? = start.getNullable("start") - /** The end time of the simulation. */ fun end(): OffsetDateTime? = end.getNullable("end") + /** The start time of the simulation. */ + fun start(): OffsetDateTime? = start.getNullable("start") + /** Auth Rule Token */ @JsonProperty("auth_rule_token") @ExcludeMissing fun _authRuleToken() = authRuleToken - /** The start time of the simulation. */ - @JsonProperty("start") @ExcludeMissing fun _start() = start - /** The end time of the simulation. */ @JsonProperty("end") @ExcludeMissing fun _end() = end + /** The start time of the simulation. */ + @JsonProperty("start") @ExcludeMissing fun _start() = start + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -636,8 +636,8 @@ private constructor( fun validate(): SimulationParameters = apply { if (!validated) { authRuleToken() - start() end() + start() validated = true } } @@ -652,14 +652,14 @@ private constructor( class Builder { private var authRuleToken: JsonField = JsonMissing.of() - private var start: JsonField = JsonMissing.of() private var end: JsonField = JsonMissing.of() + private var start: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(simulationParameters: SimulationParameters) = apply { authRuleToken = simulationParameters.authRuleToken - start = simulationParameters.start end = simulationParameters.end + start = simulationParameters.start additionalProperties = simulationParameters.additionalProperties.toMutableMap() } @@ -671,18 +671,18 @@ private constructor( this.authRuleToken = authRuleToken } - /** The start time of the simulation. */ - fun start(start: OffsetDateTime) = start(JsonField.of(start)) - - /** The start time of the simulation. */ - fun start(start: JsonField) = apply { this.start = start } - /** The end time of the simulation. */ fun end(end: OffsetDateTime) = end(JsonField.of(end)) /** The end time of the simulation. */ fun end(end: JsonField) = apply { this.end = end } + /** The start time of the simulation. */ + fun start(start: OffsetDateTime) = start(JsonField.of(start)) + + /** The start time of the simulation. */ + fun start(start: JsonField) = apply { this.start = start } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -705,8 +705,8 @@ private constructor( fun build(): SimulationParameters = SimulationParameters( authRuleToken, - start, end, + start, additionalProperties.toImmutable(), ) } @@ -716,17 +716,17 @@ private constructor( return true } - return /* spotless:off */ other is SimulationParameters && authRuleToken == other.authRuleToken && start == other.start && end == other.end && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SimulationParameters && authRuleToken == other.authRuleToken && end == other.end && start == other.start && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(authRuleToken, start, end, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(authRuleToken, end, start, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SimulationParameters{authRuleToken=$authRuleToken, start=$start, end=$end, additionalProperties=$additionalProperties}" + "SimulationParameters{authRuleToken=$authRuleToken, end=$end, start=$start, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -734,15 +734,15 @@ private constructor( return true } - return /* spotless:off */ other is BacktestResults && backtestToken == other.backtestToken && simulationParameters == other.simulationParameters && results == other.results && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BacktestResults && backtestToken == other.backtestToken && results == other.results && simulationParameters == other.simulationParameters && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(backtestToken, simulationParameters, results, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(backtestToken, results, simulationParameters, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BacktestResults{backtestToken=$backtestToken, simulationParameters=$simulationParameters, results=$results, additionalProperties=$additionalProperties}" + "BacktestResults{backtestToken=$backtestToken, results=$results, simulationParameters=$simulationParameters, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BalanceListResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BalanceListResponse.kt index a6fbdfb9..d7c38948 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BalanceListResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BalanceListResponse.kt @@ -23,6 +23,7 @@ import java.util.Objects class BalanceListResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("available_amount") @ExcludeMissing private val availableAmount: JsonField = JsonMissing.of(), @@ -32,8 +33,6 @@ private constructor( @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("last_transaction_event_token") @ExcludeMissing private val lastTransactionEventToken: JsonField = JsonMissing.of(), @@ -46,12 +45,16 @@ private constructor( @JsonProperty("total_amount") @ExcludeMissing private val totalAmount: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for the financial account that holds this balance. */ + fun token(): String = token.getRequired("token") + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ fun availableAmount(): Long = availableAmount.getRequired("available_amount") @@ -61,12 +64,6 @@ 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 token(): String = token.getRequired("token") - - /** Type of financial account. */ - fun type(): Type = type.getRequired("type") - /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -89,9 +86,15 @@ private constructor( */ fun totalAmount(): Long = totalAmount.getRequired("total_amount") + /** Type of financial account. */ + fun type(): Type = type.getRequired("type") + /** Date and time for when the balance was last updated. */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** Globally unique identifier for the financial account that holds this balance. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ @JsonProperty("available_amount") @ExcludeMissing fun _availableAmount() = availableAmount @@ -101,12 +104,6 @@ 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("token") @ExcludeMissing fun _token() = token - - /** Type of financial account. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -132,6 +129,9 @@ private constructor( */ @JsonProperty("total_amount") @ExcludeMissing fun _totalAmount() = totalAmount + /** Type of financial account. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Date and time for when the balance was last updated. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated @@ -143,15 +143,15 @@ private constructor( fun validate(): BalanceListResponse = apply { if (!validated) { + token() availableAmount() created() currency() - token() - type() lastTransactionEventToken() lastTransactionToken() pendingAmount() totalAmount() + type() updated() validated = true } @@ -166,32 +166,38 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var availableAmount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var type: 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 type: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(balanceListResponse: BalanceListResponse) = apply { + token = balanceListResponse.token availableAmount = balanceListResponse.availableAmount created = balanceListResponse.created currency = balanceListResponse.currency - token = balanceListResponse.token - type = balanceListResponse.type lastTransactionEventToken = balanceListResponse.lastTransactionEventToken lastTransactionToken = balanceListResponse.lastTransactionToken pendingAmount = balanceListResponse.pendingAmount totalAmount = balanceListResponse.totalAmount + type = balanceListResponse.type updated = balanceListResponse.updated additionalProperties = balanceListResponse.additionalProperties.toMutableMap() } + /** Globally unique identifier for the financial account that holds this balance. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the financial account that holds this balance. */ + fun token(token: JsonField) = apply { this.token = token } + /** Funds available for spend in the currency's smallest unit (e.g., cents for USD) */ fun availableAmount(availableAmount: Long) = availableAmount(JsonField.of(availableAmount)) @@ -212,18 +218,6 @@ private constructor( /** 3-digit alphabetic ISO 4217 code for the local currency of the balance. */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** Globally unique identifier for the financial account that holds this balance. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the financial account that holds this balance. */ - fun token(token: JsonField) = apply { this.token = token } - - /** Type of financial account. */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Type of financial account. */ - fun type(type: JsonField) = apply { this.type = type } - /** * Globally unique identifier for the last financial transaction event that impacted this * balance. @@ -278,6 +272,12 @@ private constructor( */ fun totalAmount(totalAmount: JsonField) = apply { this.totalAmount = totalAmount } + /** Type of financial account. */ + fun type(type: Type) = type(JsonField.of(type)) + + /** Type of financial account. */ + fun type(type: JsonField) = apply { this.type = type } + /** Date and time for when the balance was last updated. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -305,15 +305,15 @@ private constructor( fun build(): BalanceListResponse = BalanceListResponse( + token, availableAmount, created, currency, - token, - type, lastTransactionEventToken, lastTransactionToken, pendingAmount, totalAmount, + type, updated, additionalProperties.toImmutable(), ) @@ -387,15 +387,15 @@ private constructor( return true } - return /* spotless:off */ other is BalanceListResponse && availableAmount == other.availableAmount && created == other.created && currency == other.currency && token == other.token && type == other.type && lastTransactionEventToken == other.lastTransactionEventToken && lastTransactionToken == other.lastTransactionToken && pendingAmount == other.pendingAmount && totalAmount == other.totalAmount && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BalanceListResponse && token == other.token && availableAmount == other.availableAmount && created == other.created && currency == other.currency && lastTransactionEventToken == other.lastTransactionEventToken && lastTransactionToken == other.lastTransactionToken && pendingAmount == other.pendingAmount && totalAmount == other.totalAmount && type == other.type && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(availableAmount, created, currency, token, type, lastTransactionEventToken, lastTransactionToken, pendingAmount, totalAmount, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, availableAmount, created, currency, lastTransactionEventToken, lastTransactionToken, pendingAmount, totalAmount, type, updated, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BalanceListResponse{availableAmount=$availableAmount, created=$created, currency=$currency, token=$token, type=$type, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, updated=$updated, additionalProperties=$additionalProperties}" + "BalanceListResponse{token=$token, availableAmount=$availableAmount, created=$created, currency=$currency, lastTransactionEventToken=$lastTransactionEventToken, lastTransactionToken=$lastTransactionToken, pendingAmount=$pendingAmount, totalAmount=$totalAmount, type=$type, updated=$updated, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt index bcf9685d..dc991604 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/BookTransferResponse.kt @@ -22,6 +22,7 @@ import java.util.Objects class BookTransferResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -52,13 +53,18 @@ private constructor( @JsonProperty("to_financial_account_token") @ExcludeMissing private val toFinancialAccountToken: JsonValue = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** + * Customer-provided token that will serve as an idempotency token. This token will become the + * transaction token. + */ + fun token(): String = token.getRequired("token") + /** Category of the book transfer */ fun category(): Category = category.getRequired("category") @@ -103,14 +109,14 @@ private constructor( */ fun status(): Status = status.getRequired("status") + /** Date and time when the financial transaction was last updated. UTC time zone. */ + fun updated(): OffsetDateTime = updated.getRequired("updated") + /** * Customer-provided token that will serve as an idempotency token. This token will become the * transaction token. */ - fun token(): String = token.getRequired("token") - - /** Date and time when the financial transaction was last updated. UTC time zone. */ - fun updated(): OffsetDateTime = updated.getRequired("updated") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Category of the book transfer */ @JsonProperty("category") @ExcludeMissing fun _category() = category @@ -165,12 +171,6 @@ private constructor( @ExcludeMissing fun _toFinancialAccountToken() = toFinancialAccountToken - /** - * Customer-provided token that will serve as an idempotency token. This token will become the - * transaction token. - */ - @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 @@ -182,6 +182,7 @@ private constructor( fun validate(): BookTransferResponse = apply { if (!validated) { + token() category() created() currency() @@ -191,7 +192,6 @@ private constructor( result() settledAmount() status() - token() updated() validated = true } @@ -206,6 +206,7 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -216,11 +217,11 @@ private constructor( private var settledAmount: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var toFinancialAccountToken: JsonValue = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(bookTransferResponse: BookTransferResponse) = apply { + token = bookTransferResponse.token category = bookTransferResponse.category created = bookTransferResponse.created currency = bookTransferResponse.currency @@ -231,11 +232,22 @@ private constructor( settledAmount = bookTransferResponse.settledAmount status = bookTransferResponse.status toFinancialAccountToken = bookTransferResponse.toFinancialAccountToken - token = bookTransferResponse.token updated = bookTransferResponse.updated additionalProperties = bookTransferResponse.additionalProperties.toMutableMap() } + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ + fun token(token: String) = token(JsonField.of(token)) + + /** + * Customer-provided token that will serve as an idempotency token. This token will become + * the transaction token. + */ + fun token(token: JsonField) = apply { this.token = token } + /** Category of the book transfer */ fun category(category: Category) = category(JsonField.of(category)) @@ -337,18 +349,6 @@ private constructor( this.toFinancialAccountToken = toFinancialAccountToken } - /** - * Customer-provided token that will serve as an idempotency token. This token will become - * the transaction token. - */ - fun token(token: String) = token(JsonField.of(token)) - - /** - * Customer-provided token that will serve as an idempotency token. This token will become - * the transaction token. - */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -376,6 +376,7 @@ private constructor( fun build(): BookTransferResponse = BookTransferResponse( + token, category, created, currency, @@ -386,7 +387,6 @@ private constructor( settledAmount, status, toFinancialAccountToken, - token, updated, additionalProperties.toImmutable(), ) @@ -483,42 +483,52 @@ private constructor( class BookTransferEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("result") - @ExcludeMissing - private val result: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), - @JsonProperty("subtype") + @JsonProperty("detailed_results") @ExcludeMissing - private val subtype: JsonField = JsonMissing.of(), + private val detailedResults: JsonField> = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing private val memo: JsonField = JsonMissing.of(), - @JsonProperty("detailed_results") + @JsonProperty("result") @ExcludeMissing - private val detailedResults: JsonField> = JsonMissing.of(), + private val result: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). */ fun amount(): Long = amount.getRequired("amount") - /** Type of the book transfer */ - fun type(): String = type.getRequired("type") + /** Date and time when the financial event occurred. UTC time zone. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** Detailed Results */ + fun detailedResults(): List = + detailedResults.getRequired("detailed_results") + + /** Memo for the transfer. */ + fun memo(): String = memo.getRequired("memo") /** * APPROVED financial events were successful while DECLINED financial events were declined @@ -526,21 +536,14 @@ private constructor( */ fun result(): Result = result.getRequired("result") - /** Date and time when the financial event occurred. UTC time zone. */ - fun created(): OffsetDateTime = created.getRequired("created") - - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** The program specific subtype code for the specified category/type. */ fun subtype(): String = subtype.getRequired("subtype") - /** Memo for the transfer. */ - fun memo(): String = memo.getRequired("memo") + /** Type of the book transfer */ + fun type(): String = type.getRequired("type") - /** Detailed Results */ - fun detailedResults(): List = - detailedResults.getRequired("detailed_results") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** * Amount of the financial event that has been settled in the currency's smallest unit @@ -548,8 +551,14 @@ private constructor( */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - /** Type of the book transfer */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Date and time when the financial event occurred. UTC time zone. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Detailed Results */ + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + + /** Memo for the transfer. */ + @JsonProperty("memo") @ExcludeMissing fun _memo() = memo /** * APPROVED financial events were successful while DECLINED financial events were declined @@ -557,20 +566,11 @@ private constructor( */ @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Date and time when the financial event occurred. UTC time zone. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** The program specific subtype code for the specified category/type. */ @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype - /** Memo for the transfer. */ - @JsonProperty("memo") @ExcludeMissing fun _memo() = memo - - /** Detailed Results */ - @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + /** Type of the book transfer */ + @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @ExcludeMissing @@ -580,14 +580,14 @@ private constructor( fun validate(): BookTransferEvent = apply { if (!validated) { + token() amount() - type() - result() created() - token() - subtype() - memo() detailedResults() + memo() + result() + subtype() + type() validated = true } } @@ -601,28 +601,34 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var subtype: JsonField = JsonMissing.of() - private var memo: JsonField = JsonMissing.of() private var detailedResults: JsonField> = JsonMissing.of() + private var memo: JsonField = JsonMissing.of() + private var result: JsonField = JsonMissing.of() + private var subtype: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(bookTransferEvent: BookTransferEvent) = apply { + token = bookTransferEvent.token amount = bookTransferEvent.amount - type = bookTransferEvent.type - result = bookTransferEvent.result created = bookTransferEvent.created - token = bookTransferEvent.token - subtype = bookTransferEvent.subtype - memo = bookTransferEvent.memo detailedResults = bookTransferEvent.detailedResults + memo = bookTransferEvent.memo + result = bookTransferEvent.result + subtype = bookTransferEvent.subtype + type = bookTransferEvent.type additionalProperties = bookTransferEvent.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -635,11 +641,26 @@ private constructor( */ fun amount(amount: JsonField) = apply { this.amount = amount } - /** Type of the book transfer */ - fun type(type: String) = type(JsonField.of(type)) + /** Date and time when the financial event occurred. UTC time zone. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Type of the book transfer */ - fun type(type: JsonField) = apply { this.type = type } + /** Date and time when the financial event occurred. UTC time zone. */ + fun created(created: JsonField) = apply { this.created = created } + + /** Detailed Results */ + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + /** Detailed Results */ + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + + /** Memo for the transfer. */ + fun memo(memo: String) = memo(JsonField.of(memo)) + + /** Memo for the transfer. */ + fun memo(memo: JsonField) = apply { this.memo = memo } /** * APPROVED financial events were successful while DECLINED financial events were @@ -653,38 +674,17 @@ private constructor( */ fun result(result: JsonField) = apply { this.result = result } - /** Date and time when the financial event occurred. UTC time zone. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Date and time when the financial event occurred. UTC time zone. */ - fun created(created: JsonField) = apply { this.created = created } - - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** The program specific subtype code for the specified category/type. */ fun subtype(subtype: String) = subtype(JsonField.of(subtype)) /** The program specific subtype code for the specified category/type. */ fun subtype(subtype: JsonField) = apply { this.subtype = subtype } - /** Memo for the transfer. */ - fun memo(memo: String) = memo(JsonField.of(memo)) - - /** Memo for the transfer. */ - fun memo(memo: JsonField) = apply { this.memo = memo } - - /** Detailed Results */ - fun detailedResults(detailedResults: List) = - detailedResults(JsonField.of(detailedResults)) + /** Type of the book transfer */ + fun type(type: String) = type(JsonField.of(type)) - /** Detailed Results */ - fun detailedResults(detailedResults: JsonField>) = apply { - this.detailedResults = detailedResults - } + /** Type of the book transfer */ + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -707,14 +707,14 @@ private constructor( fun build(): BookTransferEvent = BookTransferEvent( + token, amount, - type, - result, created, - token, - subtype, - memo, detailedResults.map { it.toImmutable() }, + memo, + result, + subtype, + type, additionalProperties.toImmutable(), ) } @@ -838,17 +838,17 @@ private constructor( return true } - return /* spotless:off */ other is BookTransferEvent && amount == other.amount && type == other.type && result == other.result && created == other.created && token == other.token && subtype == other.subtype && memo == other.memo && detailedResults == other.detailedResults && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BookTransferEvent && token == other.token && amount == other.amount && created == other.created && detailedResults == other.detailedResults && memo == other.memo && result == other.result && subtype == other.subtype && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, type, result, created, token, subtype, memo, detailedResults, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, detailedResults, memo, result, subtype, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BookTransferEvent{amount=$amount, type=$type, result=$result, created=$created, token=$token, subtype=$subtype, memo=$memo, detailedResults=$detailedResults, additionalProperties=$additionalProperties}" + "BookTransferEvent{token=$token, amount=$amount, created=$created, detailedResults=$detailedResults, memo=$memo, result=$result, subtype=$subtype, type=$type, additionalProperties=$additionalProperties}" } class Result @@ -976,15 +976,15 @@ private constructor( return true } - return /* spotless:off */ other is BookTransferResponse && category == other.category && created == other.created && currency == other.currency && events == other.events && fromFinancialAccountToken == other.fromFinancialAccountToken && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && toFinancialAccountToken == other.toFinancialAccountToken && token == other.token && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BookTransferResponse && token == other.token && category == other.category && created == other.created && currency == other.currency && events == other.events && fromFinancialAccountToken == other.fromFinancialAccountToken && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && toFinancialAccountToken == other.toFinancialAccountToken && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, events, fromFinancialAccountToken, pendingAmount, result, settledAmount, status, toFinancialAccountToken, token, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, events, fromFinancialAccountToken, pendingAmount, result, settledAmount, status, toFinancialAccountToken, updated, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BookTransferResponse{category=$category, created=$created, currency=$currency, events=$events, fromFinancialAccountToken=$fromFinancialAccountToken, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, toFinancialAccountToken=$toFinancialAccountToken, token=$token, updated=$updated, additionalProperties=$additionalProperties}" + "BookTransferResponse{token=$token, category=$category, created=$created, currency=$currency, events=$events, fromFinancialAccountToken=$fromFinancialAccountToken, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, toFinancialAccountToken=$toFinancialAccountToken, updated=$updated, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Card.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Card.kt index c4282430..8a9595ef 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Card.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Card.kt @@ -22,24 +22,39 @@ import java.util.Objects class Card @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("auth_rule_tokens") - @ExcludeMissing - private val authRuleTokens: JsonField> = JsonMissing.of(), @JsonProperty("card_program_token") @ExcludeMissing private val cardProgramToken: JsonField = JsonMissing.of(), - @JsonProperty("replacement_for") + @JsonProperty("created") @ExcludeMissing - private val replacementFor: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), + @JsonProperty("funding") + @ExcludeMissing + private val funding: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), + @JsonProperty("pin_status") + @ExcludeMissing + private val pinStatus: JsonField = JsonMissing.of(), + @JsonProperty("spend_limit") + @ExcludeMissing + private val spendLimit: JsonField = JsonMissing.of(), + @JsonProperty("spend_limit_duration") + @ExcludeMissing + private val spendLimitDuration: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("auth_rule_tokens") + @ExcludeMissing + private val authRuleTokens: JsonField> = JsonMissing.of(), @JsonProperty("cardholder_currency") @ExcludeMissing private val cardholderCurrency: JsonField = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), @JsonProperty("cvv") @ExcludeMissing private val cvv: JsonField = JsonMissing.of(), @JsonProperty("digital_card_art_token") @ExcludeMissing @@ -50,119 +65,46 @@ private constructor( @JsonProperty("exp_year") @ExcludeMissing private val expYear: JsonField = JsonMissing.of(), - @JsonProperty("funding") - @ExcludeMissing - private val funding: JsonField = JsonMissing.of(), @JsonProperty("hostname") @ExcludeMissing private val hostname: JsonField = JsonMissing.of(), - @JsonProperty("last_four") - @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing private val memo: JsonField = JsonMissing.of(), @JsonProperty("pan") @ExcludeMissing private val pan: JsonField = JsonMissing.of(), @JsonProperty("pending_commands") @ExcludeMissing private val pendingCommands: JsonField> = JsonMissing.of(), - @JsonProperty("pin_status") - @ExcludeMissing - private val pinStatus: JsonField = JsonMissing.of(), @JsonProperty("product_id") @ExcludeMissing private val productId: JsonField = JsonMissing.of(), - @JsonProperty("spend_limit") - @ExcludeMissing - private val spendLimit: JsonField = JsonMissing.of(), - @JsonProperty("spend_limit_duration") + @JsonProperty("replacement_for") @ExcludeMissing - private val spendLimitDuration: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + private val replacementFor: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Globally unique identifier for the account to which the card belongs. */ fun accountToken(): String = accountToken.getRequired("account_token") - /** - * List of identifiers for the Auth Rule(s) that are applied on the card. This field is - * deprecated and will no longer be populated in the `Card` object. The key will be removed from - * the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule - * information instead. - */ - fun authRuleTokens(): List? = authRuleTokens.getNullable("auth_rule_tokens") - /** Globally unique identifier for the card program on which the card exists. */ fun cardProgramToken(): String = cardProgramToken.getRequired("card_program_token") - /** - * If the card is a replacement for another card, the globally unique identifier for the card - * that was replaced. - */ - fun replacementFor(): String? = replacementFor.getNullable("replacement_for") - - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") - /** 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(): String? = cvv.getNullable("cvv") - - /** - * 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(): String? = digitalCardArtToken.getNullable("digital_card_art_token") - - /** Two digit (MM) expiry month. */ - fun expMonth(): String? = expMonth.getNullable("exp_month") - - /** Four digit (yyyy) expiry year. */ - fun expYear(): String? = expYear.getNullable("exp_year") - /** Deprecated: Funding account for the card. */ fun funding(): FundingAccount = funding.getRequired("funding") - /** Hostname of card’s locked merchant (will be empty if not applicable). */ - fun hostname(): String? = hostname.getNullable("hostname") - /** Last four digits of the card number. */ fun lastFour(): String = lastFour.getRequired("last_four") - /** Friendly name to identify the card. */ - fun memo(): String? = memo.getNullable("memo") - - /** - * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to have - * PAN returned as a field in production. Please contact - * [support@lithic.com](mailto:support@lithic.com) for questions. - */ - fun pan(): String? = pan.getNullable("pan") - - /** - * Indicates if there are offline PIN changes pending card interaction with an offline PIN - * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued in - * markets supporting offline PINs. - */ - fun pendingCommands(): List? = pendingCommands.getNullable("pending_commands") - /** * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect attempts). */ fun pinStatus(): PinStatus = pinStatus.getRequired("pin_status") - /** - * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use. - * Specifies the configuration (i.e., physical card art) that the card should be manufactured - * with. - */ - fun productId(): String? = productId.getNullable("product_id") - /** * Amount (in cents) to limit approved authorizations. Transaction requests above the spend * limit will be declined. @@ -202,9 +144,6 @@ private constructor( */ fun state(): State = state.getRequired("state") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** * Card types: * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet like @@ -221,36 +160,19 @@ private constructor( */ fun type(): Type = type.getRequired("type") - /** Globally unique identifier for the account to which the card belongs. */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** * List of identifiers for the Auth Rule(s) that are applied on the card. This field is * deprecated and will no longer be populated in the `Card` object. The key will be removed from * the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule * information instead. */ - @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens - - /** Globally unique identifier for the card program on which the card exists. */ - @JsonProperty("card_program_token") @ExcludeMissing fun _cardProgramToken() = cardProgramToken - - /** - * If the card is a replacement for another card, the globally unique identifier for the card - * that was replaced. - */ - @JsonProperty("replacement_for") @ExcludeMissing fun _replacementFor() = replacementFor + fun authRuleTokens(): List? = authRuleTokens.getNullable("auth_rule_tokens") /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - @JsonProperty("cardholder_currency") - @ExcludeMissing - fun _cardholderCurrency() = cardholderCurrency - - /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") /** Three digit cvv printed on the back of the card. */ - @JsonProperty("cvv") @ExcludeMissing fun _cvv() = cvv + fun cvv(): String? = cvv.getNullable("cvv") /** * Specifies the digital card art to be displayed in the user’s digital wallet after @@ -258,53 +180,69 @@ private constructor( * 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 + fun digitalCardArtToken(): String? = digitalCardArtToken.getNullable("digital_card_art_token") /** Two digit (MM) expiry month. */ - @JsonProperty("exp_month") @ExcludeMissing fun _expMonth() = expMonth + fun expMonth(): String? = expMonth.getNullable("exp_month") /** Four digit (yyyy) expiry year. */ - @JsonProperty("exp_year") @ExcludeMissing fun _expYear() = expYear - - /** Deprecated: Funding account for the card. */ - @JsonProperty("funding") @ExcludeMissing fun _funding() = funding + fun expYear(): String? = expYear.getNullable("exp_year") /** Hostname of card’s locked merchant (will be empty if not applicable). */ - @JsonProperty("hostname") @ExcludeMissing fun _hostname() = hostname - - /** Last four digits of the card number. */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + fun hostname(): String? = hostname.getNullable("hostname") /** Friendly name to identify the card. */ - @JsonProperty("memo") @ExcludeMissing fun _memo() = memo + fun memo(): String? = memo.getNullable("memo") /** * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to have * PAN returned as a field in production. Please contact * [support@lithic.com](mailto:support@lithic.com) for questions. */ - @JsonProperty("pan") @ExcludeMissing fun _pan() = pan + fun pan(): String? = pan.getNullable("pan") /** * Indicates if there are offline PIN changes pending card interaction with an offline PIN * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued in * markets supporting offline PINs. */ - @JsonProperty("pending_commands") @ExcludeMissing fun _pendingCommands() = pendingCommands - - /** - * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect attempts). - */ - @JsonProperty("pin_status") @ExcludeMissing fun _pinStatus() = pinStatus + fun pendingCommands(): List? = pendingCommands.getNullable("pending_commands") /** * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use. * Specifies the configuration (i.e., physical card art) that the card should be manufactured * with. */ - @JsonProperty("product_id") @ExcludeMissing fun _productId() = productId + fun productId(): String? = productId.getNullable("product_id") + + /** + * If the card is a replacement for another card, the globally unique identifier for the card + * that was replaced. + */ + fun replacementFor(): String? = replacementFor.getNullable("replacement_for") + + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** Globally unique identifier for the account to which the card belongs. */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken + + /** Globally unique identifier for the card program on which the card exists. */ + @JsonProperty("card_program_token") @ExcludeMissing fun _cardProgramToken() = cardProgramToken + + /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Deprecated: Funding account for the card. */ + @JsonProperty("funding") @ExcludeMissing fun _funding() = funding + + /** Last four digits of the card number. */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + + /** + * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect attempts). + */ + @JsonProperty("pin_status") @ExcludeMissing fun _pinStatus() = pinStatus /** * Amount (in cents) to limit approved authorizations. Transaction requests above the spend @@ -346,9 +284,6 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * Card types: * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet like @@ -365,42 +300,107 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type() = type - @JsonAnyGetter - @ExcludeMissing - fun _additionalProperties(): Map = additionalProperties + /** + * List of identifiers for the Auth Rule(s) that are applied on the card. This field is + * deprecated and will no longer be populated in the `Card` object. The key will be removed from + * the schema in a future release. Use the `/auth_rules` endpoints to fetch Auth Rule + * information instead. + */ + @JsonProperty("auth_rule_tokens") @ExcludeMissing fun _authRuleTokens() = authRuleTokens - private var validated: Boolean = false + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + @JsonProperty("cardholder_currency") + @ExcludeMissing + fun _cardholderCurrency() = cardholderCurrency - fun validate(): Card = apply { - if (!validated) { - accountToken() - authRuleTokens() - cardProgramToken() - replacementFor() - cardholderCurrency() - created() - cvv() - digitalCardArtToken() - expMonth() - expYear() - funding().validate() - hostname() - lastFour() - memo() - pan() - pendingCommands() - pinStatus() - productId() - spendLimit() - spendLimitDuration() - state() - token() - type() - validated = true - } - } + /** Three digit cvv printed on the back of the card. */ + @JsonProperty("cvv") @ExcludeMissing fun _cvv() = cvv - fun toBuilder() = Builder().from(this) + /** + * 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 + + /** Four digit (yyyy) expiry year. */ + @JsonProperty("exp_year") @ExcludeMissing fun _expYear() = expYear + + /** Hostname of card’s locked merchant (will be empty if not applicable). */ + @JsonProperty("hostname") @ExcludeMissing fun _hostname() = hostname + + /** Friendly name to identify the card. */ + @JsonProperty("memo") @ExcludeMissing fun _memo() = memo + + /** + * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to have + * PAN returned as a field in production. Please contact + * [support@lithic.com](mailto:support@lithic.com) for questions. + */ + @JsonProperty("pan") @ExcludeMissing fun _pan() = pan + + /** + * Indicates if there are offline PIN changes pending card interaction with an offline PIN + * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued in + * markets supporting offline PINs. + */ + @JsonProperty("pending_commands") @ExcludeMissing fun _pendingCommands() = pendingCommands + + /** + * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before use. + * Specifies the configuration (i.e., physical card art) that the card should be manufactured + * with. + */ + @JsonProperty("product_id") @ExcludeMissing fun _productId() = productId + + /** + * If the card is a replacement for another card, the globally unique identifier for the card + * that was replaced. + */ + @JsonProperty("replacement_for") @ExcludeMissing fun _replacementFor() = replacementFor + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = additionalProperties + + private var validated: Boolean = false + + fun validate(): Card = apply { + if (!validated) { + token() + accountToken() + cardProgramToken() + created() + funding().validate() + lastFour() + pinStatus() + spendLimit() + spendLimitDuration() + state() + type() + authRuleTokens() + cardholderCurrency() + cvv() + digitalCardArtToken() + expMonth() + expYear() + hostname() + memo() + pan() + pendingCommands() + productId() + replacementFor() + validated = true + } + } + + fun toBuilder() = Builder().from(this) companion object { @@ -409,58 +409,64 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var authRuleTokens: JsonField> = JsonMissing.of() private var cardProgramToken: JsonField = JsonMissing.of() - private var replacementFor: JsonField = JsonMissing.of() - private var cardholderCurrency: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() + private var funding: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var pinStatus: JsonField = JsonMissing.of() + private var spendLimit: JsonField = JsonMissing.of() + private var spendLimitDuration: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var authRuleTokens: JsonField> = JsonMissing.of() + private var cardholderCurrency: JsonField = JsonMissing.of() private var cvv: 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() private var pan: JsonField = JsonMissing.of() private var pendingCommands: JsonField> = JsonMissing.of() - private var pinStatus: JsonField = JsonMissing.of() private var productId: JsonField = JsonMissing.of() - private var spendLimit: JsonField = JsonMissing.of() - private var spendLimitDuration: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var replacementFor: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(card: Card) = apply { + token = card.token accountToken = card.accountToken - authRuleTokens = card.authRuleTokens cardProgramToken = card.cardProgramToken - replacementFor = card.replacementFor - cardholderCurrency = card.cardholderCurrency created = card.created + funding = card.funding + lastFour = card.lastFour + pinStatus = card.pinStatus + spendLimit = card.spendLimit + spendLimitDuration = card.spendLimitDuration + state = card.state + type = card.type + authRuleTokens = card.authRuleTokens + cardholderCurrency = card.cardholderCurrency cvv = card.cvv digitalCardArtToken = card.digitalCardArtToken expMonth = card.expMonth expYear = card.expYear - funding = card.funding hostname = card.hostname - lastFour = card.lastFour memo = card.memo pan = card.pan pendingCommands = card.pendingCommands - pinStatus = card.pinStatus productId = card.productId - spendLimit = card.spendLimit - spendLimitDuration = card.spendLimitDuration - state = card.state - token = card.token - type = card.type + replacementFor = card.replacementFor additionalProperties = card.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Globally unique identifier for the account to which the card belongs. */ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) @@ -469,6 +475,164 @@ private constructor( this.accountToken = accountToken } + /** Globally unique identifier for the card program on which the card exists. */ + fun cardProgramToken(cardProgramToken: String) = + cardProgramToken(JsonField.of(cardProgramToken)) + + /** Globally unique identifier for the card program on which the card exists. */ + fun cardProgramToken(cardProgramToken: JsonField) = apply { + this.cardProgramToken = cardProgramToken + } + + /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ + fun created(created: JsonField) = apply { this.created = created } + + /** Deprecated: Funding account for the card. */ + fun funding(funding: FundingAccount) = funding(JsonField.of(funding)) + + /** Deprecated: Funding account for the card. */ + fun funding(funding: JsonField) = apply { this.funding = funding } + + /** Last four digits of the card number. */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** Last four digits of the card number. */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + + /** + * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + * attempts). + */ + fun pinStatus(pinStatus: PinStatus) = pinStatus(JsonField.of(pinStatus)) + + /** + * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect + * attempts). + */ + fun pinStatus(pinStatus: JsonField) = apply { this.pinStatus = pinStatus } + + /** + * Amount (in cents) to limit approved authorizations. Transaction requests above the spend + * limit will be declined. + */ + fun spendLimit(spendLimit: Long) = spendLimit(JsonField.of(spendLimit)) + + /** + * Amount (in cents) to limit approved authorizations. Transaction requests above the spend + * limit will be declined. + */ + fun spendLimit(spendLimit: JsonField) = apply { this.spendLimit = spendLimit } + + /** + * Spend limit duration values: + * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year. + * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the + * card. + * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. + * To support recurring monthly payments, which can occur on different day every month, + * the time window we consider for monthly velocity starts 6 days after the current + * calendar date one month prior. + * - `TRANSACTION` - Card will authorize multiple transactions if each individual + * transaction is under the spend limit. + */ + fun spendLimitDuration(spendLimitDuration: SpendLimitDuration) = + spendLimitDuration(JsonField.of(spendLimitDuration)) + + /** + * Spend limit duration values: + * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year. + * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the + * card. + * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. + * To support recurring monthly payments, which can occur on different day every month, + * the time window we consider for monthly velocity starts 6 days after the current + * calendar date one month prior. + * - `TRANSACTION` - Card will authorize multiple transactions if each individual + * transaction is under the spend limit. + */ + fun spendLimitDuration(spendLimitDuration: JsonField) = apply { + this.spendLimitDuration = spendLimitDuration + } + + /** + * Card state values: + * - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot be undone. + * - `OPEN` - Card will approve authorizations (if they match card and account parameters). + * - `PAUSED` - Card will decline authorizations, but can be resumed at a later time. + * - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The card is + * provisioned pending manufacturing and fulfillment. Cards in this state can accept + * authorizations for e-commerce purchases, but not for "Card Present" purchases where the + * physical card itself is present. + * - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + * `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state + * `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be + * used for e-commerce transactions or can be added to mobile wallets. API clients should + * update the card's state to `OPEN` only after the cardholder confirms receipt of the + * card. + * + * In sandbox, the same daily batch fulfillment occurs, but no cards are actually + * manufactured. + */ + fun state(state: State) = state(JsonField.of(state)) + + /** + * Card state values: + * - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot be undone. + * - `OPEN` - Card will approve authorizations (if they match card and account parameters). + * - `PAUSED` - Card will decline authorizations, but can be resumed at a later time. + * - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The card is + * provisioned pending manufacturing and fulfillment. Cards in this state can accept + * authorizations for e-commerce purchases, but not for "Card Present" purchases where the + * physical card itself is present. + * - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state + * `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state + * `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be + * used for e-commerce transactions or can be added to mobile wallets. API clients should + * update the card's state to `OPEN` only after the cardholder confirms receipt of the + * card. + * + * In sandbox, the same daily batch fulfillment occurs, but no cards are actually + * manufactured. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** + * Card types: + * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet + * like Apple Pay or Google Pay (if the card program is digital wallet-enabled). + * - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, + * credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at + * [lithic.com/contact](https://lithic.com/contact) for more information. + * - `SINGLE_USE` - Card is closed upon first successful authorization. + * - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + * successfully authorizes the card. + * - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL + * instead. + * - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL + * instead. + */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Card types: + * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet + * like Apple Pay or Google Pay (if the card program is digital wallet-enabled). + * - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, + * credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at + * [lithic.com/contact](https://lithic.com/contact) for more information. + * - `SINGLE_USE` - Card is closed upon first successful authorization. + * - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that + * successfully authorizes the card. + * - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL + * instead. + * - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL + * instead. + */ + fun type(type: JsonField) = apply { this.type = type } + /** * List of identifiers for the Auth Rule(s) that are applied on the card. This field is * deprecated and will no longer be populated in the `Card` object. The key will be removed @@ -488,29 +652,6 @@ private constructor( this.authRuleTokens = authRuleTokens } - /** Globally unique identifier for the card program on which the card exists. */ - fun cardProgramToken(cardProgramToken: String) = - cardProgramToken(JsonField.of(cardProgramToken)) - - /** Globally unique identifier for the card program on which the card exists. */ - fun cardProgramToken(cardProgramToken: JsonField) = apply { - this.cardProgramToken = cardProgramToken - } - - /** - * If the card is a replacement for another card, the globally unique identifier for the - * card that was replaced. - */ - fun replacementFor(replacementFor: String) = replacementFor(JsonField.of(replacementFor)) - - /** - * If the card is a replacement for another card, the globally unique identifier for the - * card that was replaced. - */ - fun replacementFor(replacementFor: JsonField) = apply { - this.replacementFor = replacementFor - } - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ fun cardholderCurrency(cardholderCurrency: String) = cardholderCurrency(JsonField.of(cardholderCurrency)) @@ -520,12 +661,6 @@ private constructor( this.cardholderCurrency = cardholderCurrency } - /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** An RFC 3339 timestamp for when the card was created. UTC time zone. */ - fun created(created: JsonField) = apply { this.created = created } - /** Three digit cvv printed on the back of the card. */ fun cvv(cvv: String) = cvv(JsonField.of(cvv)) @@ -563,24 +698,12 @@ private constructor( /** Four digit (yyyy) expiry year. */ fun expYear(expYear: JsonField) = apply { this.expYear = expYear } - /** Deprecated: Funding account for the card. */ - fun funding(funding: FundingAccount) = funding(JsonField.of(funding)) - - /** Deprecated: Funding account for the card. */ - 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)) /** Hostname of card’s locked merchant (will be empty if not applicable). */ fun hostname(hostname: JsonField) = apply { this.hostname = hostname } - /** Last four digits of the card number. */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) - - /** Last four digits of the card number. */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } - /** Friendly name to identify the card. */ fun memo(memo: String) = memo(JsonField.of(memo)) @@ -592,182 +715,59 @@ private constructor( * have PAN returned as a field in production. Please contact * [support@lithic.com](mailto:support@lithic.com) for questions. */ - fun pan(pan: String) = pan(JsonField.of(pan)) - - /** - * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to - * have PAN returned as a field in production. Please contact - * [support@lithic.com](mailto:support@lithic.com) for questions. - */ - fun pan(pan: JsonField) = apply { this.pan = pan } - - /** - * Indicates if there are offline PIN changes pending card interaction with an offline PIN - * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued - * in markets supporting offline PINs. - */ - fun pendingCommands(pendingCommands: List) = - pendingCommands(JsonField.of(pendingCommands)) - - /** - * Indicates if there are offline PIN changes pending card interaction with an offline PIN - * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued - * in markets supporting offline PINs. - */ - fun pendingCommands(pendingCommands: JsonField>) = apply { - this.pendingCommands = pendingCommands - } - - /** - * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect - * attempts). - */ - fun pinStatus(pinStatus: PinStatus) = pinStatus(JsonField.of(pinStatus)) - - /** - * Indicates if a card is blocked due a PIN status issue (e.g. excessive incorrect - * attempts). - */ - fun pinStatus(pinStatus: JsonField) = apply { this.pinStatus = pinStatus } - - /** - * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before - * use. Specifies the configuration (i.e., physical card art) that the card should be - * manufactured with. - */ - fun productId(productId: String) = productId(JsonField.of(productId)) - - /** - * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before - * use. Specifies the configuration (i.e., physical card art) that the card should be - * manufactured with. - */ - fun productId(productId: JsonField) = apply { this.productId = productId } - - /** - * Amount (in cents) to limit approved authorizations. Transaction requests above the spend - * limit will be declined. - */ - fun spendLimit(spendLimit: Long) = spendLimit(JsonField.of(spendLimit)) + fun pan(pan: String) = pan(JsonField.of(pan)) /** - * Amount (in cents) to limit approved authorizations. Transaction requests above the spend - * limit will be declined. + * Primary Account Number (PAN) (i.e. the card number). Customers must be PCI compliant to + * have PAN returned as a field in production. Please contact + * [support@lithic.com](mailto:support@lithic.com) for questions. */ - fun spendLimit(spendLimit: JsonField) = apply { this.spendLimit = spendLimit } + fun pan(pan: JsonField) = apply { this.pan = pan } /** - * Spend limit duration values: - * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year. - * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the - * card. - * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. - * To support recurring monthly payments, which can occur on different day every month, - * the time window we consider for monthly velocity starts 6 days after the current - * calendar date one month prior. - * - `TRANSACTION` - Card will authorize multiple transactions if each individual - * transaction is under the spend limit. + * Indicates if there are offline PIN changes pending card interaction with an offline PIN + * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued + * in markets supporting offline PINs. */ - fun spendLimitDuration(spendLimitDuration: SpendLimitDuration) = - spendLimitDuration(JsonField.of(spendLimitDuration)) + fun pendingCommands(pendingCommands: List) = + pendingCommands(JsonField.of(pendingCommands)) /** - * Spend limit duration values: - * - `ANNUALLY` - Card will authorize transactions up to spend limit for the trailing year. - * - `FOREVER` - Card will authorize only up to spend limit for the entire lifetime of the - * card. - * - `MONTHLY` - Card will authorize transactions up to spend limit for the trailing month. - * To support recurring monthly payments, which can occur on different day every month, - * the time window we consider for monthly velocity starts 6 days after the current - * calendar date one month prior. - * - `TRANSACTION` - Card will authorize multiple transactions if each individual - * transaction is under the spend limit. + * Indicates if there are offline PIN changes pending card interaction with an offline PIN + * terminal. Possible commands are: CHANGE_PIN, UNBLOCK_PIN. Applicable only to cards issued + * in markets supporting offline PINs. */ - fun spendLimitDuration(spendLimitDuration: JsonField) = apply { - this.spendLimitDuration = spendLimitDuration + fun pendingCommands(pendingCommands: JsonField>) = apply { + this.pendingCommands = pendingCommands } /** - * Card state values: - * - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot be undone. - * - `OPEN` - Card will approve authorizations (if they match card and account parameters). - * - `PAUSED` - Card will decline authorizations, but can be resumed at a later time. - * - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The card is - * provisioned pending manufacturing and fulfillment. Cards in this state can accept - * authorizations for e-commerce purchases, but not for "Card Present" purchases where the - * physical card itself is present. - * - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state - * `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state - * `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be - * used for e-commerce transactions or can be added to mobile wallets. API clients should - * update the card's state to `OPEN` only after the cardholder confirms receipt of the - * card. - * - * In sandbox, the same daily batch fulfillment occurs, but no cards are actually - * manufactured. + * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before + * use. Specifies the configuration (i.e., physical card art) that the card should be + * manufactured with. */ - fun state(state: State) = state(JsonField.of(state)) + fun productId(productId: String) = productId(JsonField.of(productId)) /** - * Card state values: - * - `CLOSED` - Card will no longer approve authorizations. Closing a card cannot be undone. - * - `OPEN` - Card will approve authorizations (if they match card and account parameters). - * - `PAUSED` - Card will decline authorizations, but can be resumed at a later time. - * - `PENDING_FULFILLMENT` - The initial state for cards of type `PHYSICAL`. The card is - * provisioned pending manufacturing and fulfillment. Cards in this state can accept - * authorizations for e-commerce purchases, but not for "Card Present" purchases where the - * physical card itself is present. - * - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state - * `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state - * `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be - * used for e-commerce transactions or can be added to mobile wallets. API clients should - * update the card's state to `OPEN` only after the cardholder confirms receipt of the - * card. - * - * In sandbox, the same daily batch fulfillment occurs, but no cards are actually - * manufactured. + * Only applicable to cards of type `PHYSICAL`. This must be configured with Lithic before + * use. Specifies the configuration (i.e., physical card art) that the card should be + * manufactured with. */ - fun state(state: JsonField) = apply { this.state = state } - - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } + fun productId(productId: JsonField) = apply { this.productId = productId } /** - * Card types: - * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet - * like Apple Pay or Google Pay (if the card program is digital wallet-enabled). - * - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, - * credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at - * [lithic.com/contact](https://lithic.com/contact) for more information. - * - `SINGLE_USE` - Card is closed upon first successful authorization. - * - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - * successfully authorizes the card. - * - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL - * instead. - * - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL - * instead. + * If the card is a replacement for another card, the globally unique identifier for the + * card that was replaced. */ - fun type(type: Type) = type(JsonField.of(type)) + fun replacementFor(replacementFor: String) = replacementFor(JsonField.of(replacementFor)) /** - * Card types: - * - `VIRTUAL` - Card will authorize at any merchant and can be added to a digital wallet - * like Apple Pay or Google Pay (if the card program is digital wallet-enabled). - * - `PHYSICAL` - Manufactured and sent to the cardholder. We offer white label branding, - * credit, ATM, PIN debit, chip/EMV, NFC and magstripe functionality. Reach out at - * [lithic.com/contact](https://lithic.com/contact) for more information. - * - `SINGLE_USE` - Card is closed upon first successful authorization. - * - `MERCHANT_LOCKED` - _[Deprecated]_ Card is locked to the first merchant that - * successfully authorizes the card. - * - `UNLOCKED` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL - * instead. - * - `DIGITAL_WALLET` - _[Deprecated]_ Similar behavior to VIRTUAL cards, please use VIRTUAL - * instead. + * If the card is a replacement for another card, the globally unique identifier for the + * card that was replaced. */ - fun type(type: JsonField) = apply { this.type = type } + fun replacementFor(replacementFor: JsonField) = apply { + this.replacementFor = replacementFor + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -790,29 +790,29 @@ private constructor( fun build(): Card = Card( + token, accountToken, - authRuleTokens.map { it.toImmutable() }, cardProgramToken, - replacementFor, - cardholderCurrency, created, + funding, + lastFour, + pinStatus, + spendLimit, + spendLimitDuration, + state, + type, + authRuleTokens.map { it.toImmutable() }, + cardholderCurrency, cvv, digitalCardArtToken, expMonth, expYear, - funding, hostname, - lastFour, memo, pan, pendingCommands.map { it.toImmutable() }, - pinStatus, productId, - spendLimit, - spendLimitDuration, - state, - token, - type, + replacementFor, additionalProperties.toImmutable(), ) } @@ -822,31 +822,31 @@ private constructor( class FundingAccount @JsonCreator private constructor( - @JsonProperty("account_name") + @JsonProperty("token") @ExcludeMissing - private val accountName: JsonField = JsonMissing.of(), + private val token: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), @JsonProperty("last_four") @ExcludeMissing private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("nickname") - @ExcludeMissing - private val nickname: JsonField = JsonMissing.of(), @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("account_name") + @ExcludeMissing + private val accountName: JsonField = JsonMissing.of(), + @JsonProperty("nickname") + @ExcludeMissing + private val nickname: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Account name identifying the funding source. This may be `null`. */ - fun accountName(): String? = accountName.getNullable("account_name") + /** A globally unique identifier for this FundingAccount. */ + fun token(): String = token.getRequired("token") /** * An RFC 3339 string representing when this funding source was added to the Lithic account. @@ -860,9 +860,6 @@ private constructor( */ fun lastFour(): String = lastFour.getRequired("last_four") - /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - fun nickname(): String? = nickname.getNullable("nickname") - /** * State of funding source. * @@ -874,9 +871,6 @@ private constructor( */ fun state(): State = state.getRequired("state") - /** A globally unique identifier for this FundingAccount. */ - fun token(): String = token.getRequired("token") - /** * Types of funding source: * - `DEPOSITORY_CHECKING` - Bank checking account. @@ -885,7 +879,13 @@ private constructor( fun type(): Type = type.getRequired("type") /** Account name identifying the funding source. This may be `null`. */ - @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName + fun accountName(): String? = accountName.getNullable("account_name") + + /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ + fun nickname(): String? = nickname.getNullable("nickname") + + /** A globally unique identifier for this FundingAccount. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** * An RFC 3339 string representing when this funding source was added to the Lithic account. @@ -899,9 +899,6 @@ private constructor( */ @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour - /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - @JsonProperty("nickname") @ExcludeMissing fun _nickname() = nickname - /** * State of funding source. * @@ -913,9 +910,6 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state - /** A globally unique identifier for this FundingAccount. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * Types of funding source: * - `DEPOSITORY_CHECKING` - Bank checking account. @@ -923,6 +917,12 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Account name identifying the funding source. This may be `null`. */ + @JsonProperty("account_name") @ExcludeMissing fun _accountName() = accountName + + /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ + @JsonProperty("nickname") @ExcludeMissing fun _nickname() = nickname + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -931,13 +931,13 @@ private constructor( fun validate(): FundingAccount = apply { if (!validated) { - accountName() + token() created() lastFour() - nickname() state() - token() type() + accountName() + nickname() validated = true } } @@ -951,33 +951,31 @@ private constructor( class Builder { - private var accountName: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var lastFour: JsonField = JsonMissing.of() - private var nickname: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() + private var accountName: JsonField = JsonMissing.of() + private var nickname: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(fundingAccount: FundingAccount) = apply { - accountName = fundingAccount.accountName + token = fundingAccount.token created = fundingAccount.created lastFour = fundingAccount.lastFour - nickname = fundingAccount.nickname state = fundingAccount.state - token = fundingAccount.token type = fundingAccount.type + accountName = fundingAccount.accountName + nickname = fundingAccount.nickname additionalProperties = fundingAccount.additionalProperties.toMutableMap() } - /** Account name identifying the funding source. This may be `null`. */ - fun accountName(accountName: String) = accountName(JsonField.of(accountName)) + /** A globally unique identifier for this FundingAccount. */ + fun token(token: String) = token(JsonField.of(token)) - /** Account name identifying the funding source. This may be `null`. */ - fun accountName(accountName: JsonField) = apply { - this.accountName = accountName - } + /** A globally unique identifier for this FundingAccount. */ + fun token(token: JsonField) = apply { this.token = token } /** * An RFC 3339 string representing when this funding source was added to the Lithic @@ -1003,12 +1001,6 @@ private constructor( */ fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } - /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - fun nickname(nickname: String) = nickname(JsonField.of(nickname)) - - /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ - fun nickname(nickname: JsonField) = apply { this.nickname = nickname } - /** * State of funding source. * @@ -1033,12 +1025,6 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } - /** A globally unique identifier for this FundingAccount. */ - fun token(token: String) = token(JsonField.of(token)) - - /** A globally unique identifier for this FundingAccount. */ - fun token(token: JsonField) = apply { this.token = token } - /** * Types of funding source: * - `DEPOSITORY_CHECKING` - Bank checking account. @@ -1053,6 +1039,20 @@ private constructor( */ fun type(type: JsonField) = apply { this.type = type } + /** Account name identifying the funding source. This may be `null`. */ + fun accountName(accountName: String) = accountName(JsonField.of(accountName)) + + /** Account name identifying the funding source. This may be `null`. */ + fun accountName(accountName: JsonField) = apply { + this.accountName = accountName + } + + /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ + fun nickname(nickname: String) = nickname(JsonField.of(nickname)) + + /** The nickname given to the `FundingAccount` or `null` if it has no nickname. */ + fun nickname(nickname: JsonField) = apply { this.nickname = nickname } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1074,13 +1074,13 @@ private constructor( fun build(): FundingAccount = FundingAccount( - accountName, + token, created, lastFour, - nickname, state, - token, type, + accountName, + nickname, additionalProperties.toImmutable(), ) } @@ -1210,17 +1210,17 @@ private constructor( return true } - return /* spotless:off */ other is FundingAccount && accountName == other.accountName && created == other.created && lastFour == other.lastFour && nickname == other.nickname && state == other.state && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FundingAccount && token == other.token && created == other.created && lastFour == other.lastFour && state == other.state && type == other.type && accountName == other.accountName && nickname == other.nickname && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountName, created, lastFour, nickname, state, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, lastFour, state, type, accountName, nickname, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FundingAccount{accountName=$accountName, created=$created, lastFour=$lastFour, nickname=$nickname, state=$state, token=$token, type=$type, additionalProperties=$additionalProperties}" + "FundingAccount{token=$token, created=$created, lastFour=$lastFour, state=$state, type=$type, accountName=$accountName, nickname=$nickname, additionalProperties=$additionalProperties}" } class PinStatus @@ -1447,15 +1447,15 @@ private constructor( return true } - return /* spotless:off */ other is Card && accountToken == other.accountToken && authRuleTokens == other.authRuleTokens && cardProgramToken == other.cardProgramToken && replacementFor == other.replacementFor && cardholderCurrency == other.cardholderCurrency && created == other.created && cvv == other.cvv && digitalCardArtToken == other.digitalCardArtToken && expMonth == other.expMonth && expYear == other.expYear && funding == other.funding && hostname == other.hostname && lastFour == other.lastFour && memo == other.memo && pan == other.pan && pendingCommands == other.pendingCommands && pinStatus == other.pinStatus && productId == other.productId && spendLimit == other.spendLimit && spendLimitDuration == other.spendLimitDuration && state == other.state && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Card && token == other.token && accountToken == other.accountToken && cardProgramToken == other.cardProgramToken && created == other.created && funding == other.funding && lastFour == other.lastFour && pinStatus == other.pinStatus && spendLimit == other.spendLimit && spendLimitDuration == other.spendLimitDuration && state == other.state && type == other.type && authRuleTokens == other.authRuleTokens && cardholderCurrency == other.cardholderCurrency && cvv == other.cvv && digitalCardArtToken == other.digitalCardArtToken && expMonth == other.expMonth && expYear == other.expYear && hostname == other.hostname && memo == other.memo && pan == other.pan && pendingCommands == other.pendingCommands && productId == other.productId && replacementFor == other.replacementFor && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, authRuleTokens, cardProgramToken, replacementFor, cardholderCurrency, created, cvv, digitalCardArtToken, expMonth, expYear, funding, hostname, lastFour, memo, pan, pendingCommands, pinStatus, productId, spendLimit, spendLimitDuration, state, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, cardProgramToken, created, funding, lastFour, pinStatus, spendLimit, spendLimitDuration, state, type, authRuleTokens, cardholderCurrency, cvv, digitalCardArtToken, expMonth, expYear, hostname, memo, pan, pendingCommands, productId, replacementFor, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Card{accountToken=$accountToken, authRuleTokens=$authRuleTokens, cardProgramToken=$cardProgramToken, replacementFor=$replacementFor, cardholderCurrency=$cardholderCurrency, created=$created, cvv=$cvv, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, funding=$funding, hostname=$hostname, lastFour=$lastFour, memo=$memo, pan=$pan, pendingCommands=$pendingCommands, pinStatus=$pinStatus, productId=$productId, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, token=$token, type=$type, additionalProperties=$additionalProperties}" + "Card{token=$token, accountToken=$accountToken, cardProgramToken=$cardProgramToken, created=$created, funding=$funding, lastFour=$lastFour, pinStatus=$pinStatus, spendLimit=$spendLimit, spendLimitDuration=$spendLimitDuration, state=$state, type=$type, authRuleTokens=$authRuleTokens, cardholderCurrency=$cardholderCurrency, cvv=$cvv, digitalCardArtToken=$digitalCardArtToken, expMonth=$expMonth, expYear=$expYear, hostname=$hostname, memo=$memo, pan=$pan, pendingCommands=$pendingCommands, productId=$productId, replacementFor=$replacementFor, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt index 5d279e40..070d33c2 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/CardProgram.kt @@ -20,9 +20,7 @@ import java.util.Objects class CardProgram @JsonCreator private constructor( - @JsonProperty("cardholder_currency") - @ExcludeMissing - private val cardholderCurrency: JsonField = JsonMissing.of(), + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), @@ -33,15 +31,17 @@ private constructor( @JsonProperty("pan_range_start") @ExcludeMissing private val panRangeStart: JsonField = JsonMissing.of(), + @JsonProperty("cardholder_currency") + @ExcludeMissing + private val cardholderCurrency: JsonField = JsonMissing.of(), @JsonProperty("settlement_currencies") @ExcludeMissing private val settlementCurrencies: JsonField> = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") /** Timestamp of when the card program was created. */ fun created(): OffsetDateTime = created.getRequired("created") @@ -55,6 +55,9 @@ private constructor( /** The first digits of the card number that this card program starts with. */ fun panRangeStart(): String = panRangeStart.getRequired("pan_range_start") + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(): String? = cardholderCurrency.getNullable("cardholder_currency") + /** * List of 3-digit alphabetic ISO 4217 codes for the currencies that the card program supports * for settlement. @@ -63,12 +66,7 @@ private constructor( settlementCurrencies.getNullable("settlement_currencies") /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - @JsonProperty("cardholder_currency") - @ExcludeMissing - fun _cardholderCurrency() = cardholderCurrency + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Timestamp of when the card program was created. */ @JsonProperty("created") @ExcludeMissing fun _created() = created @@ -82,6 +80,11 @@ private constructor( /** The first digits of the card number that this card program starts with. */ @JsonProperty("pan_range_start") @ExcludeMissing fun _panRangeStart() = panRangeStart + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + @JsonProperty("cardholder_currency") + @ExcludeMissing + fun _cardholderCurrency() = cardholderCurrency + /** * List of 3-digit alphabetic ISO 4217 codes for the currencies that the card program supports * for settlement. @@ -90,9 +93,6 @@ private constructor( @ExcludeMissing fun _settlementCurrencies() = settlementCurrencies - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -101,13 +101,13 @@ private constructor( fun validate(): CardProgram = apply { if (!validated) { - cardholderCurrency() + token() created() name() panRangeEnd() panRangeStart() + cardholderCurrency() settlementCurrencies() - token() validated = true } } @@ -121,34 +121,31 @@ private constructor( class Builder { - private var cardholderCurrency: JsonField = JsonMissing.of() + private var token: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var panRangeEnd: JsonField = JsonMissing.of() private var panRangeStart: JsonField = JsonMissing.of() + private var cardholderCurrency: JsonField = JsonMissing.of() private var settlementCurrencies: JsonField> = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(cardProgram: CardProgram) = apply { - cardholderCurrency = cardProgram.cardholderCurrency + token = cardProgram.token created = cardProgram.created name = cardProgram.name panRangeEnd = cardProgram.panRangeEnd panRangeStart = cardProgram.panRangeStart + cardholderCurrency = cardProgram.cardholderCurrency settlementCurrencies = cardProgram.settlementCurrencies - token = cardProgram.token additionalProperties = cardProgram.additionalProperties.toMutableMap() } - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(cardholderCurrency: String) = - cardholderCurrency(JsonField.of(cardholderCurrency)) + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) - /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ - fun cardholderCurrency(cardholderCurrency: JsonField) = apply { - this.cardholderCurrency = cardholderCurrency - } + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } /** Timestamp of when the card program was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -176,6 +173,15 @@ private constructor( this.panRangeStart = panRangeStart } + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(cardholderCurrency: String) = + cardholderCurrency(JsonField.of(cardholderCurrency)) + + /** 3-digit alphabetic ISO 4217 code for the currency of the cardholder. */ + fun cardholderCurrency(cardholderCurrency: JsonField) = apply { + this.cardholderCurrency = cardholderCurrency + } + /** * List of 3-digit alphabetic ISO 4217 codes for the currencies that the card program * supports for settlement. @@ -191,12 +197,6 @@ private constructor( this.settlementCurrencies = settlementCurrencies } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -218,13 +218,13 @@ private constructor( fun build(): CardProgram = CardProgram( - cardholderCurrency, + token, created, name, panRangeEnd, panRangeStart, + cardholderCurrency, settlementCurrencies.map { it.toImmutable() }, - token, additionalProperties.toImmutable(), ) } @@ -234,15 +234,15 @@ private constructor( return true } - return /* spotless:off */ other is CardProgram && cardholderCurrency == other.cardholderCurrency && created == other.created && name == other.name && panRangeEnd == other.panRangeEnd && panRangeStart == other.panRangeStart && settlementCurrencies == other.settlementCurrencies && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CardProgram && token == other.token && created == other.created && name == other.name && panRangeEnd == other.panRangeEnd && panRangeStart == other.panRangeStart && cardholderCurrency == other.cardholderCurrency && settlementCurrencies == other.settlementCurrencies && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(cardholderCurrency, created, name, panRangeEnd, panRangeStart, settlementCurrencies, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, name, panRangeEnd, panRangeStart, cardholderCurrency, settlementCurrencies, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CardProgram{cardholderCurrency=$cardholderCurrency, created=$created, name=$name, panRangeEnd=$panRangeEnd, panRangeStart=$panRangeStart, settlementCurrencies=$settlementCurrencies, token=$token, additionalProperties=$additionalProperties}" + "CardProgram{token=$token, created=$created, name=$name, panRangeEnd=$panRangeEnd, panRangeStart=$panRangeStart, cardholderCurrency=$cardholderCurrency, settlementCurrencies=$settlementCurrencies, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt index 286cd157..57b1a1dc 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DigitalCardArt.kt @@ -22,6 +22,7 @@ import java.util.Objects class DigitalCardArt @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("card_program_token") @ExcludeMissing private val cardProgramToken: JsonField = JsonMissing.of(), @@ -31,19 +32,21 @@ private constructor( @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), - @JsonProperty("is_card_program_default") - @ExcludeMissing - private val isCardProgramDefault: JsonField = JsonMissing.of(), @JsonProperty("is_enabled") @ExcludeMissing private val isEnabled: JsonField = JsonMissing.of(), @JsonProperty("network") @ExcludeMissing private val network: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("is_card_program_default") + @ExcludeMissing + private val isCardProgramDefault: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** 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") @@ -53,18 +56,18 @@ private constructor( /** 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(): Boolean? = - isCardProgramDefault.getNullable("is_card_program_default") - /** Whether the card art is enabled. */ fun isEnabled(): Boolean = isEnabled.getRequired("is_enabled") /** Card network. */ fun network(): Network = network.getRequired("network") + /** Whether the card art is the default card art to be added upon tokenization. */ + fun isCardProgramDefault(): Boolean? = + isCardProgramDefault.getNullable("is_card_program_default") + /** Globally unique identifier for the card art. */ - fun token(): String = token.getRequired("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Globally unique identifier for the card program. */ @JsonProperty("card_program_token") @ExcludeMissing fun _cardProgramToken() = cardProgramToken @@ -75,19 +78,16 @@ private constructor( /** 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 - /** Whether the card art is enabled. */ @JsonProperty("is_enabled") @ExcludeMissing fun _isEnabled() = isEnabled /** Card network. */ @JsonProperty("network") @ExcludeMissing fun _network() = network - /** Globally unique identifier for the card art. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the card art is the default card art to be added upon tokenization. */ + @JsonProperty("is_card_program_default") + @ExcludeMissing + fun _isCardProgramDefault() = isCardProgramDefault @JsonAnyGetter @ExcludeMissing @@ -97,13 +97,13 @@ private constructor( fun validate(): DigitalCardArt = apply { if (!validated) { + token() cardProgramToken() created() description() - isCardProgramDefault() isEnabled() network() - token() + isCardProgramDefault() validated = true } } @@ -117,26 +117,32 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var cardProgramToken: JsonField = JsonMissing.of() private var created: 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 isCardProgramDefault: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(digitalCardArt: DigitalCardArt) = apply { + token = digitalCardArt.token cardProgramToken = digitalCardArt.cardProgramToken created = digitalCardArt.created description = digitalCardArt.description - isCardProgramDefault = digitalCardArt.isCardProgramDefault isEnabled = digitalCardArt.isEnabled network = digitalCardArt.network - token = digitalCardArt.token + isCardProgramDefault = digitalCardArt.isCardProgramDefault additionalProperties = digitalCardArt.additionalProperties.toMutableMap() } + /** Globally unique identifier for the card art. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the card art. */ + fun token(token: JsonField) = apply { this.token = token } + /** Globally unique identifier for the card program. */ fun cardProgramToken(cardProgramToken: String) = cardProgramToken(JsonField.of(cardProgramToken)) @@ -158,15 +164,6 @@ private constructor( /** Description of the card art. */ 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) = - isCardProgramDefault(JsonField.of(isCardProgramDefault)) - - /** Whether the card art is the default card art to be added upon tokenization. */ - fun isCardProgramDefault(isCardProgramDefault: JsonField) = apply { - this.isCardProgramDefault = isCardProgramDefault - } - /** Whether the card art is enabled. */ fun isEnabled(isEnabled: Boolean) = isEnabled(JsonField.of(isEnabled)) @@ -179,11 +176,14 @@ private constructor( /** Card network. */ fun network(network: JsonField) = apply { this.network = network } - /** Globally unique identifier for the card art. */ - fun token(token: String) = token(JsonField.of(token)) + /** Whether the card art is the default card art to be added upon tokenization. */ + fun isCardProgramDefault(isCardProgramDefault: Boolean) = + isCardProgramDefault(JsonField.of(isCardProgramDefault)) - /** Globally unique identifier for the card art. */ - fun token(token: JsonField) = apply { this.token = token } + /** Whether the card art is the default card art to be added upon tokenization. */ + fun isCardProgramDefault(isCardProgramDefault: JsonField) = apply { + this.isCardProgramDefault = isCardProgramDefault + } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -206,13 +206,13 @@ private constructor( fun build(): DigitalCardArt = DigitalCardArt( + token, cardProgramToken, created, description, - isCardProgramDefault, isEnabled, network, - token, + isCardProgramDefault, additionalProperties.toImmutable(), ) } @@ -279,15 +279,15 @@ private constructor( return true } - return /* spotless:off */ other is DigitalCardArt && cardProgramToken == other.cardProgramToken && created == other.created && description == other.description && isCardProgramDefault == other.isCardProgramDefault && isEnabled == other.isEnabled && network == other.network && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is DigitalCardArt && token == other.token && cardProgramToken == other.cardProgramToken && created == other.created && description == other.description && isEnabled == other.isEnabled && network == other.network && isCardProgramDefault == other.isCardProgramDefault && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(cardProgramToken, created, description, isCardProgramDefault, isEnabled, network, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, cardProgramToken, created, description, isEnabled, network, isCardProgramDefault, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "DigitalCardArt{cardProgramToken=$cardProgramToken, created=$created, description=$description, isCardProgramDefault=$isCardProgramDefault, isEnabled=$isEnabled, network=$network, token=$token, additionalProperties=$additionalProperties}" + "DigitalCardArt{token=$token, cardProgramToken=$cardProgramToken, created=$created, description=$description, isEnabled=$isEnabled, network=$network, isCardProgramDefault=$isCardProgramDefault, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Dispute.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Dispute.kt index 5e734747..4c1e1b17 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Dispute.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Dispute.kt @@ -23,6 +23,7 @@ import java.util.Objects class Dispute @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("arbitration_date") @ExcludeMissing @@ -72,13 +73,15 @@ private constructor( @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("transaction_token") @ExcludeMissing private val transactionToken: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Amount under dispute. May be different from the original transaction amount. */ fun amount(): Long = amount.getRequired("amount") @@ -179,15 +182,15 @@ private constructor( */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** * The transaction that is being disputed. A transaction can only be disputed once but may have * multiple dispute cases. */ fun transactionToken(): String = transactionToken.getRequired("transaction_token") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Amount under dispute. May be different from the original transaction amount. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @@ -293,9 +296,6 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * The transaction that is being disputed. A transaction can only be disputed once but may have * multiple dispute cases. @@ -310,6 +310,7 @@ private constructor( fun validate(): Dispute = apply { if (!validated) { + token() amount() arbitrationDate() created() @@ -327,7 +328,6 @@ private constructor( resolutionNote() resolutionReason() status() - token() transactionToken() validated = true } @@ -342,6 +342,7 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var arbitrationDate: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() @@ -359,11 +360,11 @@ private constructor( private var resolutionNote: JsonField = JsonMissing.of() private var resolutionReason: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(dispute: Dispute) = apply { + token = dispute.token amount = dispute.amount arbitrationDate = dispute.arbitrationDate created = dispute.created @@ -381,11 +382,16 @@ private constructor( resolutionNote = dispute.resolutionNote resolutionReason = dispute.resolutionReason status = dispute.status - token = dispute.token transactionToken = dispute.transactionToken additionalProperties = dispute.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Amount under dispute. May be different from the original transaction amount. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -622,12 +628,6 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** * The transaction that is being disputed. A transaction can only be disputed once but may * have multiple dispute cases. @@ -664,6 +664,7 @@ private constructor( fun build(): Dispute = Dispute( + token, amount, arbitrationDate, created, @@ -681,7 +682,6 @@ private constructor( resolutionNote, resolutionReason, status, - token, transactionToken, additionalProperties.toImmutable(), ) @@ -1061,15 +1061,15 @@ private constructor( return true } - return /* spotless:off */ other is Dispute && amount == other.amount && arbitrationDate == other.arbitrationDate && created == other.created && customerFiledDate == other.customerFiledDate && customerNote == other.customerNote && networkClaimIds == other.networkClaimIds && networkFiledDate == other.networkFiledDate && networkReasonCode == other.networkReasonCode && prearbitrationDate == other.prearbitrationDate && primaryClaimId == other.primaryClaimId && reason == other.reason && representmentDate == other.representmentDate && resolutionAmount == other.resolutionAmount && resolutionDate == other.resolutionDate && resolutionNote == other.resolutionNote && resolutionReason == other.resolutionReason && status == other.status && token == other.token && transactionToken == other.transactionToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Dispute && token == other.token && amount == other.amount && arbitrationDate == other.arbitrationDate && created == other.created && customerFiledDate == other.customerFiledDate && customerNote == other.customerNote && networkClaimIds == other.networkClaimIds && networkFiledDate == other.networkFiledDate && networkReasonCode == other.networkReasonCode && prearbitrationDate == other.prearbitrationDate && primaryClaimId == other.primaryClaimId && reason == other.reason && representmentDate == other.representmentDate && resolutionAmount == other.resolutionAmount && resolutionDate == other.resolutionDate && resolutionNote == other.resolutionNote && resolutionReason == other.resolutionReason && status == other.status && transactionToken == other.transactionToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, arbitrationDate, created, customerFiledDate, customerNote, networkClaimIds, networkFiledDate, networkReasonCode, prearbitrationDate, primaryClaimId, reason, representmentDate, resolutionAmount, resolutionDate, resolutionNote, resolutionReason, status, token, transactionToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, arbitrationDate, created, customerFiledDate, customerNote, networkClaimIds, networkFiledDate, networkReasonCode, prearbitrationDate, primaryClaimId, reason, representmentDate, resolutionAmount, resolutionDate, resolutionNote, resolutionReason, status, transactionToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "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}" + "Dispute{token=$token, 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, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt index f1a5fa6c..d81b9525 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/DisputeEvidence.kt @@ -23,45 +23,37 @@ import java.util.Objects class DisputeEvidence @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), @JsonProperty("dispute_token") @ExcludeMissing private val disputeToken: JsonField = JsonMissing.of(), + @JsonProperty("upload_status") + @ExcludeMissing + private val uploadStatus: JsonField = JsonMissing.of(), @JsonProperty("download_url") @ExcludeMissing private val downloadUrl: JsonField = JsonMissing.of(), @JsonProperty("filename") @ExcludeMissing private val filename: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("upload_status") - @ExcludeMissing - private val uploadStatus: JsonField = JsonMissing.of(), @JsonProperty("upload_url") @ExcludeMissing private val uploadUrl: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Timestamp of when dispute evidence was created. */ fun created(): OffsetDateTime = created.getRequired("created") /** Dispute token evidence is attached to. */ fun disputeToken(): String = disputeToken.getRequired("dispute_token") - /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ - fun downloadUrl(): String? = downloadUrl.getNullable("download_url") - - /** - * File name of evidence. Recommended to give the dispute evidence a human-readable identifier. - */ - fun filename(): String? = filename.getNullable("filename") - - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** * Upload status types: * - `DELETED` - Evidence was deleted. @@ -72,26 +64,26 @@ private constructor( */ fun uploadStatus(): UploadStatus = uploadStatus.getRequired("upload_status") - /** URL to upload evidence. Only shown when `upload_status` is `PENDING`. */ - fun uploadUrl(): String? = uploadUrl.getNullable("upload_url") - - /** Timestamp of when dispute evidence was created. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - - /** Dispute token evidence is attached to. */ - @JsonProperty("dispute_token") @ExcludeMissing fun _disputeToken() = disputeToken - /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ - @JsonProperty("download_url") @ExcludeMissing fun _downloadUrl() = downloadUrl + fun downloadUrl(): String? = downloadUrl.getNullable("download_url") /** * File name of evidence. Recommended to give the dispute evidence a human-readable identifier. */ - @JsonProperty("filename") @ExcludeMissing fun _filename() = filename + fun filename(): String? = filename.getNullable("filename") + + /** URL to upload evidence. Only shown when `upload_status` is `PENDING`. */ + fun uploadUrl(): String? = uploadUrl.getNullable("upload_url") /** Globally unique identifier. */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Timestamp of when dispute evidence was created. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Dispute token evidence is attached to. */ + @JsonProperty("dispute_token") @ExcludeMissing fun _disputeToken() = disputeToken + /** * Upload status types: * - `DELETED` - Evidence was deleted. @@ -102,6 +94,14 @@ private constructor( */ @JsonProperty("upload_status") @ExcludeMissing fun _uploadStatus() = uploadStatus + /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ + @JsonProperty("download_url") @ExcludeMissing fun _downloadUrl() = downloadUrl + + /** + * File name of evidence. Recommended to give the dispute evidence a human-readable identifier. + */ + @JsonProperty("filename") @ExcludeMissing fun _filename() = filename + /** URL to upload evidence. Only shown when `upload_status` is `PENDING`. */ @JsonProperty("upload_url") @ExcludeMissing fun _uploadUrl() = uploadUrl @@ -113,12 +113,12 @@ private constructor( fun validate(): DisputeEvidence = apply { if (!validated) { + token() created() disputeToken() + uploadStatus() downloadUrl() filename() - token() - uploadStatus() uploadUrl() validated = true } @@ -133,26 +133,32 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var disputeToken: JsonField = JsonMissing.of() + private var uploadStatus: JsonField = JsonMissing.of() private var downloadUrl: JsonField = JsonMissing.of() private var filename: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var uploadStatus: JsonField = JsonMissing.of() private var uploadUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(disputeEvidence: DisputeEvidence) = apply { + token = disputeEvidence.token created = disputeEvidence.created disputeToken = disputeEvidence.disputeToken + uploadStatus = disputeEvidence.uploadStatus downloadUrl = disputeEvidence.downloadUrl filename = disputeEvidence.filename - token = disputeEvidence.token - uploadStatus = disputeEvidence.uploadStatus uploadUrl = disputeEvidence.uploadUrl additionalProperties = disputeEvidence.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Timestamp of when dispute evidence was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -167,30 +173,6 @@ private constructor( this.disputeToken = disputeToken } - /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ - fun downloadUrl(downloadUrl: String) = downloadUrl(JsonField.of(downloadUrl)) - - /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ - fun downloadUrl(downloadUrl: JsonField) = apply { this.downloadUrl = downloadUrl } - - /** - * File name of evidence. Recommended to give the dispute evidence a human-readable - * identifier. - */ - fun filename(filename: String) = filename(JsonField.of(filename)) - - /** - * File name of evidence. Recommended to give the dispute evidence a human-readable - * identifier. - */ - fun filename(filename: JsonField) = apply { this.filename = filename } - - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** * Upload status types: * - `DELETED` - Evidence was deleted. @@ -213,6 +195,24 @@ private constructor( this.uploadStatus = uploadStatus } + /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ + fun downloadUrl(downloadUrl: String) = downloadUrl(JsonField.of(downloadUrl)) + + /** URL to download evidence. Only shown when `upload_status` is `UPLOADED`. */ + fun downloadUrl(downloadUrl: JsonField) = apply { this.downloadUrl = downloadUrl } + + /** + * File name of evidence. Recommended to give the dispute evidence a human-readable + * identifier. + */ + fun filename(filename: String) = filename(JsonField.of(filename)) + + /** + * File name of evidence. Recommended to give the dispute evidence a human-readable + * identifier. + */ + fun filename(filename: JsonField) = apply { this.filename = filename } + /** URL to upload evidence. Only shown when `upload_status` is `PENDING`. */ fun uploadUrl(uploadUrl: String) = uploadUrl(JsonField.of(uploadUrl)) @@ -240,12 +240,12 @@ private constructor( fun build(): DisputeEvidence = DisputeEvidence( + token, created, disputeToken, + uploadStatus, downloadUrl, filename, - token, - uploadStatus, uploadUrl, additionalProperties.toImmutable(), ) @@ -331,15 +331,15 @@ private constructor( return true } - return /* spotless:off */ other is DisputeEvidence && created == other.created && disputeToken == other.disputeToken && downloadUrl == other.downloadUrl && filename == other.filename && token == other.token && uploadStatus == other.uploadStatus && uploadUrl == other.uploadUrl && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is DisputeEvidence && token == other.token && created == other.created && disputeToken == other.disputeToken && uploadStatus == other.uploadStatus && downloadUrl == other.downloadUrl && filename == other.filename && uploadUrl == other.uploadUrl && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(created, disputeToken, downloadUrl, filename, token, uploadStatus, uploadUrl, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, disputeToken, uploadStatus, downloadUrl, filename, uploadUrl, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "DisputeEvidence{created=$created, disputeToken=$disputeToken, downloadUrl=$downloadUrl, filename=$filename, token=$token, uploadStatus=$uploadStatus, uploadUrl=$uploadUrl, additionalProperties=$additionalProperties}" + "DisputeEvidence{token=$token, created=$created, disputeToken=$disputeToken, uploadStatus=$uploadStatus, downloadUrl=$downloadUrl, filename=$filename, uploadUrl=$uploadUrl, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Document.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Document.kt index ba52fe16..6e514ec3 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Document.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Document.kt @@ -343,56 +343,37 @@ private constructor( class RequiredDocumentUpload @JsonCreator private constructor( - @JsonProperty("image_type") - @ExcludeMissing - private val imageType: JsonField = JsonMissing.of(), - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), - @JsonProperty("status_reasons") - @ExcludeMissing - private val statusReasons: JsonField> = JsonMissing.of(), - @JsonProperty("upload_url") - @ExcludeMissing - private val uploadUrl: JsonField = JsonMissing.of(), @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("accepted_entity_status_reasons") @ExcludeMissing private val acceptedEntityStatusReasons: JsonField> = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("image_type") + @ExcludeMissing + private val imageType: JsonField = JsonMissing.of(), @JsonProperty("rejected_entity_status_reasons") @ExcludeMissing private val rejectedEntityStatusReasons: JsonField> = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("status") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val status: JsonField = JsonMissing.of(), + @JsonProperty("status_reasons") + @ExcludeMissing + private val statusReasons: JsonField> = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), + @JsonProperty("upload_url") + @ExcludeMissing + private val uploadUrl: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Type of image to upload. */ - fun imageType(): ImageType = imageType.getRequired("image_type") - - /** Status of an account holder's document upload. */ - fun status(): DocumentUploadStatus = status.getRequired("status") - - /** Reasons for document image upload status. */ - fun statusReasons(): List = - statusReasons.getRequired("status_reasons") - - /** - * URL to upload document image to. - * - * Note that the upload URLs expire after 7 days. If an upload URL expires, you can refresh - * the URLs by retrieving the document upload from `GET - * /account_holders/{account_holder_token}/documents`. - */ - fun uploadUrl(): String = uploadUrl.getRequired("upload_url") - /** Globally unique identifier for the document upload. */ fun token(): String = token.getRequired("token") @@ -403,6 +384,12 @@ private constructor( fun acceptedEntityStatusReasons(): List = acceptedEntityStatusReasons.getRequired("accepted_entity_status_reasons") + /** When the document upload was created */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** Type of image to upload. */ + fun imageType(): ImageType = imageType.getRequired("image_type") + /** * A list of status reasons associated with a KYB account holder that have not been * satisfied by the document upload @@ -410,20 +397,15 @@ private constructor( fun rejectedEntityStatusReasons(): List = rejectedEntityStatusReasons.getRequired("rejected_entity_status_reasons") - /** When the document upload was created */ - fun created(): OffsetDateTime = created.getRequired("created") - - /** When the document upload was last updated */ - fun updated(): OffsetDateTime = updated.getRequired("updated") - - /** Type of image to upload. */ - @JsonProperty("image_type") @ExcludeMissing fun _imageType() = imageType - /** Status of an account holder's document upload. */ - @JsonProperty("status") @ExcludeMissing fun _status() = status + fun status(): DocumentUploadStatus = status.getRequired("status") /** Reasons for document image upload status. */ - @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons + fun statusReasons(): List = + statusReasons.getRequired("status_reasons") + + /** When the document upload was last updated */ + fun updated(): OffsetDateTime = updated.getRequired("updated") /** * URL to upload document image to. @@ -432,7 +414,7 @@ private constructor( * the URLs by retrieving the document upload from `GET * /account_holders/{account_holder_token}/documents`. */ - @JsonProperty("upload_url") @ExcludeMissing fun _uploadUrl() = uploadUrl + fun uploadUrl(): String = uploadUrl.getRequired("upload_url") /** Globally unique identifier for the document upload. */ @JsonProperty("token") @ExcludeMissing fun _token() = token @@ -445,6 +427,12 @@ private constructor( @ExcludeMissing fun _acceptedEntityStatusReasons() = acceptedEntityStatusReasons + /** When the document upload was created */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** Type of image to upload. */ + @JsonProperty("image_type") @ExcludeMissing fun _imageType() = imageType + /** * A list of status reasons associated with a KYB account holder that have not been * satisfied by the document upload @@ -453,12 +441,24 @@ private constructor( @ExcludeMissing fun _rejectedEntityStatusReasons() = rejectedEntityStatusReasons - /** When the document upload was created */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Status of an account holder's document upload. */ + @JsonProperty("status") @ExcludeMissing fun _status() = status + + /** Reasons for document image upload status. */ + @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons /** When the document upload was last updated */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + /** + * URL to upload document image to. + * + * Note that the upload URLs expire after 7 days. If an upload URL expires, you can refresh + * the URLs by retrieving the document upload from `GET + * /account_holders/{account_holder_token}/documents`. + */ + @JsonProperty("upload_url") @ExcludeMissing fun _uploadUrl() = uploadUrl + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -467,15 +467,15 @@ private constructor( fun validate(): RequiredDocumentUpload = apply { if (!validated) { - imageType() - status() - statusReasons() - uploadUrl() token() acceptedEntityStatusReasons() - rejectedEntityStatusReasons() created() + imageType() + rejectedEntityStatusReasons() + status() + statusReasons() updated() + uploadUrl() validated = true } } @@ -489,70 +489,31 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() + private var acceptedEntityStatusReasons: JsonField> = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var imageType: JsonField = JsonMissing.of() + private var rejectedEntityStatusReasons: JsonField> = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() - private var uploadUrl: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var acceptedEntityStatusReasons: JsonField> = JsonMissing.of() - private var rejectedEntityStatusReasons: JsonField> = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() + private var uploadUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(requiredDocumentUpload: RequiredDocumentUpload) = apply { - imageType = requiredDocumentUpload.imageType - status = requiredDocumentUpload.status - statusReasons = requiredDocumentUpload.statusReasons - uploadUrl = requiredDocumentUpload.uploadUrl token = requiredDocumentUpload.token acceptedEntityStatusReasons = requiredDocumentUpload.acceptedEntityStatusReasons - rejectedEntityStatusReasons = requiredDocumentUpload.rejectedEntityStatusReasons created = requiredDocumentUpload.created + imageType = requiredDocumentUpload.imageType + rejectedEntityStatusReasons = requiredDocumentUpload.rejectedEntityStatusReasons + status = requiredDocumentUpload.status + statusReasons = requiredDocumentUpload.statusReasons updated = requiredDocumentUpload.updated + uploadUrl = requiredDocumentUpload.uploadUrl additionalProperties = requiredDocumentUpload.additionalProperties.toMutableMap() } - /** Type of image to upload. */ - fun imageType(imageType: ImageType) = imageType(JsonField.of(imageType)) - - /** Type of image to upload. */ - fun imageType(imageType: JsonField) = apply { this.imageType = imageType } - - /** Status of an account holder's document upload. */ - fun status(status: DocumentUploadStatus) = status(JsonField.of(status)) - - /** Status of an account holder's document upload. */ - fun status(status: JsonField) = apply { this.status = status } - - /** Reasons for document image upload status. */ - fun statusReasons(statusReasons: List) = - statusReasons(JsonField.of(statusReasons)) - - /** Reasons for document image upload status. */ - fun statusReasons(statusReasons: JsonField>) = apply { - this.statusReasons = statusReasons - } - - /** - * URL to upload document image to. - * - * Note that the upload URLs expire after 7 days. If an upload URL expires, you can - * refresh the URLs by retrieving the document upload from `GET - * /account_holders/{account_holder_token}/documents`. - */ - fun uploadUrl(uploadUrl: String) = uploadUrl(JsonField.of(uploadUrl)) - - /** - * URL to upload document image to. - * - * Note that the upload URLs expire after 7 days. If an upload URL expires, you can - * refresh the URLs by retrieving the document upload from `GET - * /account_holders/{account_holder_token}/documents`. - */ - fun uploadUrl(uploadUrl: JsonField) = apply { this.uploadUrl = uploadUrl } - /** Globally unique identifier for the document upload. */ fun token(token: String) = token(JsonField.of(token)) @@ -575,6 +536,18 @@ private constructor( this.acceptedEntityStatusReasons = acceptedEntityStatusReasons } + /** When the document upload was created */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** When the document upload was created */ + fun created(created: JsonField) = apply { this.created = created } + + /** Type of image to upload. */ + fun imageType(imageType: ImageType) = imageType(JsonField.of(imageType)) + + /** Type of image to upload. */ + fun imageType(imageType: JsonField) = apply { this.imageType = imageType } + /** * A list of status reasons associated with a KYB account holder that have not been * satisfied by the document upload @@ -591,11 +564,20 @@ private constructor( this.rejectedEntityStatusReasons = rejectedEntityStatusReasons } - /** When the document upload was created */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Status of an account holder's document upload. */ + fun status(status: DocumentUploadStatus) = status(JsonField.of(status)) - /** When the document upload was created */ - fun created(created: JsonField) = apply { this.created = created } + /** Status of an account holder's document upload. */ + fun status(status: JsonField) = apply { this.status = status } + + /** Reasons for document image upload status. */ + fun statusReasons(statusReasons: List) = + statusReasons(JsonField.of(statusReasons)) + + /** Reasons for document image upload status. */ + fun statusReasons(statusReasons: JsonField>) = apply { + this.statusReasons = statusReasons + } /** When the document upload was last updated */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -603,6 +585,24 @@ private constructor( /** When the document upload was last updated */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** + * URL to upload document image to. + * + * Note that the upload URLs expire after 7 days. If an upload URL expires, you can + * refresh the URLs by retrieving the document upload from `GET + * /account_holders/{account_holder_token}/documents`. + */ + fun uploadUrl(uploadUrl: String) = uploadUrl(JsonField.of(uploadUrl)) + + /** + * URL to upload document image to. + * + * Note that the upload URLs expire after 7 days. If an upload URL expires, you can + * refresh the URLs by retrieving the document upload from `GET + * /account_holders/{account_holder_token}/documents`. + */ + fun uploadUrl(uploadUrl: JsonField) = apply { this.uploadUrl = uploadUrl } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -624,15 +624,15 @@ private constructor( fun build(): RequiredDocumentUpload = RequiredDocumentUpload( - imageType, - status, - statusReasons.map { it.toImmutable() }, - uploadUrl, token, acceptedEntityStatusReasons.map { it.toImmutable() }, - rejectedEntityStatusReasons.map { it.toImmutable() }, created, + imageType, + rejectedEntityStatusReasons.map { it.toImmutable() }, + status, + statusReasons.map { it.toImmutable() }, updated, + uploadUrl, additionalProperties.toImmutable(), ) } @@ -891,17 +891,17 @@ private constructor( return true } - return /* spotless:off */ other is RequiredDocumentUpload && imageType == other.imageType && status == other.status && statusReasons == other.statusReasons && uploadUrl == other.uploadUrl && token == other.token && acceptedEntityStatusReasons == other.acceptedEntityStatusReasons && rejectedEntityStatusReasons == other.rejectedEntityStatusReasons && created == other.created && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is RequiredDocumentUpload && token == other.token && acceptedEntityStatusReasons == other.acceptedEntityStatusReasons && created == other.created && imageType == other.imageType && rejectedEntityStatusReasons == other.rejectedEntityStatusReasons && status == other.status && statusReasons == other.statusReasons && updated == other.updated && uploadUrl == other.uploadUrl && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(imageType, status, statusReasons, uploadUrl, token, acceptedEntityStatusReasons, rejectedEntityStatusReasons, created, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, acceptedEntityStatusReasons, created, imageType, rejectedEntityStatusReasons, status, statusReasons, updated, uploadUrl, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "RequiredDocumentUpload{imageType=$imageType, status=$status, statusReasons=$statusReasons, uploadUrl=$uploadUrl, token=$token, acceptedEntityStatusReasons=$acceptedEntityStatusReasons, rejectedEntityStatusReasons=$rejectedEntityStatusReasons, created=$created, updated=$updated, additionalProperties=$additionalProperties}" + "RequiredDocumentUpload{token=$token, acceptedEntityStatusReasons=$acceptedEntityStatusReasons, created=$created, imageType=$imageType, rejectedEntityStatusReasons=$rejectedEntityStatusReasons, status=$status, statusReasons=$statusReasons, updated=$updated, uploadUrl=$uploadUrl, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt index 50cb5bc5..76d505f6 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EnhancedData.kt @@ -23,47 +23,47 @@ class EnhancedData @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("transaction_token") + @JsonProperty("common") @ExcludeMissing - private val transactionToken: JsonField = JsonMissing.of(), + private val common: JsonField = JsonMissing.of(), @JsonProperty("event_token") @ExcludeMissing private val eventToken: JsonField = JsonMissing.of(), - @JsonProperty("common") - @ExcludeMissing - private val common: JsonField = JsonMissing.of(), @JsonProperty("fleet") @ExcludeMissing private val fleet: JsonField> = JsonMissing.of(), + @JsonProperty("transaction_token") + @ExcludeMissing + private val transactionToken: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** A unique identifier for the enhanced commercial data. */ fun token(): String = token.getRequired("token") - /** The token of the transaction that the enhanced data is associated with. */ - fun transactionToken(): String = transactionToken.getRequired("transaction_token") + fun common(): CommonData = common.getRequired("common") /** The token of the event that the enhanced data is associated with. */ fun eventToken(): String = eventToken.getRequired("event_token") - fun common(): CommonData = common.getRequired("common") - fun fleet(): List = fleet.getRequired("fleet") + /** The token of the transaction that the enhanced data is associated with. */ + fun transactionToken(): String = transactionToken.getRequired("transaction_token") + /** A unique identifier for the enhanced commercial data. */ @JsonProperty("token") @ExcludeMissing fun _token() = token - /** The token of the transaction that the enhanced data is associated with. */ - @JsonProperty("transaction_token") @ExcludeMissing fun _transactionToken() = transactionToken + @JsonProperty("common") @ExcludeMissing fun _common() = common /** The token of the event that the enhanced data is associated with. */ @JsonProperty("event_token") @ExcludeMissing fun _eventToken() = eventToken - @JsonProperty("common") @ExcludeMissing fun _common() = common - @JsonProperty("fleet") @ExcludeMissing fun _fleet() = fleet + /** The token of the transaction that the enhanced data is associated with. */ + @JsonProperty("transaction_token") @ExcludeMissing fun _transactionToken() = transactionToken + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -73,10 +73,10 @@ private constructor( fun validate(): EnhancedData = apply { if (!validated) { token() - transactionToken() - eventToken() common().validate() + eventToken() fleet().forEach { it.validate() } + transactionToken() validated = true } } @@ -91,18 +91,18 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var transactionToken: JsonField = JsonMissing.of() - private var eventToken: JsonField = JsonMissing.of() private var common: JsonField = JsonMissing.of() + private var eventToken: JsonField = JsonMissing.of() private var fleet: JsonField> = JsonMissing.of() + private var transactionToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(enhancedData: EnhancedData) = apply { token = enhancedData.token - transactionToken = enhancedData.transactionToken - eventToken = enhancedData.eventToken common = enhancedData.common + eventToken = enhancedData.eventToken fleet = enhancedData.fleet + transactionToken = enhancedData.transactionToken additionalProperties = enhancedData.additionalProperties.toMutableMap() } @@ -112,14 +112,9 @@ private constructor( /** A unique identifier for the enhanced commercial data. */ fun token(token: JsonField) = apply { this.token = token } - /** The token of the transaction that the enhanced data is associated with. */ - fun transactionToken(transactionToken: String) = - transactionToken(JsonField.of(transactionToken)) + fun common(common: CommonData) = common(JsonField.of(common)) - /** The token of the transaction that the enhanced data is associated with. */ - fun transactionToken(transactionToken: JsonField) = apply { - this.transactionToken = transactionToken - } + fun common(common: JsonField) = apply { this.common = common } /** The token of the event that the enhanced data is associated with. */ fun eventToken(eventToken: String) = eventToken(JsonField.of(eventToken)) @@ -127,14 +122,19 @@ private constructor( /** The token of the event that the enhanced data is associated with. */ fun eventToken(eventToken: JsonField) = apply { this.eventToken = eventToken } - fun common(common: CommonData) = common(JsonField.of(common)) - - fun common(common: JsonField) = apply { this.common = common } - fun fleet(fleet: List) = fleet(JsonField.of(fleet)) fun fleet(fleet: JsonField>) = apply { this.fleet = fleet } + /** The token of the transaction that the enhanced data is associated with. */ + fun transactionToken(transactionToken: String) = + transactionToken(JsonField.of(transactionToken)) + + /** The token of the transaction that the enhanced data is associated with. */ + fun transactionToken(transactionToken: JsonField) = apply { + this.transactionToken = transactionToken + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -157,10 +157,10 @@ private constructor( fun build(): EnhancedData = EnhancedData( token, - transactionToken, - eventToken, common, + eventToken, fleet.map { it.toImmutable() }, + transactionToken, additionalProperties.toImmutable(), ) } @@ -169,6 +169,10 @@ private constructor( class CommonData @JsonCreator private constructor( + @JsonProperty("line_items") + @ExcludeMissing + private val lineItems: JsonField> = JsonMissing.of(), + @JsonProperty("tax") @ExcludeMissing private val tax: JsonField = JsonMissing.of(), @JsonProperty("customer_reference_number") @ExcludeMissing private val customerReferenceNumber: JsonField = JsonMissing.of(), @@ -178,14 +182,14 @@ private constructor( @JsonProperty("order_date") @ExcludeMissing private val orderDate: JsonField = JsonMissing.of(), - @JsonProperty("tax") @ExcludeMissing private val tax: JsonField = JsonMissing.of(), - @JsonProperty("line_items") - @ExcludeMissing - private val lineItems: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun lineItems(): List = lineItems.getRequired("line_items") + + fun tax(): TaxData = tax.getRequired("tax") + /** A customer identifier. */ fun customerReferenceNumber(): String? = customerReferenceNumber.getNullable("customer_reference_number") @@ -197,9 +201,9 @@ private constructor( /** The date of the order. */ fun orderDate(): LocalDate? = orderDate.getNullable("order_date") - fun tax(): TaxData = tax.getRequired("tax") + @JsonProperty("line_items") @ExcludeMissing fun _lineItems() = lineItems - fun lineItems(): List = lineItems.getRequired("line_items") + @JsonProperty("tax") @ExcludeMissing fun _tax() = tax /** A customer identifier. */ @JsonProperty("customer_reference_number") @@ -214,10 +218,6 @@ private constructor( /** The date of the order. */ @JsonProperty("order_date") @ExcludeMissing fun _orderDate() = orderDate - @JsonProperty("tax") @ExcludeMissing fun _tax() = tax - - @JsonProperty("line_items") @ExcludeMissing fun _lineItems() = lineItems - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -226,11 +226,11 @@ private constructor( fun validate(): CommonData = apply { if (!validated) { + lineItems().forEach { it.validate() } + tax().validate() customerReferenceNumber() merchantReferenceNumber() orderDate() - tax().validate() - lineItems().forEach { it.validate() } validated = true } } @@ -244,22 +244,32 @@ private constructor( class Builder { + private var lineItems: JsonField> = JsonMissing.of() + private var tax: JsonField = JsonMissing.of() private var customerReferenceNumber: JsonField = JsonMissing.of() private var merchantReferenceNumber: JsonField = JsonMissing.of() private var orderDate: JsonField = JsonMissing.of() - private var tax: JsonField = JsonMissing.of() - private var lineItems: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(commonData: CommonData) = apply { + lineItems = commonData.lineItems + tax = commonData.tax customerReferenceNumber = commonData.customerReferenceNumber merchantReferenceNumber = commonData.merchantReferenceNumber orderDate = commonData.orderDate - tax = commonData.tax - lineItems = commonData.lineItems additionalProperties = commonData.additionalProperties.toMutableMap() } + fun lineItems(lineItems: List) = lineItems(JsonField.of(lineItems)) + + fun lineItems(lineItems: JsonField>) = apply { + this.lineItems = lineItems + } + + fun tax(tax: TaxData) = tax(JsonField.of(tax)) + + fun tax(tax: JsonField) = apply { this.tax = tax } + /** A customer identifier. */ fun customerReferenceNumber(customerReferenceNumber: String) = customerReferenceNumber(JsonField.of(customerReferenceNumber)) @@ -284,16 +294,6 @@ private constructor( /** The date of the order. */ fun orderDate(orderDate: JsonField) = apply { this.orderDate = orderDate } - fun tax(tax: TaxData) = tax(JsonField.of(tax)) - - fun tax(tax: JsonField) = apply { this.tax = tax } - - fun lineItems(lineItems: List) = lineItems(JsonField.of(lineItems)) - - fun lineItems(lineItems: JsonField>) = apply { - this.lineItems = lineItems - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -315,11 +315,11 @@ private constructor( fun build(): CommonData = CommonData( + lineItems.map { it.toImmutable() }, + tax, customerReferenceNumber, merchantReferenceNumber, orderDate, - tax, - lineItems.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -329,46 +329,46 @@ private constructor( class LineItem @JsonCreator private constructor( - @JsonProperty("product_code") + @JsonProperty("amount") @ExcludeMissing - private val productCode: JsonField = JsonMissing.of(), + private val amount: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), + @JsonProperty("product_code") + @ExcludeMissing + private val productCode: JsonField = JsonMissing.of(), @JsonProperty("quantity") @ExcludeMissing private val quantity: JsonField = JsonMissing.of(), - @JsonProperty("amount") - @ExcludeMissing - private val amount: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** An identifier for the item purchased. */ - fun productCode(): String? = productCode.getNullable("product_code") + /** The price of the item purchased in merchant currency. */ + fun amount(): Double? = amount.getNullable("amount") /** A human-readable description of the item. */ fun description(): String? = description.getNullable("description") + /** An identifier for the item purchased. */ + fun productCode(): String? = productCode.getNullable("product_code") + /** The quantity of the item purchased. */ fun quantity(): Double? = quantity.getNullable("quantity") /** The price of the item purchased in merchant currency. */ - fun amount(): Double? = amount.getNullable("amount") - - /** An identifier for the item purchased. */ - @JsonProperty("product_code") @ExcludeMissing fun _productCode() = productCode + @JsonProperty("amount") @ExcludeMissing fun _amount() = amount /** A human-readable description of the item. */ @JsonProperty("description") @ExcludeMissing fun _description() = description + /** An identifier for the item purchased. */ + @JsonProperty("product_code") @ExcludeMissing fun _productCode() = productCode + /** The quantity of the item purchased. */ @JsonProperty("quantity") @ExcludeMissing fun _quantity() = quantity - /** The price of the item purchased in merchant currency. */ - @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -377,10 +377,10 @@ private constructor( fun validate(): LineItem = apply { if (!validated) { - productCode() + amount() description() + productCode() quantity() - amount() validated = true } } @@ -394,27 +394,25 @@ private constructor( class Builder { - private var productCode: JsonField = JsonMissing.of() + private var amount: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() + private var productCode: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() - private var amount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(lineItem: LineItem) = apply { - productCode = lineItem.productCode + amount = lineItem.amount description = lineItem.description + productCode = lineItem.productCode quantity = lineItem.quantity - amount = lineItem.amount additionalProperties = lineItem.additionalProperties.toMutableMap() } - /** An identifier for the item purchased. */ - fun productCode(productCode: String) = productCode(JsonField.of(productCode)) + /** The price of the item purchased in merchant currency. */ + fun amount(amount: Double) = amount(JsonField.of(amount)) - /** An identifier for the item purchased. */ - fun productCode(productCode: JsonField) = apply { - this.productCode = productCode - } + /** The price of the item purchased in merchant currency. */ + fun amount(amount: JsonField) = apply { this.amount = amount } /** A human-readable description of the item. */ fun description(description: String) = description(JsonField.of(description)) @@ -424,18 +422,20 @@ private constructor( this.description = description } + /** An identifier for the item purchased. */ + fun productCode(productCode: String) = productCode(JsonField.of(productCode)) + + /** An identifier for the item purchased. */ + fun productCode(productCode: JsonField) = apply { + this.productCode = productCode + } + /** The quantity of the item purchased. */ fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) /** The quantity of the item purchased. */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } - /** The price of the item purchased in merchant currency. */ - fun amount(amount: Double) = amount(JsonField.of(amount)) - - /** The price of the item purchased in merchant currency. */ - fun amount(amount: JsonField) = apply { this.amount = amount } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -460,10 +460,10 @@ private constructor( fun build(): LineItem = LineItem( - productCode, + amount, description, + productCode, quantity, - amount, additionalProperties.toImmutable(), ) } @@ -473,17 +473,17 @@ private constructor( return true } - return /* spotless:off */ other is LineItem && productCode == other.productCode && description == other.description && quantity == other.quantity && amount == other.amount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LineItem && amount == other.amount && description == other.description && productCode == other.productCode && quantity == other.quantity && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(productCode, description, quantity, amount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amount, description, productCode, quantity, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "LineItem{productCode=$productCode, description=$description, quantity=$quantity, amount=$amount, additionalProperties=$additionalProperties}" + "LineItem{amount=$amount, description=$description, productCode=$productCode, quantity=$quantity, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -696,89 +696,89 @@ private constructor( return true } - return /* spotless:off */ other is CommonData && customerReferenceNumber == other.customerReferenceNumber && merchantReferenceNumber == other.merchantReferenceNumber && orderDate == other.orderDate && tax == other.tax && lineItems == other.lineItems && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CommonData && lineItems == other.lineItems && tax == other.tax && customerReferenceNumber == other.customerReferenceNumber && merchantReferenceNumber == other.merchantReferenceNumber && orderDate == other.orderDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(customerReferenceNumber, merchantReferenceNumber, orderDate, tax, lineItems, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(lineItems, tax, customerReferenceNumber, merchantReferenceNumber, orderDate, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CommonData{customerReferenceNumber=$customerReferenceNumber, merchantReferenceNumber=$merchantReferenceNumber, orderDate=$orderDate, tax=$tax, lineItems=$lineItems, additionalProperties=$additionalProperties}" + "CommonData{lineItems=$lineItems, tax=$tax, customerReferenceNumber=$customerReferenceNumber, merchantReferenceNumber=$merchantReferenceNumber, orderDate=$orderDate, additionalProperties=$additionalProperties}" } @NoAutoDetect class Fleet @JsonCreator private constructor( - @JsonProperty("service_type") - @ExcludeMissing - private val serviceType: JsonField = JsonMissing.of(), - @JsonProperty("odometer") + @JsonProperty("amount_totals") @ExcludeMissing - private val odometer: JsonField = JsonMissing.of(), - @JsonProperty("vehicle_number") + private val amountTotals: JsonField = JsonMissing.of(), + @JsonProperty("fuel") @ExcludeMissing - private val vehicleNumber: JsonField = JsonMissing.of(), + private val fuel: JsonField = JsonMissing.of(), @JsonProperty("driver_number") @ExcludeMissing private val driverNumber: JsonField = JsonMissing.of(), - @JsonProperty("fuel") + @JsonProperty("odometer") @ExcludeMissing - private val fuel: JsonField = JsonMissing.of(), - @JsonProperty("amount_totals") + private val odometer: JsonField = JsonMissing.of(), + @JsonProperty("service_type") @ExcludeMissing - private val amountTotals: JsonField = JsonMissing.of(), + private val serviceType: JsonField = JsonMissing.of(), + @JsonProperty("vehicle_number") + @ExcludeMissing + private val vehicleNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of fuel service. */ - fun serviceType(): ServiceType? = serviceType.getNullable("service_type") + fun amountTotals(): AmountTotals = amountTotals.getRequired("amount_totals") + + fun fuel(): FuelData = fuel.getRequired("fuel") + + /** + * The driver number entered into the terminal at the time of sale, with leading zeros + * stripped. + */ + fun driverNumber(): String? = driverNumber.getNullable("driver_number") /** The odometer reading entered into the terminal at the time of sale. */ fun odometer(): Long? = odometer.getNullable("odometer") + /** The type of fuel service. */ + fun serviceType(): ServiceType? = serviceType.getNullable("service_type") + /** * The vehicle number entered into the terminal at the time of sale, with leading zeros * stripped. */ fun vehicleNumber(): String? = vehicleNumber.getNullable("vehicle_number") + @JsonProperty("amount_totals") @ExcludeMissing fun _amountTotals() = amountTotals + + @JsonProperty("fuel") @ExcludeMissing fun _fuel() = fuel + /** * The driver number entered into the terminal at the time of sale, with leading zeros * stripped. */ - fun driverNumber(): String? = driverNumber.getNullable("driver_number") - - fun fuel(): FuelData = fuel.getRequired("fuel") + @JsonProperty("driver_number") @ExcludeMissing fun _driverNumber() = driverNumber - fun amountTotals(): AmountTotals = amountTotals.getRequired("amount_totals") + /** The odometer reading entered into the terminal at the time of sale. */ + @JsonProperty("odometer") @ExcludeMissing fun _odometer() = odometer /** The type of fuel service. */ @JsonProperty("service_type") @ExcludeMissing fun _serviceType() = serviceType - /** The odometer reading entered into the terminal at the time of sale. */ - @JsonProperty("odometer") @ExcludeMissing fun _odometer() = odometer - /** * The vehicle number entered into the terminal at the time of sale, with leading zeros * stripped. */ @JsonProperty("vehicle_number") @ExcludeMissing fun _vehicleNumber() = vehicleNumber - /** - * The driver number entered into the terminal at the time of sale, with leading zeros - * stripped. - */ - @JsonProperty("driver_number") @ExcludeMissing fun _driverNumber() = driverNumber - - @JsonProperty("fuel") @ExcludeMissing fun _fuel() = fuel - - @JsonProperty("amount_totals") @ExcludeMissing fun _amountTotals() = amountTotals - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -787,12 +787,12 @@ private constructor( fun validate(): Fleet = apply { if (!validated) { - serviceType() + amountTotals().validate() + fuel().validate() + driverNumber() odometer() + serviceType() vehicleNumber() - driverNumber() - fuel().validate() - amountTotals().validate() validated = true } } @@ -806,51 +806,33 @@ private constructor( class Builder { - private var serviceType: JsonField = JsonMissing.of() + private var amountTotals: JsonField = JsonMissing.of() + private var fuel: JsonField = JsonMissing.of() + private var driverNumber: JsonField = JsonMissing.of() private var odometer: JsonField = JsonMissing.of() + private var serviceType: JsonField = JsonMissing.of() private var vehicleNumber: JsonField = JsonMissing.of() - private var driverNumber: JsonField = JsonMissing.of() - private var fuel: JsonField = JsonMissing.of() - private var amountTotals: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(fleet: Fleet) = apply { - serviceType = fleet.serviceType + amountTotals = fleet.amountTotals + fuel = fleet.fuel + driverNumber = fleet.driverNumber odometer = fleet.odometer + serviceType = fleet.serviceType vehicleNumber = fleet.vehicleNumber - driverNumber = fleet.driverNumber - fuel = fleet.fuel - amountTotals = fleet.amountTotals additionalProperties = fleet.additionalProperties.toMutableMap() } - /** The type of fuel service. */ - fun serviceType(serviceType: ServiceType) = serviceType(JsonField.of(serviceType)) + fun amountTotals(amountTotals: AmountTotals) = amountTotals(JsonField.of(amountTotals)) - /** The type of fuel service. */ - fun serviceType(serviceType: JsonField) = apply { - this.serviceType = serviceType + fun amountTotals(amountTotals: JsonField) = apply { + this.amountTotals = amountTotals } - /** The odometer reading entered into the terminal at the time of sale. */ - fun odometer(odometer: Long) = odometer(JsonField.of(odometer)) - - /** The odometer reading entered into the terminal at the time of sale. */ - fun odometer(odometer: JsonField) = apply { this.odometer = odometer } - - /** - * The vehicle number entered into the terminal at the time of sale, with leading zeros - * stripped. - */ - fun vehicleNumber(vehicleNumber: String) = vehicleNumber(JsonField.of(vehicleNumber)) + fun fuel(fuel: FuelData) = fuel(JsonField.of(fuel)) - /** - * The vehicle number entered into the terminal at the time of sale, with leading zeros - * stripped. - */ - fun vehicleNumber(vehicleNumber: JsonField) = apply { - this.vehicleNumber = vehicleNumber - } + fun fuel(fuel: JsonField) = apply { this.fuel = fuel } /** * The driver number entered into the terminal at the time of sale, with leading zeros @@ -866,14 +848,32 @@ private constructor( this.driverNumber = driverNumber } - fun fuel(fuel: FuelData) = fuel(JsonField.of(fuel)) + /** The odometer reading entered into the terminal at the time of sale. */ + fun odometer(odometer: Long) = odometer(JsonField.of(odometer)) - fun fuel(fuel: JsonField) = apply { this.fuel = fuel } + /** The odometer reading entered into the terminal at the time of sale. */ + fun odometer(odometer: JsonField) = apply { this.odometer = odometer } - fun amountTotals(amountTotals: AmountTotals) = amountTotals(JsonField.of(amountTotals)) + /** The type of fuel service. */ + fun serviceType(serviceType: ServiceType) = serviceType(JsonField.of(serviceType)) - fun amountTotals(amountTotals: JsonField) = apply { - this.amountTotals = amountTotals + /** The type of fuel service. */ + fun serviceType(serviceType: JsonField) = apply { + this.serviceType = serviceType + } + + /** + * The vehicle number entered into the terminal at the time of sale, with leading zeros + * stripped. + */ + fun vehicleNumber(vehicleNumber: String) = vehicleNumber(JsonField.of(vehicleNumber)) + + /** + * The vehicle number entered into the terminal at the time of sale, with leading zeros + * stripped. + */ + fun vehicleNumber(vehicleNumber: JsonField) = apply { + this.vehicleNumber = vehicleNumber } fun additionalProperties(additionalProperties: Map) = apply { @@ -897,12 +897,12 @@ private constructor( fun build(): Fleet = Fleet( - serviceType, + amountTotals, + fuel, + driverNumber, odometer, + serviceType, vehicleNumber, - driverNumber, - fuel, - amountTotals, additionalProperties.toImmutable(), ) } @@ -911,12 +911,12 @@ private constructor( class AmountTotals @JsonCreator private constructor( - @JsonProperty("gross_sale") - @ExcludeMissing - private val grossSale: JsonField = JsonMissing.of(), @JsonProperty("discount") @ExcludeMissing private val discount: JsonField = JsonMissing.of(), + @JsonProperty("gross_sale") + @ExcludeMissing + private val grossSale: JsonField = JsonMissing.of(), @JsonProperty("net_sale") @ExcludeMissing private val netSale: JsonField = JsonMissing.of(), @@ -924,21 +924,21 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The gross sale amount. */ - fun grossSale(): Long? = grossSale.getNullable("gross_sale") - /** The discount applied to the gross sale amount. */ fun discount(): Long? = discount.getNullable("discount") + /** The gross sale amount. */ + fun grossSale(): Long? = grossSale.getNullable("gross_sale") + /** The amount after discount. */ fun netSale(): Long? = netSale.getNullable("net_sale") - /** The gross sale amount. */ - @JsonProperty("gross_sale") @ExcludeMissing fun _grossSale() = grossSale - /** The discount applied to the gross sale amount. */ @JsonProperty("discount") @ExcludeMissing fun _discount() = discount + /** The gross sale amount. */ + @JsonProperty("gross_sale") @ExcludeMissing fun _grossSale() = grossSale + /** The amount after discount. */ @JsonProperty("net_sale") @ExcludeMissing fun _netSale() = netSale @@ -950,8 +950,8 @@ private constructor( fun validate(): AmountTotals = apply { if (!validated) { - grossSale() discount() + grossSale() netSale() validated = true } @@ -966,30 +966,30 @@ private constructor( class Builder { - private var grossSale: JsonField = JsonMissing.of() private var discount: JsonField = JsonMissing.of() + private var grossSale: JsonField = JsonMissing.of() private var netSale: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(amountTotals: AmountTotals) = apply { - grossSale = amountTotals.grossSale discount = amountTotals.discount + grossSale = amountTotals.grossSale netSale = amountTotals.netSale additionalProperties = amountTotals.additionalProperties.toMutableMap() } - /** The gross sale amount. */ - fun grossSale(grossSale: Long) = grossSale(JsonField.of(grossSale)) - - /** The gross sale amount. */ - fun grossSale(grossSale: JsonField) = apply { this.grossSale = grossSale } - /** The discount applied to the gross sale amount. */ fun discount(discount: Long) = discount(JsonField.of(discount)) /** The discount applied to the gross sale amount. */ fun discount(discount: JsonField) = apply { this.discount = discount } + /** The gross sale amount. */ + fun grossSale(grossSale: Long) = grossSale(JsonField.of(grossSale)) + + /** The gross sale amount. */ + fun grossSale(grossSale: JsonField) = apply { this.grossSale = grossSale } + /** The amount after discount. */ fun netSale(netSale: Long) = netSale(JsonField.of(netSale)) @@ -1020,8 +1020,8 @@ private constructor( fun build(): AmountTotals = AmountTotals( - grossSale, discount, + grossSale, netSale, additionalProperties.toImmutable(), ) @@ -1032,63 +1032,63 @@ private constructor( return true } - return /* spotless:off */ other is AmountTotals && grossSale == other.grossSale && discount == other.discount && netSale == other.netSale && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AmountTotals && discount == other.discount && grossSale == other.grossSale && netSale == other.netSale && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(grossSale, discount, netSale, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(discount, grossSale, netSale, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AmountTotals{grossSale=$grossSale, discount=$discount, netSale=$netSale, additionalProperties=$additionalProperties}" + "AmountTotals{discount=$discount, grossSale=$grossSale, netSale=$netSale, additionalProperties=$additionalProperties}" } @NoAutoDetect class FuelData @JsonCreator private constructor( - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), @JsonProperty("quantity") @ExcludeMissing private val quantity: JsonField = JsonMissing.of(), - @JsonProperty("unit_price") + @JsonProperty("type") @ExcludeMissing - private val unitPrice: JsonField = JsonMissing.of(), + private val type: JsonField = JsonMissing.of(), @JsonProperty("unit_of_measure") @ExcludeMissing private val unitOfMeasure: JsonField = JsonMissing.of(), + @JsonProperty("unit_price") + @ExcludeMissing + private val unitPrice: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** The type of fuel purchased. */ - fun type(): FuelType? = type.getNullable("type") - /** The quantity of fuel purchased. */ fun quantity(): Double? = quantity.getNullable("quantity") - /** The price per unit of fuel. */ - fun unitPrice(): Long? = unitPrice.getNullable("unit_price") + /** The type of fuel purchased. */ + fun type(): FuelType? = type.getNullable("type") /** Unit of measure for fuel disbursement. */ fun unitOfMeasure(): FuelUnitOfMeasure? = unitOfMeasure.getNullable("unit_of_measure") - /** The type of fuel purchased. */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** The price per unit of fuel. */ + fun unitPrice(): Long? = unitPrice.getNullable("unit_price") /** The quantity of fuel purchased. */ @JsonProperty("quantity") @ExcludeMissing fun _quantity() = quantity - /** The price per unit of fuel. */ - @JsonProperty("unit_price") @ExcludeMissing fun _unitPrice() = unitPrice + /** The type of fuel purchased. */ + @JsonProperty("type") @ExcludeMissing fun _type() = type /** Unit of measure for fuel disbursement. */ @JsonProperty("unit_of_measure") @ExcludeMissing fun _unitOfMeasure() = unitOfMeasure + /** The price per unit of fuel. */ + @JsonProperty("unit_price") @ExcludeMissing fun _unitPrice() = unitPrice + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1097,10 +1097,10 @@ private constructor( fun validate(): FuelData = apply { if (!validated) { - type() quantity() - unitPrice() + type() unitOfMeasure() + unitPrice() validated = true } } @@ -1114,37 +1114,31 @@ private constructor( class Builder { - private var type: JsonField = JsonMissing.of() private var quantity: JsonField = JsonMissing.of() - private var unitPrice: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var unitOfMeasure: JsonField = JsonMissing.of() + private var unitPrice: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(fuelData: FuelData) = apply { - type = fuelData.type quantity = fuelData.quantity - unitPrice = fuelData.unitPrice + type = fuelData.type unitOfMeasure = fuelData.unitOfMeasure + unitPrice = fuelData.unitPrice additionalProperties = fuelData.additionalProperties.toMutableMap() } - /** The type of fuel purchased. */ - fun type(type: FuelType) = type(JsonField.of(type)) - - /** The type of fuel purchased. */ - fun type(type: JsonField) = apply { this.type = type } - /** The quantity of fuel purchased. */ fun quantity(quantity: Double) = quantity(JsonField.of(quantity)) /** The quantity of fuel purchased. */ fun quantity(quantity: JsonField) = apply { this.quantity = quantity } - /** The price per unit of fuel. */ - fun unitPrice(unitPrice: Long) = unitPrice(JsonField.of(unitPrice)) + /** The type of fuel purchased. */ + fun type(type: FuelType) = type(JsonField.of(type)) - /** The price per unit of fuel. */ - fun unitPrice(unitPrice: JsonField) = apply { this.unitPrice = unitPrice } + /** The type of fuel purchased. */ + fun type(type: JsonField) = apply { this.type = type } /** Unit of measure for fuel disbursement. */ fun unitOfMeasure(unitOfMeasure: FuelUnitOfMeasure) = @@ -1155,6 +1149,12 @@ private constructor( this.unitOfMeasure = unitOfMeasure } + /** The price per unit of fuel. */ + fun unitPrice(unitPrice: Long) = unitPrice(JsonField.of(unitPrice)) + + /** The price per unit of fuel. */ + fun unitPrice(unitPrice: JsonField) = apply { this.unitPrice = unitPrice } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1179,10 +1179,10 @@ private constructor( fun build(): FuelData = FuelData( - type, quantity, - unitPrice, + type, unitOfMeasure, + unitPrice, additionalProperties.toImmutable(), ) } @@ -2153,17 +2153,17 @@ private constructor( return true } - return /* spotless:off */ other is FuelData && type == other.type && quantity == other.quantity && unitPrice == other.unitPrice && unitOfMeasure == other.unitOfMeasure && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FuelData && quantity == other.quantity && type == other.type && unitOfMeasure == other.unitOfMeasure && unitPrice == other.unitPrice && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(type, quantity, unitPrice, unitOfMeasure, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(quantity, type, unitOfMeasure, unitPrice, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FuelData{type=$type, quantity=$quantity, unitPrice=$unitPrice, unitOfMeasure=$unitOfMeasure, additionalProperties=$additionalProperties}" + "FuelData{quantity=$quantity, type=$type, unitOfMeasure=$unitOfMeasure, unitPrice=$unitPrice, additionalProperties=$additionalProperties}" } class ServiceType @@ -2246,17 +2246,17 @@ private constructor( return true } - return /* spotless:off */ other is Fleet && serviceType == other.serviceType && odometer == other.odometer && vehicleNumber == other.vehicleNumber && driverNumber == other.driverNumber && fuel == other.fuel && amountTotals == other.amountTotals && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Fleet && amountTotals == other.amountTotals && fuel == other.fuel && driverNumber == other.driverNumber && odometer == other.odometer && serviceType == other.serviceType && vehicleNumber == other.vehicleNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(serviceType, odometer, vehicleNumber, driverNumber, fuel, amountTotals, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(amountTotals, fuel, driverNumber, odometer, serviceType, vehicleNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Fleet{serviceType=$serviceType, odometer=$odometer, vehicleNumber=$vehicleNumber, driverNumber=$driverNumber, fuel=$fuel, amountTotals=$amountTotals, additionalProperties=$additionalProperties}" + "Fleet{amountTotals=$amountTotals, fuel=$fuel, driverNumber=$driverNumber, odometer=$odometer, serviceType=$serviceType, vehicleNumber=$vehicleNumber, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -2264,15 +2264,15 @@ private constructor( return true } - return /* spotless:off */ other is EnhancedData && token == other.token && transactionToken == other.transactionToken && eventToken == other.eventToken && common == other.common && fleet == other.fleet && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EnhancedData && token == other.token && common == other.common && eventToken == other.eventToken && fleet == other.fleet && transactionToken == other.transactionToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, transactionToken, eventToken, common, fleet, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, common, eventToken, fleet, transactionToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EnhancedData{token=$token, transactionToken=$transactionToken, eventToken=$eventToken, common=$common, fleet=$fleet, additionalProperties=$additionalProperties}" + "EnhancedData{token=$token, common=$common, eventToken=$eventToken, fleet=$fleet, transactionToken=$transactionToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Event.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Event.kt index 9c9f964e..53ade7c7 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Event.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Event.kt @@ -23,6 +23,7 @@ import java.util.Objects class Event @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), @@ -32,10 +33,12 @@ private constructor( @JsonProperty("payload") @ExcludeMissing private val payload: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -76,7 +79,7 @@ private constructor( fun payload(): Payload = payload.getRequired("payload") /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** * An RFC 3339 timestamp for when the event was created. UTC time zone. @@ -117,9 +120,6 @@ private constructor( @JsonProperty("payload") @ExcludeMissing fun _payload() = payload - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -128,10 +128,10 @@ private constructor( fun validate(): Event = apply { if (!validated) { + token() created() eventType() payload().validate() - token() validated = true } } @@ -145,20 +145,26 @@ 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 token: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(event: Event) = apply { + token = event.token created = event.created eventType = event.eventType payload = event.payload - token = event.token additionalProperties = event.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -241,12 +247,6 @@ private constructor( fun payload(payload: JsonField) = apply { this.payload = payload } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -268,10 +268,10 @@ private constructor( fun build(): Event = Event( + token, created, eventType, payload, - token, additionalProperties.toImmutable(), ) } @@ -649,15 +649,15 @@ private constructor( return true } - return /* spotless:off */ other is Event && created == other.created && eventType == other.eventType && payload == other.payload && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Event && token == other.token && created == other.created && eventType == other.eventType && payload == other.payload && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(created, eventType, payload, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, eventType, payload, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Event{created=$created, eventType=$eventType, payload=$payload, token=$token, additionalProperties=$additionalProperties}" + "Event{token=$token, created=$created, eventType=$eventType, payload=$payload, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt index ae4fce20..4cc266d4 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/EventSubscription.kt @@ -22,32 +22,35 @@ import java.util.Objects class EventSubscription @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("description") @ExcludeMissing private val description: JsonField = JsonMissing.of(), @JsonProperty("disabled") @ExcludeMissing private val disabled: JsonField = JsonMissing.of(), + @JsonProperty("url") @ExcludeMissing private val url: JsonField = JsonMissing.of(), @JsonProperty("event_types") @ExcludeMissing private val eventTypes: JsonField> = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("url") @ExcludeMissing private val url: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** A description of the subscription. */ fun description(): String = description.getRequired("description") /** Whether the subscription is disabled. */ fun disabled(): Boolean = disabled.getRequired("disabled") + fun url(): String = url.getRequired("url") + fun eventTypes(): List? = eventTypes.getNullable("event_types") /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - - fun url(): String = url.getRequired("url") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** A description of the subscription. */ @JsonProperty("description") @ExcludeMissing fun _description() = description @@ -55,13 +58,10 @@ private constructor( /** Whether the subscription is disabled. */ @JsonProperty("disabled") @ExcludeMissing fun _disabled() = disabled - @JsonProperty("event_types") @ExcludeMissing fun _eventTypes() = eventTypes - - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("url") @ExcludeMissing fun _url() = url + @JsonProperty("event_types") @ExcludeMissing fun _eventTypes() = eventTypes + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -70,11 +70,11 @@ private constructor( fun validate(): EventSubscription = apply { if (!validated) { + token() description() disabled() - eventTypes() - token() url() + eventTypes() validated = true } } @@ -88,22 +88,28 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var description: JsonField = JsonMissing.of() private var disabled: JsonField = JsonMissing.of() - private var eventTypes: JsonField> = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var url: JsonField = JsonMissing.of() + private var eventTypes: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(eventSubscription: EventSubscription) = apply { + token = eventSubscription.token description = eventSubscription.description disabled = eventSubscription.disabled - eventTypes = eventSubscription.eventTypes - token = eventSubscription.token url = eventSubscription.url + eventTypes = eventSubscription.eventTypes additionalProperties = eventSubscription.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** A description of the subscription. */ fun description(description: String) = description(JsonField.of(description)) @@ -116,22 +122,16 @@ private constructor( /** Whether the subscription is disabled. */ fun disabled(disabled: JsonField) = apply { this.disabled = disabled } + fun url(url: String) = url(JsonField.of(url)) + + fun url(url: JsonField) = apply { this.url = url } + fun eventTypes(eventTypes: List) = eventTypes(JsonField.of(eventTypes)) fun eventTypes(eventTypes: JsonField>) = apply { this.eventTypes = eventTypes } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - - fun url(url: String) = url(JsonField.of(url)) - - fun url(url: JsonField) = apply { this.url = url } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -153,11 +153,11 @@ private constructor( fun build(): EventSubscription = EventSubscription( + token, description, disabled, - eventTypes.map { it.toImmutable() }, - token, url, + eventTypes.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -461,15 +461,15 @@ private constructor( return true } - return /* spotless:off */ other is EventSubscription && description == other.description && disabled == other.disabled && eventTypes == other.eventTypes && token == other.token && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is EventSubscription && token == other.token && description == other.description && disabled == other.disabled && url == other.url && eventTypes == other.eventTypes && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(description, disabled, eventTypes, token, url, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, description, disabled, url, eventTypes, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "EventSubscription{description=$description, disabled=$disabled, eventTypes=$eventTypes, token=$token, url=$url, additionalProperties=$additionalProperties}" + "EventSubscription{token=$token, description=$description, disabled=$disabled, url=$url, eventTypes=$eventTypes, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt index 2a8f7bdb..7827d666 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountAddress.kt @@ -22,43 +22,43 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), @JsonProperty("postal_code") @ExcludeMissing private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("country") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val address2: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun address1(): String = address1.getRequired("address1") - fun address2(): String? = address2.getNullable("address2") - 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 + fun address2(): String? = address2.getNullable("address2") - @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + @JsonProperty("address1") @ExcludeMissing fun _address1() = address1 @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 + + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 @JsonAnyGetter @ExcludeMissing @@ -69,11 +69,11 @@ private constructor( fun validate(): ExternalBankAccountAddress = apply { if (!validated) { address1() - address2() city() - state() - postalCode() country() + postalCode() + state() + address2() validated = true } } @@ -88,20 +88,20 @@ private constructor( class Builder { 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 address2: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalBankAccountAddress: ExternalBankAccountAddress) = apply { address1 = externalBankAccountAddress.address1 - address2 = externalBankAccountAddress.address2 city = externalBankAccountAddress.city - state = externalBankAccountAddress.state - postalCode = externalBankAccountAddress.postalCode country = externalBankAccountAddress.country + postalCode = externalBankAccountAddress.postalCode + state = externalBankAccountAddress.state + address2 = externalBankAccountAddress.address2 additionalProperties = externalBankAccountAddress.additionalProperties.toMutableMap() } @@ -109,25 +109,25 @@ private constructor( fun address1(address1: JsonField) = apply { this.address1 = address1 } - fun address2(address2: String) = address2(JsonField.of(address2)) - - fun address2(address2: JsonField) = apply { this.address2 = address2 } - fun city(city: String) = city(JsonField.of(city)) fun city(city: JsonField) = apply { this.city = city } - fun state(state: String) = state(JsonField.of(state)) + fun country(country: String) = country(JsonField.of(country)) - fun state(state: JsonField) = apply { this.state = state } + fun country(country: JsonField) = apply { this.country = country } fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode)) fun postalCode(postalCode: JsonField) = apply { this.postalCode = postalCode } - fun country(country: String) = country(JsonField.of(country)) + fun state(state: String) = state(JsonField.of(state)) - fun country(country: JsonField) = apply { this.country = country } + fun state(state: JsonField) = apply { this.state = state } + + fun address2(address2: String) = address2(JsonField.of(address2)) + + fun address2(address2: JsonField) = apply { this.address2 = address2 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -151,11 +151,11 @@ private constructor( fun build(): ExternalBankAccountAddress = ExternalBankAccountAddress( address1, - address2, city, - state, - postalCode, country, + postalCode, + state, + address2, additionalProperties.toImmutable(), ) } @@ -165,15 +165,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountAddress && address1 == other.address1 && address2 == other.address2 && city == other.city && state == other.state && postalCode == other.postalCode && country == other.country && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountAddress && address1 == other.address1 && city == other.city && country == other.country && postalCode == other.postalCode && state == other.state && address2 == other.address2 && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, state, postalCode, country, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, postalCode, state, address2, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountAddress{address1=$address1, address2=$address2, city=$city, state=$state, postalCode=$postalCode, country=$country, additionalProperties=$additionalProperties}" + "ExternalBankAccountAddress{address1=$address1, city=$city, country=$country, postalCode=$postalCode, state=$state, address2=$address2, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt index 5acf561a..eaefebbe 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateParams.kt @@ -409,33 +409,42 @@ constructor( class BankVerifiedCreateBankAccountApiRequest @JsonCreator private constructor( - @JsonProperty("verification_method") private val verificationMethod: VerificationMethod, - @JsonProperty("owner_type") private val ownerType: OwnerType, + @JsonProperty("account_number") private val accountNumber: String, + @JsonProperty("country") private val country: String, + @JsonProperty("currency") private val currency: String, + @JsonProperty("financial_account_token") private val financialAccountToken: String, @JsonProperty("owner") private val owner: String, + @JsonProperty("owner_type") private val ownerType: OwnerType, + @JsonProperty("routing_number") private val routingNumber: String, + @JsonProperty("type") private val type: AccountType, + @JsonProperty("verification_method") private val verificationMethod: VerificationMethod, @JsonProperty("account_token") private val accountToken: String?, + @JsonProperty("address") private val address: ExternalBankAccountAddress?, @JsonProperty("company_id") private val companyId: String?, - @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("dob") private val dob: LocalDate?, - @JsonProperty("user_defined_id") private val userDefinedId: String?, - @JsonProperty("type") private val type: AccountType, - @JsonProperty("routing_number") private val routingNumber: String, - @JsonProperty("account_number") private val accountNumber: String, + @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("name") private val name: String?, - @JsonProperty("country") private val country: String, - @JsonProperty("currency") private val currency: String, + @JsonProperty("user_defined_id") private val userDefinedId: String?, @JsonProperty("verification_enforcement") private val verificationEnforcement: Boolean?, - @JsonProperty("address") private val address: ExternalBankAccountAddress?, - @JsonProperty("financial_account_token") private val financialAccountToken: String, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod = verificationMethod + /** Account Number */ + @JsonProperty("account_number") fun accountNumber(): String = accountNumber - /** Owner Type */ - @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") fun country(): String = country + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") fun currency(): String = currency + + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + fun financialAccountToken(): String = financialAccountToken /** * Legal Name of the business or individual who owns the external account. This will appear @@ -443,55 +452,46 @@ constructor( */ @JsonProperty("owner") fun owner(): String = owner + /** Owner Type */ + @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType + + /** Routing Number */ + @JsonProperty("routing_number") fun routingNumber(): String = routingNumber + + /** Account Type */ + @JsonProperty("type") fun type(): AccountType = type + + /** Verification Method */ + @JsonProperty("verification_method") + fun verificationMethod(): VerificationMethod = verificationMethod + /** * Indicates which Lithic account the external account is associated with. For external * accounts that are associated with the program, account_token field returned will be null */ @JsonProperty("account_token") fun accountToken(): String? = accountToken + /** Address */ + @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address + /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId - /** Doing Business As */ - @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob - /** User Defined ID */ - @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId - - /** Account Type */ - @JsonProperty("type") fun type(): AccountType = type - - /** Routing Number */ - @JsonProperty("routing_number") fun routingNumber(): String = routingNumber - - /** Account Number */ - @JsonProperty("account_number") fun accountNumber(): String = accountNumber + /** Doing Business As */ + @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs /** The nickname for this External Bank Account */ @JsonProperty("name") fun name(): String? = name - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") fun country(): String = country - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") fun currency(): String = currency + /** User Defined ID */ + @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId @JsonProperty("verification_enforcement") fun verificationEnforcement(): Boolean? = verificationEnforcement - /** Address */ - @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - fun financialAccountToken(): String = financialAccountToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -505,58 +505,67 @@ constructor( class Builder { - private var verificationMethod: VerificationMethod? = null - private var ownerType: OwnerType? = null + private var accountNumber: String? = null + private var country: String? = null + private var currency: String? = null + private var financialAccountToken: String? = null private var owner: String? = null + private var ownerType: OwnerType? = null + private var routingNumber: String? = null + private var type: AccountType? = null + private var verificationMethod: VerificationMethod? = null private var accountToken: String? = null + private var address: ExternalBankAccountAddress? = null private var companyId: String? = null - private var doingBusinessAs: String? = null private var dob: LocalDate? = null - private var userDefinedId: String? = null - private var type: AccountType? = null - private var routingNumber: String? = null - private var accountNumber: String? = null + private var doingBusinessAs: String? = null private var name: String? = null - private var country: String? = null - private var currency: String? = null + private var userDefinedId: String? = null private var verificationEnforcement: Boolean? = null - private var address: ExternalBankAccountAddress? = null - private var financialAccountToken: String? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from( bankVerifiedCreateBankAccountApiRequest: BankVerifiedCreateBankAccountApiRequest ) = apply { - verificationMethod = bankVerifiedCreateBankAccountApiRequest.verificationMethod - ownerType = bankVerifiedCreateBankAccountApiRequest.ownerType + accountNumber = bankVerifiedCreateBankAccountApiRequest.accountNumber + country = bankVerifiedCreateBankAccountApiRequest.country + currency = bankVerifiedCreateBankAccountApiRequest.currency + financialAccountToken = + bankVerifiedCreateBankAccountApiRequest.financialAccountToken owner = bankVerifiedCreateBankAccountApiRequest.owner + ownerType = bankVerifiedCreateBankAccountApiRequest.ownerType + routingNumber = bankVerifiedCreateBankAccountApiRequest.routingNumber + type = bankVerifiedCreateBankAccountApiRequest.type + verificationMethod = bankVerifiedCreateBankAccountApiRequest.verificationMethod accountToken = bankVerifiedCreateBankAccountApiRequest.accountToken + address = bankVerifiedCreateBankAccountApiRequest.address companyId = bankVerifiedCreateBankAccountApiRequest.companyId - doingBusinessAs = bankVerifiedCreateBankAccountApiRequest.doingBusinessAs dob = bankVerifiedCreateBankAccountApiRequest.dob - userDefinedId = bankVerifiedCreateBankAccountApiRequest.userDefinedId - type = bankVerifiedCreateBankAccountApiRequest.type - routingNumber = bankVerifiedCreateBankAccountApiRequest.routingNumber - accountNumber = bankVerifiedCreateBankAccountApiRequest.accountNumber + doingBusinessAs = bankVerifiedCreateBankAccountApiRequest.doingBusinessAs name = bankVerifiedCreateBankAccountApiRequest.name - country = bankVerifiedCreateBankAccountApiRequest.country - currency = bankVerifiedCreateBankAccountApiRequest.currency + userDefinedId = bankVerifiedCreateBankAccountApiRequest.userDefinedId verificationEnforcement = bankVerifiedCreateBankAccountApiRequest.verificationEnforcement - address = bankVerifiedCreateBankAccountApiRequest.address - financialAccountToken = - bankVerifiedCreateBankAccountApiRequest.financialAccountToken additionalProperties = bankVerifiedCreateBankAccountApiRequest.additionalProperties.toMutableMap() } - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod - } + /** Account Number */ + fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept + * USA bank accounts e.g., USA + */ + fun country(country: String) = apply { this.country = country } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = apply { this.currency = currency } + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = apply { + this.financialAccountToken = financialAccountToken + } /** * Legal Name of the business or individual who owns the external account. This will @@ -564,6 +573,20 @@ constructor( */ fun owner(owner: String) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + + /** Routing Number */ + fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } + + /** Account Type */ + fun type(type: AccountType) = apply { this.type = type } + + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = apply { + this.verificationMethod = verificationMethod + } + /** * Indicates which Lithic account the external account is associated with. For external * accounts that are associated with the program, account_token field returned will be @@ -571,53 +594,30 @@ constructor( */ fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } + /** Address */ + fun address(address: ExternalBankAccountAddress) = apply { this.address = address } + /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = apply { this.companyId = companyId } + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = apply { this.dob = dob } + /** Doing Business As */ fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = apply { this.dob = dob } - - /** User Defined ID */ - fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } - - /** Account Type */ - fun type(type: AccountType) = apply { this.type = type } - - /** Routing Number */ - fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } - - /** Account Number */ - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - /** The nickname for this External Bank Account */ fun name(name: String) = apply { this.name = name } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept - * USA bank accounts e.g., USA - */ - fun country(country: String) = apply { this.country = country } - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = apply { this.currency = currency } + /** User Defined ID */ + fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } fun verificationEnforcement(verificationEnforcement: Boolean) = apply { this.verificationEnforcement = verificationEnforcement } - /** Address */ - fun address(address: ExternalBankAccountAddress) = apply { this.address = address } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = apply { - this.financialAccountToken = financialAccountToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -639,27 +639,27 @@ constructor( fun build(): BankVerifiedCreateBankAccountApiRequest = BankVerifiedCreateBankAccountApiRequest( + checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, + checkNotNull(country) { "`country` is required but was not set" }, + checkNotNull(currency) { "`currency` is required but was not set" }, + checkNotNull(financialAccountToken) { + "`financialAccountToken` is required but was not set" + }, + 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" }, checkNotNull(verificationMethod) { "`verificationMethod` is required but was not set" }, - checkNotNull(ownerType) { "`ownerType` is required but was not set" }, - checkNotNull(owner) { "`owner` is required but was not set" }, accountToken, + address, companyId, - doingBusinessAs, dob, - userDefinedId, - checkNotNull(type) { "`type` is required but was not set" }, - checkNotNull(routingNumber) { "`routingNumber` is required but was not set" }, - checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, + doingBusinessAs, name, - checkNotNull(country) { "`country` is required but was not set" }, - checkNotNull(currency) { "`currency` is required but was not set" }, + userDefinedId, verificationEnforcement, - address, - checkNotNull(financialAccountToken) { - "`financialAccountToken` is required but was not set" - }, additionalProperties.toImmutable(), ) } @@ -726,69 +726,69 @@ constructor( return true } - return /* spotless:off */ other is BankVerifiedCreateBankAccountApiRequest && verificationMethod == other.verificationMethod && ownerType == other.ownerType && owner == other.owner && accountToken == other.accountToken && companyId == other.companyId && doingBusinessAs == other.doingBusinessAs && dob == other.dob && userDefinedId == other.userDefinedId && type == other.type && routingNumber == other.routingNumber && accountNumber == other.accountNumber && name == other.name && country == other.country && currency == other.currency && verificationEnforcement == other.verificationEnforcement && address == other.address && financialAccountToken == other.financialAccountToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BankVerifiedCreateBankAccountApiRequest && accountNumber == other.accountNumber && country == other.country && currency == other.currency && financialAccountToken == other.financialAccountToken && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && type == other.type && verificationMethod == other.verificationMethod && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && name == other.name && userDefinedId == other.userDefinedId && verificationEnforcement == other.verificationEnforcement && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(verificationMethod, ownerType, owner, accountToken, companyId, doingBusinessAs, dob, userDefinedId, type, routingNumber, accountNumber, name, country, currency, verificationEnforcement, address, financialAccountToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountNumber, country, currency, financialAccountToken, owner, ownerType, routingNumber, type, verificationMethod, accountToken, address, companyId, dob, doingBusinessAs, name, userDefinedId, verificationEnforcement, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BankVerifiedCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, doingBusinessAs=$doingBusinessAs, dob=$dob, userDefinedId=$userDefinedId, type=$type, routingNumber=$routingNumber, accountNumber=$accountNumber, name=$name, country=$country, currency=$currency, verificationEnforcement=$verificationEnforcement, address=$address, financialAccountToken=$financialAccountToken, additionalProperties=$additionalProperties}" + "BankVerifiedCreateBankAccountApiRequest{accountNumber=$accountNumber, country=$country, currency=$currency, financialAccountToken=$financialAccountToken, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, type=$type, verificationMethod=$verificationMethod, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, name=$name, userDefinedId=$userDefinedId, verificationEnforcement=$verificationEnforcement, additionalProperties=$additionalProperties}" } @NoAutoDetect class PlaidCreateBankAccountApiRequest @JsonCreator private constructor( - @JsonProperty("verification_method") private val verificationMethod: VerificationMethod, - @JsonProperty("owner_type") private val ownerType: OwnerType, @JsonProperty("owner") private val owner: String, + @JsonProperty("owner_type") private val ownerType: OwnerType, + @JsonProperty("processor_token") private val processorToken: String, + @JsonProperty("verification_method") private val verificationMethod: VerificationMethod, @JsonProperty("account_token") private val accountToken: String?, @JsonProperty("company_id") private val companyId: String?, - @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("dob") private val dob: LocalDate?, + @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("user_defined_id") private val userDefinedId: String?, - @JsonProperty("processor_token") private val processorToken: String, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(): VerificationMethod = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType - /** * Legal Name of the business or individual who owns the external account. This will appear * in statements */ @JsonProperty("owner") fun owner(): String = owner - /** - * Indicates which Lithic account the external account is associated with. For external - * accounts that are associated with the program, account_token field returned will be null - */ - @JsonProperty("account_token") fun accountToken(): String? = accountToken + /** Owner Type */ + @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType + + @JsonProperty("processor_token") fun processorToken(): String = processorToken + + /** Verification Method */ + @JsonProperty("verification_method") + fun verificationMethod(): VerificationMethod = verificationMethod + + /** + * Indicates which Lithic account the external account is associated with. For external + * accounts that are associated with the program, account_token field returned will be null + */ + @JsonProperty("account_token") fun accountToken(): String? = accountToken /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId - /** Doing Business As */ - @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob + /** Doing Business As */ + @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs + /** User Defined ID */ @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId - @JsonProperty("processor_token") fun processorToken(): String = processorToken - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -802,46 +802,50 @@ constructor( class Builder { - private var verificationMethod: VerificationMethod? = null - private var ownerType: OwnerType? = null private var owner: String? = null + private var ownerType: OwnerType? = null + private var processorToken: String? = null + private var verificationMethod: VerificationMethod? = null private var accountToken: String? = null private var companyId: String? = null - private var doingBusinessAs: String? = null private var dob: LocalDate? = null + private var doingBusinessAs: String? = null private var userDefinedId: String? = null - private var processorToken: String? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from(plaidCreateBankAccountApiRequest: PlaidCreateBankAccountApiRequest) = apply { - verificationMethod = plaidCreateBankAccountApiRequest.verificationMethod - ownerType = plaidCreateBankAccountApiRequest.ownerType owner = plaidCreateBankAccountApiRequest.owner + ownerType = plaidCreateBankAccountApiRequest.ownerType + processorToken = plaidCreateBankAccountApiRequest.processorToken + verificationMethod = plaidCreateBankAccountApiRequest.verificationMethod accountToken = plaidCreateBankAccountApiRequest.accountToken companyId = plaidCreateBankAccountApiRequest.companyId - doingBusinessAs = plaidCreateBankAccountApiRequest.doingBusinessAs dob = plaidCreateBankAccountApiRequest.dob + doingBusinessAs = plaidCreateBankAccountApiRequest.doingBusinessAs userDefinedId = plaidCreateBankAccountApiRequest.userDefinedId - processorToken = plaidCreateBankAccountApiRequest.processorToken additionalProperties = plaidCreateBankAccountApiRequest.additionalProperties.toMutableMap() } - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } - /** * Legal Name of the business or individual who owns the external account. This will * appear in statements */ fun owner(owner: String) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + + fun processorToken(processorToken: String) = apply { + this.processorToken = processorToken + } + + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = apply { + this.verificationMethod = verificationMethod + } + /** * Indicates which Lithic account the external account is associated with. For external * accounts that are associated with the program, account_token field returned will be @@ -852,21 +856,17 @@ constructor( /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = apply { this.companyId = companyId } + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = apply { this.dob = dob } + /** Doing Business As */ fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = apply { this.dob = dob } - /** User Defined ID */ fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } - fun processorToken(processorToken: String) = apply { - this.processorToken = processorToken - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -888,17 +888,17 @@ constructor( fun build(): PlaidCreateBankAccountApiRequest = PlaidCreateBankAccountApiRequest( + 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" }, checkNotNull(verificationMethod) { "`verificationMethod` is required but was not set" }, - checkNotNull(ownerType) { "`ownerType` is required but was not set" }, - checkNotNull(owner) { "`owner` is required but was not set" }, accountToken, companyId, - doingBusinessAs, dob, + doingBusinessAs, userDefinedId, - checkNotNull(processorToken) { "`processorToken` is required but was not set" }, additionalProperties.toImmutable(), ) } @@ -908,49 +908,54 @@ constructor( return true } - return /* spotless:off */ other is PlaidCreateBankAccountApiRequest && verificationMethod == other.verificationMethod && ownerType == other.ownerType && owner == other.owner && accountToken == other.accountToken && companyId == other.companyId && doingBusinessAs == other.doingBusinessAs && dob == other.dob && userDefinedId == other.userDefinedId && processorToken == other.processorToken && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PlaidCreateBankAccountApiRequest && owner == other.owner && ownerType == other.ownerType && processorToken == other.processorToken && verificationMethod == other.verificationMethod && accountToken == other.accountToken && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(verificationMethod, ownerType, owner, accountToken, companyId, doingBusinessAs, dob, userDefinedId, processorToken, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(owner, ownerType, processorToken, verificationMethod, accountToken, companyId, dob, doingBusinessAs, userDefinedId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PlaidCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, doingBusinessAs=$doingBusinessAs, dob=$dob, userDefinedId=$userDefinedId, processorToken=$processorToken, additionalProperties=$additionalProperties}" + "PlaidCreateBankAccountApiRequest{owner=$owner, ownerType=$ownerType, processorToken=$processorToken, verificationMethod=$verificationMethod, accountToken=$accountToken, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } @NoAutoDetect class ExternallyVerifiedCreateBankAccountApiRequest @JsonCreator private constructor( + @JsonProperty("account_number") private val accountNumber: String, + @JsonProperty("country") private val country: String, + @JsonProperty("currency") private val currency: String, + @JsonProperty("owner") private val owner: String, + @JsonProperty("owner_type") private val ownerType: OwnerType, + @JsonProperty("routing_number") private val routingNumber: String, + @JsonProperty("type") private val type: Type, @JsonProperty("verification_method") private val verificationMethod: ExternallyVerifiedVerificationMethod, - @JsonProperty("owner_type") private val ownerType: OwnerType, - @JsonProperty("owner") private val owner: String, @JsonProperty("account_token") private val accountToken: String?, + @JsonProperty("address") private val address: ExternalBankAccountAddress?, @JsonProperty("company_id") private val companyId: String?, - @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("dob") private val dob: LocalDate?, - @JsonProperty("user_defined_id") private val userDefinedId: String?, - @JsonProperty("type") private val type: Type, - @JsonProperty("routing_number") private val routingNumber: String, - @JsonProperty("account_number") private val accountNumber: String, + @JsonProperty("doing_business_as") private val doingBusinessAs: String?, @JsonProperty("name") private val name: String?, - @JsonProperty("country") private val country: String, - @JsonProperty("currency") private val currency: String, - @JsonProperty("address") private val address: ExternalBankAccountAddress?, + @JsonProperty("user_defined_id") private val userDefinedId: String?, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Verification Method */ - @JsonProperty("verification_method") - fun verificationMethod(): ExternallyVerifiedVerificationMethod = verificationMethod + /** Account Number */ + @JsonProperty("account_number") fun accountNumber(): String = accountNumber - /** Owner Type */ - @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") fun country(): String = country + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") fun currency(): String = currency /** * Legal Name of the business or individual who owns the external account. This will appear @@ -958,47 +963,42 @@ constructor( */ @JsonProperty("owner") fun owner(): String = owner + /** Owner Type */ + @JsonProperty("owner_type") fun ownerType(): OwnerType = ownerType + + /** Routing Number */ + @JsonProperty("routing_number") fun routingNumber(): String = routingNumber + + /** Account Type */ + @JsonProperty("type") fun type(): Type = type + + /** Verification Method */ + @JsonProperty("verification_method") + fun verificationMethod(): ExternallyVerifiedVerificationMethod = verificationMethod + /** * Indicates which Lithic account the external account is associated with. For external * accounts that are associated with the program, account_token field returned will be null */ @JsonProperty("account_token") fun accountToken(): String? = accountToken + /** Address */ + @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address + /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") fun companyId(): String? = companyId - /** Doing Business As */ - @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs - /** Date of Birth of the Individual that owns the external bank account */ @JsonProperty("dob") fun dob(): LocalDate? = dob - /** User Defined ID */ - @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId - - /** Account Type */ - @JsonProperty("type") fun type(): Type = type - - /** Routing Number */ - @JsonProperty("routing_number") fun routingNumber(): String = routingNumber - - /** Account Number */ - @JsonProperty("account_number") fun accountNumber(): String = accountNumber + /** Doing Business As */ + @JsonProperty("doing_business_as") fun doingBusinessAs(): String? = doingBusinessAs /** The nickname for this External Bank Account */ @JsonProperty("name") fun name(): String? = name - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") fun country(): String = country - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") fun currency(): String = currency - - /** Address */ - @JsonProperty("address") fun address(): ExternalBankAccountAddress? = address + /** User Defined ID */ + @JsonProperty("user_defined_id") fun userDefinedId(): String? = userDefinedId @JsonAnyGetter @ExcludeMissing @@ -1013,56 +1013,59 @@ constructor( class Builder { - private var verificationMethod: ExternallyVerifiedVerificationMethod? = null - private var ownerType: OwnerType? = null + private var accountNumber: String? = null + private var country: String? = null + private var currency: String? = null private var owner: String? = null + private var ownerType: OwnerType? = null + private var routingNumber: String? = null + private var type: Type? = null + private var verificationMethod: ExternallyVerifiedVerificationMethod? = null private var accountToken: String? = null + private var address: ExternalBankAccountAddress? = null private var companyId: String? = null - private var doingBusinessAs: String? = null private var dob: LocalDate? = null - private var userDefinedId: String? = null - private var type: Type? = null - private var routingNumber: String? = null - private var accountNumber: String? = null + private var doingBusinessAs: String? = null private var name: String? = null - private var country: String? = null - private var currency: String? = null - private var address: ExternalBankAccountAddress? = null + private var userDefinedId: String? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from( externallyVerifiedCreateBankAccountApiRequest: ExternallyVerifiedCreateBankAccountApiRequest ) = apply { + accountNumber = externallyVerifiedCreateBankAccountApiRequest.accountNumber + country = externallyVerifiedCreateBankAccountApiRequest.country + currency = externallyVerifiedCreateBankAccountApiRequest.currency + owner = externallyVerifiedCreateBankAccountApiRequest.owner + ownerType = externallyVerifiedCreateBankAccountApiRequest.ownerType + routingNumber = externallyVerifiedCreateBankAccountApiRequest.routingNumber + type = externallyVerifiedCreateBankAccountApiRequest.type verificationMethod = externallyVerifiedCreateBankAccountApiRequest.verificationMethod - ownerType = externallyVerifiedCreateBankAccountApiRequest.ownerType - owner = externallyVerifiedCreateBankAccountApiRequest.owner accountToken = externallyVerifiedCreateBankAccountApiRequest.accountToken + address = externallyVerifiedCreateBankAccountApiRequest.address companyId = externallyVerifiedCreateBankAccountApiRequest.companyId - doingBusinessAs = externallyVerifiedCreateBankAccountApiRequest.doingBusinessAs dob = externallyVerifiedCreateBankAccountApiRequest.dob - userDefinedId = externallyVerifiedCreateBankAccountApiRequest.userDefinedId - type = externallyVerifiedCreateBankAccountApiRequest.type - routingNumber = externallyVerifiedCreateBankAccountApiRequest.routingNumber - accountNumber = externallyVerifiedCreateBankAccountApiRequest.accountNumber + doingBusinessAs = externallyVerifiedCreateBankAccountApiRequest.doingBusinessAs name = externallyVerifiedCreateBankAccountApiRequest.name - country = externallyVerifiedCreateBankAccountApiRequest.country - currency = externallyVerifiedCreateBankAccountApiRequest.currency - address = externallyVerifiedCreateBankAccountApiRequest.address + userDefinedId = externallyVerifiedCreateBankAccountApiRequest.userDefinedId additionalProperties = externallyVerifiedCreateBankAccountApiRequest.additionalProperties .toMutableMap() } - /** Verification Method */ - fun verificationMethod(verificationMethod: ExternallyVerifiedVerificationMethod) = - apply { - this.verificationMethod = verificationMethod - } + /** Account Number */ + fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept + * USA bank accounts e.g., USA + */ + fun country(country: String) = apply { this.country = country } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = apply { this.currency = currency } /** * Legal Name of the business or individual who owns the external account. This will @@ -1070,6 +1073,21 @@ constructor( */ fun owner(owner: String) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = apply { this.ownerType = ownerType } + + /** Routing Number */ + fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } + + /** Account Type */ + fun type(type: Type) = apply { this.type = type } + + /** Verification Method */ + fun verificationMethod(verificationMethod: ExternallyVerifiedVerificationMethod) = + apply { + this.verificationMethod = verificationMethod + } + /** * Indicates which Lithic account the external account is associated with. For external * accounts that are associated with the program, account_token field returned will be @@ -1077,43 +1095,25 @@ constructor( */ fun accountToken(accountToken: String) = apply { this.accountToken = accountToken } + /** Address */ + fun address(address: ExternalBankAccountAddress) = apply { this.address = address } + /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = apply { this.companyId = companyId } + /** Date of Birth of the Individual that owns the external bank account */ + fun dob(dob: LocalDate) = apply { this.dob = dob } + /** Doing Business As */ fun doingBusinessAs(doingBusinessAs: String) = apply { this.doingBusinessAs = doingBusinessAs } - /** Date of Birth of the Individual that owns the external bank account */ - fun dob(dob: LocalDate) = apply { this.dob = dob } - - /** User Defined ID */ - fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } - - /** Account Type */ - fun type(type: Type) = apply { this.type = type } - - /** Routing Number */ - fun routingNumber(routingNumber: String) = apply { this.routingNumber = routingNumber } - - /** Account Number */ - fun accountNumber(accountNumber: String) = apply { this.accountNumber = accountNumber } - /** The nickname for this External Bank Account */ fun name(name: String) = apply { this.name = name } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept - * USA bank accounts e.g., USA - */ - fun country(country: String) = apply { this.country = country } - - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = apply { this.currency = currency } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = apply { this.address = address } + /** User Defined ID */ + fun userDefinedId(userDefinedId: String) = apply { this.userDefinedId = userDefinedId } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1136,23 +1136,23 @@ constructor( fun build(): ExternallyVerifiedCreateBankAccountApiRequest = ExternallyVerifiedCreateBankAccountApiRequest( + checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, + checkNotNull(country) { "`country` is required but was not set" }, + checkNotNull(currency) { "`currency` is required but was not set" }, + 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" }, checkNotNull(verificationMethod) { "`verificationMethod` is required but was not set" }, - checkNotNull(ownerType) { "`ownerType` is required but was not set" }, - checkNotNull(owner) { "`owner` is required but was not set" }, accountToken, + address, companyId, - doingBusinessAs, dob, - userDefinedId, - checkNotNull(type) { "`type` is required but was not set" }, - checkNotNull(routingNumber) { "`routingNumber` is required but was not set" }, - checkNotNull(accountNumber) { "`accountNumber` is required but was not set" }, + doingBusinessAs, name, - checkNotNull(country) { "`country` is required but was not set" }, - checkNotNull(currency) { "`currency` is required but was not set" }, - address, + userDefinedId, additionalProperties.toImmutable(), ) } @@ -1273,17 +1273,17 @@ constructor( return true } - return /* spotless:off */ other is ExternallyVerifiedCreateBankAccountApiRequest && verificationMethod == other.verificationMethod && ownerType == other.ownerType && owner == other.owner && accountToken == other.accountToken && companyId == other.companyId && doingBusinessAs == other.doingBusinessAs && dob == other.dob && userDefinedId == other.userDefinedId && type == other.type && routingNumber == other.routingNumber && accountNumber == other.accountNumber && name == other.name && country == other.country && currency == other.currency && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternallyVerifiedCreateBankAccountApiRequest && accountNumber == other.accountNumber && country == other.country && currency == other.currency && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && type == other.type && verificationMethod == other.verificationMethod && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && name == other.name && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(verificationMethod, ownerType, owner, accountToken, companyId, doingBusinessAs, dob, userDefinedId, type, routingNumber, accountNumber, name, country, currency, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountNumber, country, currency, owner, ownerType, routingNumber, type, verificationMethod, accountToken, address, companyId, dob, doingBusinessAs, name, userDefinedId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternallyVerifiedCreateBankAccountApiRequest{verificationMethod=$verificationMethod, ownerType=$ownerType, owner=$owner, accountToken=$accountToken, companyId=$companyId, doingBusinessAs=$doingBusinessAs, dob=$dob, userDefinedId=$userDefinedId, type=$type, routingNumber=$routingNumber, accountNumber=$accountNumber, name=$name, country=$country, currency=$currency, address=$address, additionalProperties=$additionalProperties}" + "ExternallyVerifiedCreateBankAccountApiRequest{accountNumber=$accountNumber, country=$country, currency=$currency, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, type=$type, verificationMethod=$verificationMethod, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, name=$name, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt index c7b76c1a..90fe3f11 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountCreateResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountCreateResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountCreateResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,54 +301,54 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalBankAccountCreateResponse: ExternalBankAccountCreateResponse) = apply { token = externalBankAccountCreateResponse.token + country = externalBankAccountCreateResponse.country + created = externalBankAccountCreateResponse.created + currency = externalBankAccountCreateResponse.currency + lastFour = externalBankAccountCreateResponse.lastFour owner = externalBankAccountCreateResponse.owner + ownerType = externalBankAccountCreateResponse.ownerType routingNumber = externalBankAccountCreateResponse.routingNumber - lastFour = externalBankAccountCreateResponse.lastFour - name = externalBankAccountCreateResponse.name - currency = externalBankAccountCreateResponse.currency - country = externalBankAccountCreateResponse.country + state = externalBankAccountCreateResponse.state + type = externalBankAccountCreateResponse.type + verificationAttempts = externalBankAccountCreateResponse.verificationAttempts + verificationMethod = externalBankAccountCreateResponse.verificationMethod + verificationState = externalBankAccountCreateResponse.verificationState accountToken = externalBankAccountCreateResponse.accountToken - created = externalBankAccountCreateResponse.created + address = externalBankAccountCreateResponse.address companyId = externalBankAccountCreateResponse.companyId dob = externalBankAccountCreateResponse.dob doingBusinessAs = externalBankAccountCreateResponse.doingBusinessAs + financialAccountToken = externalBankAccountCreateResponse.financialAccountToken + name = externalBankAccountCreateResponse.name userDefinedId = externalBankAccountCreateResponse.userDefinedId verificationFailedReason = externalBankAccountCreateResponse.verificationFailedReason - verificationAttempts = externalBankAccountCreateResponse.verificationAttempts - financialAccountToken = externalBankAccountCreateResponse.financialAccountToken - type = externalBankAccountCreateResponse.type - verificationMethod = externalBankAccountCreateResponse.verificationMethod - ownerType = externalBankAccountCreateResponse.ownerType - state = externalBankAccountCreateResponse.state - verificationState = externalBankAccountCreateResponse.verificationState - address = externalBankAccountCreateResponse.address additionalProperties = externalBankAccountCreateResponse.additionalProperties.toMutableMap() } @@ -367,6 +367,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -379,6 +417,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -387,39 +431,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -435,15 +484,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -466,6 +513,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -491,68 +553,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -575,27 +575,27 @@ private constructor( fun build(): ExternalBankAccountCreateResponse = ExternalBankAccountCreateResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -920,15 +920,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountCreateResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountCreateResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountCreateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountCreateResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt index 175ec851..9b292c0b 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountListResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountListResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountListResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,53 +301,53 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalBankAccountListResponse: ExternalBankAccountListResponse) = apply { token = externalBankAccountListResponse.token + country = externalBankAccountListResponse.country + created = externalBankAccountListResponse.created + currency = externalBankAccountListResponse.currency + lastFour = externalBankAccountListResponse.lastFour owner = externalBankAccountListResponse.owner + ownerType = externalBankAccountListResponse.ownerType routingNumber = externalBankAccountListResponse.routingNumber - lastFour = externalBankAccountListResponse.lastFour - name = externalBankAccountListResponse.name - currency = externalBankAccountListResponse.currency - country = externalBankAccountListResponse.country + state = externalBankAccountListResponse.state + type = externalBankAccountListResponse.type + verificationAttempts = externalBankAccountListResponse.verificationAttempts + verificationMethod = externalBankAccountListResponse.verificationMethod + verificationState = externalBankAccountListResponse.verificationState accountToken = externalBankAccountListResponse.accountToken - created = externalBankAccountListResponse.created + address = externalBankAccountListResponse.address companyId = externalBankAccountListResponse.companyId dob = externalBankAccountListResponse.dob doingBusinessAs = externalBankAccountListResponse.doingBusinessAs + financialAccountToken = externalBankAccountListResponse.financialAccountToken + name = externalBankAccountListResponse.name userDefinedId = externalBankAccountListResponse.userDefinedId verificationFailedReason = externalBankAccountListResponse.verificationFailedReason - verificationAttempts = externalBankAccountListResponse.verificationAttempts - financialAccountToken = externalBankAccountListResponse.financialAccountToken - type = externalBankAccountListResponse.type - verificationMethod = externalBankAccountListResponse.verificationMethod - ownerType = externalBankAccountListResponse.ownerType - state = externalBankAccountListResponse.state - verificationState = externalBankAccountListResponse.verificationState - address = externalBankAccountListResponse.address additionalProperties = externalBankAccountListResponse.additionalProperties.toMutableMap() } @@ -366,6 +366,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -378,6 +416,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -386,39 +430,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -434,15 +483,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -465,6 +512,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -490,68 +552,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -574,27 +574,27 @@ private constructor( fun build(): ExternalBankAccountListResponse = ExternalBankAccountListResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -919,15 +919,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountListResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountListResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountListResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountListResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt index cd4e5a9d..1397d471 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetrieveResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountRetrieveResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountRetrieveResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,54 +301,54 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( externalBankAccountRetrieveResponse: ExternalBankAccountRetrieveResponse ) = apply { token = externalBankAccountRetrieveResponse.token + country = externalBankAccountRetrieveResponse.country + created = externalBankAccountRetrieveResponse.created + currency = externalBankAccountRetrieveResponse.currency + lastFour = externalBankAccountRetrieveResponse.lastFour owner = externalBankAccountRetrieveResponse.owner + ownerType = externalBankAccountRetrieveResponse.ownerType routingNumber = externalBankAccountRetrieveResponse.routingNumber - lastFour = externalBankAccountRetrieveResponse.lastFour - name = externalBankAccountRetrieveResponse.name - currency = externalBankAccountRetrieveResponse.currency - country = externalBankAccountRetrieveResponse.country + state = externalBankAccountRetrieveResponse.state + type = externalBankAccountRetrieveResponse.type + verificationAttempts = externalBankAccountRetrieveResponse.verificationAttempts + verificationMethod = externalBankAccountRetrieveResponse.verificationMethod + verificationState = externalBankAccountRetrieveResponse.verificationState accountToken = externalBankAccountRetrieveResponse.accountToken - created = externalBankAccountRetrieveResponse.created + address = externalBankAccountRetrieveResponse.address companyId = externalBankAccountRetrieveResponse.companyId dob = externalBankAccountRetrieveResponse.dob doingBusinessAs = externalBankAccountRetrieveResponse.doingBusinessAs + financialAccountToken = externalBankAccountRetrieveResponse.financialAccountToken + name = externalBankAccountRetrieveResponse.name userDefinedId = externalBankAccountRetrieveResponse.userDefinedId verificationFailedReason = externalBankAccountRetrieveResponse.verificationFailedReason - verificationAttempts = externalBankAccountRetrieveResponse.verificationAttempts - financialAccountToken = externalBankAccountRetrieveResponse.financialAccountToken - type = externalBankAccountRetrieveResponse.type - verificationMethod = externalBankAccountRetrieveResponse.verificationMethod - ownerType = externalBankAccountRetrieveResponse.ownerType - state = externalBankAccountRetrieveResponse.state - verificationState = externalBankAccountRetrieveResponse.verificationState - address = externalBankAccountRetrieveResponse.address additionalProperties = externalBankAccountRetrieveResponse.additionalProperties.toMutableMap() } @@ -367,6 +367,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -379,6 +417,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -387,39 +431,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -435,15 +484,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -466,6 +513,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -491,68 +553,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -575,27 +575,27 @@ private constructor( fun build(): ExternalBankAccountRetrieveResponse = ExternalBankAccountRetrieveResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -920,15 +920,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountRetrieveResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountRetrieveResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountRetrieveResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountRetrieveResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt index b9cf6e50..d943bb23 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryMicroDepositsResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountRetryMicroDepositsResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountRetryMicroDepositsResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,27 +301,27 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var owner: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() private var country: JsonField = JsonMissing.of() - private var accountToken: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var companyId: JsonField = JsonMissing.of() - private var dob: JsonField = JsonMissing.of() - private var doingBusinessAs: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() - private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() + private var owner: JsonField = JsonMissing.of() private var ownerType: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() private var verificationState: JsonField = JsonMissing.of() + private var accountToken: JsonField = JsonMissing.of() private var address: JsonField = JsonMissing.of() + private var companyId: JsonField = JsonMissing.of() + private var dob: JsonField = JsonMissing.of() + private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() + private var verificationFailedReason: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( @@ -329,30 +329,30 @@ private constructor( ExternalBankAccountRetryMicroDepositsResponse ) = apply { token = externalBankAccountRetryMicroDepositsResponse.token + country = externalBankAccountRetryMicroDepositsResponse.country + created = externalBankAccountRetryMicroDepositsResponse.created + currency = externalBankAccountRetryMicroDepositsResponse.currency + lastFour = externalBankAccountRetryMicroDepositsResponse.lastFour owner = externalBankAccountRetryMicroDepositsResponse.owner + ownerType = externalBankAccountRetryMicroDepositsResponse.ownerType routingNumber = externalBankAccountRetryMicroDepositsResponse.routingNumber - lastFour = externalBankAccountRetryMicroDepositsResponse.lastFour - name = externalBankAccountRetryMicroDepositsResponse.name - currency = externalBankAccountRetryMicroDepositsResponse.currency - country = externalBankAccountRetryMicroDepositsResponse.country + state = externalBankAccountRetryMicroDepositsResponse.state + type = externalBankAccountRetryMicroDepositsResponse.type + verificationAttempts = + externalBankAccountRetryMicroDepositsResponse.verificationAttempts + verificationMethod = externalBankAccountRetryMicroDepositsResponse.verificationMethod + verificationState = externalBankAccountRetryMicroDepositsResponse.verificationState accountToken = externalBankAccountRetryMicroDepositsResponse.accountToken - created = externalBankAccountRetryMicroDepositsResponse.created + address = externalBankAccountRetryMicroDepositsResponse.address companyId = externalBankAccountRetryMicroDepositsResponse.companyId dob = externalBankAccountRetryMicroDepositsResponse.dob doingBusinessAs = externalBankAccountRetryMicroDepositsResponse.doingBusinessAs + financialAccountToken = + externalBankAccountRetryMicroDepositsResponse.financialAccountToken + name = externalBankAccountRetryMicroDepositsResponse.name userDefinedId = externalBankAccountRetryMicroDepositsResponse.userDefinedId verificationFailedReason = externalBankAccountRetryMicroDepositsResponse.verificationFailedReason - verificationAttempts = - externalBankAccountRetryMicroDepositsResponse.verificationAttempts - financialAccountToken = - externalBankAccountRetryMicroDepositsResponse.financialAccountToken - type = externalBankAccountRetryMicroDepositsResponse.type - verificationMethod = externalBankAccountRetryMicroDepositsResponse.verificationMethod - ownerType = externalBankAccountRetryMicroDepositsResponse.ownerType - state = externalBankAccountRetryMicroDepositsResponse.state - verificationState = externalBankAccountRetryMicroDepositsResponse.verificationState - address = externalBankAccountRetryMicroDepositsResponse.address additionalProperties = externalBankAccountRetryMicroDepositsResponse.additionalProperties.toMutableMap() } @@ -371,6 +371,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -383,6 +421,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -391,39 +435,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -439,15 +488,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -470,6 +517,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -495,68 +557,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -579,27 +579,27 @@ private constructor( fun build(): ExternalBankAccountRetryMicroDepositsResponse = ExternalBankAccountRetryMicroDepositsResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -924,15 +924,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountRetryMicroDepositsResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountRetryMicroDepositsResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountRetryMicroDepositsResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountRetryMicroDepositsResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteResponse.kt index b2ac386d..d566aeb8 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountRetryPrenoteResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountRetryPrenoteResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountRetryPrenoteResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,55 +301,55 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( externalBankAccountRetryPrenoteResponse: ExternalBankAccountRetryPrenoteResponse ) = apply { token = externalBankAccountRetryPrenoteResponse.token + country = externalBankAccountRetryPrenoteResponse.country + created = externalBankAccountRetryPrenoteResponse.created + currency = externalBankAccountRetryPrenoteResponse.currency + lastFour = externalBankAccountRetryPrenoteResponse.lastFour owner = externalBankAccountRetryPrenoteResponse.owner + ownerType = externalBankAccountRetryPrenoteResponse.ownerType routingNumber = externalBankAccountRetryPrenoteResponse.routingNumber - lastFour = externalBankAccountRetryPrenoteResponse.lastFour - name = externalBankAccountRetryPrenoteResponse.name - currency = externalBankAccountRetryPrenoteResponse.currency - country = externalBankAccountRetryPrenoteResponse.country + state = externalBankAccountRetryPrenoteResponse.state + type = externalBankAccountRetryPrenoteResponse.type + verificationAttempts = externalBankAccountRetryPrenoteResponse.verificationAttempts + verificationMethod = externalBankAccountRetryPrenoteResponse.verificationMethod + verificationState = externalBankAccountRetryPrenoteResponse.verificationState accountToken = externalBankAccountRetryPrenoteResponse.accountToken - created = externalBankAccountRetryPrenoteResponse.created + address = externalBankAccountRetryPrenoteResponse.address companyId = externalBankAccountRetryPrenoteResponse.companyId dob = externalBankAccountRetryPrenoteResponse.dob doingBusinessAs = externalBankAccountRetryPrenoteResponse.doingBusinessAs + financialAccountToken = externalBankAccountRetryPrenoteResponse.financialAccountToken + name = externalBankAccountRetryPrenoteResponse.name userDefinedId = externalBankAccountRetryPrenoteResponse.userDefinedId verificationFailedReason = externalBankAccountRetryPrenoteResponse.verificationFailedReason - verificationAttempts = externalBankAccountRetryPrenoteResponse.verificationAttempts - financialAccountToken = externalBankAccountRetryPrenoteResponse.financialAccountToken - type = externalBankAccountRetryPrenoteResponse.type - verificationMethod = externalBankAccountRetryPrenoteResponse.verificationMethod - ownerType = externalBankAccountRetryPrenoteResponse.ownerType - state = externalBankAccountRetryPrenoteResponse.state - verificationState = externalBankAccountRetryPrenoteResponse.verificationState - address = externalBankAccountRetryPrenoteResponse.address additionalProperties = externalBankAccountRetryPrenoteResponse.additionalProperties.toMutableMap() } @@ -368,6 +368,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -380,6 +418,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -388,39 +432,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -436,15 +485,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -467,6 +514,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -492,68 +554,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -576,27 +576,27 @@ private constructor( fun build(): ExternalBankAccountRetryPrenoteResponse = ExternalBankAccountRetryPrenoteResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -795,15 +795,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountRetryPrenoteResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountRetryPrenoteResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountRetryPrenoteResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountRetryPrenoteResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt index a8118817..c4c292d4 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalBankAccountUpdateResponse.kt @@ -24,26 +24,42 @@ class ExternalBankAccountUpdateResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): ExternalBankAccountUpdateResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,54 +301,54 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalBankAccountUpdateResponse: ExternalBankAccountUpdateResponse) = apply { token = externalBankAccountUpdateResponse.token + country = externalBankAccountUpdateResponse.country + created = externalBankAccountUpdateResponse.created + currency = externalBankAccountUpdateResponse.currency + lastFour = externalBankAccountUpdateResponse.lastFour owner = externalBankAccountUpdateResponse.owner + ownerType = externalBankAccountUpdateResponse.ownerType routingNumber = externalBankAccountUpdateResponse.routingNumber - lastFour = externalBankAccountUpdateResponse.lastFour - name = externalBankAccountUpdateResponse.name - currency = externalBankAccountUpdateResponse.currency - country = externalBankAccountUpdateResponse.country + state = externalBankAccountUpdateResponse.state + type = externalBankAccountUpdateResponse.type + verificationAttempts = externalBankAccountUpdateResponse.verificationAttempts + verificationMethod = externalBankAccountUpdateResponse.verificationMethod + verificationState = externalBankAccountUpdateResponse.verificationState accountToken = externalBankAccountUpdateResponse.accountToken - created = externalBankAccountUpdateResponse.created + address = externalBankAccountUpdateResponse.address companyId = externalBankAccountUpdateResponse.companyId dob = externalBankAccountUpdateResponse.dob doingBusinessAs = externalBankAccountUpdateResponse.doingBusinessAs + financialAccountToken = externalBankAccountUpdateResponse.financialAccountToken + name = externalBankAccountUpdateResponse.name userDefinedId = externalBankAccountUpdateResponse.userDefinedId verificationFailedReason = externalBankAccountUpdateResponse.verificationFailedReason - verificationAttempts = externalBankAccountUpdateResponse.verificationAttempts - financialAccountToken = externalBankAccountUpdateResponse.financialAccountToken - type = externalBankAccountUpdateResponse.type - verificationMethod = externalBankAccountUpdateResponse.verificationMethod - ownerType = externalBankAccountUpdateResponse.ownerType - state = externalBankAccountUpdateResponse.state - verificationState = externalBankAccountUpdateResponse.verificationState - address = externalBankAccountUpdateResponse.address additionalProperties = externalBankAccountUpdateResponse.additionalProperties.toMutableMap() } @@ -367,6 +367,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -379,6 +417,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -387,39 +431,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -435,15 +484,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -466,6 +513,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -491,68 +553,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -575,27 +575,27 @@ private constructor( fun build(): ExternalBankAccountUpdateResponse = ExternalBankAccountUpdateResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -920,15 +920,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalBankAccountUpdateResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalBankAccountUpdateResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalBankAccountUpdateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "ExternalBankAccountUpdateResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt index 2c04a3cd..9603d92f 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ExternalPayment.kt @@ -24,93 +24,81 @@ class ExternalPayment @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("result") - @ExcludeMissing - private val result: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), - @JsonProperty("settled_amount") - @ExcludeMissing - private val settledAmount: JsonField = JsonMissing.of(), - @JsonProperty("pending_amount") + @JsonProperty("created") @ExcludeMissing - private val pendingAmount: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), @JsonProperty("events") @ExcludeMissing private val events: JsonField> = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("financial_account_token") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("payment_type") + @ExcludeMissing + private val paymentType: JsonField = JsonMissing.of(), + @JsonProperty("pending_amount") + @ExcludeMissing + private val pendingAmount: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + private val result: JsonField = JsonMissing.of(), + @JsonProperty("settled_amount") + @ExcludeMissing + private val settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("payment_type") - @ExcludeMissing - private val paymentType: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun token(): String = token.getRequired("token") - fun result(): TransactionResult = result.getRequired("result") - fun category(): ExternalPaymentCategory = category.getRequired("category") - fun status(): TransactionStatus = status.getRequired("status") - - fun settledAmount(): Long = settledAmount.getRequired("settled_amount") - - fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount") + fun created(): OffsetDateTime = created.getRequired("created") fun currency(): String = currency.getRequired("currency") fun events(): List = events.getRequired("events") - fun created(): OffsetDateTime = created.getRequired("created") - - fun updated(): OffsetDateTime = updated.getRequired("updated") - - fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") - fun financialAccountToken(): String = financialAccountToken.getRequired("financial_account_token") fun paymentType(): ExternalPaymentDirection = paymentType.getRequired("payment_type") - @JsonProperty("token") @ExcludeMissing fun _token() = token + fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount") - @JsonProperty("result") @ExcludeMissing fun _result() = result + fun result(): TransactionResult = result.getRequired("result") - @JsonProperty("category") @ExcludeMissing fun _category() = category + fun settledAmount(): Long = settledAmount.getRequired("settled_amount") - @JsonProperty("status") @ExcludeMissing fun _status() = status + fun status(): TransactionStatus = status.getRequired("status") - @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + fun updated(): OffsetDateTime = updated.getRequired("updated") - @JsonProperty("pending_amount") @ExcludeMissing fun _pendingAmount() = pendingAmount + fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonProperty("category") @ExcludeMissing fun _category() = category @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + @JsonProperty("events") @ExcludeMissing fun _events() = events @JsonProperty("financial_account_token") @ExcludeMissing @@ -118,6 +106,18 @@ private constructor( @JsonProperty("payment_type") @ExcludeMissing fun _paymentType() = paymentType + @JsonProperty("pending_amount") @ExcludeMissing fun _pendingAmount() = pendingAmount + + @JsonProperty("result") @ExcludeMissing fun _result() = result + + @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + + @JsonProperty("status") @ExcludeMissing fun _status() = status + + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + + @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,18 +127,18 @@ private constructor( fun validate(): ExternalPayment = apply { if (!validated) { token() - result() category() - status() - settledAmount() - pendingAmount() + created() currency() events().forEach { it.validate() } - created() - updated() - userDefinedId() financialAccountToken() paymentType() + pendingAmount() + result() + settledAmount() + status() + updated() + userDefinedId() validated = true } } @@ -153,34 +153,34 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var settledAmount: JsonField = JsonMissing.of() - private var pendingAmount: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() - private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() - private var userDefinedId: JsonField = JsonMissing.of() private var financialAccountToken: JsonField = JsonMissing.of() private var paymentType: 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 updated: JsonField = JsonMissing.of() + private var userDefinedId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalPayment: ExternalPayment) = apply { token = externalPayment.token - result = externalPayment.result category = externalPayment.category - status = externalPayment.status - settledAmount = externalPayment.settledAmount - pendingAmount = externalPayment.pendingAmount + created = externalPayment.created currency = externalPayment.currency events = externalPayment.events - created = externalPayment.created - updated = externalPayment.updated - userDefinedId = externalPayment.userDefinedId financialAccountToken = externalPayment.financialAccountToken paymentType = externalPayment.paymentType + pendingAmount = externalPayment.pendingAmount + result = externalPayment.result + settledAmount = externalPayment.settledAmount + status = externalPayment.status + updated = externalPayment.updated + userDefinedId = externalPayment.userDefinedId additionalProperties = externalPayment.additionalProperties.toMutableMap() } @@ -188,24 +188,36 @@ private constructor( fun token(token: JsonField) = apply { this.token = token } - fun result(result: TransactionResult) = result(JsonField.of(result)) - - fun result(result: JsonField) = apply { this.result = result } - fun category(category: ExternalPaymentCategory) = category(JsonField.of(category)) fun category(category: JsonField) = apply { this.category = category } - fun status(status: TransactionStatus) = status(JsonField.of(status)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - fun status(status: JsonField) = apply { this.status = status } + fun created(created: JsonField) = apply { this.created = created } - fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) + fun currency(currency: String) = currency(JsonField.of(currency)) - fun settledAmount(settledAmount: JsonField) = apply { - this.settledAmount = settledAmount + fun currency(currency: JsonField) = apply { this.currency = currency } + + fun events(events: List) = events(JsonField.of(events)) + + fun events(events: JsonField>) = apply { this.events = events } + + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + fun paymentType(paymentType: ExternalPaymentDirection) = + paymentType(JsonField.of(paymentType)) + + fun paymentType(paymentType: JsonField) = apply { + this.paymentType = paymentType } fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -214,17 +226,19 @@ private constructor( this.pendingAmount = pendingAmount } - fun currency(currency: String) = currency(JsonField.of(currency)) + fun result(result: TransactionResult) = result(JsonField.of(result)) - fun currency(currency: JsonField) = apply { this.currency = currency } + fun result(result: JsonField) = apply { this.result = result } - fun events(events: List) = events(JsonField.of(events)) + fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) - fun events(events: JsonField>) = apply { this.events = events } + fun settledAmount(settledAmount: JsonField) = apply { + this.settledAmount = settledAmount + } - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun status(status: TransactionStatus) = status(JsonField.of(status)) - fun created(created: JsonField) = apply { this.created = created } + fun status(status: JsonField) = apply { this.status = status } fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -236,20 +250,6 @@ private constructor( this.userDefinedId = userDefinedId } - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - fun paymentType(paymentType: ExternalPaymentDirection) = - paymentType(JsonField.of(paymentType)) - - fun paymentType(paymentType: JsonField) = apply { - this.paymentType = paymentType - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -272,18 +272,18 @@ private constructor( fun build(): ExternalPayment = ExternalPayment( token, - result, category, - status, - settledAmount, - pendingAmount, + created, currency, events.map { it.toImmutable() }, - created, - updated, - userDefinedId, financialAccountToken, paymentType, + pendingAmount, + result, + settledAmount, + status, + updated, + userDefinedId, additionalProperties.toImmutable(), ) } @@ -361,66 +361,66 @@ private constructor( class ExternalPaymentEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("result") + @JsonProperty("created") @ExcludeMissing - private val result: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), @JsonProperty("detailed_results") @ExcludeMissing private val detailedResults: JsonField> = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), - @JsonProperty("token") + @JsonProperty("effective_date") @ExcludeMissing - private val token: JsonField = JsonMissing.of(), + private val effectiveDate: JsonField = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing private val memo: JsonField = JsonMissing.of(), - @JsonProperty("effective_date") + @JsonProperty("result") @ExcludeMissing - private val effectiveDate: JsonField = JsonMissing.of(), + private val result: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun amount(): Long = amount.getRequired("amount") + fun token(): String = token.getRequired("token") - fun type(): ExternalPaymentEventType = type.getRequired("type") + fun amount(): Long = amount.getRequired("amount") - fun result(): TransactionResult = result.getRequired("result") + fun created(): OffsetDateTime = created.getRequired("created") fun detailedResults(): List = detailedResults.getRequired("detailed_results") - fun created(): OffsetDateTime = created.getRequired("created") - - fun token(): String = token.getRequired("token") + fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") fun memo(): String = memo.getRequired("memo") - fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") - - @JsonProperty("amount") @ExcludeMissing fun _amount() = amount + fun result(): TransactionResult = result.getRequired("result") - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): ExternalPaymentEventType = type.getRequired("type") - @JsonProperty("result") @ExcludeMissing fun _result() = result + @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + + @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate @JsonProperty("memo") @ExcludeMissing fun _memo() = memo - @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate + @JsonProperty("result") @ExcludeMissing fun _result() = result + + @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @ExcludeMissing @@ -430,14 +430,14 @@ private constructor( fun validate(): ExternalPaymentEvent = apply { if (!validated) { + token() amount() - type() - result() - detailedResults() created() - token() - memo() + detailedResults() effectiveDate() + memo() + result() + type() validated = true } } @@ -451,39 +451,39 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() - private var detailedResults: JsonField> = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var memo: JsonField = JsonMissing.of() + private var detailedResults: JsonField> = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var memo: JsonField = JsonMissing.of() + private var result: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(externalPaymentEvent: ExternalPaymentEvent) = apply { + token = externalPaymentEvent.token amount = externalPaymentEvent.amount - type = externalPaymentEvent.type - result = externalPaymentEvent.result - detailedResults = externalPaymentEvent.detailedResults created = externalPaymentEvent.created - token = externalPaymentEvent.token - memo = externalPaymentEvent.memo + detailedResults = externalPaymentEvent.detailedResults effectiveDate = externalPaymentEvent.effectiveDate + memo = externalPaymentEvent.memo + result = externalPaymentEvent.result + type = externalPaymentEvent.type additionalProperties = externalPaymentEvent.additionalProperties.toMutableMap() } - fun amount(amount: Long) = amount(JsonField.of(amount)) + fun token(token: String) = token(JsonField.of(token)) - fun amount(amount: JsonField) = apply { this.amount = amount } + fun token(token: JsonField) = apply { this.token = token } - fun type(type: ExternalPaymentEventType) = type(JsonField.of(type)) + fun amount(amount: Long) = amount(JsonField.of(amount)) - fun type(type: JsonField) = apply { this.type = type } + fun amount(amount: JsonField) = apply { this.amount = amount } - fun result(result: TransactionResult) = result(JsonField.of(result)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - fun result(result: JsonField) = apply { this.result = result } + fun created(created: JsonField) = apply { this.created = created } fun detailedResults(detailedResults: List) = detailedResults(JsonField.of(detailedResults)) @@ -492,23 +492,23 @@ private constructor( this.detailedResults = detailedResults } - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - fun created(created: JsonField) = apply { this.created = created } - - fun token(token: String) = token(JsonField.of(token)) + fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) - fun token(token: JsonField) = apply { this.token = token } + fun effectiveDate(effectiveDate: JsonField) = apply { + this.effectiveDate = effectiveDate + } fun memo(memo: String) = memo(JsonField.of(memo)) fun memo(memo: JsonField) = apply { this.memo = memo } - fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) + fun result(result: TransactionResult) = result(JsonField.of(result)) - fun effectiveDate(effectiveDate: JsonField) = apply { - this.effectiveDate = effectiveDate - } + fun result(result: JsonField) = apply { this.result = result } + + fun type(type: ExternalPaymentEventType) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -531,14 +531,14 @@ private constructor( fun build(): ExternalPaymentEvent = ExternalPaymentEvent( + token, amount, - type, - result, - detailedResults.map { it.toImmutable() }, created, - token, - memo, + detailedResults.map { it.toImmutable() }, effectiveDate, + memo, + result, + type, additionalProperties.toImmutable(), ) } @@ -822,17 +822,17 @@ private constructor( return true } - return /* spotless:off */ other is ExternalPaymentEvent && amount == other.amount && type == other.type && result == other.result && detailedResults == other.detailedResults && created == other.created && token == other.token && memo == other.memo && effectiveDate == other.effectiveDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalPaymentEvent && token == other.token && amount == other.amount && created == other.created && detailedResults == other.detailedResults && effectiveDate == other.effectiveDate && memo == other.memo && result == other.result && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, type, result, detailedResults, created, token, memo, effectiveDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, detailedResults, effectiveDate, memo, result, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalPaymentEvent{amount=$amount, type=$type, result=$result, detailedResults=$detailedResults, created=$created, token=$token, memo=$memo, effectiveDate=$effectiveDate, additionalProperties=$additionalProperties}" + "ExternalPaymentEvent{token=$token, amount=$amount, created=$created, detailedResults=$detailedResults, effectiveDate=$effectiveDate, memo=$memo, result=$result, type=$type, additionalProperties=$additionalProperties}" } class ExternalPaymentDirection @@ -1029,15 +1029,15 @@ private constructor( return true } - return /* spotless:off */ other is ExternalPayment && token == other.token && result == other.result && category == other.category && status == other.status && settledAmount == other.settledAmount && pendingAmount == other.pendingAmount && currency == other.currency && events == other.events && created == other.created && updated == other.updated && userDefinedId == other.userDefinedId && financialAccountToken == other.financialAccountToken && paymentType == other.paymentType && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ExternalPayment && token == other.token && category == other.category && created == other.created && currency == other.currency && events == other.events && financialAccountToken == other.financialAccountToken && paymentType == other.paymentType && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && updated == other.updated && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, result, category, status, settledAmount, pendingAmount, currency, events, created, updated, userDefinedId, financialAccountToken, paymentType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, events, financialAccountToken, paymentType, pendingAmount, result, settledAmount, status, updated, userDefinedId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ExternalPayment{token=$token, result=$result, category=$category, status=$status, settledAmount=$settledAmount, pendingAmount=$pendingAmount, currency=$currency, events=$events, created=$created, updated=$updated, userDefinedId=$userDefinedId, financialAccountToken=$financialAccountToken, paymentType=$paymentType, additionalProperties=$additionalProperties}" + "ExternalPayment{token=$token, category=$category, created=$created, currency=$currency, events=$events, financialAccountToken=$financialAccountToken, paymentType=$paymentType, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, updated=$updated, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt index 5be4d1d9..5962d39a 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccount.kt @@ -23,80 +23,80 @@ class FinancialAccount @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("account_token") + @ExcludeMissing + private val accountToken: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), - @JsonProperty("updated") - @ExcludeMissing - private val updated: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("routing_number") + @JsonProperty("credit_configuration") @ExcludeMissing - private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("account_number") + private val creditConfiguration: JsonField = JsonMissing.of(), + @JsonProperty("is_for_benefit_of") @ExcludeMissing - private val accountNumber: JsonField = JsonMissing.of(), + private val isForBenefitOf: JsonField = JsonMissing.of(), @JsonProperty("nickname") @ExcludeMissing private val nickname: JsonField = JsonMissing.of(), - @JsonProperty("account_token") + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("updated") @ExcludeMissing - private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("is_for_benefit_of") + private val updated: JsonField = JsonMissing.of(), + @JsonProperty("account_number") @ExcludeMissing - private val isForBenefitOf: JsonField = JsonMissing.of(), - @JsonProperty("credit_configuration") + private val accountNumber: JsonField = JsonMissing.of(), + @JsonProperty("routing_number") @ExcludeMissing - private val creditConfiguration: JsonField = JsonMissing.of(), + private val routingNumber: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Globally unique identifier for the account */ fun token(): String = token.getRequired("token") - fun created(): OffsetDateTime = created.getRequired("created") - - fun updated(): OffsetDateTime = updated.getRequired("updated") + fun accountToken(): String? = accountToken.getNullable("account_token") - fun type(): Type = type.getRequired("type") + fun created(): OffsetDateTime = created.getRequired("created") - fun routingNumber(): String? = routingNumber.getNullable("routing_number") + fun creditConfiguration(): FinancialAccountCreditConfig? = + creditConfiguration.getNullable("credit_configuration") - fun accountNumber(): String? = accountNumber.getNullable("account_number") + /** Whether financial account is for the benefit of another entity */ + fun isForBenefitOf(): Boolean = isForBenefitOf.getRequired("is_for_benefit_of") fun nickname(): String? = nickname.getNullable("nickname") - fun accountToken(): String? = accountToken.getNullable("account_token") + fun type(): Type = type.getRequired("type") - /** Whether financial account is for the benefit of another entity */ - fun isForBenefitOf(): Boolean = isForBenefitOf.getRequired("is_for_benefit_of") + fun updated(): OffsetDateTime = updated.getRequired("updated") - fun creditConfiguration(): FinancialAccountCreditConfig? = - creditConfiguration.getNullable("credit_configuration") + fun accountNumber(): String? = accountNumber.getNullable("account_number") + + fun routingNumber(): String? = routingNumber.getNullable("routing_number") /** Globally unique identifier for the account */ @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("created") @ExcludeMissing fun _created() = created - - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - @JsonProperty("type") @ExcludeMissing fun _type() = type + @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber + @JsonProperty("credit_configuration") + @ExcludeMissing + fun _creditConfiguration() = creditConfiguration - @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber + /** Whether financial account is for the benefit of another entity */ + @JsonProperty("is_for_benefit_of") @ExcludeMissing fun _isForBenefitOf() = isForBenefitOf @JsonProperty("nickname") @ExcludeMissing fun _nickname() = nickname - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** Whether financial account is for the benefit of another entity */ - @JsonProperty("is_for_benefit_of") @ExcludeMissing fun _isForBenefitOf() = isForBenefitOf + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated - @JsonProperty("credit_configuration") - @ExcludeMissing - fun _creditConfiguration() = creditConfiguration + @JsonProperty("account_number") @ExcludeMissing fun _accountNumber() = accountNumber + + @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber @JsonAnyGetter @ExcludeMissing @@ -107,15 +107,15 @@ private constructor( fun validate(): FinancialAccount = apply { if (!validated) { token() + accountToken() created() - updated() + creditConfiguration()?.validate() + isForBenefitOf() + nickname() type() - routingNumber() + updated() accountNumber() - nickname() - accountToken() - isForBenefitOf() - creditConfiguration()?.validate() + routingNumber() validated = true } } @@ -130,28 +130,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var accountToken: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() + private var creditConfiguration: JsonField = JsonMissing.of() + private var isForBenefitOf: JsonField = JsonMissing.of() + private var nickname: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() - private var routingNumber: JsonField = JsonMissing.of() + private var updated: JsonField = JsonMissing.of() private var accountNumber: JsonField = JsonMissing.of() - private var nickname: JsonField = JsonMissing.of() - private var accountToken: JsonField = JsonMissing.of() - private var isForBenefitOf: JsonField = JsonMissing.of() - private var creditConfiguration: JsonField = JsonMissing.of() + private var routingNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialAccount: FinancialAccount) = apply { token = financialAccount.token + accountToken = financialAccount.accountToken created = financialAccount.created - updated = financialAccount.updated + creditConfiguration = financialAccount.creditConfiguration + isForBenefitOf = financialAccount.isForBenefitOf + nickname = financialAccount.nickname type = financialAccount.type - routingNumber = financialAccount.routingNumber + updated = financialAccount.updated accountNumber = financialAccount.accountNumber - nickname = financialAccount.nickname - accountToken = financialAccount.accountToken - isForBenefitOf = financialAccount.isForBenefitOf - creditConfiguration = financialAccount.creditConfiguration + routingNumber = financialAccount.routingNumber additionalProperties = financialAccount.additionalProperties.toMutableMap() } @@ -161,23 +161,43 @@ private constructor( /** Globally unique identifier for the account */ fun token(token: JsonField) = apply { this.token = token } + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + fun created(created: OffsetDateTime) = created(JsonField.of(created)) fun created(created: JsonField) = apply { this.created = created } - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + fun creditConfiguration(creditConfiguration: FinancialAccountCreditConfig) = + creditConfiguration(JsonField.of(creditConfiguration)) - fun updated(updated: JsonField) = apply { this.updated = updated } + fun creditConfiguration(creditConfiguration: JsonField) = + apply { + this.creditConfiguration = creditConfiguration + } + + /** Whether financial account is for the benefit of another entity */ + fun isForBenefitOf(isForBenefitOf: Boolean) = isForBenefitOf(JsonField.of(isForBenefitOf)) + + /** Whether financial account is for the benefit of another entity */ + fun isForBenefitOf(isForBenefitOf: JsonField) = apply { + this.isForBenefitOf = isForBenefitOf + } + + fun nickname(nickname: String) = nickname(JsonField.of(nickname)) + + fun nickname(nickname: JsonField) = apply { this.nickname = nickname } fun type(type: Type) = type(JsonField.of(type)) fun type(type: JsonField) = apply { this.type = type } - fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - fun routingNumber(routingNumber: JsonField) = apply { - this.routingNumber = routingNumber - } + fun updated(updated: JsonField) = apply { this.updated = updated } fun accountNumber(accountNumber: String) = accountNumber(JsonField.of(accountNumber)) @@ -185,32 +205,12 @@ private constructor( this.accountNumber = accountNumber } - fun nickname(nickname: String) = nickname(JsonField.of(nickname)) - - fun nickname(nickname: JsonField) = apply { this.nickname = nickname } - - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) - - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } - - /** Whether financial account is for the benefit of another entity */ - fun isForBenefitOf(isForBenefitOf: Boolean) = isForBenefitOf(JsonField.of(isForBenefitOf)) + fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) - /** Whether financial account is for the benefit of another entity */ - fun isForBenefitOf(isForBenefitOf: JsonField) = apply { - this.isForBenefitOf = isForBenefitOf + fun routingNumber(routingNumber: JsonField) = apply { + this.routingNumber = routingNumber } - fun creditConfiguration(creditConfiguration: FinancialAccountCreditConfig) = - creditConfiguration(JsonField.of(creditConfiguration)) - - fun creditConfiguration(creditConfiguration: JsonField) = - apply { - this.creditConfiguration = creditConfiguration - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -233,15 +233,15 @@ private constructor( fun build(): FinancialAccount = FinancialAccount( token, + accountToken, created, - updated, + creditConfiguration, + isForBenefitOf, + nickname, type, - routingNumber, + updated, accountNumber, - nickname, - accountToken, - isForBenefitOf, - creditConfiguration, + routingNumber, additionalProperties.toImmutable(), ) } @@ -250,77 +250,77 @@ private constructor( class FinancialAccountCreditConfig @JsonCreator private constructor( + @JsonProperty("charged_off_reason") + @ExcludeMissing + private val chargedOffReason: JsonField = JsonMissing.of(), @JsonProperty("credit_limit") @ExcludeMissing private val creditLimit: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_account_token") - @ExcludeMissing - private val externalBankAccountToken: JsonField = JsonMissing.of(), @JsonProperty("credit_product_token") @ExcludeMissing private val creditProductToken: JsonField = JsonMissing.of(), - @JsonProperty("tier") - @ExcludeMissing - private val tier: JsonField = JsonMissing.of(), - @JsonProperty("is_spend_blocked") + @JsonProperty("external_bank_account_token") @ExcludeMissing - private val isSpendBlocked: JsonField = JsonMissing.of(), + private val externalBankAccountToken: JsonField = JsonMissing.of(), @JsonProperty("financial_account_state") @ExcludeMissing private val financialAccountState: JsonField = JsonMissing.of(), - @JsonProperty("charged_off_reason") + @JsonProperty("is_spend_blocked") @ExcludeMissing - private val chargedOffReason: JsonField = JsonMissing.of(), + private val isSpendBlocked: JsonField = JsonMissing.of(), + @JsonProperty("tier") + @ExcludeMissing + private val tier: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun creditLimit(): Long? = creditLimit.getNullable("credit_limit") + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(): ChargedOffReason? = + chargedOffReason.getNullable("charged_off_reason") - fun externalBankAccountToken(): String? = - externalBankAccountToken.getNullable("external_bank_account_token") + fun creditLimit(): Long? = creditLimit.getNullable("credit_limit") /** Globally unique identifier for the credit product */ fun creditProductToken(): String? = creditProductToken.getNullable("credit_product_token") - /** Tier assigned to the financial account */ - fun tier(): String? = tier.getNullable("tier") - - fun isSpendBlocked(): Boolean = isSpendBlocked.getRequired("is_spend_blocked") + fun externalBankAccountToken(): String? = + externalBankAccountToken.getNullable("external_bank_account_token") /** State of the financial account */ fun financialAccountState(): FinancialAccountState? = financialAccountState.getNullable("financial_account_state") - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(): ChargedOffReason? = - chargedOffReason.getNullable("charged_off_reason") + fun isSpendBlocked(): Boolean = isSpendBlocked.getRequired("is_spend_blocked") - @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit + /** Tier assigned to the financial account */ + fun tier(): String? = tier.getNullable("tier") - @JsonProperty("external_bank_account_token") + /** Reason for the financial account being marked as Charged Off */ + @JsonProperty("charged_off_reason") @ExcludeMissing - fun _externalBankAccountToken() = externalBankAccountToken + fun _chargedOffReason() = chargedOffReason + + @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit /** Globally unique identifier for the credit product */ @JsonProperty("credit_product_token") @ExcludeMissing fun _creditProductToken() = creditProductToken - /** Tier assigned to the financial account */ - @JsonProperty("tier") @ExcludeMissing fun _tier() = tier - - @JsonProperty("is_spend_blocked") @ExcludeMissing fun _isSpendBlocked() = isSpendBlocked + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken() = externalBankAccountToken /** State of the financial account */ @JsonProperty("financial_account_state") @ExcludeMissing fun _financialAccountState() = financialAccountState - /** Reason for the financial account being marked as Charged Off */ - @JsonProperty("charged_off_reason") - @ExcludeMissing - fun _chargedOffReason() = chargedOffReason + @JsonProperty("is_spend_blocked") @ExcludeMissing fun _isSpendBlocked() = isSpendBlocked + + /** Tier assigned to the financial account */ + @JsonProperty("tier") @ExcludeMissing fun _tier() = tier @JsonAnyGetter @ExcludeMissing @@ -330,13 +330,13 @@ private constructor( fun validate(): FinancialAccountCreditConfig = apply { if (!validated) { + chargedOffReason() creditLimit() - externalBankAccountToken() creditProductToken() - tier() - isSpendBlocked() + externalBankAccountToken() financialAccountState() - chargedOffReason() + isSpendBlocked() + tier() validated = true } } @@ -350,37 +350,39 @@ private constructor( class Builder { + private var chargedOffReason: JsonField = JsonMissing.of() private var creditLimit: JsonField = JsonMissing.of() - private var externalBankAccountToken: JsonField = JsonMissing.of() private var creditProductToken: JsonField = JsonMissing.of() - private var tier: JsonField = JsonMissing.of() - private var isSpendBlocked: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() private var financialAccountState: JsonField = JsonMissing.of() - private var chargedOffReason: JsonField = JsonMissing.of() + private var isSpendBlocked: JsonField = JsonMissing.of() + private var tier: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialAccountCreditConfig: FinancialAccountCreditConfig) = apply { + chargedOffReason = financialAccountCreditConfig.chargedOffReason creditLimit = financialAccountCreditConfig.creditLimit - externalBankAccountToken = financialAccountCreditConfig.externalBankAccountToken creditProductToken = financialAccountCreditConfig.creditProductToken - tier = financialAccountCreditConfig.tier - isSpendBlocked = financialAccountCreditConfig.isSpendBlocked + externalBankAccountToken = financialAccountCreditConfig.externalBankAccountToken financialAccountState = financialAccountCreditConfig.financialAccountState - chargedOffReason = financialAccountCreditConfig.chargedOffReason + isSpendBlocked = financialAccountCreditConfig.isSpendBlocked + tier = financialAccountCreditConfig.tier additionalProperties = financialAccountCreditConfig.additionalProperties.toMutableMap() } - fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(chargedOffReason: ChargedOffReason) = + chargedOffReason(JsonField.of(chargedOffReason)) - fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(chargedOffReason: JsonField) = apply { + this.chargedOffReason = chargedOffReason + } - fun externalBankAccountToken(externalBankAccountToken: String) = - externalBankAccountToken(JsonField.of(externalBankAccountToken)) + fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { - this.externalBankAccountToken = externalBankAccountToken - } + fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } /** Globally unique identifier for the credit product */ fun creditProductToken(creditProductToken: String) = @@ -391,17 +393,11 @@ private constructor( this.creditProductToken = creditProductToken } - /** Tier assigned to the financial account */ - fun tier(tier: String) = tier(JsonField.of(tier)) - - /** Tier assigned to the financial account */ - fun tier(tier: JsonField) = apply { this.tier = tier } - - fun isSpendBlocked(isSpendBlocked: Boolean) = - isSpendBlocked(JsonField.of(isSpendBlocked)) + fun externalBankAccountToken(externalBankAccountToken: String) = + externalBankAccountToken(JsonField.of(externalBankAccountToken)) - fun isSpendBlocked(isSpendBlocked: JsonField) = apply { - this.isSpendBlocked = isSpendBlocked + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken } /** State of the financial account */ @@ -414,15 +410,19 @@ private constructor( this.financialAccountState = financialAccountState } - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(chargedOffReason: ChargedOffReason) = - chargedOffReason(JsonField.of(chargedOffReason)) + fun isSpendBlocked(isSpendBlocked: Boolean) = + isSpendBlocked(JsonField.of(isSpendBlocked)) - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(chargedOffReason: JsonField) = apply { - this.chargedOffReason = chargedOffReason + fun isSpendBlocked(isSpendBlocked: JsonField) = apply { + this.isSpendBlocked = isSpendBlocked } + /** Tier assigned to the financial account */ + fun tier(tier: String) = tier(JsonField.of(tier)) + + /** Tier assigned to the financial account */ + fun tier(tier: JsonField) = apply { this.tier = tier } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -444,13 +444,13 @@ private constructor( fun build(): FinancialAccountCreditConfig = FinancialAccountCreditConfig( + chargedOffReason, creditLimit, - externalBankAccountToken, creditProductToken, - tier, - isSpendBlocked, + externalBankAccountToken, financialAccountState, - chargedOffReason, + isSpendBlocked, + tier, additionalProperties.toImmutable(), ) } @@ -587,17 +587,17 @@ private constructor( return true } - return /* spotless:off */ other is FinancialAccountCreditConfig && creditLimit == other.creditLimit && externalBankAccountToken == other.externalBankAccountToken && creditProductToken == other.creditProductToken && tier == other.tier && isSpendBlocked == other.isSpendBlocked && financialAccountState == other.financialAccountState && chargedOffReason == other.chargedOffReason && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialAccountCreditConfig && chargedOffReason == other.chargedOffReason && creditLimit == other.creditLimit && creditProductToken == other.creditProductToken && externalBankAccountToken == other.externalBankAccountToken && financialAccountState == other.financialAccountState && isSpendBlocked == other.isSpendBlocked && tier == other.tier && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(creditLimit, externalBankAccountToken, creditProductToken, tier, isSpendBlocked, financialAccountState, chargedOffReason, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(chargedOffReason, creditLimit, creditProductToken, externalBankAccountToken, financialAccountState, isSpendBlocked, tier, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccountCreditConfig{creditLimit=$creditLimit, externalBankAccountToken=$externalBankAccountToken, creditProductToken=$creditProductToken, tier=$tier, isSpendBlocked=$isSpendBlocked, financialAccountState=$financialAccountState, chargedOffReason=$chargedOffReason, additionalProperties=$additionalProperties}" + "FinancialAccountCreditConfig{chargedOffReason=$chargedOffReason, creditLimit=$creditLimit, creditProductToken=$creditProductToken, externalBankAccountToken=$externalBankAccountToken, financialAccountState=$financialAccountState, isSpendBlocked=$isSpendBlocked, tier=$tier, additionalProperties=$additionalProperties}" } class Type @@ -668,15 +668,15 @@ private constructor( return true } - return /* spotless:off */ other is FinancialAccount && token == other.token && created == other.created && updated == other.updated && type == other.type && routingNumber == other.routingNumber && accountNumber == other.accountNumber && nickname == other.nickname && accountToken == other.accountToken && isForBenefitOf == other.isForBenefitOf && creditConfiguration == other.creditConfiguration && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialAccount && token == other.token && accountToken == other.accountToken && created == other.created && creditConfiguration == other.creditConfiguration && isForBenefitOf == other.isForBenefitOf && nickname == other.nickname && type == other.type && updated == other.updated && accountNumber == other.accountNumber && routingNumber == other.routingNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, created, updated, type, routingNumber, accountNumber, nickname, accountToken, isForBenefitOf, creditConfiguration, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, created, creditConfiguration, isForBenefitOf, nickname, type, updated, accountNumber, routingNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccount{token=$token, created=$created, updated=$updated, type=$type, routingNumber=$routingNumber, accountNumber=$accountNumber, nickname=$nickname, accountToken=$accountToken, isForBenefitOf=$isForBenefitOf, creditConfiguration=$creditConfiguration, additionalProperties=$additionalProperties}" + "FinancialAccount{token=$token, accountToken=$accountToken, created=$created, creditConfiguration=$creditConfiguration, isForBenefitOf=$isForBenefitOf, nickname=$nickname, type=$type, updated=$updated, accountNumber=$accountNumber, routingNumber=$routingNumber, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt index 0f19fed1..a2864285 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialAccountCreditConfig.kt @@ -24,41 +24,41 @@ private constructor( @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), + @JsonProperty("charged_off_reason") + @ExcludeMissing + private val chargedOffReason: JsonField = JsonMissing.of(), @JsonProperty("credit_limit") @ExcludeMissing private val creditLimit: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_account_token") - @ExcludeMissing - private val externalBankAccountToken: JsonField = JsonMissing.of(), @JsonProperty("credit_product_token") @ExcludeMissing private val creditProductToken: JsonField = JsonMissing.of(), - @JsonProperty("tier") @ExcludeMissing private val tier: JsonField = JsonMissing.of(), + @JsonProperty("external_bank_account_token") + @ExcludeMissing + private val externalBankAccountToken: JsonField = JsonMissing.of(), @JsonProperty("financial_account_state") @ExcludeMissing private val financialAccountState: JsonField = JsonMissing.of(), @JsonProperty("is_spend_blocked") @ExcludeMissing private val isSpendBlocked: JsonField = JsonMissing.of(), - @JsonProperty("charged_off_reason") - @ExcludeMissing - private val chargedOffReason: JsonField = JsonMissing.of(), + @JsonProperty("tier") @ExcludeMissing private val tier: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Globally unique identifier for the account */ fun accountToken(): String = accountToken.getRequired("account_token") - fun creditLimit(): Long? = creditLimit.getNullable("credit_limit") + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(): ChargedOffReason? = chargedOffReason.getNullable("charged_off_reason") - fun externalBankAccountToken(): String? = - externalBankAccountToken.getNullable("external_bank_account_token") + fun creditLimit(): Long? = creditLimit.getNullable("credit_limit") /** Globally unique identifier for the credit product */ fun creditProductToken(): String? = creditProductToken.getNullable("credit_product_token") - /** Tier assigned to the financial account */ - fun tier(): String? = tier.getNullable("tier") + fun externalBankAccountToken(): String? = + externalBankAccountToken.getNullable("external_bank_account_token") /** State of the financial account */ fun financialAccountState(): FinancialAccountState = @@ -66,25 +66,25 @@ private constructor( fun isSpendBlocked(): Boolean = isSpendBlocked.getRequired("is_spend_blocked") - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(): ChargedOffReason? = chargedOffReason.getNullable("charged_off_reason") + /** Tier assigned to the financial account */ + fun tier(): String? = tier.getNullable("tier") /** Globally unique identifier for the account */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit + /** Reason for the financial account being marked as Charged Off */ + @JsonProperty("charged_off_reason") @ExcludeMissing fun _chargedOffReason() = chargedOffReason - @JsonProperty("external_bank_account_token") - @ExcludeMissing - fun _externalBankAccountToken() = externalBankAccountToken + @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit /** Globally unique identifier for the credit product */ @JsonProperty("credit_product_token") @ExcludeMissing fun _creditProductToken() = creditProductToken - /** Tier assigned to the financial account */ - @JsonProperty("tier") @ExcludeMissing fun _tier() = tier + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken() = externalBankAccountToken /** State of the financial account */ @JsonProperty("financial_account_state") @@ -93,8 +93,8 @@ private constructor( @JsonProperty("is_spend_blocked") @ExcludeMissing fun _isSpendBlocked() = isSpendBlocked - /** Reason for the financial account being marked as Charged Off */ - @JsonProperty("charged_off_reason") @ExcludeMissing fun _chargedOffReason() = chargedOffReason + /** Tier assigned to the financial account */ + @JsonProperty("tier") @ExcludeMissing fun _tier() = tier @JsonAnyGetter @ExcludeMissing @@ -105,13 +105,13 @@ private constructor( fun validate(): FinancialAccountCreditConfig = apply { if (!validated) { accountToken() + chargedOffReason() creditLimit() - externalBankAccountToken() creditProductToken() - tier() + externalBankAccountToken() financialAccountState() isSpendBlocked() - chargedOffReason() + tier() validated = true } } @@ -126,24 +126,24 @@ private constructor( class Builder { private var accountToken: JsonField = JsonMissing.of() + private var chargedOffReason: JsonField = JsonMissing.of() private var creditLimit: JsonField = JsonMissing.of() - private var externalBankAccountToken: JsonField = JsonMissing.of() private var creditProductToken: JsonField = JsonMissing.of() - private var tier: JsonField = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() private var financialAccountState: JsonField = JsonMissing.of() private var isSpendBlocked: JsonField = JsonMissing.of() - private var chargedOffReason: JsonField = JsonMissing.of() + private var tier: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialAccountCreditConfig: FinancialAccountCreditConfig) = apply { accountToken = financialAccountCreditConfig.accountToken + chargedOffReason = financialAccountCreditConfig.chargedOffReason creditLimit = financialAccountCreditConfig.creditLimit - externalBankAccountToken = financialAccountCreditConfig.externalBankAccountToken creditProductToken = financialAccountCreditConfig.creditProductToken - tier = financialAccountCreditConfig.tier + externalBankAccountToken = financialAccountCreditConfig.externalBankAccountToken financialAccountState = financialAccountCreditConfig.financialAccountState isSpendBlocked = financialAccountCreditConfig.isSpendBlocked - chargedOffReason = financialAccountCreditConfig.chargedOffReason + tier = financialAccountCreditConfig.tier additionalProperties = financialAccountCreditConfig.additionalProperties.toMutableMap() } @@ -155,16 +155,18 @@ private constructor( this.accountToken = accountToken } - fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(chargedOffReason: ChargedOffReason) = + chargedOffReason(JsonField.of(chargedOffReason)) - fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } + /** Reason for the financial account being marked as Charged Off */ + fun chargedOffReason(chargedOffReason: JsonField) = apply { + this.chargedOffReason = chargedOffReason + } - fun externalBankAccountToken(externalBankAccountToken: String) = - externalBankAccountToken(JsonField.of(externalBankAccountToken)) + fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { - this.externalBankAccountToken = externalBankAccountToken - } + fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } /** Globally unique identifier for the credit product */ fun creditProductToken(creditProductToken: String) = @@ -175,11 +177,12 @@ private constructor( this.creditProductToken = creditProductToken } - /** Tier assigned to the financial account */ - fun tier(tier: String) = tier(JsonField.of(tier)) + fun externalBankAccountToken(externalBankAccountToken: String) = + externalBankAccountToken(JsonField.of(externalBankAccountToken)) - /** Tier assigned to the financial account */ - fun tier(tier: JsonField) = apply { this.tier = tier } + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken + } /** State of the financial account */ fun financialAccountState(financialAccountState: FinancialAccountState) = @@ -196,14 +199,11 @@ private constructor( this.isSpendBlocked = isSpendBlocked } - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(chargedOffReason: ChargedOffReason) = - chargedOffReason(JsonField.of(chargedOffReason)) + /** Tier assigned to the financial account */ + fun tier(tier: String) = tier(JsonField.of(tier)) - /** Reason for the financial account being marked as Charged Off */ - fun chargedOffReason(chargedOffReason: JsonField) = apply { - this.chargedOffReason = chargedOffReason - } + /** Tier assigned to the financial account */ + fun tier(tier: JsonField) = apply { this.tier = tier } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -227,13 +227,13 @@ private constructor( fun build(): FinancialAccountCreditConfig = FinancialAccountCreditConfig( accountToken, + chargedOffReason, creditLimit, - externalBankAccountToken, creditProductToken, - tier, + externalBankAccountToken, financialAccountState, isSpendBlocked, - chargedOffReason, + tier, additionalProperties.toImmutable(), ) } @@ -369,15 +369,15 @@ private constructor( return true } - return /* spotless:off */ other is FinancialAccountCreditConfig && accountToken == other.accountToken && creditLimit == other.creditLimit && externalBankAccountToken == other.externalBankAccountToken && creditProductToken == other.creditProductToken && tier == other.tier && financialAccountState == other.financialAccountState && isSpendBlocked == other.isSpendBlocked && chargedOffReason == other.chargedOffReason && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialAccountCreditConfig && accountToken == other.accountToken && chargedOffReason == other.chargedOffReason && creditLimit == other.creditLimit && creditProductToken == other.creditProductToken && externalBankAccountToken == other.externalBankAccountToken && financialAccountState == other.financialAccountState && isSpendBlocked == other.isSpendBlocked && tier == other.tier && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, creditLimit, externalBankAccountToken, creditProductToken, tier, financialAccountState, isSpendBlocked, chargedOffReason, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(accountToken, chargedOffReason, creditLimit, creditProductToken, externalBankAccountToken, financialAccountState, isSpendBlocked, tier, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialAccountCreditConfig{accountToken=$accountToken, creditLimit=$creditLimit, externalBankAccountToken=$externalBankAccountToken, creditProductToken=$creditProductToken, tier=$tier, financialAccountState=$financialAccountState, isSpendBlocked=$isSpendBlocked, chargedOffReason=$chargedOffReason, additionalProperties=$additionalProperties}" + "FinancialAccountCreditConfig{accountToken=$accountToken, chargedOffReason=$chargedOffReason, creditLimit=$creditLimit, creditProductToken=$creditProductToken, externalBankAccountToken=$externalBankAccountToken, financialAccountState=$financialAccountState, isSpendBlocked=$isSpendBlocked, tier=$tier, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt index 46d9e008..d224d0d3 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/FinancialTransaction.kt @@ -22,6 +22,7 @@ import java.util.Objects class FinancialTransaction @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -49,13 +50,15 @@ private constructor( @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * Status types: * - `CARD` - Issuing card transaction. @@ -109,12 +112,12 @@ private constructor( */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Status types: * - `CARD` - Issuing card transaction. @@ -168,9 +171,6 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @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 @@ -182,6 +182,7 @@ private constructor( fun validate(): FinancialTransaction = apply { if (!validated) { + token() category() created() currency() @@ -191,7 +192,6 @@ private constructor( result() settledAmount() status() - token() updated() validated = true } @@ -206,6 +206,7 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -215,11 +216,11 @@ private constructor( private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialTransaction: FinancialTransaction) = apply { + token = financialTransaction.token category = financialTransaction.category created = financialTransaction.created currency = financialTransaction.currency @@ -229,11 +230,16 @@ private constructor( result = financialTransaction.result settledAmount = financialTransaction.settledAmount status = financialTransaction.status - token = financialTransaction.token updated = financialTransaction.updated additionalProperties = financialTransaction.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Status types: * - `CARD` - Issuing card transaction. @@ -346,12 +352,6 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -379,6 +379,7 @@ private constructor( fun build(): FinancialTransaction = FinancialTransaction( + token, category, created, currency, @@ -388,7 +389,6 @@ private constructor( result, settledAmount, status, - token, updated, additionalProperties.toImmutable(), ) @@ -461,6 +461,9 @@ private constructor( class FinancialEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @@ -470,9 +473,6 @@ private constructor( @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @@ -480,6 +480,9 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String? = token.getNullable("token") + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -495,11 +498,11 @@ private constructor( */ fun result(): Result? = result.getNullable("result") - /** Globally unique identifier. */ - fun token(): String? = token.getNullable("token") - fun type(): FinancialEventType? = type.getNullable("type") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -515,9 +518,6 @@ private constructor( */ @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @@ -528,10 +528,10 @@ private constructor( fun validate(): FinancialEvent = apply { if (!validated) { + token() amount() created() result() - token() type() validated = true } @@ -546,22 +546,28 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialEvent: FinancialEvent) = apply { + token = financialEvent.token amount = financialEvent.amount created = financialEvent.created result = financialEvent.result - token = financialEvent.token type = financialEvent.type additionalProperties = financialEvent.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -592,12 +598,6 @@ private constructor( */ fun result(result: JsonField) = apply { this.result = result } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun type(type: FinancialEventType) = type(JsonField.of(type)) fun type(type: JsonField) = apply { this.type = type } @@ -623,10 +623,10 @@ private constructor( fun build(): FinancialEvent = FinancialEvent( + token, amount, created, result, - token, type, additionalProperties.toImmutable(), ) @@ -1111,17 +1111,17 @@ private constructor( return true } - return /* spotless:off */ other is FinancialEvent && amount == other.amount && created == other.created && result == other.result && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialEvent && token == other.token && amount == other.amount && created == other.created && result == other.result && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, created, result, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, result, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialEvent{amount=$amount, created=$created, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "FinancialEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, additionalProperties=$additionalProperties}" } class Result @@ -1267,15 +1267,15 @@ private constructor( return true } - return /* spotless:off */ other is FinancialTransaction && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && token == other.token && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialTransaction && token == other.token && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, descriptor, events, pendingAmount, result, settledAmount, status, token, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, descriptor, events, pendingAmount, result, settledAmount, status, updated, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialTransaction{category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, token=$token, updated=$updated, additionalProperties=$additionalProperties}" + "FinancialTransaction{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, updated=$updated, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyb.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyb.kt index 4d88b498..8d90639b 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyb.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyb.kt @@ -33,24 +33,24 @@ private constructor( @JsonProperty("control_person") @ExcludeMissing private val controlPerson: JsonField = JsonMissing.of(), - @JsonProperty("external_id") - @ExcludeMissing - private val externalId: JsonField = JsonMissing.of(), - @JsonProperty("kyb_passed_timestamp") - @ExcludeMissing - private val kybPassedTimestamp: JsonField = JsonMissing.of(), @JsonProperty("nature_of_business") @ExcludeMissing private val natureOfBusiness: JsonField = JsonMissing.of(), @JsonProperty("tos_timestamp") @ExcludeMissing private val tosTimestamp: JsonField = JsonMissing.of(), - @JsonProperty("website_url") - @ExcludeMissing - private val websiteUrl: JsonField = JsonMissing.of(), @JsonProperty("workflow") @ExcludeMissing private val workflow: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + private val externalId: JsonField = JsonMissing.of(), + @JsonProperty("kyb_passed_timestamp") + @ExcludeMissing + private val kybPassedTimestamp: JsonField = JsonMissing.of(), + @JsonProperty("website_url") + @ExcludeMissing + private val websiteUrl: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -92,6 +92,19 @@ private constructor( */ fun controlPerson(): KybIndividual = controlPerson.getRequired("control_person") + /** Short description of the company's line of business (i.e., what does the company do?). */ + fun natureOfBusiness(): String = natureOfBusiness.getRequired("nature_of_business") + + /** + * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal + * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation with + * Lithic. + */ + fun tosTimestamp(): String = tosTimestamp.getRequired("tos_timestamp") + + /** Specifies the type of KYB workflow to run. */ + fun workflow(): Workflow = workflow.getRequired("workflow") + /** A user provided id that can be used to link an account holder with an external system */ fun externalId(): String? = externalId.getNullable("external_id") @@ -103,22 +116,9 @@ private constructor( */ fun kybPassedTimestamp(): String? = kybPassedTimestamp.getNullable("kyb_passed_timestamp") - /** Short description of the company's line of business (i.e., what does the company do?). */ - fun natureOfBusiness(): String = natureOfBusiness.getRequired("nature_of_business") - - /** - * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal - * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation with - * Lithic. - */ - fun tosTimestamp(): String = tosTimestamp.getRequired("tos_timestamp") - /** Company website URL. */ fun websiteUrl(): String? = websiteUrl.getNullable("website_url") - /** Specifies the type of KYB workflow to run. */ - fun workflow(): Workflow = workflow.getRequired("workflow") - /** * 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. @@ -159,6 +159,19 @@ private constructor( */ @JsonProperty("control_person") @ExcludeMissing fun _controlPerson() = controlPerson + /** Short description of the company's line of business (i.e., what does the company do?). */ + @JsonProperty("nature_of_business") @ExcludeMissing fun _natureOfBusiness() = natureOfBusiness + + /** + * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal + * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation with + * Lithic. + */ + @JsonProperty("tos_timestamp") @ExcludeMissing fun _tosTimestamp() = tosTimestamp + + /** Specifies the type of KYB workflow to run. */ + @JsonProperty("workflow") @ExcludeMissing fun _workflow() = workflow + /** A user provided id that can be used to link an account holder with an external system */ @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId @@ -172,22 +185,9 @@ private constructor( @ExcludeMissing fun _kybPassedTimestamp() = kybPassedTimestamp - /** Short description of the company's line of business (i.e., what does the company do?). */ - @JsonProperty("nature_of_business") @ExcludeMissing fun _natureOfBusiness() = natureOfBusiness - - /** - * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal - * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation with - * Lithic. - */ - @JsonProperty("tos_timestamp") @ExcludeMissing fun _tosTimestamp() = tosTimestamp - /** Company website URL. */ @JsonProperty("website_url") @ExcludeMissing fun _websiteUrl() = websiteUrl - /** Specifies the type of KYB workflow to run. */ - @JsonProperty("workflow") @ExcludeMissing fun _workflow() = workflow - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -200,12 +200,12 @@ private constructor( beneficialOwnerIndividuals().forEach { it.validate() } businessEntity().validate() controlPerson().validate() - externalId() - kybPassedTimestamp() natureOfBusiness() tosTimestamp() - websiteUrl() workflow() + externalId() + kybPassedTimestamp() + websiteUrl() validated = true } } @@ -223,12 +223,12 @@ private constructor( private var beneficialOwnerIndividuals: JsonField> = JsonMissing.of() private var businessEntity: JsonField = JsonMissing.of() private var controlPerson: JsonField = JsonMissing.of() - private var externalId: JsonField = JsonMissing.of() - private var kybPassedTimestamp: JsonField = JsonMissing.of() private var natureOfBusiness: JsonField = JsonMissing.of() private var tosTimestamp: JsonField = JsonMissing.of() - private var websiteUrl: JsonField = JsonMissing.of() private var workflow: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() + private var kybPassedTimestamp: JsonField = JsonMissing.of() + private var websiteUrl: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(kyb: Kyb) = apply { @@ -236,12 +236,12 @@ private constructor( beneficialOwnerIndividuals = kyb.beneficialOwnerIndividuals businessEntity = kyb.businessEntity controlPerson = kyb.controlPerson - externalId = kyb.externalId - kybPassedTimestamp = kyb.kybPassedTimestamp natureOfBusiness = kyb.natureOfBusiness tosTimestamp = kyb.tosTimestamp - websiteUrl = kyb.websiteUrl workflow = kyb.workflow + externalId = kyb.externalId + kybPassedTimestamp = kyb.kybPassedTimestamp + websiteUrl = kyb.websiteUrl additionalProperties = kyb.additionalProperties.toMutableMap() } @@ -332,31 +332,6 @@ private constructor( this.controlPerson = controlPerson } - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: String) = externalId(JsonField.of(externalId)) - - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: JsonField) = apply { this.externalId = externalId } - - /** - * An RFC 3339 timestamp indicating when precomputed KYC was completed on the business with - * a pass result. - * - * This field is required only if workflow type is `KYB_BYO`. - */ - fun kybPassedTimestamp(kybPassedTimestamp: String) = - kybPassedTimestamp(JsonField.of(kybPassedTimestamp)) - - /** - * An RFC 3339 timestamp indicating when precomputed KYC was completed on the business with - * a pass result. - * - * This field is required only if workflow type is `KYB_BYO`. - */ - fun kybPassedTimestamp(kybPassedTimestamp: JsonField) = apply { - this.kybPassedTimestamp = kybPassedTimestamp - } - /** * Short description of the company's line of business (i.e., what does the company do?). */ @@ -386,18 +361,43 @@ private constructor( this.tosTimestamp = tosTimestamp } - /** Company website URL. */ - fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) - - /** Company website URL. */ - fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } - /** Specifies the type of KYB workflow to run. */ fun workflow(workflow: Workflow) = workflow(JsonField.of(workflow)) /** Specifies the type of KYB workflow to run. */ fun workflow(workflow: JsonField) = apply { this.workflow = workflow } + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: String) = externalId(JsonField.of(externalId)) + + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + + /** + * An RFC 3339 timestamp indicating when precomputed KYC was completed on the business with + * a pass result. + * + * This field is required only if workflow type is `KYB_BYO`. + */ + fun kybPassedTimestamp(kybPassedTimestamp: String) = + kybPassedTimestamp(JsonField.of(kybPassedTimestamp)) + + /** + * An RFC 3339 timestamp indicating when precomputed KYC was completed on the business with + * a pass result. + * + * This field is required only if workflow type is `KYB_BYO`. + */ + fun kybPassedTimestamp(kybPassedTimestamp: JsonField) = apply { + this.kybPassedTimestamp = kybPassedTimestamp + } + + /** Company website URL. */ + fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl)) + + /** Company website URL. */ + fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -423,12 +423,12 @@ private constructor( beneficialOwnerIndividuals.map { it.toImmutable() }, businessEntity, controlPerson, - externalId, - kybPassedTimestamp, natureOfBusiness, tosTimestamp, - websiteUrl, workflow, + externalId, + kybPassedTimestamp, + websiteUrl, additionalProperties.toImmutable(), ) } @@ -440,21 +440,21 @@ private constructor( @JsonProperty("address") @ExcludeMissing private val address: JsonField
= JsonMissing.of(), - @JsonProperty("dba_business_name") - @ExcludeMissing - private val dbaBusinessName: JsonField = JsonMissing.of(), @JsonProperty("government_id") @ExcludeMissing private val governmentId: JsonField = JsonMissing.of(), @JsonProperty("legal_business_name") @ExcludeMissing private val legalBusinessName: JsonField = JsonMissing.of(), - @JsonProperty("parent_company") - @ExcludeMissing - private val parentCompany: JsonField = JsonMissing.of(), @JsonProperty("phone_numbers") @ExcludeMissing private val phoneNumbers: JsonField> = JsonMissing.of(), + @JsonProperty("dba_business_name") + @ExcludeMissing + private val dbaBusinessName: JsonField = JsonMissing.of(), + @JsonProperty("parent_company") + @ExcludeMissing + private val parentCompany: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -465,12 +465,6 @@ private constructor( */ fun address(): Address = address.getRequired("address") - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(): String? = dbaBusinessName.getNullable("dba_business_name") - /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. @@ -480,23 +474,23 @@ private constructor( /** Legal (formal) business name. */ fun legalBusinessName(): String = legalBusinessName.getRequired("legal_business_name") - /** Parent company name (if applicable). */ - fun parentCompany(): String? = parentCompany.getNullable("parent_company") - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(): List = phoneNumbers.getRequired("phone_numbers") /** - * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; - * APO/FPO are acceptable. + * Any name that the business operates under that is not its legal business name (if + * applicable). */ - @JsonProperty("address") @ExcludeMissing fun _address() = address + fun dbaBusinessName(): String? = dbaBusinessName.getNullable("dba_business_name") + + /** Parent company name (if applicable). */ + fun parentCompany(): String? = parentCompany.getNullable("parent_company") /** - * Any name that the business operates under that is not its legal business name (if - * applicable). + * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; + * APO/FPO are acceptable. */ - @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName + @JsonProperty("address") @ExcludeMissing fun _address() = address /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) @@ -509,12 +503,18 @@ private constructor( @ExcludeMissing fun _legalBusinessName() = legalBusinessName - /** Parent company name (if applicable). */ - @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName + + /** Parent company name (if applicable). */ + @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -524,11 +524,11 @@ private constructor( fun validate(): BusinessEntity = apply { if (!validated) { address().validate() - dbaBusinessName() governmentId() legalBusinessName() - parentCompany() phoneNumbers() + dbaBusinessName() + parentCompany() validated = true } } @@ -543,20 +543,20 @@ private constructor( class Builder { private var address: JsonField
= JsonMissing.of() - private var dbaBusinessName: JsonField = JsonMissing.of() private var governmentId: JsonField = JsonMissing.of() private var legalBusinessName: JsonField = JsonMissing.of() - private var parentCompany: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() + private var dbaBusinessName: JsonField = JsonMissing.of() + private var parentCompany: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(businessEntity: BusinessEntity) = apply { address = businessEntity.address - dbaBusinessName = businessEntity.dbaBusinessName governmentId = businessEntity.governmentId legalBusinessName = businessEntity.legalBusinessName - parentCompany = businessEntity.parentCompany phoneNumbers = businessEntity.phoneNumbers + dbaBusinessName = businessEntity.dbaBusinessName + parentCompany = businessEntity.parentCompany additionalProperties = businessEntity.additionalProperties.toMutableMap() } @@ -572,21 +572,6 @@ private constructor( */ fun address(address: JsonField
) = apply { this.address = address } - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(dbaBusinessName: String) = - dbaBusinessName(JsonField.of(dbaBusinessName)) - - /** - * Any name that the business operates under that is not its legal business name (if - * applicable). - */ - fun dbaBusinessName(dbaBusinessName: JsonField) = apply { - this.dbaBusinessName = dbaBusinessName - } - /** * Government-issued identification number. US Federal Employer Identification Numbers * (EIN) are currently supported, entered as full nine-digits, with or without hyphens. @@ -610,14 +595,6 @@ private constructor( this.legalBusinessName = legalBusinessName } - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) - - /** Parent company name (if applicable). */ - fun parentCompany(parentCompany: JsonField) = apply { - this.parentCompany = parentCompany - } - /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) @@ -626,6 +603,29 @@ private constructor( this.phoneNumbers = phoneNumbers } + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + fun dbaBusinessName(dbaBusinessName: String) = + dbaBusinessName(JsonField.of(dbaBusinessName)) + + /** + * Any name that the business operates under that is not its legal business name (if + * applicable). + */ + fun dbaBusinessName(dbaBusinessName: JsonField) = apply { + this.dbaBusinessName = dbaBusinessName + } + + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) + + /** Parent company name (if applicable). */ + fun parentCompany(parentCompany: JsonField) = apply { + this.parentCompany = parentCompany + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -648,11 +648,11 @@ private constructor( fun build(): BusinessEntity = BusinessEntity( address, - dbaBusinessName, governmentId, legalBusinessName, - parentCompany, phoneNumbers.map { it.toImmutable() }, + dbaBusinessName, + parentCompany, additionalProperties.toImmutable(), ) } @@ -662,17 +662,17 @@ private constructor( return true } - return /* spotless:off */ other is BusinessEntity && address == other.address && dbaBusinessName == other.dbaBusinessName && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && parentCompany == other.parentCompany && phoneNumbers == other.phoneNumbers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is BusinessEntity && address == other.address && governmentId == other.governmentId && legalBusinessName == other.legalBusinessName && phoneNumbers == other.phoneNumbers && dbaBusinessName == other.dbaBusinessName && parentCompany == other.parentCompany && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, dbaBusinessName, governmentId, legalBusinessName, parentCompany, phoneNumbers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, governmentId, legalBusinessName, phoneNumbers, dbaBusinessName, parentCompany, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "BusinessEntity{address=$address, dbaBusinessName=$dbaBusinessName, governmentId=$governmentId, legalBusinessName=$legalBusinessName, parentCompany=$parentCompany, phoneNumbers=$phoneNumbers, additionalProperties=$additionalProperties}" + "BusinessEntity{address=$address, governmentId=$governmentId, legalBusinessName=$legalBusinessName, phoneNumbers=$phoneNumbers, dbaBusinessName=$dbaBusinessName, parentCompany=$parentCompany, additionalProperties=$additionalProperties}" } /** Individuals associated with a KYB application. Phone number is optional. */ @@ -995,15 +995,15 @@ private constructor( return true } - return /* spotless:off */ other is Kyb && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && businessEntity == other.businessEntity && controlPerson == other.controlPerson && externalId == other.externalId && kybPassedTimestamp == other.kybPassedTimestamp && natureOfBusiness == other.natureOfBusiness && tosTimestamp == other.tosTimestamp && websiteUrl == other.websiteUrl && workflow == other.workflow && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Kyb && beneficialOwnerEntities == other.beneficialOwnerEntities && beneficialOwnerIndividuals == other.beneficialOwnerIndividuals && businessEntity == other.businessEntity && controlPerson == other.controlPerson && natureOfBusiness == other.natureOfBusiness && tosTimestamp == other.tosTimestamp && workflow == other.workflow && externalId == other.externalId && kybPassedTimestamp == other.kybPassedTimestamp && websiteUrl == other.websiteUrl && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(beneficialOwnerEntities, beneficialOwnerIndividuals, businessEntity, controlPerson, externalId, kybPassedTimestamp, natureOfBusiness, tosTimestamp, websiteUrl, workflow, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(beneficialOwnerEntities, beneficialOwnerIndividuals, businessEntity, controlPerson, natureOfBusiness, tosTimestamp, workflow, externalId, kybPassedTimestamp, websiteUrl, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Kyb{beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessEntity=$businessEntity, controlPerson=$controlPerson, externalId=$externalId, kybPassedTimestamp=$kybPassedTimestamp, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, websiteUrl=$websiteUrl, workflow=$workflow, additionalProperties=$additionalProperties}" + "Kyb{beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessEntity=$businessEntity, controlPerson=$controlPerson, natureOfBusiness=$natureOfBusiness, tosTimestamp=$tosTimestamp, workflow=$workflow, externalId=$externalId, kybPassedTimestamp=$kybPassedTimestamp, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyc.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyc.kt index 2fc3b11b..18766e82 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyc.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Kyc.kt @@ -21,38 +21,27 @@ import java.util.Objects class Kyc @JsonCreator private constructor( - @JsonProperty("external_id") - @ExcludeMissing - private val externalId: JsonField = JsonMissing.of(), @JsonProperty("individual") @ExcludeMissing private val individual: JsonField = JsonMissing.of(), - @JsonProperty("kyc_passed_timestamp") - @ExcludeMissing - private val kycPassedTimestamp: JsonField = JsonMissing.of(), @JsonProperty("tos_timestamp") @ExcludeMissing private val tosTimestamp: JsonField = JsonMissing.of(), @JsonProperty("workflow") @ExcludeMissing private val workflow: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + private val externalId: JsonField = JsonMissing.of(), + @JsonProperty("kyc_passed_timestamp") + @ExcludeMissing + private val kycPassedTimestamp: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(): String? = externalId.getNullable("external_id") - /** Information on individual for whom the account is being opened and KYC is being run. */ fun individual(): Individual = individual.getRequired("individual") - /** - * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual with a - * pass result. - * - * This field is required only if workflow type is `KYC_BYO`. - */ - fun kycPassedTimestamp(): String? = kycPassedTimestamp.getNullable("kyc_passed_timestamp") - /** * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation with @@ -64,10 +53,7 @@ private constructor( fun workflow(): Workflow = workflow.getRequired("workflow") /** A user provided id that can be used to link an account holder with an external system */ - @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId - - /** Information on individual for whom the account is being opened and KYC is being run. */ - @JsonProperty("individual") @ExcludeMissing fun _individual() = individual + fun externalId(): String? = externalId.getNullable("external_id") /** * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual with a @@ -75,9 +61,10 @@ private constructor( * * This field is required only if workflow type is `KYC_BYO`. */ - @JsonProperty("kyc_passed_timestamp") - @ExcludeMissing - fun _kycPassedTimestamp() = kycPassedTimestamp + fun kycPassedTimestamp(): String? = kycPassedTimestamp.getNullable("kyc_passed_timestamp") + + /** Information on individual for whom the account is being opened and KYC is being run. */ + @JsonProperty("individual") @ExcludeMissing fun _individual() = individual /** * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal @@ -89,6 +76,19 @@ private constructor( /** Specifies the type of KYC workflow to run. */ @JsonProperty("workflow") @ExcludeMissing fun _workflow() = workflow + /** A user provided id that can be used to link an account holder with an external system */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId + + /** + * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual with a + * pass result. + * + * This field is required only if workflow type is `KYC_BYO`. + */ + @JsonProperty("kyc_passed_timestamp") + @ExcludeMissing + fun _kycPassedTimestamp() = kycPassedTimestamp + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -97,11 +97,11 @@ private constructor( fun validate(): Kyc = apply { if (!validated) { - externalId() individual().validate() - kycPassedTimestamp() tosTimestamp() workflow() + externalId() + kycPassedTimestamp() validated = true } } @@ -115,53 +115,28 @@ private constructor( class Builder { - private var externalId: JsonField = JsonMissing.of() private var individual: JsonField = JsonMissing.of() - private var kycPassedTimestamp: JsonField = JsonMissing.of() private var tosTimestamp: JsonField = JsonMissing.of() private var workflow: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() + private var kycPassedTimestamp: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(kyc: Kyc) = apply { - externalId = kyc.externalId individual = kyc.individual - kycPassedTimestamp = kyc.kycPassedTimestamp tosTimestamp = kyc.tosTimestamp workflow = kyc.workflow + externalId = kyc.externalId + kycPassedTimestamp = kyc.kycPassedTimestamp additionalProperties = kyc.additionalProperties.toMutableMap() } - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: String) = externalId(JsonField.of(externalId)) - - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: JsonField) = apply { this.externalId = externalId } - /** Information on individual for whom the account is being opened and KYC is being run. */ fun individual(individual: Individual) = individual(JsonField.of(individual)) /** Information on individual for whom the account is being opened and KYC is being run. */ fun individual(individual: JsonField) = apply { this.individual = individual } - /** - * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual - * with a pass result. - * - * This field is required only if workflow type is `KYC_BYO`. - */ - fun kycPassedTimestamp(kycPassedTimestamp: String) = - kycPassedTimestamp(JsonField.of(kycPassedTimestamp)) - - /** - * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual - * with a pass result. - * - * This field is required only if workflow type is `KYC_BYO`. - */ - fun kycPassedTimestamp(kycPassedTimestamp: JsonField) = apply { - this.kycPassedTimestamp = kycPassedTimestamp - } - /** * An RFC 3339 timestamp indicating when the account holder accepted the applicable legal * agreements (e.g., cardholder terms) as agreed upon during API customer's implementation @@ -184,6 +159,31 @@ private constructor( /** Specifies the type of KYC workflow to run. */ fun workflow(workflow: JsonField) = apply { this.workflow = workflow } + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: String) = externalId(JsonField.of(externalId)) + + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + + /** + * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual + * with a pass result. + * + * This field is required only if workflow type is `KYC_BYO`. + */ + fun kycPassedTimestamp(kycPassedTimestamp: String) = + kycPassedTimestamp(JsonField.of(kycPassedTimestamp)) + + /** + * An RFC 3339 timestamp indicating when precomputed KYC was completed on the individual + * with a pass result. + * + * This field is required only if workflow type is `KYC_BYO`. + */ + fun kycPassedTimestamp(kycPassedTimestamp: JsonField) = apply { + this.kycPassedTimestamp = kycPassedTimestamp + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -205,11 +205,11 @@ private constructor( fun build(): Kyc = Kyc( - externalId, individual, - kycPassedTimestamp, tosTimestamp, workflow, + externalId, + kycPassedTimestamp, additionalProperties.toImmutable(), ) } @@ -534,15 +534,15 @@ private constructor( return true } - return /* spotless:off */ other is Kyc && externalId == other.externalId && individual == other.individual && kycPassedTimestamp == other.kycPassedTimestamp && tosTimestamp == other.tosTimestamp && workflow == other.workflow && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Kyc && individual == other.individual && tosTimestamp == other.tosTimestamp && workflow == other.workflow && externalId == other.externalId && kycPassedTimestamp == other.kycPassedTimestamp && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(externalId, individual, kycPassedTimestamp, tosTimestamp, workflow, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(individual, tosTimestamp, workflow, externalId, kycPassedTimestamp, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Kyc{externalId=$externalId, individual=$individual, kycPassedTimestamp=$kycPassedTimestamp, tosTimestamp=$tosTimestamp, workflow=$workflow, additionalProperties=$additionalProperties}" + "Kyc{individual=$individual, tosTimestamp=$tosTimestamp, workflow=$workflow, externalId=$externalId, kycPassedTimestamp=$kycPassedTimestamp, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt index 7422fbb6..101f033e 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/KycExempt.kt @@ -24,13 +24,7 @@ private constructor( @JsonProperty("address") @ExcludeMissing private val address: JsonField
= JsonMissing.of(), - @JsonProperty("business_account_token") - @ExcludeMissing - private val businessAccountToken: JsonField = JsonMissing.of(), @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), - @JsonProperty("external_id") - @ExcludeMissing - private val externalId: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), @@ -46,6 +40,12 @@ private constructor( @JsonProperty("workflow") @ExcludeMissing private val workflow: JsonField = JsonMissing.of(), + @JsonProperty("business_account_token") + @ExcludeMissing + private val businessAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("external_id") + @ExcludeMissing + private val externalId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -55,19 +55,9 @@ private constructor( */ fun address(): Address = address.getRequired("address") - /** - * 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(): String? = businessAccountToken.getNullable("business_account_token") - /** The KYC Exempt user's email */ fun email(): String = email.getRequired("email") - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(): String? = externalId.getNullable("external_id") - /** The KYC Exempt user's first name */ fun firstName(): String = firstName.getRequired("first_name") @@ -83,27 +73,25 @@ private constructor( /** 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. - */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - /** * 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 + fun businessAccountToken(): String? = businessAccountToken.getNullable("business_account_token") + + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(): String? = externalId.getNullable("external_id") + + /** + * KYC Exempt user's current address - PO boxes, UPS drops, and FedEx drops are not acceptable; + * APO/FPO are acceptable. + */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** The KYC Exempt user's email */ @JsonProperty("email") @ExcludeMissing fun _email() = email - /** A user provided id that can be used to link an account holder with an external system */ - @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId - /** The KYC Exempt user's first name */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName @@ -119,6 +107,18 @@ private constructor( /** 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 + + /** A user provided id that can be used to link an account holder with an external system */ + @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -128,14 +128,14 @@ private constructor( fun validate(): KycExempt = apply { if (!validated) { address().validate() - businessAccountToken() email() - externalId() firstName() kycExemptionType() lastName() phoneNumber() workflow() + businessAccountToken() + externalId() validated = true } } @@ -150,26 +150,26 @@ private constructor( class Builder { private var address: JsonField
= JsonMissing.of() - private var businessAccountToken: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() - private var externalId: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() private var kycExemptionType: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() private var workflow: JsonField = JsonMissing.of() + private var businessAccountToken: JsonField = JsonMissing.of() + private var externalId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(kycExempt: KycExempt) = apply { address = kycExempt.address - businessAccountToken = kycExempt.businessAccountToken email = kycExempt.email - externalId = kycExempt.externalId firstName = kycExempt.firstName kycExemptionType = kycExempt.kycExemptionType lastName = kycExempt.lastName phoneNumber = kycExempt.phoneNumber workflow = kycExempt.workflow + businessAccountToken = kycExempt.businessAccountToken + externalId = kycExempt.externalId additionalProperties = kycExempt.additionalProperties.toMutableMap() } @@ -185,35 +185,12 @@ private constructor( */ fun address(address: JsonField
) = apply { this.address = address } - /** - * 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. - */ - 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 */ fun email(email: JsonField) = apply { this.email = email } - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: String) = externalId(JsonField.of(externalId)) - - /** A user provided id that can be used to link an account holder with an external system */ - fun externalId(externalId: JsonField) = apply { this.externalId = externalId } - /** The KYC Exempt user's first name */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) @@ -247,6 +224,29 @@ private constructor( /** Specifies the workflow type. This must be 'KYC_EXEMPT' */ fun workflow(workflow: JsonField) = apply { this.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. + */ + 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. + */ + fun businessAccountToken(businessAccountToken: JsonField) = apply { + this.businessAccountToken = businessAccountToken + } + + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: String) = externalId(JsonField.of(externalId)) + + /** A user provided id that can be used to link an account holder with an external system */ + fun externalId(externalId: JsonField) = apply { this.externalId = externalId } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -269,14 +269,14 @@ private constructor( fun build(): KycExempt = KycExempt( address, - businessAccountToken, email, - externalId, firstName, kycExemptionType, lastName, phoneNumber, workflow, + businessAccountToken, + externalId, additionalProperties.toImmutable(), ) } @@ -394,15 +394,15 @@ private constructor( return true } - return /* spotless:off */ other is KycExempt && address == other.address && businessAccountToken == other.businessAccountToken && email == other.email && externalId == other.externalId && firstName == other.firstName && kycExemptionType == other.kycExemptionType && lastName == other.lastName && phoneNumber == other.phoneNumber && workflow == other.workflow && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is KycExempt && address == other.address && email == other.email && firstName == other.firstName && kycExemptionType == other.kycExemptionType && lastName == other.lastName && phoneNumber == other.phoneNumber && workflow == other.workflow && businessAccountToken == other.businessAccountToken && externalId == other.externalId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address, businessAccountToken, email, externalId, firstName, kycExemptionType, lastName, phoneNumber, workflow, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address, email, firstName, kycExemptionType, lastName, phoneNumber, workflow, businessAccountToken, externalId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "KycExempt{address=$address, businessAccountToken=$businessAccountToken, email=$email, externalId=$externalId, firstName=$firstName, kycExemptionType=$kycExemptionType, lastName=$lastName, phoneNumber=$phoneNumber, workflow=$workflow, additionalProperties=$additionalProperties}" + "KycExempt{address=$address, email=$email, firstName=$firstName, kycExemptionType=$kycExemptionType, lastName=$lastName, phoneNumber=$phoneNumber, workflow=$workflow, businessAccountToken=$businessAccountToken, externalId=$externalId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt index 36f68709..3cbb620c 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LineItemListResponse.kt @@ -24,115 +24,115 @@ class LineItemListResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("card_token") + @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), + @JsonProperty("category") @ExcludeMissing - private val cardToken: JsonField = JsonMissing.of(), - @JsonProperty("financial_transaction_token") + private val category: JsonField = JsonMissing.of(), + @JsonProperty("created") @ExcludeMissing - private val financialTransactionToken: JsonField = JsonMissing.of(), - @JsonProperty("financial_transaction_event_token") + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing - private val financialTransactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("category") + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("effective_date") @ExcludeMissing - private val category: JsonField = JsonMissing.of(), + private val effectiveDate: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("effective_date") + @JsonProperty("financial_account_token") @ExcludeMissing - private val effectiveDate: JsonField = JsonMissing.of(), - @JsonProperty("descriptor") + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_transaction_event_token") @ExcludeMissing - private val descriptor: JsonField = JsonMissing.of(), - @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val financialTransactionEventToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_transaction_token") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("created") + private val financialTransactionToken: JsonField = JsonMissing.of(), + @JsonProperty("card_token") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val cardToken: JsonField = JsonMissing.of(), + @JsonProperty("descriptor") + @ExcludeMissing + private val descriptor: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Globally unique identifier for a Statement Line Item */ fun token(): String = token.getRequired("token") + /** Transaction amount in cents */ + fun amount(): Long = amount.getRequired("amount") + + fun category(): TransactionCategory = category.getRequired("category") + + /** Timestamp of when the line item was generated */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(): String = currency.getRequired("currency") + + /** Date that the transaction effected the account balance */ + fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") + + fun eventType(): FinancialEventType = eventType.getRequired("event_type") + /** Globally unique identifier for a financial account */ fun financialAccountToken(): String = financialAccountToken.getRequired("financial_account_token") - /** Globally unique identifier for a card */ - fun cardToken(): String? = cardToken.getNullable("card_token") + /** Globally unique identifier for a financial transaction event */ + fun financialTransactionEventToken(): String = + financialTransactionEventToken.getRequired("financial_transaction_event_token") /** Globally unique identifier for a financial transaction */ fun financialTransactionToken(): String = financialTransactionToken.getRequired("financial_transaction_token") - /** Globally unique identifier for a financial transaction event */ - fun financialTransactionEventToken(): String = - financialTransactionEventToken.getRequired("financial_transaction_event_token") + /** Globally unique identifier for a card */ + fun cardToken(): String? = cardToken.getNullable("card_token") - fun category(): TransactionCategory = category.getRequired("category") + fun descriptor(): String? = descriptor.getNullable("descriptor") - fun eventType(): FinancialEventType = eventType.getRequired("event_type") + /** Globally unique identifier for a Statement Line Item */ + @JsonProperty("token") @ExcludeMissing fun _token() = token - /** Date that the transaction effected the account balance */ - fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") + /** Transaction amount in cents */ + @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - fun descriptor(): String? = descriptor.getNullable("descriptor") + @JsonProperty("category") @ExcludeMissing fun _category() = category - /** Transaction amount in cents */ - fun amount(): Long = amount.getRequired("amount") + /** Timestamp of when the line item was generated */ + @JsonProperty("created") @ExcludeMissing fun _created() = created /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(): String = currency.getRequired("currency") + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - /** Timestamp of when the line item was generated */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Date that the transaction effected the account balance */ + @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate - /** Globally unique identifier for a Statement Line Item */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType /** Globally unique identifier for a financial account */ @JsonProperty("financial_account_token") @ExcludeMissing fun _financialAccountToken() = financialAccountToken - /** Globally unique identifier for a card */ - @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken - - /** Globally unique identifier for a financial transaction */ - @JsonProperty("financial_transaction_token") - @ExcludeMissing - fun _financialTransactionToken() = financialTransactionToken - /** Globally unique identifier for a financial transaction event */ @JsonProperty("financial_transaction_event_token") @ExcludeMissing fun _financialTransactionEventToken() = financialTransactionEventToken - @JsonProperty("category") @ExcludeMissing fun _category() = category - - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Globally unique identifier for a financial transaction */ + @JsonProperty("financial_transaction_token") + @ExcludeMissing + fun _financialTransactionToken() = financialTransactionToken - /** Date that the transaction effected the account balance */ - @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate + /** Globally unique identifier for a card */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken @JsonProperty("descriptor") @ExcludeMissing fun _descriptor() = descriptor - /** Transaction amount in cents */ - @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - - /** Timestamp of when the line item was generated */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -142,17 +142,17 @@ private constructor( fun validate(): LineItemListResponse = apply { if (!validated) { token() - financialAccountToken() - cardToken() - financialTransactionToken() - financialTransactionEventToken() + amount() category() - eventType() + created() + currency() effectiveDate() + eventType() + financialAccountToken() + financialTransactionEventToken() + financialTransactionToken() + cardToken() descriptor() - amount() - currency() - created() validated = true } } @@ -167,32 +167,32 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var cardToken: JsonField = JsonMissing.of() - private var financialTransactionToken: JsonField = JsonMissing.of() - private var financialTransactionEventToken: JsonField = JsonMissing.of() + private var amount: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() - private var eventType: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var financialTransactionEventToken: JsonField = JsonMissing.of() + private var financialTransactionToken: JsonField = JsonMissing.of() + private var cardToken: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() - private var amount: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(lineItemListResponse: LineItemListResponse) = apply { token = lineItemListResponse.token - financialAccountToken = lineItemListResponse.financialAccountToken - cardToken = lineItemListResponse.cardToken - financialTransactionToken = lineItemListResponse.financialTransactionToken - financialTransactionEventToken = lineItemListResponse.financialTransactionEventToken + amount = lineItemListResponse.amount category = lineItemListResponse.category - eventType = lineItemListResponse.eventType + created = lineItemListResponse.created + currency = lineItemListResponse.currency effectiveDate = lineItemListResponse.effectiveDate + eventType = lineItemListResponse.eventType + financialAccountToken = lineItemListResponse.financialAccountToken + financialTransactionEventToken = lineItemListResponse.financialTransactionEventToken + financialTransactionToken = lineItemListResponse.financialTransactionToken + cardToken = lineItemListResponse.cardToken descriptor = lineItemListResponse.descriptor - amount = lineItemListResponse.amount - currency = lineItemListResponse.currency - created = lineItemListResponse.created additionalProperties = lineItemListResponse.additionalProperties.toMutableMap() } @@ -202,6 +202,42 @@ private constructor( /** Globally unique identifier for a Statement Line Item */ fun token(token: JsonField) = apply { this.token = token } + /** Transaction amount in cents */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** Transaction amount in cents */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + fun category(category: TransactionCategory) = category(JsonField.of(category)) + + fun category(category: JsonField) = apply { this.category = category } + + /** Timestamp of when the line item was generated */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** Timestamp of when the line item was generated */ + fun created(created: JsonField) = apply { this.created = created } + + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** Date that the transaction effected the account balance */ + fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) + + /** Date that the transaction effected the account balance */ + fun effectiveDate(effectiveDate: JsonField) = apply { + this.effectiveDate = effectiveDate + } + + fun eventType(eventType: FinancialEventType) = eventType(JsonField.of(eventType)) + + fun eventType(eventType: JsonField) = apply { + this.eventType = eventType + } + /** Globally unique identifier for a financial account */ fun financialAccountToken(financialAccountToken: String) = financialAccountToken(JsonField.of(financialAccountToken)) @@ -211,21 +247,6 @@ private constructor( this.financialAccountToken = financialAccountToken } - /** Globally unique identifier for a card */ - fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) - - /** Globally unique identifier for a card */ - fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } - - /** Globally unique identifier for a financial transaction */ - fun financialTransactionToken(financialTransactionToken: String) = - financialTransactionToken(JsonField.of(financialTransactionToken)) - - /** Globally unique identifier for a financial transaction */ - fun financialTransactionToken(financialTransactionToken: JsonField) = apply { - this.financialTransactionToken = financialTransactionToken - } - /** Globally unique identifier for a financial transaction event */ fun financialTransactionEventToken(financialTransactionEventToken: String) = financialTransactionEventToken(JsonField.of(financialTransactionEventToken)) @@ -236,46 +257,25 @@ private constructor( this.financialTransactionEventToken = financialTransactionEventToken } - fun category(category: TransactionCategory) = category(JsonField.of(category)) - - fun category(category: JsonField) = apply { this.category = category } - - fun eventType(eventType: FinancialEventType) = eventType(JsonField.of(eventType)) + /** Globally unique identifier for a financial transaction */ + fun financialTransactionToken(financialTransactionToken: String) = + financialTransactionToken(JsonField.of(financialTransactionToken)) - fun eventType(eventType: JsonField) = apply { - this.eventType = eventType + /** Globally unique identifier for a financial transaction */ + fun financialTransactionToken(financialTransactionToken: JsonField) = apply { + this.financialTransactionToken = financialTransactionToken } - /** Date that the transaction effected the account balance */ - fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) + /** Globally unique identifier for a card */ + fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) - /** Date that the transaction effected the account balance */ - fun effectiveDate(effectiveDate: JsonField) = apply { - this.effectiveDate = effectiveDate - } + /** Globally unique identifier for a card */ + fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } fun descriptor(descriptor: String) = descriptor(JsonField.of(descriptor)) fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } - /** Transaction amount in cents */ - fun amount(amount: Long) = amount(JsonField.of(amount)) - - /** Transaction amount in cents */ - fun amount(amount: JsonField) = apply { this.amount = amount } - - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(currency: String) = currency(JsonField.of(currency)) - - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(currency: JsonField) = apply { this.currency = currency } - - /** Timestamp of when the line item was generated */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - /** Timestamp of when the line item was generated */ - fun created(created: JsonField) = apply { this.created = created } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -298,17 +298,17 @@ private constructor( fun build(): LineItemListResponse = LineItemListResponse( token, - financialAccountToken, - cardToken, - financialTransactionToken, - financialTransactionEventToken, + amount, category, - eventType, + created, + currency, effectiveDate, + eventType, + financialAccountToken, + financialTransactionEventToken, + financialTransactionToken, + cardToken, descriptor, - amount, - currency, - created, additionalProperties.toImmutable(), ) } @@ -846,15 +846,15 @@ private constructor( return true } - return /* spotless:off */ other is LineItemListResponse && token == other.token && financialAccountToken == other.financialAccountToken && cardToken == other.cardToken && financialTransactionToken == other.financialTransactionToken && financialTransactionEventToken == other.financialTransactionEventToken && category == other.category && eventType == other.eventType && effectiveDate == other.effectiveDate && descriptor == other.descriptor && amount == other.amount && currency == other.currency && created == other.created && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LineItemListResponse && token == other.token && amount == other.amount && category == other.category && created == other.created && currency == other.currency && effectiveDate == other.effectiveDate && eventType == other.eventType && financialAccountToken == other.financialAccountToken && financialTransactionEventToken == other.financialTransactionEventToken && financialTransactionToken == other.financialTransactionToken && cardToken == other.cardToken && descriptor == other.descriptor && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, financialAccountToken, cardToken, financialTransactionToken, financialTransactionEventToken, category, eventType, effectiveDate, descriptor, amount, currency, created, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, category, created, currency, effectiveDate, eventType, financialAccountToken, financialTransactionEventToken, financialTransactionToken, cardToken, descriptor, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "LineItemListResponse{token=$token, financialAccountToken=$financialAccountToken, cardToken=$cardToken, financialTransactionToken=$financialTransactionToken, financialTransactionEventToken=$financialTransactionEventToken, category=$category, eventType=$eventType, effectiveDate=$effectiveDate, descriptor=$descriptor, amount=$amount, currency=$currency, created=$created, additionalProperties=$additionalProperties}" + "LineItemListResponse{token=$token, amount=$amount, category=$category, created=$created, currency=$currency, effectiveDate=$effectiveDate, eventType=$eventType, financialAccountToken=$financialAccountToken, financialTransactionEventToken=$financialTransactionEventToken, financialTransactionToken=$financialTransactionToken, cardToken=$cardToken, descriptor=$descriptor, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt index f32d2248..5c3cc23d 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt @@ -24,110 +24,98 @@ class LoanTape @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") + @JsonProperty("account_standing") @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("date") @ExcludeMissing private val date: JsonField = JsonMissing.of(), - @JsonProperty("created") + private val accountStanding: JsonField = JsonMissing.of(), + @JsonProperty("available_credit") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), - @JsonProperty("updated") + private val availableCredit: JsonField = JsonMissing.of(), + @JsonProperty("balances") @ExcludeMissing - private val updated: JsonField = JsonMissing.of(), - @JsonProperty("version") + private val balances: JsonField = JsonMissing.of(), + @JsonProperty("created") @ExcludeMissing - private val version: JsonField = JsonMissing.of(), - @JsonProperty("ytd_totals") + private val created: JsonField = JsonMissing.of(), + @JsonProperty("credit_limit") @ExcludeMissing - private val ytdTotals: JsonField = JsonMissing.of(), - @JsonProperty("period_totals") + private val creditLimit: JsonField = JsonMissing.of(), + @JsonProperty("credit_product_token") @ExcludeMissing - private val periodTotals: JsonField = JsonMissing.of(), + private val creditProductToken: JsonField = JsonMissing.of(), + @JsonProperty("date") @ExcludeMissing private val date: JsonField = JsonMissing.of(), @JsonProperty("day_totals") @ExcludeMissing private val dayTotals: JsonField = JsonMissing.of(), - @JsonProperty("balances") - @ExcludeMissing - private val balances: JsonField = JsonMissing.of(), - @JsonProperty("starting_balance") - @ExcludeMissing - private val startingBalance: JsonField = JsonMissing.of(), @JsonProperty("ending_balance") @ExcludeMissing private val endingBalance: JsonField = JsonMissing.of(), - @JsonProperty("credit_limit") - @ExcludeMissing - private val creditLimit: JsonField = JsonMissing.of(), - @JsonProperty("available_credit") - @ExcludeMissing - private val availableCredit: JsonField = JsonMissing.of(), @JsonProperty("excess_credits") @ExcludeMissing private val excessCredits: JsonField = JsonMissing.of(), - @JsonProperty("account_standing") + @JsonProperty("financial_account_token") @ExcludeMissing - private val accountStanding: JsonField = JsonMissing.of(), - @JsonProperty("credit_product_token") + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("interest_details") @ExcludeMissing - private val creditProductToken: JsonField = JsonMissing.of(), - @JsonProperty("tier") @ExcludeMissing private val tier: JsonField = JsonMissing.of(), + private val interestDetails: JsonField = JsonMissing.of(), + @JsonProperty("minimum_payment_balance") + @ExcludeMissing + private val minimumPaymentBalance: JsonField = JsonMissing.of(), @JsonProperty("payment_allocation") @ExcludeMissing private val paymentAllocation: JsonField = JsonMissing.of(), - @JsonProperty("minimum_payment_balance") + @JsonProperty("period_totals") @ExcludeMissing - private val minimumPaymentBalance: JsonField = JsonMissing.of(), + private val periodTotals: JsonField = JsonMissing.of(), @JsonProperty("previous_statement_balance") @ExcludeMissing private val previousStatementBalance: JsonField = JsonMissing.of(), - @JsonProperty("interest_details") + @JsonProperty("starting_balance") @ExcludeMissing - private val interestDetails: JsonField = JsonMissing.of(), + private val startingBalance: JsonField = JsonMissing.of(), + @JsonProperty("updated") + @ExcludeMissing + private val updated: JsonField = JsonMissing.of(), + @JsonProperty("version") + @ExcludeMissing + private val version: JsonField = JsonMissing.of(), + @JsonProperty("ytd_totals") + @ExcludeMissing + private val ytdTotals: JsonField = JsonMissing.of(), + @JsonProperty("tier") @ExcludeMissing private val tier: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Globally unique identifier for a loan tape */ fun token(): String = token.getRequired("token") - /** Globally unique identifier for a financial account */ - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") + fun accountStanding(): AccountStanding = accountStanding.getRequired("account_standing") - /** Date of transactions that this loan tape covers */ - fun date(): LocalDate = date.getRequired("date") + /** Amount of credit available to spend in cents */ + fun availableCredit(): Long = availableCredit.getRequired("available_credit") + + fun balances(): Balances = balances.getRequired("balances") /** Timestamp of when the loan tape was created */ fun created(): OffsetDateTime = created.getRequired("created") - /** Timestamp of when the loan tape was updated */ - fun updated(): OffsetDateTime = updated.getRequired("updated") - - /** Version number of the loan tape. This starts at 1 */ - fun version(): Long = version.getRequired("version") + /** + * For prepay accounts, this is the minimum prepay balance that must be maintained. For charge + * card accounts, this is the maximum credit balance extended by a lender + */ + fun creditLimit(): Long = creditLimit.getRequired("credit_limit") - fun ytdTotals(): StatementTotals = ytdTotals.getRequired("ytd_totals") + /** Globally unique identifier for a credit product */ + fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") - fun periodTotals(): StatementTotals = periodTotals.getRequired("period_totals") + /** Date of transactions that this loan tape covers */ + fun date(): LocalDate = date.getRequired("date") fun dayTotals(): StatementTotals = dayTotals.getRequired("day_totals") - fun balances(): Balances = balances.getRequired("balances") - - /** Balance at the start of the day */ - fun startingBalance(): Long = startingBalance.getRequired("starting_balance") - /** Balance at the end of the day */ fun endingBalance(): Long = endingBalance.getRequired("ending_balance") - /** - * For prepay accounts, this is the minimum prepay balance that must be maintained. For charge - * card accounts, this is the maximum credit balance extended by a lender - */ - fun creditLimit(): Long = creditLimit.getRequired("credit_limit") - - /** Amount of credit available to spend in cents */ - fun availableCredit(): Long = availableCredit.getRequired("available_credit") - /** * Excess credits in the form of provisional credits, payments, or purchase refunds. If * positive, the account is in net credit state with no outstanding balances. An overpayment @@ -135,57 +123,48 @@ private constructor( */ fun excessCredits(): Long = excessCredits.getRequired("excess_credits") - fun accountStanding(): AccountStanding = accountStanding.getRequired("account_standing") + /** Globally unique identifier for a financial account */ + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") - /** Globally unique identifier for a credit product */ - fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") + fun interestDetails(): InterestDetails? = interestDetails.getNullable("interest_details") - /** Interest tier to which this account belongs to */ - fun tier(): String? = tier.getNullable("tier") + fun minimumPaymentBalance(): BalanceDetails = + minimumPaymentBalance.getRequired("minimum_payment_balance") fun paymentAllocation(): CategoryBalances = paymentAllocation.getRequired("payment_allocation") - fun minimumPaymentBalance(): BalanceDetails = - minimumPaymentBalance.getRequired("minimum_payment_balance") + fun periodTotals(): StatementTotals = periodTotals.getRequired("period_totals") fun previousStatementBalance(): BalanceDetails = previousStatementBalance.getRequired("previous_statement_balance") - fun interestDetails(): InterestDetails? = interestDetails.getNullable("interest_details") - - /** Globally unique identifier for a loan tape */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - - /** Globally unique identifier for a financial account */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Date of transactions that this loan tape covers */ - @JsonProperty("date") @ExcludeMissing fun _date() = date - - /** Timestamp of when the loan tape was created */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Balance at the start of the day */ + fun startingBalance(): Long = startingBalance.getRequired("starting_balance") /** Timestamp of when the loan tape was updated */ - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + fun updated(): OffsetDateTime = updated.getRequired("updated") /** Version number of the loan tape. This starts at 1 */ - @JsonProperty("version") @ExcludeMissing fun _version() = version + fun version(): Long = version.getRequired("version") - @JsonProperty("ytd_totals") @ExcludeMissing fun _ytdTotals() = ytdTotals + fun ytdTotals(): StatementTotals = ytdTotals.getRequired("ytd_totals") - @JsonProperty("period_totals") @ExcludeMissing fun _periodTotals() = periodTotals + /** Interest tier to which this account belongs to */ + fun tier(): String? = tier.getNullable("tier") - @JsonProperty("day_totals") @ExcludeMissing fun _dayTotals() = dayTotals + /** Globally unique identifier for a loan tape */ + @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("balances") @ExcludeMissing fun _balances() = balances + @JsonProperty("account_standing") @ExcludeMissing fun _accountStanding() = accountStanding - /** Balance at the start of the day */ - @JsonProperty("starting_balance") @ExcludeMissing fun _startingBalance() = startingBalance + /** Amount of credit available to spend in cents */ + @JsonProperty("available_credit") @ExcludeMissing fun _availableCredit() = availableCredit - /** Balance at the end of the day */ - @JsonProperty("ending_balance") @ExcludeMissing fun _endingBalance() = endingBalance + @JsonProperty("balances") @ExcludeMissing fun _balances() = balances + + /** Timestamp of when the loan tape was created */ + @JsonProperty("created") @ExcludeMissing fun _created() = created /** * For prepay accounts, this is the minimum prepay balance that must be maintained. For charge @@ -193,8 +172,18 @@ private constructor( */ @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit - /** Amount of credit available to spend in cents */ - @JsonProperty("available_credit") @ExcludeMissing fun _availableCredit() = availableCredit + /** Globally unique identifier for a credit product */ + @JsonProperty("credit_product_token") + @ExcludeMissing + fun _creditProductToken() = creditProductToken + + /** Date of transactions that this loan tape covers */ + @JsonProperty("date") @ExcludeMissing fun _date() = date + + @JsonProperty("day_totals") @ExcludeMissing fun _dayTotals() = dayTotals + + /** Balance at the end of the day */ + @JsonProperty("ending_balance") @ExcludeMissing fun _endingBalance() = endingBalance /** * Excess credits in the form of provisional credits, payments, or purchase refunds. If @@ -203,27 +192,38 @@ private constructor( */ @JsonProperty("excess_credits") @ExcludeMissing fun _excessCredits() = excessCredits - @JsonProperty("account_standing") @ExcludeMissing fun _accountStanding() = accountStanding - - /** Globally unique identifier for a credit product */ - @JsonProperty("credit_product_token") + /** Globally unique identifier for a financial account */ + @JsonProperty("financial_account_token") @ExcludeMissing - fun _creditProductToken() = creditProductToken - - /** Interest tier to which this account belongs to */ - @JsonProperty("tier") @ExcludeMissing fun _tier() = tier + fun _financialAccountToken() = financialAccountToken - @JsonProperty("payment_allocation") @ExcludeMissing fun _paymentAllocation() = paymentAllocation + @JsonProperty("interest_details") @ExcludeMissing fun _interestDetails() = interestDetails @JsonProperty("minimum_payment_balance") @ExcludeMissing fun _minimumPaymentBalance() = minimumPaymentBalance + @JsonProperty("payment_allocation") @ExcludeMissing fun _paymentAllocation() = paymentAllocation + + @JsonProperty("period_totals") @ExcludeMissing fun _periodTotals() = periodTotals + @JsonProperty("previous_statement_balance") @ExcludeMissing fun _previousStatementBalance() = previousStatementBalance - @JsonProperty("interest_details") @ExcludeMissing fun _interestDetails() = interestDetails + /** Balance at the start of the day */ + @JsonProperty("starting_balance") @ExcludeMissing fun _startingBalance() = startingBalance + + /** Timestamp of when the loan tape was updated */ + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + + /** Version number of the loan tape. This starts at 1 */ + @JsonProperty("version") @ExcludeMissing fun _version() = version + + @JsonProperty("ytd_totals") @ExcludeMissing fun _ytdTotals() = ytdTotals + + /** Interest tier to which this account belongs to */ + @JsonProperty("tier") @ExcludeMissing fun _tier() = tier @JsonAnyGetter @ExcludeMissing @@ -234,27 +234,27 @@ private constructor( fun validate(): LoanTape = apply { if (!validated) { token() - financialAccountToken() - date() + accountStanding().validate() + availableCredit() + balances().validate() created() - updated() - version() - ytdTotals().validate() - periodTotals().validate() + creditLimit() + creditProductToken() + date() dayTotals().validate() - balances().validate() - startingBalance() endingBalance() - creditLimit() - availableCredit() excessCredits() - accountStanding().validate() - creditProductToken() - tier() - paymentAllocation().validate() + financialAccountToken() + interestDetails()?.validate() minimumPaymentBalance().validate() + paymentAllocation().validate() + periodTotals().validate() previousStatementBalance().validate() - interestDetails()?.validate() + startingBalance() + updated() + version() + ytdTotals().validate() + tier() validated = true } } @@ -269,52 +269,52 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var date: JsonField = JsonMissing.of() + private var accountStanding: JsonField = JsonMissing.of() + private var availableCredit: JsonField = JsonMissing.of() + private var balances: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var updated: JsonField = JsonMissing.of() - private var version: JsonField = JsonMissing.of() - private var ytdTotals: JsonField = JsonMissing.of() - private var periodTotals: JsonField = JsonMissing.of() + private var creditLimit: JsonField = JsonMissing.of() + private var creditProductToken: JsonField = JsonMissing.of() + private var date: JsonField = JsonMissing.of() private var dayTotals: JsonField = JsonMissing.of() - private var balances: JsonField = JsonMissing.of() - private var startingBalance: JsonField = JsonMissing.of() private var endingBalance: JsonField = JsonMissing.of() - private var creditLimit: JsonField = JsonMissing.of() - private var availableCredit: JsonField = JsonMissing.of() private var excessCredits: JsonField = JsonMissing.of() - private var accountStanding: JsonField = JsonMissing.of() - private var creditProductToken: JsonField = JsonMissing.of() - private var tier: JsonField = JsonMissing.of() - private var paymentAllocation: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var interestDetails: JsonField = JsonMissing.of() private var minimumPaymentBalance: JsonField = JsonMissing.of() + private var paymentAllocation: JsonField = JsonMissing.of() + private var periodTotals: JsonField = JsonMissing.of() private var previousStatementBalance: JsonField = JsonMissing.of() - private var interestDetails: JsonField = JsonMissing.of() + private var startingBalance: JsonField = JsonMissing.of() + private var updated: JsonField = JsonMissing.of() + private var version: JsonField = JsonMissing.of() + private var ytdTotals: JsonField = JsonMissing.of() + private var tier: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(loanTape: LoanTape) = apply { token = loanTape.token - financialAccountToken = loanTape.financialAccountToken - date = loanTape.date + accountStanding = loanTape.accountStanding + availableCredit = loanTape.availableCredit + balances = loanTape.balances created = loanTape.created - updated = loanTape.updated - version = loanTape.version - ytdTotals = loanTape.ytdTotals - periodTotals = loanTape.periodTotals + creditLimit = loanTape.creditLimit + creditProductToken = loanTape.creditProductToken + date = loanTape.date dayTotals = loanTape.dayTotals - balances = loanTape.balances - startingBalance = loanTape.startingBalance endingBalance = loanTape.endingBalance - creditLimit = loanTape.creditLimit - availableCredit = loanTape.availableCredit excessCredits = loanTape.excessCredits - accountStanding = loanTape.accountStanding - creditProductToken = loanTape.creditProductToken - tier = loanTape.tier - paymentAllocation = loanTape.paymentAllocation + financialAccountToken = loanTape.financialAccountToken + interestDetails = loanTape.interestDetails minimumPaymentBalance = loanTape.minimumPaymentBalance + paymentAllocation = loanTape.paymentAllocation + periodTotals = loanTape.periodTotals previousStatementBalance = loanTape.previousStatementBalance - interestDetails = loanTape.interestDetails + startingBalance = loanTape.startingBalance + updated = loanTape.updated + version = loanTape.version + ytdTotals = loanTape.ytdTotals + tier = loanTape.tier additionalProperties = loanTape.additionalProperties.toMutableMap() } @@ -324,20 +324,24 @@ private constructor( /** Globally unique identifier for a loan tape */ fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) + fun accountStanding(accountStanding: AccountStanding) = + accountStanding(JsonField.of(accountStanding)) + + fun accountStanding(accountStanding: JsonField) = apply { + this.accountStanding = accountStanding + } + + /** Amount of credit available to spend in cents */ + fun availableCredit(availableCredit: Long) = availableCredit(JsonField.of(availableCredit)) - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken + /** Amount of credit available to spend in cents */ + fun availableCredit(availableCredit: JsonField) = apply { + this.availableCredit = availableCredit } - /** Date of transactions that this loan tape covers */ - fun date(date: LocalDate) = date(JsonField.of(date)) + fun balances(balances: Balances) = balances(JsonField.of(balances)) - /** Date of transactions that this loan tape covers */ - fun date(date: JsonField) = apply { this.date = date } + fun balances(balances: JsonField) = apply { this.balances = balances } /** Timestamp of when the loan tape was created */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) @@ -345,44 +349,37 @@ private constructor( /** Timestamp of when the loan tape was created */ fun created(created: JsonField) = apply { this.created = created } - /** Timestamp of when the loan tape was updated */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - - /** Timestamp of when the loan tape was updated */ - fun updated(updated: JsonField) = apply { this.updated = updated } - - /** Version number of the loan tape. This starts at 1 */ - fun version(version: Long) = version(JsonField.of(version)) + /** + * For prepay accounts, this is the minimum prepay balance that must be maintained. For + * charge card accounts, this is the maximum credit balance extended by a lender + */ + fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - /** Version number of the loan tape. This starts at 1 */ - fun version(version: JsonField) = apply { this.version = version } + /** + * For prepay accounts, this is the minimum prepay balance that must be maintained. For + * charge card accounts, this is the maximum credit balance extended by a lender + */ + fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } - fun ytdTotals(ytdTotals: StatementTotals) = ytdTotals(JsonField.of(ytdTotals)) + /** Globally unique identifier for a credit product */ + fun creditProductToken(creditProductToken: String) = + creditProductToken(JsonField.of(creditProductToken)) - fun ytdTotals(ytdTotals: JsonField) = apply { this.ytdTotals = ytdTotals } + /** Globally unique identifier for a credit product */ + fun creditProductToken(creditProductToken: JsonField) = apply { + this.creditProductToken = creditProductToken + } - fun periodTotals(periodTotals: StatementTotals) = periodTotals(JsonField.of(periodTotals)) + /** Date of transactions that this loan tape covers */ + fun date(date: LocalDate) = date(JsonField.of(date)) - fun periodTotals(periodTotals: JsonField) = apply { - this.periodTotals = periodTotals - } + /** Date of transactions that this loan tape covers */ + fun date(date: JsonField) = apply { this.date = date } fun dayTotals(dayTotals: StatementTotals) = dayTotals(JsonField.of(dayTotals)) fun dayTotals(dayTotals: JsonField) = apply { this.dayTotals = dayTotals } - fun balances(balances: Balances) = balances(JsonField.of(balances)) - - fun balances(balances: JsonField) = apply { this.balances = balances } - - /** Balance at the start of the day */ - fun startingBalance(startingBalance: Long) = startingBalance(JsonField.of(startingBalance)) - - /** Balance at the start of the day */ - fun startingBalance(startingBalance: JsonField) = apply { - this.startingBalance = startingBalance - } - /** Balance at the end of the day */ fun endingBalance(endingBalance: Long) = endingBalance(JsonField.of(endingBalance)) @@ -391,26 +388,6 @@ private constructor( this.endingBalance = endingBalance } - /** - * For prepay accounts, this is the minimum prepay balance that must be maintained. For - * charge card accounts, this is the maximum credit balance extended by a lender - */ - fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - - /** - * For prepay accounts, this is the minimum prepay balance that must be maintained. For - * charge card accounts, this is the maximum credit balance extended by a lender - */ - fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } - - /** Amount of credit available to spend in cents */ - fun availableCredit(availableCredit: Long) = availableCredit(JsonField.of(availableCredit)) - - /** Amount of credit available to spend in cents */ - fun availableCredit(availableCredit: JsonField) = apply { - this.availableCredit = availableCredit - } - /** * Excess credits in the form of provisional credits, payments, or purchase refunds. If * positive, the account is in net credit state with no outstanding balances. An overpayment @@ -427,27 +404,28 @@ private constructor( this.excessCredits = excessCredits } - fun accountStanding(accountStanding: AccountStanding) = - accountStanding(JsonField.of(accountStanding)) + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) - fun accountStanding(accountStanding: JsonField) = apply { - this.accountStanding = accountStanding + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken } - /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: String) = - creditProductToken(JsonField.of(creditProductToken)) + fun interestDetails(interestDetails: InterestDetails) = + interestDetails(JsonField.of(interestDetails)) - /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: JsonField) = apply { - this.creditProductToken = creditProductToken + fun interestDetails(interestDetails: JsonField) = apply { + this.interestDetails = interestDetails } - /** Interest tier to which this account belongs to */ - fun tier(tier: String) = tier(JsonField.of(tier)) + fun minimumPaymentBalance(minimumPaymentBalance: BalanceDetails) = + minimumPaymentBalance(JsonField.of(minimumPaymentBalance)) - /** Interest tier to which this account belongs to */ - fun tier(tier: JsonField) = apply { this.tier = tier } + fun minimumPaymentBalance(minimumPaymentBalance: JsonField) = apply { + this.minimumPaymentBalance = minimumPaymentBalance + } fun paymentAllocation(paymentAllocation: CategoryBalances) = paymentAllocation(JsonField.of(paymentAllocation)) @@ -456,11 +434,10 @@ private constructor( this.paymentAllocation = paymentAllocation } - fun minimumPaymentBalance(minimumPaymentBalance: BalanceDetails) = - minimumPaymentBalance(JsonField.of(minimumPaymentBalance)) + fun periodTotals(periodTotals: StatementTotals) = periodTotals(JsonField.of(periodTotals)) - fun minimumPaymentBalance(minimumPaymentBalance: JsonField) = apply { - this.minimumPaymentBalance = minimumPaymentBalance + fun periodTotals(periodTotals: JsonField) = apply { + this.periodTotals = periodTotals } fun previousStatementBalance(previousStatementBalance: BalanceDetails) = @@ -470,13 +447,36 @@ private constructor( this.previousStatementBalance = previousStatementBalance } - fun interestDetails(interestDetails: InterestDetails) = - interestDetails(JsonField.of(interestDetails)) + /** Balance at the start of the day */ + fun startingBalance(startingBalance: Long) = startingBalance(JsonField.of(startingBalance)) - fun interestDetails(interestDetails: JsonField) = apply { - this.interestDetails = interestDetails + /** Balance at the start of the day */ + fun startingBalance(startingBalance: JsonField) = apply { + this.startingBalance = startingBalance } + /** Timestamp of when the loan tape was updated */ + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + + /** Timestamp of when the loan tape was updated */ + fun updated(updated: JsonField) = apply { this.updated = updated } + + /** Version number of the loan tape. This starts at 1 */ + fun version(version: Long) = version(JsonField.of(version)) + + /** Version number of the loan tape. This starts at 1 */ + fun version(version: JsonField) = apply { this.version = version } + + fun ytdTotals(ytdTotals: StatementTotals) = ytdTotals(JsonField.of(ytdTotals)) + + fun ytdTotals(ytdTotals: JsonField) = apply { this.ytdTotals = ytdTotals } + + /** Interest tier to which this account belongs to */ + fun tier(tier: String) = tier(JsonField.of(tier)) + + /** Interest tier to which this account belongs to */ + fun tier(tier: JsonField) = apply { this.tier = tier } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -499,27 +499,27 @@ private constructor( fun build(): LoanTape = LoanTape( token, - financialAccountToken, - date, + accountStanding, + availableCredit, + balances, created, - updated, - version, - ytdTotals, - periodTotals, + creditLimit, + creditProductToken, + date, dayTotals, - balances, - startingBalance, endingBalance, - creditLimit, - availableCredit, excessCredits, - accountStanding, - creditProductToken, - tier, - paymentAllocation, + financialAccountToken, + interestDetails, minimumPaymentBalance, + paymentAllocation, + periodTotals, previousStatementBalance, - interestDetails, + startingBalance, + updated, + version, + ytdTotals, + tier, additionalProperties.toImmutable(), ) } @@ -528,35 +528,34 @@ private constructor( class AccountStanding @JsonCreator private constructor( - @JsonProperty("period_state") - @ExcludeMissing - private val periodState: JsonField = JsonMissing.of(), - @JsonProperty("period_number") + @JsonProperty("consecutive_full_payments_made") @ExcludeMissing - private val periodNumber: JsonField = JsonMissing.of(), + private val consecutiveFullPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("consecutive_minimum_payments_made") @ExcludeMissing private val consecutiveMinimumPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("consecutive_minimum_payments_missed") @ExcludeMissing private val consecutiveMinimumPaymentsMissed: JsonField = JsonMissing.of(), - @JsonProperty("consecutive_full_payments_made") - @ExcludeMissing - private val consecutiveFullPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("days_past_due") @ExcludeMissing private val daysPastDue: JsonField = JsonMissing.of(), @JsonProperty("has_grace") @ExcludeMissing private val hasGrace: JsonField = JsonMissing.of(), + @JsonProperty("period_number") + @ExcludeMissing + private val periodNumber: JsonField = JsonMissing.of(), + @JsonProperty("period_state") + @ExcludeMissing + private val periodState: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun periodState(): PeriodState = periodState.getRequired("period_state") - - /** Current overall period number */ - fun periodNumber(): Long = periodNumber.getRequired("period_number") + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(): Long = + consecutiveFullPaymentsMade.getRequired("consecutive_full_payments_made") /** Number of consecutive minimum payments made */ fun consecutiveMinimumPaymentsMade(): Long = @@ -566,20 +565,21 @@ private constructor( fun consecutiveMinimumPaymentsMissed(): Long = consecutiveMinimumPaymentsMissed.getRequired("consecutive_minimum_payments_missed") - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(): Long = - consecutiveFullPaymentsMade.getRequired("consecutive_full_payments_made") - /** Number of days past due */ fun daysPastDue(): Long = daysPastDue.getRequired("days_past_due") /** Whether the account currently has grace or not */ fun hasGrace(): Boolean = hasGrace.getRequired("has_grace") - @JsonProperty("period_state") @ExcludeMissing fun _periodState() = periodState - /** Current overall period number */ - @JsonProperty("period_number") @ExcludeMissing fun _periodNumber() = periodNumber + fun periodNumber(): Long = periodNumber.getRequired("period_number") + + fun periodState(): PeriodState = periodState.getRequired("period_state") + + /** Number of consecutive full payments made */ + @JsonProperty("consecutive_full_payments_made") + @ExcludeMissing + fun _consecutiveFullPaymentsMade() = consecutiveFullPaymentsMade /** Number of consecutive minimum payments made */ @JsonProperty("consecutive_minimum_payments_made") @@ -591,17 +591,17 @@ private constructor( @ExcludeMissing fun _consecutiveMinimumPaymentsMissed() = consecutiveMinimumPaymentsMissed - /** Number of consecutive full payments made */ - @JsonProperty("consecutive_full_payments_made") - @ExcludeMissing - fun _consecutiveFullPaymentsMade() = consecutiveFullPaymentsMade - /** Number of days past due */ @JsonProperty("days_past_due") @ExcludeMissing fun _daysPastDue() = daysPastDue /** Whether the account currently has grace or not */ @JsonProperty("has_grace") @ExcludeMissing fun _hasGrace() = hasGrace + /** Current overall period number */ + @JsonProperty("period_number") @ExcludeMissing fun _periodNumber() = periodNumber + + @JsonProperty("period_state") @ExcludeMissing fun _periodState() = periodState + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -610,13 +610,13 @@ private constructor( fun validate(): AccountStanding = apply { if (!validated) { - periodState() - periodNumber() + consecutiveFullPaymentsMade() consecutiveMinimumPaymentsMade() consecutiveMinimumPaymentsMissed() - consecutiveFullPaymentsMade() daysPastDue() hasGrace() + periodNumber() + periodState() validated = true } } @@ -630,38 +630,33 @@ private constructor( class Builder { - private var periodState: JsonField = JsonMissing.of() - private var periodNumber: JsonField = JsonMissing.of() + private var consecutiveFullPaymentsMade: JsonField = JsonMissing.of() private var consecutiveMinimumPaymentsMade: JsonField = JsonMissing.of() private var consecutiveMinimumPaymentsMissed: JsonField = JsonMissing.of() - private var consecutiveFullPaymentsMade: JsonField = JsonMissing.of() private var daysPastDue: JsonField = JsonMissing.of() private var hasGrace: JsonField = JsonMissing.of() + private var periodNumber: JsonField = JsonMissing.of() + private var periodState: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountStanding: AccountStanding) = apply { - periodState = accountStanding.periodState - periodNumber = accountStanding.periodNumber + consecutiveFullPaymentsMade = accountStanding.consecutiveFullPaymentsMade consecutiveMinimumPaymentsMade = accountStanding.consecutiveMinimumPaymentsMade consecutiveMinimumPaymentsMissed = accountStanding.consecutiveMinimumPaymentsMissed - consecutiveFullPaymentsMade = accountStanding.consecutiveFullPaymentsMade daysPastDue = accountStanding.daysPastDue - hasGrace = accountStanding.hasGrace - additionalProperties = accountStanding.additionalProperties.toMutableMap() - } - - fun periodState(periodState: PeriodState) = periodState(JsonField.of(periodState)) - - fun periodState(periodState: JsonField) = apply { - this.periodState = periodState + hasGrace = accountStanding.hasGrace + periodNumber = accountStanding.periodNumber + periodState = accountStanding.periodState + additionalProperties = accountStanding.additionalProperties.toMutableMap() } - /** Current overall period number */ - fun periodNumber(periodNumber: Long) = periodNumber(JsonField.of(periodNumber)) + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: Long) = + consecutiveFullPaymentsMade(JsonField.of(consecutiveFullPaymentsMade)) - /** Current overall period number */ - fun periodNumber(periodNumber: JsonField) = apply { - this.periodNumber = periodNumber + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: JsonField) = apply { + this.consecutiveFullPaymentsMade = consecutiveFullPaymentsMade } /** Number of consecutive minimum payments made */ @@ -683,15 +678,6 @@ private constructor( consecutiveMinimumPaymentsMissed: JsonField ) = apply { this.consecutiveMinimumPaymentsMissed = consecutiveMinimumPaymentsMissed } - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: Long) = - consecutiveFullPaymentsMade(JsonField.of(consecutiveFullPaymentsMade)) - - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: JsonField) = apply { - this.consecutiveFullPaymentsMade = consecutiveFullPaymentsMade - } - /** Number of days past due */ fun daysPastDue(daysPastDue: Long) = daysPastDue(JsonField.of(daysPastDue)) @@ -704,6 +690,20 @@ private constructor( /** Whether the account currently has grace or not */ fun hasGrace(hasGrace: JsonField) = apply { this.hasGrace = hasGrace } + /** Current overall period number */ + fun periodNumber(periodNumber: Long) = periodNumber(JsonField.of(periodNumber)) + + /** Current overall period number */ + fun periodNumber(periodNumber: JsonField) = apply { + this.periodNumber = periodNumber + } + + fun periodState(periodState: PeriodState) = periodState(JsonField.of(periodState)) + + fun periodState(periodState: JsonField) = apply { + this.periodState = periodState + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -725,13 +725,13 @@ private constructor( fun build(): AccountStanding = AccountStanding( - periodState, - periodNumber, + consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, - consecutiveFullPaymentsMade, daysPastDue, hasGrace, + periodNumber, + periodState, additionalProperties.toImmutable(), ) } @@ -804,52 +804,45 @@ private constructor( return true } - return /* spotless:off */ other is AccountStanding && periodState == other.periodState && periodNumber == other.periodNumber && consecutiveMinimumPaymentsMade == other.consecutiveMinimumPaymentsMade && consecutiveMinimumPaymentsMissed == other.consecutiveMinimumPaymentsMissed && consecutiveFullPaymentsMade == other.consecutiveFullPaymentsMade && daysPastDue == other.daysPastDue && hasGrace == other.hasGrace && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountStanding && consecutiveFullPaymentsMade == other.consecutiveFullPaymentsMade && consecutiveMinimumPaymentsMade == other.consecutiveMinimumPaymentsMade && consecutiveMinimumPaymentsMissed == other.consecutiveMinimumPaymentsMissed && daysPastDue == other.daysPastDue && hasGrace == other.hasGrace && periodNumber == other.periodNumber && periodState == other.periodState && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(periodState, periodNumber, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, consecutiveFullPaymentsMade, daysPastDue, hasGrace, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, daysPastDue, hasGrace, periodNumber, periodState, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountStanding{periodState=$periodState, periodNumber=$periodNumber, consecutiveMinimumPaymentsMade=$consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed=$consecutiveMinimumPaymentsMissed, consecutiveFullPaymentsMade=$consecutiveFullPaymentsMade, daysPastDue=$daysPastDue, hasGrace=$hasGrace, additionalProperties=$additionalProperties}" + "AccountStanding{consecutiveFullPaymentsMade=$consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade=$consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed=$consecutiveMinimumPaymentsMissed, daysPastDue=$daysPastDue, hasGrace=$hasGrace, periodNumber=$periodNumber, periodState=$periodState, additionalProperties=$additionalProperties}" } @NoAutoDetect class Balances @JsonCreator private constructor( - @JsonProperty("past_due") - @ExcludeMissing - private val pastDue: JsonField = JsonMissing.of(), @JsonProperty("due") @ExcludeMissing private val due: JsonField = JsonMissing.of(), - @JsonProperty("past_statements_due") - @ExcludeMissing - private val pastStatementsDue: JsonField = JsonMissing.of(), @JsonProperty("next_statement_due") @ExcludeMissing private val nextStatementDue: JsonField = JsonMissing.of(), + @JsonProperty("past_due") + @ExcludeMissing + private val pastDue: JsonField = JsonMissing.of(), + @JsonProperty("past_statements_due") + @ExcludeMissing + private val pastStatementsDue: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Amount not paid off on previous due dates */ - fun pastDue(): CategoryBalances = pastDue.getRequired("past_due") - /** * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date * will be considered past due the next day */ fun due(): CategoryBalances = due.getRequired("due") - /** Amount due for the past billing cycles. */ - fun pastStatementsDue(): CategoryBalances = - pastStatementsDue.getRequired("past_statements_due") - /** * Amount due for the current billing cycle. Any amounts not paid off by early payments or * credits will be considered due at the end of the current billing period @@ -858,7 +851,11 @@ private constructor( nextStatementDue.getRequired("next_statement_due") /** Amount not paid off on previous due dates */ - @JsonProperty("past_due") @ExcludeMissing fun _pastDue() = pastDue + fun pastDue(): CategoryBalances = pastDue.getRequired("past_due") + + /** Amount due for the past billing cycles. */ + fun pastStatementsDue(): CategoryBalances = + pastStatementsDue.getRequired("past_statements_due") /** * Amount due for the prior billing cycle. Any amounts not fully paid off on this due date @@ -866,11 +863,6 @@ private constructor( */ @JsonProperty("due") @ExcludeMissing fun _due() = due - /** Amount due for the past billing cycles. */ - @JsonProperty("past_statements_due") - @ExcludeMissing - fun _pastStatementsDue() = pastStatementsDue - /** * Amount due for the current billing cycle. Any amounts not paid off by early payments or * credits will be considered due at the end of the current billing period @@ -879,6 +871,14 @@ private constructor( @ExcludeMissing fun _nextStatementDue() = nextStatementDue + /** Amount not paid off on previous due dates */ + @JsonProperty("past_due") @ExcludeMissing fun _pastDue() = pastDue + + /** Amount due for the past billing cycles. */ + @JsonProperty("past_statements_due") + @ExcludeMissing + fun _pastStatementsDue() = pastStatementsDue + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -887,10 +887,10 @@ private constructor( fun validate(): Balances = apply { if (!validated) { - pastDue().validate() due().validate() - pastStatementsDue().validate() nextStatementDue().validate() + pastDue().validate() + pastStatementsDue().validate() validated = true } } @@ -904,26 +904,20 @@ private constructor( class Builder { - private var pastDue: JsonField = JsonMissing.of() private var due: JsonField = JsonMissing.of() - private var pastStatementsDue: JsonField = JsonMissing.of() private var nextStatementDue: JsonField = JsonMissing.of() + private var pastDue: JsonField = JsonMissing.of() + private var pastStatementsDue: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(balances: Balances) = apply { - pastDue = balances.pastDue due = balances.due - pastStatementsDue = balances.pastStatementsDue nextStatementDue = balances.nextStatementDue + pastDue = balances.pastDue + pastStatementsDue = balances.pastStatementsDue additionalProperties = balances.additionalProperties.toMutableMap() } - /** Amount not paid off on previous due dates */ - fun pastDue(pastDue: CategoryBalances) = pastDue(JsonField.of(pastDue)) - - /** Amount not paid off on previous due dates */ - fun pastDue(pastDue: JsonField) = apply { this.pastDue = pastDue } - /** * Amount due for the prior billing cycle. Any amounts not fully paid off on this due * date will be considered past due the next day @@ -936,15 +930,6 @@ private constructor( */ fun due(due: JsonField) = apply { this.due = due } - /** Amount due for the past billing cycles. */ - fun pastStatementsDue(pastStatementsDue: CategoryBalances) = - pastStatementsDue(JsonField.of(pastStatementsDue)) - - /** Amount due for the past billing cycles. */ - fun pastStatementsDue(pastStatementsDue: JsonField) = apply { - this.pastStatementsDue = pastStatementsDue - } - /** * Amount due for the current billing cycle. Any amounts not paid off by early payments * or credits will be considered due at the end of the current billing period @@ -960,6 +945,21 @@ private constructor( this.nextStatementDue = nextStatementDue } + /** Amount not paid off on previous due dates */ + fun pastDue(pastDue: CategoryBalances) = pastDue(JsonField.of(pastDue)) + + /** Amount not paid off on previous due dates */ + fun pastDue(pastDue: JsonField) = apply { this.pastDue = pastDue } + + /** Amount due for the past billing cycles. */ + fun pastStatementsDue(pastStatementsDue: CategoryBalances) = + pastStatementsDue(JsonField.of(pastStatementsDue)) + + /** Amount due for the past billing cycles. */ + fun pastStatementsDue(pastStatementsDue: JsonField) = apply { + this.pastStatementsDue = pastStatementsDue + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -981,10 +981,10 @@ private constructor( fun build(): Balances = Balances( - pastDue, due, - pastStatementsDue, nextStatementDue, + pastDue, + pastStatementsDue, additionalProperties.toImmutable(), ) } @@ -997,31 +997,31 @@ private constructor( class CategoryBalances @JsonCreator private constructor( + @JsonProperty("fees") + @ExcludeMissing + private val fees: JsonField = JsonMissing.of(), @JsonProperty("interest") @ExcludeMissing private val interest: JsonField = JsonMissing.of(), @JsonProperty("principal") @ExcludeMissing private val principal: JsonField = JsonMissing.of(), - @JsonProperty("fees") - @ExcludeMissing - private val fees: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun fees(): Long = fees.getRequired("fees") + fun interest(): Long = interest.getRequired("interest") fun principal(): Long = principal.getRequired("principal") - fun fees(): Long = fees.getRequired("fees") + @JsonProperty("fees") @ExcludeMissing fun _fees() = fees @JsonProperty("interest") @ExcludeMissing fun _interest() = interest @JsonProperty("principal") @ExcludeMissing fun _principal() = principal - @JsonProperty("fees") @ExcludeMissing fun _fees() = fees - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1030,9 +1030,9 @@ private constructor( fun validate(): CategoryBalances = apply { if (!validated) { + fees() interest() principal() - fees() validated = true } } @@ -1046,18 +1046,22 @@ private constructor( class Builder { + private var fees: JsonField = JsonMissing.of() private var interest: JsonField = JsonMissing.of() private var principal: JsonField = JsonMissing.of() - private var fees: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(categoryBalances: CategoryBalances) = apply { + fees = categoryBalances.fees interest = categoryBalances.interest principal = categoryBalances.principal - fees = categoryBalances.fees additionalProperties = categoryBalances.additionalProperties.toMutableMap() } + fun fees(fees: Long) = fees(JsonField.of(fees)) + + fun fees(fees: JsonField) = apply { this.fees = fees } + fun interest(interest: Long) = interest(JsonField.of(interest)) fun interest(interest: JsonField) = apply { this.interest = interest } @@ -1066,10 +1070,6 @@ private constructor( fun principal(principal: JsonField) = apply { this.principal = principal } - fun fees(fees: Long) = fees(JsonField.of(fees)) - - fun fees(fees: JsonField) = apply { this.fees = fees } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1094,9 +1094,9 @@ private constructor( fun build(): CategoryBalances = CategoryBalances( + fees, interest, principal, - fees, additionalProperties.toImmutable(), ) } @@ -1106,17 +1106,17 @@ private constructor( return true } - return /* spotless:off */ other is CategoryBalances && interest == other.interest && principal == other.principal && fees == other.fees && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryBalances && fees == other.fees && interest == other.interest && principal == other.principal && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(interest, principal, fees, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(fees, interest, principal, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CategoryBalances{interest=$interest, principal=$principal, fees=$fees, additionalProperties=$additionalProperties}" + "CategoryBalances{fees=$fees, interest=$interest, principal=$principal, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1124,93 +1124,93 @@ private constructor( return true } - return /* spotless:off */ other is Balances && pastDue == other.pastDue && due == other.due && pastStatementsDue == other.pastStatementsDue && nextStatementDue == other.nextStatementDue && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Balances && due == other.due && nextStatementDue == other.nextStatementDue && pastDue == other.pastDue && pastStatementsDue == other.pastStatementsDue && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(pastDue, due, pastStatementsDue, nextStatementDue, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(due, nextStatementDue, pastDue, pastStatementsDue, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Balances{pastDue=$pastDue, due=$due, pastStatementsDue=$pastStatementsDue, nextStatementDue=$nextStatementDue, additionalProperties=$additionalProperties}" + "Balances{due=$due, nextStatementDue=$nextStatementDue, pastDue=$pastDue, pastStatementsDue=$pastStatementsDue, additionalProperties=$additionalProperties}" } @NoAutoDetect class StatementTotals @JsonCreator private constructor( - @JsonProperty("payments") + @JsonProperty("balance_transfers") @ExcludeMissing - private val payments: JsonField = JsonMissing.of(), - @JsonProperty("purchases") + private val balanceTransfers: JsonField = JsonMissing.of(), + @JsonProperty("cash_advances") @ExcludeMissing - private val purchases: JsonField = JsonMissing.of(), - @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), + private val cashAdvances: JsonField = JsonMissing.of(), @JsonProperty("credits") @ExcludeMissing private val credits: JsonField = JsonMissing.of(), + @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), @JsonProperty("interest") @ExcludeMissing private val interest: JsonField = JsonMissing.of(), - @JsonProperty("cash_advances") + @JsonProperty("payments") @ExcludeMissing - private val cashAdvances: JsonField = JsonMissing.of(), - @JsonProperty("balance_transfers") + private val payments: JsonField = JsonMissing.of(), + @JsonProperty("purchases") @ExcludeMissing - private val balanceTransfers: JsonField = JsonMissing.of(), + private val purchases: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Any funds transfers which affective the balance in cents */ - fun payments(): Long = payments.getRequired("payments") - - /** Net card transaction volume less any cash advances in cents */ - fun purchases(): Long = purchases.getRequired("purchases") + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(): Long = balanceTransfers.getRequired("balance_transfers") - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(): Long = fees.getRequired("fees") + /** ATM and cashback transactions in cents */ + fun cashAdvances(): Long = cashAdvances.getRequired("cash_advances") /** * Volume of credit management operation transactions less any balance transfers in cents */ fun credits(): Long = credits.getRequired("credits") + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(): Long = fees.getRequired("fees") + /** Interest accrued in cents */ fun interest(): Long = interest.getRequired("interest") - /** ATM and cashback transactions in cents */ - fun cashAdvances(): Long = cashAdvances.getRequired("cash_advances") - - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(): Long = balanceTransfers.getRequired("balance_transfers") - /** Any funds transfers which affective the balance in cents */ - @JsonProperty("payments") @ExcludeMissing fun _payments() = payments + fun payments(): Long = payments.getRequired("payments") /** Net card transaction volume less any cash advances in cents */ - @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + fun purchases(): Long = purchases.getRequired("purchases") - /** Volume of debit management operation transactions less any interest in cents */ - @JsonProperty("fees") @ExcludeMissing fun _fees() = fees + /** Opening balance transferred from previous account in cents */ + @JsonProperty("balance_transfers") + @ExcludeMissing + fun _balanceTransfers() = balanceTransfers + + /** ATM and cashback transactions in cents */ + @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances /** * Volume of credit management operation transactions less any balance transfers in cents */ @JsonProperty("credits") @ExcludeMissing fun _credits() = credits + /** Volume of debit management operation transactions less any interest in cents */ + @JsonProperty("fees") @ExcludeMissing fun _fees() = fees + /** Interest accrued in cents */ @JsonProperty("interest") @ExcludeMissing fun _interest() = interest - /** ATM and cashback transactions in cents */ - @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + /** Any funds transfers which affective the balance in cents */ + @JsonProperty("payments") @ExcludeMissing fun _payments() = payments - /** Opening balance transferred from previous account in cents */ - @JsonProperty("balance_transfers") - @ExcludeMissing - fun _balanceTransfers() = balanceTransfers + /** Net card transaction volume less any cash advances in cents */ + @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases @JsonAnyGetter @ExcludeMissing @@ -1220,13 +1220,13 @@ private constructor( fun validate(): StatementTotals = apply { if (!validated) { - payments() - purchases() - fees() + balanceTransfers() + cashAdvances() credits() + fees() interest() - cashAdvances() - balanceTransfers() + payments() + purchases() validated = true } } @@ -1240,43 +1240,42 @@ private constructor( class Builder { - private var payments: JsonField = JsonMissing.of() - private var purchases: JsonField = JsonMissing.of() - private var fees: JsonField = JsonMissing.of() + private var balanceTransfers: JsonField = JsonMissing.of() + private var cashAdvances: JsonField = JsonMissing.of() private var credits: JsonField = JsonMissing.of() + private var fees: JsonField = JsonMissing.of() private var interest: JsonField = JsonMissing.of() - private var cashAdvances: JsonField = JsonMissing.of() - private var balanceTransfers: JsonField = JsonMissing.of() + private var payments: JsonField = JsonMissing.of() + private var purchases: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(statementTotals: StatementTotals) = apply { - payments = statementTotals.payments - purchases = statementTotals.purchases - fees = statementTotals.fees + balanceTransfers = statementTotals.balanceTransfers + cashAdvances = statementTotals.cashAdvances credits = statementTotals.credits + fees = statementTotals.fees interest = statementTotals.interest - cashAdvances = statementTotals.cashAdvances - balanceTransfers = statementTotals.balanceTransfers + payments = statementTotals.payments + purchases = statementTotals.purchases additionalProperties = statementTotals.additionalProperties.toMutableMap() } - /** Any funds transfers which affective the balance in cents */ - fun payments(payments: Long) = payments(JsonField.of(payments)) - - /** Any funds transfers which affective the balance in cents */ - fun payments(payments: JsonField) = apply { this.payments = payments } - - /** Net card transaction volume less any cash advances in cents */ - fun purchases(purchases: Long) = purchases(JsonField.of(purchases)) + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(balanceTransfers: Long) = + balanceTransfers(JsonField.of(balanceTransfers)) - /** Net card transaction volume less any cash advances in cents */ - fun purchases(purchases: JsonField) = apply { this.purchases = purchases } + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(balanceTransfers: JsonField) = apply { + this.balanceTransfers = balanceTransfers + } - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(fees: Long) = fees(JsonField.of(fees)) + /** ATM and cashback transactions in cents */ + fun cashAdvances(cashAdvances: Long) = cashAdvances(JsonField.of(cashAdvances)) - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(fees: JsonField) = apply { this.fees = fees } + /** ATM and cashback transactions in cents */ + fun cashAdvances(cashAdvances: JsonField) = apply { + this.cashAdvances = cashAdvances + } /** * Volume of credit management operation transactions less any balance transfers in @@ -1290,28 +1289,29 @@ private constructor( */ fun credits(credits: JsonField) = apply { this.credits = credits } + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(fees: Long) = fees(JsonField.of(fees)) + + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(fees: JsonField) = apply { this.fees = fees } + /** Interest accrued in cents */ fun interest(interest: Long) = interest(JsonField.of(interest)) /** Interest accrued in cents */ fun interest(interest: JsonField) = apply { this.interest = interest } - /** ATM and cashback transactions in cents */ - fun cashAdvances(cashAdvances: Long) = cashAdvances(JsonField.of(cashAdvances)) + /** Any funds transfers which affective the balance in cents */ + fun payments(payments: Long) = payments(JsonField.of(payments)) - /** ATM and cashback transactions in cents */ - fun cashAdvances(cashAdvances: JsonField) = apply { - this.cashAdvances = cashAdvances - } + /** Any funds transfers which affective the balance in cents */ + fun payments(payments: JsonField) = apply { this.payments = payments } - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(balanceTransfers: Long) = - balanceTransfers(JsonField.of(balanceTransfers)) + /** Net card transaction volume less any cash advances in cents */ + fun purchases(purchases: Long) = purchases(JsonField.of(purchases)) - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(balanceTransfers: JsonField) = apply { - this.balanceTransfers = balanceTransfers - } + /** Net card transaction volume less any cash advances in cents */ + fun purchases(purchases: JsonField) = apply { this.purchases = purchases } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1334,13 +1334,13 @@ private constructor( fun build(): StatementTotals = StatementTotals( - payments, - purchases, - fees, + balanceTransfers, + cashAdvances, credits, + fees, interest, - cashAdvances, - balanceTransfers, + payments, + purchases, additionalProperties.toImmutable(), ) } @@ -1350,92 +1350,92 @@ private constructor( return true } - return /* spotless:off */ other is StatementTotals && payments == other.payments && purchases == other.purchases && fees == other.fees && credits == other.credits && interest == other.interest && cashAdvances == other.cashAdvances && balanceTransfers == other.balanceTransfers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is StatementTotals && balanceTransfers == other.balanceTransfers && cashAdvances == other.cashAdvances && credits == other.credits && fees == other.fees && interest == other.interest && payments == other.payments && purchases == other.purchases && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(payments, purchases, fees, credits, interest, cashAdvances, balanceTransfers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(balanceTransfers, cashAdvances, credits, fees, interest, payments, purchases, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "StatementTotals{payments=$payments, purchases=$purchases, fees=$fees, credits=$credits, interest=$interest, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}" + "StatementTotals{balanceTransfers=$balanceTransfers, cashAdvances=$cashAdvances, credits=$credits, fees=$fees, interest=$interest, payments=$payments, purchases=$purchases, additionalProperties=$additionalProperties}" } @NoAutoDetect class InterestDetails @JsonCreator private constructor( - @JsonProperty("prime_rate") + @JsonProperty("actual_interest_charged") @ExcludeMissing - private val primeRate: JsonField = JsonMissing.of(), - @JsonProperty("interest_calculation_method") + private val actualInterestCharged: JsonField = JsonMissing.of(), + @JsonProperty("daily_balance_amounts") @ExcludeMissing - private val interestCalculationMethod: JsonField = - JsonMissing.of(), + private val dailyBalanceAmounts: JsonField = JsonMissing.of(), @JsonProperty("effective_apr") @ExcludeMissing private val effectiveApr: JsonField = JsonMissing.of(), + @JsonProperty("interest_calculation_method") + @ExcludeMissing + private val interestCalculationMethod: JsonField = + JsonMissing.of(), @JsonProperty("interest_for_period") @ExcludeMissing private val interestForPeriod: JsonField = JsonMissing.of(), - @JsonProperty("daily_balance_amounts") + @JsonProperty("prime_rate") @ExcludeMissing - private val dailyBalanceAmounts: JsonField = JsonMissing.of(), + private val primeRate: JsonField = JsonMissing.of(), @JsonProperty("minimum_interest_charged") @ExcludeMissing private val minimumInterestCharged: JsonField = JsonMissing.of(), - @JsonProperty("actual_interest_charged") - @ExcludeMissing - private val actualInterestCharged: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun primeRate(): String? = primeRate.getNullable("prime_rate") + fun actualInterestCharged(): Long? = + actualInterestCharged.getNullable("actual_interest_charged") - fun interestCalculationMethod(): InterestCalculationMethod = - interestCalculationMethod.getRequired("interest_calculation_method") + fun dailyBalanceAmounts(): CategoryDetails = + dailyBalanceAmounts.getRequired("daily_balance_amounts") fun effectiveApr(): CategoryDetails = effectiveApr.getRequired("effective_apr") + fun interestCalculationMethod(): InterestCalculationMethod = + interestCalculationMethod.getRequired("interest_calculation_method") + fun interestForPeriod(): CategoryDetails = interestForPeriod.getRequired("interest_for_period") - fun dailyBalanceAmounts(): CategoryDetails = - dailyBalanceAmounts.getRequired("daily_balance_amounts") + fun primeRate(): String? = primeRate.getNullable("prime_rate") fun minimumInterestCharged(): Long? = minimumInterestCharged.getNullable("minimum_interest_charged") - fun actualInterestCharged(): Long? = - actualInterestCharged.getNullable("actual_interest_charged") + @JsonProperty("actual_interest_charged") + @ExcludeMissing + fun _actualInterestCharged() = actualInterestCharged - @JsonProperty("prime_rate") @ExcludeMissing fun _primeRate() = primeRate + @JsonProperty("daily_balance_amounts") + @ExcludeMissing + fun _dailyBalanceAmounts() = dailyBalanceAmounts + + @JsonProperty("effective_apr") @ExcludeMissing fun _effectiveApr() = effectiveApr @JsonProperty("interest_calculation_method") @ExcludeMissing fun _interestCalculationMethod() = interestCalculationMethod - @JsonProperty("effective_apr") @ExcludeMissing fun _effectiveApr() = effectiveApr - @JsonProperty("interest_for_period") @ExcludeMissing fun _interestForPeriod() = interestForPeriod - @JsonProperty("daily_balance_amounts") - @ExcludeMissing - fun _dailyBalanceAmounts() = dailyBalanceAmounts + @JsonProperty("prime_rate") @ExcludeMissing fun _primeRate() = primeRate @JsonProperty("minimum_interest_charged") @ExcludeMissing fun _minimumInterestCharged() = minimumInterestCharged - @JsonProperty("actual_interest_charged") - @ExcludeMissing - fun _actualInterestCharged() = actualInterestCharged - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1444,13 +1444,13 @@ private constructor( fun validate(): InterestDetails = apply { if (!validated) { - primeRate() - interestCalculationMethod() + actualInterestCharged() + dailyBalanceAmounts().validate() effectiveApr().validate() + interestCalculationMethod() interestForPeriod().validate() - dailyBalanceAmounts().validate() + primeRate() minimumInterestCharged() - actualInterestCharged() validated = true } } @@ -1464,37 +1464,40 @@ private constructor( class Builder { - private var primeRate: JsonField = JsonMissing.of() + private var actualInterestCharged: JsonField = JsonMissing.of() + private var dailyBalanceAmounts: JsonField = JsonMissing.of() + private var effectiveApr: JsonField = JsonMissing.of() private var interestCalculationMethod: JsonField = JsonMissing.of() - private var effectiveApr: JsonField = JsonMissing.of() private var interestForPeriod: JsonField = JsonMissing.of() - private var dailyBalanceAmounts: JsonField = JsonMissing.of() + private var primeRate: JsonField = JsonMissing.of() private var minimumInterestCharged: JsonField = JsonMissing.of() - private var actualInterestCharged: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(interestDetails: InterestDetails) = apply { - primeRate = interestDetails.primeRate - interestCalculationMethod = interestDetails.interestCalculationMethod + actualInterestCharged = interestDetails.actualInterestCharged + dailyBalanceAmounts = interestDetails.dailyBalanceAmounts effectiveApr = interestDetails.effectiveApr + interestCalculationMethod = interestDetails.interestCalculationMethod interestForPeriod = interestDetails.interestForPeriod - dailyBalanceAmounts = interestDetails.dailyBalanceAmounts + primeRate = interestDetails.primeRate minimumInterestCharged = interestDetails.minimumInterestCharged - actualInterestCharged = interestDetails.actualInterestCharged additionalProperties = interestDetails.additionalProperties.toMutableMap() } - fun primeRate(primeRate: String) = primeRate(JsonField.of(primeRate)) + fun actualInterestCharged(actualInterestCharged: Long) = + actualInterestCharged(JsonField.of(actualInterestCharged)) - fun primeRate(primeRate: JsonField) = apply { this.primeRate = primeRate } + fun actualInterestCharged(actualInterestCharged: JsonField) = apply { + this.actualInterestCharged = actualInterestCharged + } - fun interestCalculationMethod(interestCalculationMethod: InterestCalculationMethod) = - interestCalculationMethod(JsonField.of(interestCalculationMethod)) + fun dailyBalanceAmounts(dailyBalanceAmounts: CategoryDetails) = + dailyBalanceAmounts(JsonField.of(dailyBalanceAmounts)) - fun interestCalculationMethod( - interestCalculationMethod: JsonField - ) = apply { this.interestCalculationMethod = interestCalculationMethod } + fun dailyBalanceAmounts(dailyBalanceAmounts: JsonField) = apply { + this.dailyBalanceAmounts = dailyBalanceAmounts + } fun effectiveApr(effectiveApr: CategoryDetails) = effectiveApr(JsonField.of(effectiveApr)) @@ -1503,6 +1506,13 @@ private constructor( this.effectiveApr = effectiveApr } + fun interestCalculationMethod(interestCalculationMethod: InterestCalculationMethod) = + interestCalculationMethod(JsonField.of(interestCalculationMethod)) + + fun interestCalculationMethod( + interestCalculationMethod: JsonField + ) = apply { this.interestCalculationMethod = interestCalculationMethod } + fun interestForPeriod(interestForPeriod: CategoryDetails) = interestForPeriod(JsonField.of(interestForPeriod)) @@ -1510,12 +1520,9 @@ private constructor( this.interestForPeriod = interestForPeriod } - fun dailyBalanceAmounts(dailyBalanceAmounts: CategoryDetails) = - dailyBalanceAmounts(JsonField.of(dailyBalanceAmounts)) + fun primeRate(primeRate: String) = primeRate(JsonField.of(primeRate)) - fun dailyBalanceAmounts(dailyBalanceAmounts: JsonField) = apply { - this.dailyBalanceAmounts = dailyBalanceAmounts - } + fun primeRate(primeRate: JsonField) = apply { this.primeRate = primeRate } fun minimumInterestCharged(minimumInterestCharged: Long) = minimumInterestCharged(JsonField.of(minimumInterestCharged)) @@ -1524,13 +1531,6 @@ private constructor( this.minimumInterestCharged = minimumInterestCharged } - fun actualInterestCharged(actualInterestCharged: Long) = - actualInterestCharged(JsonField.of(actualInterestCharged)) - - fun actualInterestCharged(actualInterestCharged: JsonField) = apply { - this.actualInterestCharged = actualInterestCharged - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1552,13 +1552,13 @@ private constructor( fun build(): InterestDetails = InterestDetails( - primeRate, - interestCalculationMethod, + actualInterestCharged, + dailyBalanceAmounts, effectiveApr, + interestCalculationMethod, interestForPeriod, - dailyBalanceAmounts, + primeRate, minimumInterestCharged, - actualInterestCharged, additionalProperties.toImmutable(), ) } @@ -1567,33 +1567,33 @@ private constructor( class CategoryDetails @JsonCreator private constructor( - @JsonProperty("purchases") + @JsonProperty("balance_transfers") @ExcludeMissing - private val purchases: JsonField = JsonMissing.of(), + private val balanceTransfers: JsonField = JsonMissing.of(), @JsonProperty("cash_advances") @ExcludeMissing private val cashAdvances: JsonField = JsonMissing.of(), - @JsonProperty("balance_transfers") + @JsonProperty("purchases") @ExcludeMissing - private val balanceTransfers: JsonField = JsonMissing.of(), + private val purchases: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun purchases(): String = purchases.getRequired("purchases") - - fun cashAdvances(): String = cashAdvances.getRequired("cash_advances") - fun balanceTransfers(): String = balanceTransfers.getRequired("balance_transfers") - @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + fun cashAdvances(): String = cashAdvances.getRequired("cash_advances") - @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + fun purchases(): String = purchases.getRequired("purchases") @JsonProperty("balance_transfers") @ExcludeMissing fun _balanceTransfers() = balanceTransfers + @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + + @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1602,9 +1602,9 @@ private constructor( fun validate(): CategoryDetails = apply { if (!validated) { - purchases() - cashAdvances() balanceTransfers() + cashAdvances() + purchases() validated = true } } @@ -1618,21 +1618,24 @@ private constructor( class Builder { - private var purchases: JsonField = JsonMissing.of() - private var cashAdvances: JsonField = JsonMissing.of() private var balanceTransfers: JsonField = JsonMissing.of() + private var cashAdvances: JsonField = JsonMissing.of() + private var purchases: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(categoryDetails: CategoryDetails) = apply { - purchases = categoryDetails.purchases - cashAdvances = categoryDetails.cashAdvances balanceTransfers = categoryDetails.balanceTransfers + cashAdvances = categoryDetails.cashAdvances + purchases = categoryDetails.purchases additionalProperties = categoryDetails.additionalProperties.toMutableMap() } - fun purchases(purchases: String) = purchases(JsonField.of(purchases)) + fun balanceTransfers(balanceTransfers: String) = + balanceTransfers(JsonField.of(balanceTransfers)) - fun purchases(purchases: JsonField) = apply { this.purchases = purchases } + fun balanceTransfers(balanceTransfers: JsonField) = apply { + this.balanceTransfers = balanceTransfers + } fun cashAdvances(cashAdvances: String) = cashAdvances(JsonField.of(cashAdvances)) @@ -1640,12 +1643,9 @@ private constructor( this.cashAdvances = cashAdvances } - fun balanceTransfers(balanceTransfers: String) = - balanceTransfers(JsonField.of(balanceTransfers)) + fun purchases(purchases: String) = purchases(JsonField.of(purchases)) - fun balanceTransfers(balanceTransfers: JsonField) = apply { - this.balanceTransfers = balanceTransfers - } + fun purchases(purchases: JsonField) = apply { this.purchases = purchases } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1671,9 +1671,9 @@ private constructor( fun build(): CategoryDetails = CategoryDetails( - purchases, - cashAdvances, balanceTransfers, + cashAdvances, + purchases, additionalProperties.toImmutable(), ) } @@ -1683,17 +1683,17 @@ private constructor( return true } - return /* spotless:off */ other is CategoryDetails && purchases == other.purchases && cashAdvances == other.cashAdvances && balanceTransfers == other.balanceTransfers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryDetails && balanceTransfers == other.balanceTransfers && cashAdvances == other.cashAdvances && purchases == other.purchases && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(purchases, cashAdvances, balanceTransfers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(balanceTransfers, cashAdvances, purchases, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CategoryDetails{purchases=$purchases, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}" + "CategoryDetails{balanceTransfers=$balanceTransfers, cashAdvances=$cashAdvances, purchases=$purchases, additionalProperties=$additionalProperties}" } class InterestCalculationMethod @@ -1761,17 +1761,17 @@ private constructor( return true } - return /* spotless:off */ other is InterestDetails && primeRate == other.primeRate && interestCalculationMethod == other.interestCalculationMethod && effectiveApr == other.effectiveApr && interestForPeriod == other.interestForPeriod && dailyBalanceAmounts == other.dailyBalanceAmounts && minimumInterestCharged == other.minimumInterestCharged && actualInterestCharged == other.actualInterestCharged && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InterestDetails && actualInterestCharged == other.actualInterestCharged && dailyBalanceAmounts == other.dailyBalanceAmounts && effectiveApr == other.effectiveApr && interestCalculationMethod == other.interestCalculationMethod && interestForPeriod == other.interestForPeriod && primeRate == other.primeRate && minimumInterestCharged == other.minimumInterestCharged && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(primeRate, interestCalculationMethod, effectiveApr, interestForPeriod, dailyBalanceAmounts, minimumInterestCharged, actualInterestCharged, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(actualInterestCharged, dailyBalanceAmounts, effectiveApr, interestCalculationMethod, interestForPeriod, primeRate, minimumInterestCharged, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "InterestDetails{primeRate=$primeRate, interestCalculationMethod=$interestCalculationMethod, effectiveApr=$effectiveApr, interestForPeriod=$interestForPeriod, dailyBalanceAmounts=$dailyBalanceAmounts, minimumInterestCharged=$minimumInterestCharged, actualInterestCharged=$actualInterestCharged, additionalProperties=$additionalProperties}" + "InterestDetails{actualInterestCharged=$actualInterestCharged, dailyBalanceAmounts=$dailyBalanceAmounts, effectiveApr=$effectiveApr, interestCalculationMethod=$interestCalculationMethod, interestForPeriod=$interestForPeriod, primeRate=$primeRate, minimumInterestCharged=$minimumInterestCharged, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -1886,29 +1886,29 @@ private constructor( class CategoryBalances @JsonCreator private constructor( + @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), @JsonProperty("interest") @ExcludeMissing private val interest: JsonField = JsonMissing.of(), @JsonProperty("principal") @ExcludeMissing private val principal: JsonField = JsonMissing.of(), - @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + fun fees(): Long = fees.getRequired("fees") + fun interest(): Long = interest.getRequired("interest") fun principal(): Long = principal.getRequired("principal") - fun fees(): Long = fees.getRequired("fees") + @JsonProperty("fees") @ExcludeMissing fun _fees() = fees @JsonProperty("interest") @ExcludeMissing fun _interest() = interest @JsonProperty("principal") @ExcludeMissing fun _principal() = principal - @JsonProperty("fees") @ExcludeMissing fun _fees() = fees - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1917,9 +1917,9 @@ private constructor( fun validate(): CategoryBalances = apply { if (!validated) { + fees() interest() principal() - fees() validated = true } } @@ -1933,18 +1933,22 @@ private constructor( class Builder { + private var fees: JsonField = JsonMissing.of() private var interest: JsonField = JsonMissing.of() private var principal: JsonField = JsonMissing.of() - private var fees: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(categoryBalances: CategoryBalances) = apply { + fees = categoryBalances.fees interest = categoryBalances.interest principal = categoryBalances.principal - fees = categoryBalances.fees additionalProperties = categoryBalances.additionalProperties.toMutableMap() } + fun fees(fees: Long) = fees(JsonField.of(fees)) + + fun fees(fees: JsonField) = apply { this.fees = fees } + fun interest(interest: Long) = interest(JsonField.of(interest)) fun interest(interest: JsonField) = apply { this.interest = interest } @@ -1953,10 +1957,6 @@ private constructor( fun principal(principal: JsonField) = apply { this.principal = principal } - fun fees(fees: Long) = fees(JsonField.of(fees)) - - fun fees(fees: JsonField) = apply { this.fees = fees } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1978,9 +1978,9 @@ private constructor( fun build(): CategoryBalances = CategoryBalances( + fees, interest, principal, - fees, additionalProperties.toImmutable(), ) } @@ -1990,17 +1990,17 @@ private constructor( return true } - return /* spotless:off */ other is CategoryBalances && interest == other.interest && principal == other.principal && fees == other.fees && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryBalances && fees == other.fees && interest == other.interest && principal == other.principal && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(interest, principal, fees, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(fees, interest, principal, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CategoryBalances{interest=$interest, principal=$principal, fees=$fees, additionalProperties=$additionalProperties}" + "CategoryBalances{fees=$fees, interest=$interest, principal=$principal, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -2008,15 +2008,15 @@ private constructor( return true } - return /* spotless:off */ other is LoanTape && token == other.token && financialAccountToken == other.financialAccountToken && date == other.date && created == other.created && updated == other.updated && version == other.version && ytdTotals == other.ytdTotals && periodTotals == other.periodTotals && dayTotals == other.dayTotals && balances == other.balances && startingBalance == other.startingBalance && endingBalance == other.endingBalance && creditLimit == other.creditLimit && availableCredit == other.availableCredit && excessCredits == other.excessCredits && accountStanding == other.accountStanding && creditProductToken == other.creditProductToken && tier == other.tier && paymentAllocation == other.paymentAllocation && minimumPaymentBalance == other.minimumPaymentBalance && previousStatementBalance == other.previousStatementBalance && interestDetails == other.interestDetails && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is LoanTape && token == other.token && accountStanding == other.accountStanding && availableCredit == other.availableCredit && balances == other.balances && created == other.created && creditLimit == other.creditLimit && creditProductToken == other.creditProductToken && date == other.date && dayTotals == other.dayTotals && endingBalance == other.endingBalance && excessCredits == other.excessCredits && financialAccountToken == other.financialAccountToken && interestDetails == other.interestDetails && minimumPaymentBalance == other.minimumPaymentBalance && paymentAllocation == other.paymentAllocation && periodTotals == other.periodTotals && previousStatementBalance == other.previousStatementBalance && startingBalance == other.startingBalance && updated == other.updated && version == other.version && ytdTotals == other.ytdTotals && tier == other.tier && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, financialAccountToken, date, created, updated, version, ytdTotals, periodTotals, dayTotals, balances, startingBalance, endingBalance, creditLimit, availableCredit, excessCredits, accountStanding, creditProductToken, tier, paymentAllocation, minimumPaymentBalance, previousStatementBalance, interestDetails, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountStanding, availableCredit, balances, created, creditLimit, creditProductToken, date, dayTotals, endingBalance, excessCredits, financialAccountToken, interestDetails, minimumPaymentBalance, paymentAllocation, periodTotals, previousStatementBalance, startingBalance, updated, version, ytdTotals, tier, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "LoanTape{token=$token, financialAccountToken=$financialAccountToken, date=$date, created=$created, updated=$updated, version=$version, ytdTotals=$ytdTotals, periodTotals=$periodTotals, dayTotals=$dayTotals, balances=$balances, startingBalance=$startingBalance, endingBalance=$endingBalance, creditLimit=$creditLimit, availableCredit=$availableCredit, excessCredits=$excessCredits, accountStanding=$accountStanding, creditProductToken=$creditProductToken, tier=$tier, paymentAllocation=$paymentAllocation, minimumPaymentBalance=$minimumPaymentBalance, previousStatementBalance=$previousStatementBalance, interestDetails=$interestDetails, additionalProperties=$additionalProperties}" + "LoanTape{token=$token, accountStanding=$accountStanding, availableCredit=$availableCredit, balances=$balances, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, date=$date, dayTotals=$dayTotals, endingBalance=$endingBalance, excessCredits=$excessCredits, financialAccountToken=$financialAccountToken, interestDetails=$interestDetails, minimumPaymentBalance=$minimumPaymentBalance, paymentAllocation=$paymentAllocation, periodTotals=$periodTotals, previousStatementBalance=$previousStatementBalance, startingBalance=$startingBalance, updated=$updated, version=$version, ytdTotals=$ytdTotals, tier=$tier, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt index 1e593723..f753a29a 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ManagementOperationTransaction.kt @@ -24,100 +24,100 @@ class ManagementOperationTransaction @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("result") - @ExcludeMissing - private val result: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), - @JsonProperty("status") - @ExcludeMissing - private val status: JsonField = JsonMissing.of(), - @JsonProperty("settled_amount") - @ExcludeMissing - private val settledAmount: JsonField = JsonMissing.of(), - @JsonProperty("pending_amount") + @JsonProperty("created") @ExcludeMissing - private val pendingAmount: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing private val currency: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + private val direction: JsonField = JsonMissing.of(), @JsonProperty("events") @ExcludeMissing private val events: JsonField> = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("financial_account_token") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("pending_amount") + @ExcludeMissing + private val pendingAmount: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + private val result: JsonField = JsonMissing.of(), + @JsonProperty("settled_amount") + @ExcludeMissing + private val settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("status") + @ExcludeMissing + private val status: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("direction") - @ExcludeMissing - private val direction: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { fun token(): String = token.getRequired("token") - fun result(): TransactionResult = result.getRequired("result") - fun category(): ManagementOperationCategory = category.getRequired("category") - fun status(): TransactionStatus = status.getRequired("status") + fun created(): OffsetDateTime = created.getRequired("created") - fun settledAmount(): Long = settledAmount.getRequired("settled_amount") + fun currency(): String = currency.getRequired("currency") + + fun direction(): ManagementOperationDirection = direction.getRequired("direction") + + fun events(): List = events.getRequired("events") + + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount") - fun currency(): String = currency.getRequired("currency") + fun result(): TransactionResult = result.getRequired("result") - fun events(): List = events.getRequired("events") + fun settledAmount(): Long = settledAmount.getRequired("settled_amount") - fun created(): OffsetDateTime = created.getRequired("created") + fun status(): TransactionStatus = status.getRequired("status") fun updated(): OffsetDateTime = updated.getRequired("updated") fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") + @JsonProperty("token") @ExcludeMissing fun _token() = token - fun direction(): ManagementOperationDirection = direction.getRequired("direction") + @JsonProperty("category") @ExcludeMissing fun _category() = category - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("result") @ExcludeMissing fun _result() = result + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - @JsonProperty("category") @ExcludeMissing fun _category() = category + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction - @JsonProperty("status") @ExcludeMissing fun _status() = status + @JsonProperty("events") @ExcludeMissing fun _events() = events - @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken @JsonProperty("pending_amount") @ExcludeMissing fun _pendingAmount() = pendingAmount - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + @JsonProperty("result") @ExcludeMissing fun _result() = result - @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount - @JsonProperty("created") @ExcludeMissing fun _created() = created + @JsonProperty("status") @ExcludeMissing fun _status() = status @JsonProperty("updated") @ExcludeMissing fun _updated() = updated @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,18 +127,18 @@ private constructor( fun validate(): ManagementOperationTransaction = apply { if (!validated) { token() - result() category() - status() - settledAmount() - pendingAmount() + created() currency() + direction() events().forEach { it.validate() } - created() + financialAccountToken() + pendingAmount() + result() + settledAmount() + status() updated() userDefinedId() - financialAccountToken() - direction() validated = true } } @@ -153,34 +153,34 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() - private var status: JsonField = JsonMissing.of() - private var settledAmount: JsonField = JsonMissing.of() - private var pendingAmount: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() + private var direction: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var financialAccountToken: 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 updated: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var direction: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(managementOperationTransaction: ManagementOperationTransaction) = apply { token = managementOperationTransaction.token - result = managementOperationTransaction.result category = managementOperationTransaction.category - status = managementOperationTransaction.status - settledAmount = managementOperationTransaction.settledAmount - pendingAmount = managementOperationTransaction.pendingAmount + created = managementOperationTransaction.created currency = managementOperationTransaction.currency + direction = managementOperationTransaction.direction events = managementOperationTransaction.events - created = managementOperationTransaction.created + financialAccountToken = managementOperationTransaction.financialAccountToken + pendingAmount = managementOperationTransaction.pendingAmount + result = managementOperationTransaction.result + settledAmount = managementOperationTransaction.settledAmount + status = managementOperationTransaction.status updated = managementOperationTransaction.updated userDefinedId = managementOperationTransaction.userDefinedId - financialAccountToken = managementOperationTransaction.financialAccountToken - direction = managementOperationTransaction.direction additionalProperties = managementOperationTransaction.additionalProperties.toMutableMap() } @@ -189,24 +189,37 @@ private constructor( fun token(token: JsonField) = apply { this.token = token } - fun result(result: TransactionResult) = result(JsonField.of(result)) - - fun result(result: JsonField) = apply { this.result = result } - fun category(category: ManagementOperationCategory) = category(JsonField.of(category)) fun category(category: JsonField) = apply { this.category = category } - fun status(status: TransactionStatus) = status(JsonField.of(status)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - fun status(status: JsonField) = apply { this.status = status } + fun created(created: JsonField) = apply { this.created = created } - fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) + fun currency(currency: String) = currency(JsonField.of(currency)) - fun settledAmount(settledAmount: JsonField) = apply { - this.settledAmount = settledAmount + fun currency(currency: JsonField) = apply { this.currency = currency } + + fun direction(direction: ManagementOperationDirection) = direction(JsonField.of(direction)) + + fun direction(direction: JsonField) = apply { + this.direction = direction + } + + fun events(events: List) = events(JsonField.of(events)) + + fun events(events: JsonField>) = apply { + this.events = events + } + + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken } fun pendingAmount(pendingAmount: Long) = pendingAmount(JsonField.of(pendingAmount)) @@ -215,19 +228,19 @@ private constructor( this.pendingAmount = pendingAmount } - fun currency(currency: String) = currency(JsonField.of(currency)) + fun result(result: TransactionResult) = result(JsonField.of(result)) - fun currency(currency: JsonField) = apply { this.currency = currency } + fun result(result: JsonField) = apply { this.result = result } - fun events(events: List) = events(JsonField.of(events)) + fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) - fun events(events: JsonField>) = apply { - this.events = events + fun settledAmount(settledAmount: JsonField) = apply { + this.settledAmount = settledAmount } - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun status(status: TransactionStatus) = status(JsonField.of(status)) - fun created(created: JsonField) = apply { this.created = created } + fun status(status: JsonField) = apply { this.status = status } fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -239,19 +252,6 @@ private constructor( this.userDefinedId = userDefinedId } - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - fun direction(direction: ManagementOperationDirection) = direction(JsonField.of(direction)) - - fun direction(direction: JsonField) = apply { - this.direction = direction - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -274,18 +274,18 @@ private constructor( fun build(): ManagementOperationTransaction = ManagementOperationTransaction( token, - result, category, - status, - settledAmount, - pendingAmount, + created, currency, + direction, events.map { it.toImmutable() }, - created, + financialAccountToken, + pendingAmount, + result, + settledAmount, + status, updated, userDefinedId, - financialAccountToken, - direction, additionalProperties.toImmutable(), ) } @@ -422,73 +422,73 @@ private constructor( class ManagementOperationEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), - @JsonProperty("type") - @ExcludeMissing - private val type: JsonField = JsonMissing.of(), - @JsonProperty("subtype") - @ExcludeMissing - private val subtype: JsonField = JsonMissing.of(), - @JsonProperty("result") + @JsonProperty("created") @ExcludeMissing - private val result: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), @JsonProperty("detailed_results") @ExcludeMissing private val detailedResults: JsonField> = JsonMissing.of(), - @JsonProperty("created") - @ExcludeMissing - private val created: JsonField = JsonMissing.of(), - @JsonProperty("token") + @JsonProperty("effective_date") @ExcludeMissing - private val token: JsonField = JsonMissing.of(), + private val effectiveDate: JsonField = JsonMissing.of(), @JsonProperty("memo") @ExcludeMissing private val memo: JsonField = JsonMissing.of(), - @JsonProperty("effective_date") + @JsonProperty("result") @ExcludeMissing - private val effectiveDate: JsonField = JsonMissing.of(), + private val result: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("subtype") + @ExcludeMissing + private val subtype: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun amount(): Long = amount.getRequired("amount") - - fun type(): ManagementOperationEventType = type.getRequired("type") + fun token(): String = token.getRequired("token") - fun subtype(): String? = subtype.getNullable("subtype") + fun amount(): Long = amount.getRequired("amount") - fun result(): TransactionResult = result.getRequired("result") + fun created(): OffsetDateTime = created.getRequired("created") fun detailedResults(): List = detailedResults.getRequired("detailed_results") - fun created(): OffsetDateTime = created.getRequired("created") - - fun token(): String = token.getRequired("token") + fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") fun memo(): String = memo.getRequired("memo") - fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") - - @JsonProperty("amount") @ExcludeMissing fun _amount() = amount + fun result(): TransactionResult = result.getRequired("result") - @JsonProperty("type") @ExcludeMissing fun _type() = type + fun type(): ManagementOperationEventType = type.getRequired("type") - @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype + fun subtype(): String? = subtype.getNullable("subtype") - @JsonProperty("result") @ExcludeMissing fun _result() = result + @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + + @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate @JsonProperty("memo") @ExcludeMissing fun _memo() = memo - @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate + @JsonProperty("result") @ExcludeMissing fun _result() = result + + @JsonProperty("type") @ExcludeMissing fun _type() = type + + @JsonProperty("subtype") @ExcludeMissing fun _subtype() = subtype @JsonAnyGetter @ExcludeMissing @@ -498,15 +498,15 @@ private constructor( fun validate(): ManagementOperationEvent = apply { if (!validated) { + token() amount() - type() - subtype() - result() - detailedResults() created() - token() - memo() + detailedResults() effectiveDate() + memo() + result() + type() + subtype() validated = true } } @@ -520,45 +520,41 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var subtype: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() - private var detailedResults: JsonField> = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() - private var memo: JsonField = JsonMissing.of() + private var detailedResults: JsonField> = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var memo: JsonField = JsonMissing.of() + private var result: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var subtype: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(managementOperationEvent: ManagementOperationEvent) = apply { + token = managementOperationEvent.token amount = managementOperationEvent.amount - type = managementOperationEvent.type - subtype = managementOperationEvent.subtype - result = managementOperationEvent.result - detailedResults = managementOperationEvent.detailedResults created = managementOperationEvent.created - token = managementOperationEvent.token - memo = managementOperationEvent.memo + detailedResults = managementOperationEvent.detailedResults effectiveDate = managementOperationEvent.effectiveDate + memo = managementOperationEvent.memo + result = managementOperationEvent.result + type = managementOperationEvent.type + subtype = managementOperationEvent.subtype additionalProperties = managementOperationEvent.additionalProperties.toMutableMap() } - fun amount(amount: Long) = amount(JsonField.of(amount)) - - fun amount(amount: JsonField) = apply { this.amount = amount } - - fun type(type: ManagementOperationEventType) = type(JsonField.of(type)) + fun token(token: String) = token(JsonField.of(token)) - fun type(type: JsonField) = apply { this.type = type } + fun token(token: JsonField) = apply { this.token = token } - fun subtype(subtype: String) = subtype(JsonField.of(subtype)) + fun amount(amount: Long) = amount(JsonField.of(amount)) - fun subtype(subtype: JsonField) = apply { this.subtype = subtype } + fun amount(amount: JsonField) = apply { this.amount = amount } - fun result(result: TransactionResult) = result(JsonField.of(result)) + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - fun result(result: JsonField) = apply { this.result = result } + fun created(created: JsonField) = apply { this.created = created } fun detailedResults(detailedResults: List) = detailedResults(JsonField.of(detailedResults)) @@ -567,23 +563,27 @@ private constructor( this.detailedResults = detailedResults } - fun created(created: OffsetDateTime) = created(JsonField.of(created)) - - fun created(created: JsonField) = apply { this.created = created } - - fun token(token: String) = token(JsonField.of(token)) + fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) - fun token(token: JsonField) = apply { this.token = token } + fun effectiveDate(effectiveDate: JsonField) = apply { + this.effectiveDate = effectiveDate + } fun memo(memo: String) = memo(JsonField.of(memo)) fun memo(memo: JsonField) = apply { this.memo = memo } - fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) + fun result(result: TransactionResult) = result(JsonField.of(result)) - fun effectiveDate(effectiveDate: JsonField) = apply { - this.effectiveDate = effectiveDate - } + fun result(result: JsonField) = apply { this.result = result } + + fun type(type: ManagementOperationEventType) = type(JsonField.of(type)) + + fun type(type: JsonField) = apply { this.type = type } + + fun subtype(subtype: String) = subtype(JsonField.of(subtype)) + + fun subtype(subtype: JsonField) = apply { this.subtype = subtype } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -606,15 +606,15 @@ private constructor( fun build(): ManagementOperationEvent = ManagementOperationEvent( + token, amount, - type, - subtype, - result, - detailedResults.map { it.toImmutable() }, created, - token, - memo, + detailedResults.map { it.toImmutable() }, effectiveDate, + memo, + result, + type, + subtype, additionalProperties.toImmutable(), ) } @@ -864,17 +864,17 @@ private constructor( return true } - return /* spotless:off */ other is ManagementOperationEvent && amount == other.amount && type == other.type && subtype == other.subtype && result == other.result && detailedResults == other.detailedResults && created == other.created && token == other.token && memo == other.memo && effectiveDate == other.effectiveDate && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ManagementOperationEvent && token == other.token && amount == other.amount && created == other.created && detailedResults == other.detailedResults && effectiveDate == other.effectiveDate && memo == other.memo && result == other.result && type == other.type && subtype == other.subtype && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, type, subtype, result, detailedResults, created, token, memo, effectiveDate, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, detailedResults, effectiveDate, memo, result, type, subtype, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ManagementOperationEvent{amount=$amount, type=$type, subtype=$subtype, result=$result, detailedResults=$detailedResults, created=$created, token=$token, memo=$memo, effectiveDate=$effectiveDate, additionalProperties=$additionalProperties}" + "ManagementOperationEvent{token=$token, amount=$amount, created=$created, detailedResults=$detailedResults, effectiveDate=$effectiveDate, memo=$memo, result=$result, type=$type, subtype=$subtype, additionalProperties=$additionalProperties}" } class TransactionResult @@ -1014,15 +1014,15 @@ private constructor( return true } - return /* spotless:off */ other is ManagementOperationTransaction && token == other.token && result == other.result && category == other.category && status == other.status && settledAmount == other.settledAmount && pendingAmount == other.pendingAmount && currency == other.currency && events == other.events && created == other.created && updated == other.updated && userDefinedId == other.userDefinedId && financialAccountToken == other.financialAccountToken && direction == other.direction && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ManagementOperationTransaction && token == other.token && category == other.category && created == other.created && currency == other.currency && direction == other.direction && events == other.events && financialAccountToken == other.financialAccountToken && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && updated == other.updated && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, result, category, status, settledAmount, pendingAmount, currency, events, created, updated, userDefinedId, financialAccountToken, direction, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, direction, events, financialAccountToken, pendingAmount, result, settledAmount, status, updated, userDefinedId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "ManagementOperationTransaction{token=$token, result=$result, category=$category, status=$status, settledAmount=$settledAmount, pendingAmount=$pendingAmount, currency=$currency, events=$events, created=$created, updated=$updated, userDefinedId=$userDefinedId, financialAccountToken=$financialAccountToken, direction=$direction, additionalProperties=$additionalProperties}" + "ManagementOperationTransaction{token=$token, category=$category, created=$created, currency=$currency, direction=$direction, events=$events, financialAccountToken=$financialAccountToken, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, updated=$updated, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt index ae180f45..7a8c2dab 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MessageAttempt.kt @@ -23,6 +23,7 @@ import java.util.Objects class MessageAttempt @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), @@ -41,11 +42,13 @@ private constructor( @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("url") @ExcludeMissing private val url: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -69,11 +72,11 @@ private constructor( /** The status of the event attempt. */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - fun url(): String = url.getRequired("url") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -100,9 +103,6 @@ private constructor( /** The status of the event attempt. */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("url") @ExcludeMissing fun _url() = url @JsonAnyGetter @@ -113,13 +113,13 @@ private constructor( fun validate(): MessageAttempt = apply { if (!validated) { + token() created() eventSubscriptionToken() eventToken() response() responseStatusCode() status() - token() url() validated = true } @@ -134,28 +134,34 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var eventSubscriptionToken: JsonField = JsonMissing.of() private var eventToken: JsonField = JsonMissing.of() private var response: JsonField = JsonMissing.of() private var responseStatusCode: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var url: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(messageAttempt: MessageAttempt) = apply { + token = messageAttempt.token created = messageAttempt.created eventSubscriptionToken = messageAttempt.eventSubscriptionToken eventToken = messageAttempt.eventToken response = messageAttempt.response responseStatusCode = messageAttempt.responseStatusCode status = messageAttempt.status - token = messageAttempt.token url = messageAttempt.url additionalProperties = messageAttempt.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * An RFC 3339 timestamp for when the event was created. UTC time zone. * @@ -206,12 +212,6 @@ private constructor( /** The status of the event attempt. */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun url(url: String) = url(JsonField.of(url)) fun url(url: JsonField) = apply { this.url = url } @@ -237,13 +237,13 @@ private constructor( fun build(): MessageAttempt = MessageAttempt( + token, created, eventSubscriptionToken, eventToken, response, responseStatusCode, status, - token, url, additionalProperties.toImmutable(), ) @@ -323,15 +323,15 @@ private constructor( return true } - return /* spotless:off */ other is MessageAttempt && created == other.created && eventSubscriptionToken == other.eventSubscriptionToken && eventToken == other.eventToken && response == other.response && responseStatusCode == other.responseStatusCode && status == other.status && token == other.token && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MessageAttempt && token == other.token && created == other.created && eventSubscriptionToken == other.eventSubscriptionToken && eventToken == other.eventToken && response == other.response && responseStatusCode == other.responseStatusCode && status == other.status && url == other.url && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(created, eventSubscriptionToken, eventToken, response, responseStatusCode, status, token, url, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, created, eventSubscriptionToken, eventToken, response, responseStatusCode, status, url, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MessageAttempt{created=$created, eventSubscriptionToken=$eventSubscriptionToken, eventToken=$eventToken, response=$response, responseStatusCode=$responseStatusCode, status=$status, token=$token, url=$url, additionalProperties=$additionalProperties}" + "MessageAttempt{token=$token, created=$created, eventSubscriptionToken=$eventSubscriptionToken, eventToken=$eventToken, response=$response, responseStatusCode=$responseStatusCode, status=$status, url=$url, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt index 15e8ed59..8bd4a6d5 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/MicroDepositCreateResponse.kt @@ -24,26 +24,42 @@ class MicroDepositCreateResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("country") + @ExcludeMissing + private val country: JsonField = JsonMissing.of(), + @JsonProperty("created") + @ExcludeMissing + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("last_four") + @ExcludeMissing + private val lastFour: JsonField = JsonMissing.of(), @JsonProperty("owner") @ExcludeMissing private val owner: JsonField = JsonMissing.of(), + @JsonProperty("owner_type") + @ExcludeMissing + private val ownerType: JsonField = JsonMissing.of(), @JsonProperty("routing_number") @ExcludeMissing private val routingNumber: JsonField = JsonMissing.of(), - @JsonProperty("last_four") + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("verification_attempts") @ExcludeMissing - private val lastFour: JsonField = JsonMissing.of(), - @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val verificationAttempts: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("country") + private val verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_state") @ExcludeMissing - private val country: JsonField = JsonMissing.of(), + private val verificationState: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), - @JsonProperty("created") + @JsonProperty("address") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val address: JsonField = JsonMissing.of(), @JsonProperty("company_id") @ExcludeMissing private val companyId: JsonField = JsonMissing.of(), @@ -51,32 +67,16 @@ private constructor( @JsonProperty("doing_business_as") @ExcludeMissing private val doingBusinessAs: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonProperty("verification_failed_reason") @ExcludeMissing private val verificationFailedReason: JsonField = JsonMissing.of(), - @JsonProperty("verification_attempts") - @ExcludeMissing - private val verificationAttempts: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - private val verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("owner_type") - @ExcludeMissing - private val ownerType: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), - @JsonProperty("verification_state") - @ExcludeMissing - private val verificationState: JsonField = JsonMissing.of(), - @JsonProperty("address") - @ExcludeMissing - private val address: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -87,29 +87,48 @@ private constructor( */ fun token(): String = token.getRequired("token") + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(): String = country.getRequired("country") + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(): String = currency.getRequired("currency") + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + fun lastFour(): String = lastFour.getRequired("last_four") + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ fun owner(): String = owner.getRequired("owner") + /** Owner Type */ + fun ownerType(): OwnerType = ownerType.getRequired("owner_type") + /** Routing Number */ fun routingNumber(): String = routingNumber.getRequired("routing_number") - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - fun lastFour(): String = lastFour.getRequired("last_four") + /** Account State */ + fun state(): State = state.getRequired("state") - /** The nickname for this External Bank Account */ - fun name(): String? = name.getNullable("name") + /** Account Type */ + fun type(): Type = type.getRequired("type") - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(): String = currency.getRequired("currency") + /** The number of attempts at verification */ + fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(): String = country.getRequired("country") + /** Verification Method */ + fun verificationMethod(): VerificationMethod = + verificationMethod.getRequired("verification_method") + + /** Verification State */ + fun verificationState(): VerificationState = verificationState.getRequired("verification_state") /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -117,8 +136,8 @@ private constructor( */ fun accountToken(): String? = accountToken.getNullable("account_token") - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Address */ + fun address(): ExternalBankAccountAddress? = address.getNullable("address") /** Optional field that helps identify bank accounts in receipts */ fun companyId(): String? = companyId.getNullable("company_id") @@ -129,6 +148,13 @@ private constructor( /** Doing Business As */ fun doingBusinessAs(): String? = doingBusinessAs.getNullable("doing_business_as") + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(): String? = + financialAccountToken.getNullable("financial_account_token") + + /** The nickname for this External Bank Account */ + fun name(): String? = name.getNullable("name") + /** User Defined ID */ fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") @@ -140,32 +166,6 @@ private constructor( fun verificationFailedReason(): String? = verificationFailedReason.getNullable("verification_failed_reason") - /** The number of attempts at verification */ - fun verificationAttempts(): Long = verificationAttempts.getRequired("verification_attempts") - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(): String? = - financialAccountToken.getNullable("financial_account_token") - - /** Account Type */ - fun type(): Type = type.getRequired("type") - - /** Verification Method */ - fun verificationMethod(): VerificationMethod = - verificationMethod.getRequired("verification_method") - - /** Owner Type */ - fun ownerType(): OwnerType = ownerType.getRequired("owner_type") - - /** Account State */ - fun state(): State = state.getRequired("state") - - /** Verification State */ - fun verificationState(): VerificationState = verificationState.getRequired("verification_state") - - /** Address */ - fun address(): ExternalBankAccountAddress? = address.getNullable("address") - /** * A globally unique identifier for this record of an external bank account association. If a * program links an external bank account to more than one end-user or to both the program and @@ -173,29 +173,51 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + @JsonProperty("country") @ExcludeMissing fun _country() = country + + /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ + @JsonProperty("created") @ExcludeMissing fun _created() = created + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + + /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ + @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** * Legal Name of the business or individual who owns the external account. This will appear in * statements */ @JsonProperty("owner") @ExcludeMissing fun _owner() = owner + /** Owner Type */ + @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType + /** Routing Number */ @JsonProperty("routing_number") @ExcludeMissing fun _routingNumber() = routingNumber - /** The last 4 digits of the bank account. Derived by Lithic from the account number passed */ - @JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour + /** Account State */ + @JsonProperty("state") @ExcludeMissing fun _state() = state - /** The nickname for this External Bank Account */ - @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Account Type */ + @JsonProperty("type") @ExcludeMissing fun _type() = type - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency + /** The number of attempts at verification */ + @JsonProperty("verification_attempts") + @ExcludeMissing + fun _verificationAttempts() = verificationAttempts - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - @JsonProperty("country") @ExcludeMissing fun _country() = country + /** Verification Method */ + @JsonProperty("verification_method") + @ExcludeMissing + fun _verificationMethod() = verificationMethod + + /** Verification State */ + @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState /** * Indicates which Lithic account the external account is associated with. For external accounts @@ -203,8 +225,8 @@ private constructor( */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** An ISO 8601 string representing when this funding source was added to the Lithic account. */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + /** Address */ + @JsonProperty("address") @ExcludeMissing fun _address() = address /** Optional field that helps identify bank accounts in receipts */ @JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId @@ -215,6 +237,14 @@ private constructor( /** Doing Business As */ @JsonProperty("doing_business_as") @ExcludeMissing fun _doingBusinessAs() = doingBusinessAs + /** The financial account token of the operating account to fund the micro deposits */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + /** The nickname for this External Bank Account */ + @JsonProperty("name") @ExcludeMissing fun _name() = name + /** User Defined ID */ @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @@ -227,36 +257,6 @@ private constructor( @ExcludeMissing fun _verificationFailedReason() = verificationFailedReason - /** The number of attempts at verification */ - @JsonProperty("verification_attempts") - @ExcludeMissing - fun _verificationAttempts() = verificationAttempts - - /** The financial account token of the operating account to fund the micro deposits */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - /** Account Type */ - @JsonProperty("type") @ExcludeMissing fun _type() = type - - /** Verification Method */ - @JsonProperty("verification_method") - @ExcludeMissing - fun _verificationMethod() = verificationMethod - - /** Owner Type */ - @JsonProperty("owner_type") @ExcludeMissing fun _ownerType() = ownerType - - /** Account State */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Verification State */ - @JsonProperty("verification_state") @ExcludeMissing fun _verificationState() = verificationState - - /** Address */ - @JsonProperty("address") @ExcludeMissing fun _address() = address - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -266,27 +266,27 @@ private constructor( fun validate(): MicroDepositCreateResponse = apply { if (!validated) { token() + country() + created() + currency() + lastFour() owner() + ownerType() routingNumber() - lastFour() - name() - currency() - country() + state() + type() + verificationAttempts() + verificationMethod() + verificationState() accountToken() - created() + address()?.validate() companyId() dob() doingBusinessAs() + financialAccountToken() + name() userDefinedId() verificationFailedReason() - verificationAttempts() - financialAccountToken() - type() - verificationMethod() - ownerType() - state() - verificationState() - address()?.validate() validated = true } } @@ -301,52 +301,52 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() + private var country: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() + private var lastFour: JsonField = JsonMissing.of() private var owner: JsonField = JsonMissing.of() + private var ownerType: JsonField = JsonMissing.of() private var routingNumber: JsonField = JsonMissing.of() - private var lastFour: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var country: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var verificationAttempts: JsonField = JsonMissing.of() + private var verificationMethod: JsonField = JsonMissing.of() + private var verificationState: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var address: JsonField = JsonMissing.of() private var companyId: JsonField = JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var doingBusinessAs: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() private var userDefinedId: JsonField = JsonMissing.of() private var verificationFailedReason: JsonField = JsonMissing.of() - private var verificationAttempts: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var type: JsonField = JsonMissing.of() - private var verificationMethod: JsonField = JsonMissing.of() - private var ownerType: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var verificationState: JsonField = JsonMissing.of() - private var address: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(microDepositCreateResponse: MicroDepositCreateResponse) = apply { token = microDepositCreateResponse.token + country = microDepositCreateResponse.country + created = microDepositCreateResponse.created + currency = microDepositCreateResponse.currency + lastFour = microDepositCreateResponse.lastFour owner = microDepositCreateResponse.owner + ownerType = microDepositCreateResponse.ownerType routingNumber = microDepositCreateResponse.routingNumber - lastFour = microDepositCreateResponse.lastFour - name = microDepositCreateResponse.name - currency = microDepositCreateResponse.currency - country = microDepositCreateResponse.country + state = microDepositCreateResponse.state + type = microDepositCreateResponse.type + verificationAttempts = microDepositCreateResponse.verificationAttempts + verificationMethod = microDepositCreateResponse.verificationMethod + verificationState = microDepositCreateResponse.verificationState accountToken = microDepositCreateResponse.accountToken - created = microDepositCreateResponse.created + address = microDepositCreateResponse.address companyId = microDepositCreateResponse.companyId dob = microDepositCreateResponse.dob doingBusinessAs = microDepositCreateResponse.doingBusinessAs + financialAccountToken = microDepositCreateResponse.financialAccountToken + name = microDepositCreateResponse.name userDefinedId = microDepositCreateResponse.userDefinedId verificationFailedReason = microDepositCreateResponse.verificationFailedReason - verificationAttempts = microDepositCreateResponse.verificationAttempts - financialAccountToken = microDepositCreateResponse.financialAccountToken - type = microDepositCreateResponse.type - verificationMethod = microDepositCreateResponse.verificationMethod - ownerType = microDepositCreateResponse.ownerType - state = microDepositCreateResponse.state - verificationState = microDepositCreateResponse.verificationState - address = microDepositCreateResponse.address additionalProperties = microDepositCreateResponse.additionalProperties.toMutableMap() } @@ -364,6 +364,44 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * The country that the bank account is located in using ISO 3166-1. We will only accept USA + * bank accounts e.g., USA + */ + fun country(country: JsonField) = apply { this.country = country } + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) + + /** + * An ISO 8601 string representing when this funding source was added to the Lithic account. + */ + fun created(created: JsonField) = apply { this.created = created } + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** currency of the external account 3-digit alphabetic ISO 4217 code */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + + /** + * The last 4 digits of the bank account. Derived by Lithic from the account number passed + */ + fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** * Legal Name of the business or individual who owns the external account. This will appear * in statements @@ -376,6 +414,12 @@ private constructor( */ fun owner(owner: JsonField) = apply { this.owner = owner } + /** Owner Type */ + fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) + + /** Owner Type */ + fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } + /** Routing Number */ fun routingNumber(routingNumber: String) = routingNumber(JsonField.of(routingNumber)) @@ -384,39 +428,44 @@ private constructor( this.routingNumber = routingNumber } - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: String) = lastFour(JsonField.of(lastFour)) + /** Account State */ + fun state(state: State) = state(JsonField.of(state)) - /** - * The last 4 digits of the bank account. Derived by Lithic from the account number passed - */ - fun lastFour(lastFour: JsonField) = apply { this.lastFour = lastFour } + /** Account State */ + fun state(state: JsonField) = apply { this.state = state } - /** The nickname for this External Bank Account */ - fun name(name: String) = name(JsonField.of(name)) + /** Account Type */ + fun type(type: Type) = type(JsonField.of(type)) - /** The nickname for this External Bank Account */ - fun name(name: JsonField) = apply { this.name = name } + /** Account Type */ + fun type(type: JsonField) = apply { this.type = type } - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: Long) = + verificationAttempts(JsonField.of(verificationAttempts)) - /** currency of the external account 3-digit alphabetic ISO 4217 code */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** The number of attempts at verification */ + fun verificationAttempts(verificationAttempts: JsonField) = apply { + this.verificationAttempts = verificationAttempts + } - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: String) = country(JsonField.of(country)) + /** Verification Method */ + fun verificationMethod(verificationMethod: VerificationMethod) = + verificationMethod(JsonField.of(verificationMethod)) - /** - * The country that the bank account is located in using ISO 3166-1. We will only accept USA - * bank accounts e.g., USA - */ - fun country(country: JsonField) = apply { this.country = country } + /** Verification Method */ + fun verificationMethod(verificationMethod: JsonField) = apply { + this.verificationMethod = verificationMethod + } + + /** Verification State */ + fun verificationState(verificationState: VerificationState) = + verificationState(JsonField.of(verificationState)) + + /** Verification State */ + fun verificationState(verificationState: JsonField) = apply { + this.verificationState = verificationState + } /** * Indicates which Lithic account the external account is associated with. For external @@ -432,15 +481,13 @@ private constructor( this.accountToken = accountToken } - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Address */ + fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - /** - * An ISO 8601 string representing when this funding source was added to the Lithic account. - */ - fun created(created: JsonField) = apply { this.created = created } + /** Address */ + fun address(address: JsonField) = apply { + this.address = address + } /** Optional field that helps identify bank accounts in receipts */ fun companyId(companyId: String) = companyId(JsonField.of(companyId)) @@ -463,6 +510,21 @@ private constructor( this.doingBusinessAs = doingBusinessAs } + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** The financial account token of the operating account to fund the micro deposits */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** The nickname for this External Bank Account */ + fun name(name: String) = name(JsonField.of(name)) + + /** The nickname for this External Bank Account */ + fun name(name: JsonField) = apply { this.name = name } + /** User Defined ID */ fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) @@ -488,68 +550,6 @@ private constructor( this.verificationFailedReason = verificationFailedReason } - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: Long) = - verificationAttempts(JsonField.of(verificationAttempts)) - - /** The number of attempts at verification */ - fun verificationAttempts(verificationAttempts: JsonField) = apply { - this.verificationAttempts = verificationAttempts - } - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - /** The financial account token of the operating account to fund the micro deposits */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - /** Account Type */ - fun type(type: Type) = type(JsonField.of(type)) - - /** Account Type */ - fun type(type: JsonField) = apply { this.type = type } - - /** Verification Method */ - fun verificationMethod(verificationMethod: VerificationMethod) = - verificationMethod(JsonField.of(verificationMethod)) - - /** Verification Method */ - fun verificationMethod(verificationMethod: JsonField) = apply { - this.verificationMethod = verificationMethod - } - - /** Owner Type */ - fun ownerType(ownerType: OwnerType) = ownerType(JsonField.of(ownerType)) - - /** Owner Type */ - fun ownerType(ownerType: JsonField) = apply { this.ownerType = ownerType } - - /** Account State */ - fun state(state: State) = state(JsonField.of(state)) - - /** Account State */ - fun state(state: JsonField) = apply { this.state = state } - - /** Verification State */ - fun verificationState(verificationState: VerificationState) = - verificationState(JsonField.of(verificationState)) - - /** Verification State */ - fun verificationState(verificationState: JsonField) = apply { - this.verificationState = verificationState - } - - /** Address */ - fun address(address: ExternalBankAccountAddress) = address(JsonField.of(address)) - - /** Address */ - fun address(address: JsonField) = apply { - this.address = address - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -572,27 +572,27 @@ private constructor( fun build(): MicroDepositCreateResponse = MicroDepositCreateResponse( token, + country, + created, + currency, + lastFour, owner, + ownerType, routingNumber, - lastFour, - name, - currency, - country, + state, + type, + verificationAttempts, + verificationMethod, + verificationState, accountToken, - created, + address, companyId, dob, doingBusinessAs, + financialAccountToken, + name, userDefinedId, verificationFailedReason, - verificationAttempts, - financialAccountToken, - type, - verificationMethod, - ownerType, - state, - verificationState, - address, additionalProperties.toImmutable(), ) } @@ -917,15 +917,15 @@ private constructor( return true } - return /* spotless:off */ other is MicroDepositCreateResponse && token == other.token && owner == other.owner && routingNumber == other.routingNumber && lastFour == other.lastFour && name == other.name && currency == other.currency && country == other.country && accountToken == other.accountToken && created == other.created && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && verificationAttempts == other.verificationAttempts && financialAccountToken == other.financialAccountToken && type == other.type && verificationMethod == other.verificationMethod && ownerType == other.ownerType && state == other.state && verificationState == other.verificationState && address == other.address && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is MicroDepositCreateResponse && token == other.token && country == other.country && created == other.created && currency == other.currency && lastFour == other.lastFour && owner == other.owner && ownerType == other.ownerType && routingNumber == other.routingNumber && state == other.state && type == other.type && verificationAttempts == other.verificationAttempts && verificationMethod == other.verificationMethod && verificationState == other.verificationState && accountToken == other.accountToken && address == other.address && companyId == other.companyId && dob == other.dob && doingBusinessAs == other.doingBusinessAs && financialAccountToken == other.financialAccountToken && name == other.name && userDefinedId == other.userDefinedId && verificationFailedReason == other.verificationFailedReason && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, owner, routingNumber, lastFour, name, currency, country, accountToken, created, companyId, dob, doingBusinessAs, userDefinedId, verificationFailedReason, verificationAttempts, financialAccountToken, type, verificationMethod, ownerType, state, verificationState, address, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, country, created, currency, lastFour, owner, ownerType, routingNumber, state, type, verificationAttempts, verificationMethod, verificationState, accountToken, address, companyId, dob, doingBusinessAs, financialAccountToken, name, userDefinedId, verificationFailedReason, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "MicroDepositCreateResponse{token=$token, owner=$owner, routingNumber=$routingNumber, lastFour=$lastFour, name=$name, currency=$currency, country=$country, accountToken=$accountToken, created=$created, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, verificationAttempts=$verificationAttempts, financialAccountToken=$financialAccountToken, type=$type, verificationMethod=$verificationMethod, ownerType=$ownerType, state=$state, verificationState=$verificationState, address=$address, additionalProperties=$additionalProperties}" + "MicroDepositCreateResponse{token=$token, country=$country, created=$created, currency=$currency, lastFour=$lastFour, owner=$owner, ownerType=$ownerType, routingNumber=$routingNumber, state=$state, type=$type, verificationAttempts=$verificationAttempts, verificationMethod=$verificationMethod, verificationState=$verificationState, accountToken=$accountToken, address=$address, companyId=$companyId, dob=$dob, doingBusinessAs=$doingBusinessAs, financialAccountToken=$financialAccountToken, name=$name, userDefinedId=$userDefinedId, verificationFailedReason=$verificationFailedReason, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Payment.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Payment.kt index a25264de..7184e951 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Payment.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Payment.kt @@ -22,6 +22,7 @@ import java.util.Objects class Payment @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -34,9 +35,24 @@ private constructor( @JsonProperty("descriptor") @ExcludeMissing private val descriptor: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + private val direction: JsonField = JsonMissing.of(), @JsonProperty("events") @ExcludeMissing private val events: JsonField> = JsonMissing.of(), + @JsonProperty("external_bank_account_token") + @ExcludeMissing + private val externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("method") + @ExcludeMissing + private val method: JsonField = JsonMissing.of(), + @JsonProperty("method_attributes") + @ExcludeMissing + private val methodAttributes: JsonField = JsonMissing.of(), @JsonProperty("pending_amount") @ExcludeMissing private val pendingAmount: JsonField = JsonMissing.of(), @@ -46,37 +62,24 @@ private constructor( @JsonProperty("settled_amount") @ExcludeMissing private val settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("source") + @ExcludeMissing + private val source: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), - @JsonProperty("direction") - @ExcludeMissing - private val direction: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_account_token") - @ExcludeMissing - private val externalBankAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("method") - @ExcludeMissing - private val method: JsonField = JsonMissing.of(), - @JsonProperty("method_attributes") - @ExcludeMissing - private val methodAttributes: JsonField = JsonMissing.of(), - @JsonProperty("source") - @ExcludeMissing - private val source: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Payment category */ fun category(): Category = category.getRequired("category") @@ -89,9 +92,22 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ fun descriptor(): String = descriptor.getRequired("descriptor") + fun direction(): Direction = direction.getRequired("direction") + /** A list of all payment events that have modified this payment. */ fun events(): List = events.getRequired("events") + fun externalBankAccountToken(): String? = + externalBankAccountToken.getNullable("external_bank_account_token") + + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + fun method(): Method = method.getRequired("method") + + fun methodAttributes(): PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -109,6 +125,8 @@ private constructor( */ fun settledAmount(): Long = settledAmount.getRequired("settled_amount") + fun source(): Source = source.getRequired("source") + /** * Status types: * - `DECLINED` - The payment was declined. @@ -119,29 +137,14 @@ private constructor( */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun direction(): Direction = direction.getRequired("direction") - - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") - - fun externalBankAccountToken(): String? = - externalBankAccountToken.getNullable("external_bank_account_token") - - fun method(): Method = method.getRequired("method") - - fun methodAttributes(): PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") - - fun source(): Source = source.getRequired("source") - fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Payment category */ @JsonProperty("category") @ExcludeMissing fun _category() = category @@ -154,9 +157,23 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ @JsonProperty("descriptor") @ExcludeMissing fun _descriptor() = descriptor + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + /** A list of all payment events that have modified this payment. */ @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken() = externalBankAccountToken + + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + @JsonProperty("method") @ExcludeMissing fun _method() = method + + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -174,6 +191,8 @@ private constructor( */ @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + @JsonProperty("source") @ExcludeMissing fun _source() = source + /** * Status types: * - `DECLINED` - The payment was declined. @@ -184,28 +203,9 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @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 - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction - - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - @JsonProperty("external_bank_account_token") - @ExcludeMissing - fun _externalBankAccountToken() = externalBankAccountToken - - @JsonProperty("method") @ExcludeMissing fun _method() = method - - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - - @JsonProperty("source") @ExcludeMissing fun _source() = source - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId @JsonAnyGetter @@ -216,23 +216,23 @@ private constructor( fun validate(): Payment = apply { if (!validated) { + token() category() created() currency() descriptor() + direction() events().forEach { it.validate() } + externalBankAccountToken() + financialAccountToken() + method() + methodAttributes().validate() pendingAmount() result() settledAmount() + source() status() - token() updated() - direction() - financialAccountToken() - externalBankAccountToken() - method() - methodAttributes().validate() - source() userDefinedId() validated = true } @@ -247,48 +247,54 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() + private var direction: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var direction: JsonField = JsonMissing.of() - private var financialAccountToken: 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() internal fun from(payment: Payment) = apply { + token = payment.token category = payment.category created = payment.created currency = payment.currency descriptor = payment.descriptor + direction = payment.direction events = payment.events + externalBankAccountToken = payment.externalBankAccountToken + financialAccountToken = payment.financialAccountToken + method = payment.method + methodAttributes = payment.methodAttributes pendingAmount = payment.pendingAmount result = payment.result settledAmount = payment.settledAmount + source = payment.source status = payment.status - token = payment.token updated = payment.updated - direction = payment.direction - financialAccountToken = payment.financialAccountToken - externalBankAccountToken = payment.externalBankAccountToken - method = payment.method - methodAttributes = payment.methodAttributes - source = payment.source userDefinedId = payment.userDefinedId additionalProperties = payment.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Payment category */ fun category(category: Category) = category(JsonField.of(category)) @@ -317,12 +323,41 @@ private constructor( */ fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } + fun direction(direction: Direction) = direction(JsonField.of(direction)) + + fun direction(direction: JsonField) = apply { this.direction = direction } + /** A list of all payment events that have modified this payment. */ fun events(events: List) = events(JsonField.of(events)) /** A list of all payment events that have modified this payment. */ fun events(events: JsonField>) = apply { this.events = events } + fun externalBankAccountToken(externalBankAccountToken: String) = + externalBankAccountToken(JsonField.of(externalBankAccountToken)) + + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken + } + + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + fun method(method: Method) = method(JsonField.of(method)) + + fun method(method: JsonField) = apply { this.method = method } + + fun methodAttributes(methodAttributes: PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes + } + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -363,6 +398,10 @@ private constructor( this.settledAmount = settledAmount } + fun source(source: Source) = source(JsonField.of(source)) + + fun source(source: JsonField) = apply { this.source = source } + /** * Status types: * - `DECLINED` - The payment was declined. @@ -383,51 +422,12 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: JsonField) = apply { this.updated = updated } - fun direction(direction: Direction) = direction(JsonField.of(direction)) - - fun direction(direction: JsonField) = apply { this.direction = direction } - - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - fun externalBankAccountToken(externalBankAccountToken: String) = - externalBankAccountToken(JsonField.of(externalBankAccountToken)) - - fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { - this.externalBankAccountToken = externalBankAccountToken - } - - fun method(method: Method) = method(JsonField.of(method)) - - fun method(method: JsonField) = apply { this.method = method } - - fun methodAttributes(methodAttributes: PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) - - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes - } - - fun source(source: Source) = source(JsonField.of(source)) - - fun source(source: JsonField) = apply { this.source = source } - fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) fun userDefinedId(userDefinedId: JsonField) = apply { @@ -455,23 +455,23 @@ private constructor( fun build(): Payment = Payment( + token, category, created, currency, descriptor, + direction, events.map { it.toImmutable() }, + externalBankAccountToken, + financialAccountToken, + method, + methodAttributes, pendingAmount, result, settledAmount, + source, status, - token, updated, - direction, - financialAccountToken, - externalBankAccountToken, - method, - methodAttributes, - source, userDefinedId, additionalProperties.toImmutable(), ) @@ -589,28 +589,31 @@ private constructor( class PaymentEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), - @JsonProperty("detailed_results") - @ExcludeMissing - private val detailedResults: JsonField> = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), + @JsonProperty("detailed_results") + @ExcludeMissing + private val detailedResults: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -620,19 +623,12 @@ private constructor( /** Date and time when the financial event occurred. UTC time zone. */ fun created(): OffsetDateTime = created.getRequired("created") - /** More detailed reasons for the event */ - fun detailedResults(): List? = - detailedResults.getNullable("detailed_results") - /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. */ fun result(): Result = result.getRequired("result") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** * Event types: * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release @@ -652,6 +648,13 @@ private constructor( */ fun type(): PaymentEventType = type.getRequired("type") + /** More detailed reasons for the event */ + fun detailedResults(): List? = + detailedResults.getNullable("detailed_results") + + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -661,18 +664,12 @@ private constructor( /** Date and time when the financial event occurred. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - /** More detailed reasons for the event */ - @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults - /** * APPROVED financial events were successful while DECLINED financial events were declined * by user, Lithic, or the network. */ @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** * Event types: * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release @@ -692,6 +689,9 @@ private constructor( */ @JsonProperty("type") @ExcludeMissing fun _type() = type + /** More detailed reasons for the event */ + @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -700,12 +700,12 @@ private constructor( fun validate(): PaymentEvent = apply { if (!validated) { + token() amount() created() - detailedResults() result() - token() type() + detailedResults() validated = true } } @@ -719,24 +719,30 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() 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() + private var detailedResults: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(paymentEvent: PaymentEvent) = apply { + token = paymentEvent.token amount = paymentEvent.amount created = paymentEvent.created - detailedResults = paymentEvent.detailedResults result = paymentEvent.result - token = paymentEvent.token type = paymentEvent.type + detailedResults = paymentEvent.detailedResults additionalProperties = paymentEvent.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -755,15 +761,6 @@ private constructor( /** Date and time when the financial event occurred. UTC time zone. */ fun created(created: JsonField) = apply { this.created = created } - /** More detailed reasons for the event */ - fun detailedResults(detailedResults: List) = - detailedResults(JsonField.of(detailedResults)) - - /** More detailed reasons for the event */ - fun detailedResults(detailedResults: JsonField>) = apply { - this.detailedResults = detailedResults - } - /** * APPROVED financial events were successful while DECLINED financial events were * declined by user, Lithic, or the network. @@ -776,12 +773,6 @@ private constructor( */ fun result(result: JsonField) = apply { this.result = result } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** * Event types: * - `ACH_ORIGINATION_INITIATED` - ACH origination received and pending approval/release @@ -822,6 +813,15 @@ private constructor( */ fun type(type: JsonField) = apply { this.type = type } + /** More detailed reasons for the event */ + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + /** More detailed reasons for the event */ + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -843,12 +843,12 @@ private constructor( fun build(): PaymentEvent = PaymentEvent( + token, amount, created, - detailedResults.map { it.toImmutable() }, result, - token, type, + detailedResults.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -1101,17 +1101,17 @@ private constructor( return true } - return /* spotless:off */ other is PaymentEvent && amount == other.amount && created == other.created && detailedResults == other.detailedResults && result == other.result && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentEvent && token == other.token && amount == other.amount && created == other.created && result == other.result && type == other.type && detailedResults == other.detailedResults && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, created, detailedResults, result, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, result, type, detailedResults, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentEvent{amount=$amount, created=$created, detailedResults=$detailedResults, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "PaymentEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, detailedResults=$detailedResults, additionalProperties=$additionalProperties}" } class Method @@ -1603,15 +1603,15 @@ private constructor( return true } - return /* spotless:off */ other is Payment && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && token == other.token && updated == other.updated && direction == other.direction && financialAccountToken == other.financialAccountToken && externalBankAccountToken == other.externalBankAccountToken && method == other.method && methodAttributes == other.methodAttributes && source == other.source && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Payment && token == other.token && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && direction == other.direction && events == other.events && externalBankAccountToken == other.externalBankAccountToken && financialAccountToken == other.financialAccountToken && method == other.method && methodAttributes == other.methodAttributes && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && source == other.source && status == other.status && updated == other.updated && userDefinedId == other.userDefinedId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, descriptor, events, pendingAmount, result, settledAmount, status, token, updated, direction, financialAccountToken, externalBankAccountToken, method, methodAttributes, source, userDefinedId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, descriptor, direction, events, externalBankAccountToken, financialAccountToken, method, methodAttributes, pendingAmount, result, settledAmount, source, status, updated, userDefinedId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode 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, direction=$direction, financialAccountToken=$financialAccountToken, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" + "Payment{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, direction=$direction, events=$events, externalBankAccountToken=$externalBankAccountToken, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, userDefinedId=$userDefinedId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt index 044ffb33..9889c155 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentCreateResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects class PaymentCreateResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -32,9 +33,24 @@ private constructor( @JsonProperty("descriptor") @ExcludeMissing private val descriptor: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + private val direction: JsonField = JsonMissing.of(), @JsonProperty("events") @ExcludeMissing private val events: JsonField> = JsonMissing.of(), + @JsonProperty("external_bank_account_token") + @ExcludeMissing + private val externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("method") + @ExcludeMissing + private val method: JsonField = JsonMissing.of(), + @JsonProperty("method_attributes") + @ExcludeMissing + private val methodAttributes: JsonField = JsonMissing.of(), @JsonProperty("pending_amount") @ExcludeMissing private val pendingAmount: JsonField = JsonMissing.of(), @@ -44,31 +60,15 @@ private constructor( @JsonProperty("settled_amount") @ExcludeMissing private val settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("source") + @ExcludeMissing + private val source: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), - @JsonProperty("direction") - @ExcludeMissing - private val direction: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_account_token") - @ExcludeMissing - private val externalBankAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("method") - @ExcludeMissing - private val method: JsonField = JsonMissing.of(), - @JsonProperty("method_attributes") - @ExcludeMissing - private val methodAttributes: JsonField = JsonMissing.of(), - @JsonProperty("source") - @ExcludeMissing - private val source: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @@ -78,6 +78,9 @@ private constructor( @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Payment category */ fun category(): Payment.Category = category.getRequired("category") @@ -90,9 +93,22 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ fun descriptor(): String = descriptor.getRequired("descriptor") + fun direction(): Payment.Direction = direction.getRequired("direction") + /** A list of all payment events that have modified this payment. */ fun events(): List = events.getRequired("events") + fun externalBankAccountToken(): String? = + externalBankAccountToken.getNullable("external_bank_account_token") + + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + fun method(): Payment.Method = method.getRequired("method") + + fun methodAttributes(): Payment.PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -110,6 +126,8 @@ private constructor( */ fun settledAmount(): Long = settledAmount.getRequired("settled_amount") + fun source(): Payment.Source = source.getRequired("source") + /** * Status types: * - `DECLINED` - The payment was declined. @@ -120,32 +138,17 @@ private constructor( */ fun status(): Payment.Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun direction(): Payment.Direction = direction.getRequired("direction") - - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") - - fun externalBankAccountToken(): String? = - externalBankAccountToken.getNullable("external_bank_account_token") - - fun method(): Payment.Method = method.getRequired("method") - - fun methodAttributes(): Payment.PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") - - fun source(): Payment.Source = source.getRequired("source") - fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") /** Balance */ fun balance(): Balance? = balance.getNullable("balance") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Payment category */ @JsonProperty("category") @ExcludeMissing fun _category() = category @@ -158,9 +161,23 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ @JsonProperty("descriptor") @ExcludeMissing fun _descriptor() = descriptor + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + /** A list of all payment events that have modified this payment. */ @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken() = externalBankAccountToken + + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + @JsonProperty("method") @ExcludeMissing fun _method() = method + + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -178,6 +195,8 @@ private constructor( */ @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + @JsonProperty("source") @ExcludeMissing fun _source() = source + /** * Status types: * - `DECLINED` - The payment was declined. @@ -188,28 +207,9 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @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 - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction - - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - @JsonProperty("external_bank_account_token") - @ExcludeMissing - fun _externalBankAccountToken() = externalBankAccountToken - - @JsonProperty("method") @ExcludeMissing fun _method() = method - - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - - @JsonProperty("source") @ExcludeMissing fun _source() = source - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** Balance */ @@ -221,23 +221,23 @@ private constructor( fun toPayment(): Payment = Payment.builder() + .token(token) .category(category) .created(created) .currency(currency) .descriptor(descriptor) + .direction(direction) .events(events) + .externalBankAccountToken(externalBankAccountToken) + .financialAccountToken(financialAccountToken) + .method(method) + .methodAttributes(methodAttributes) .pendingAmount(pendingAmount) .result(result) .settledAmount(settledAmount) + .source(source) .status(status) - .token(token) .updated(updated) - .direction(direction) - .financialAccountToken(financialAccountToken) - .externalBankAccountToken(externalBankAccountToken) - .method(method) - .methodAttributes(methodAttributes) - .source(source) .userDefinedId(userDefinedId) .build() @@ -245,23 +245,23 @@ private constructor( fun validate(): PaymentCreateResponse = apply { if (!validated) { + token() category() created() currency() descriptor() + direction() events().forEach { it.validate() } + externalBankAccountToken() + financialAccountToken() + method() + methodAttributes().validate() pendingAmount() result() settledAmount() + source() status() - token() updated() - direction() - financialAccountToken() - externalBankAccountToken() - method() - methodAttributes().validate() - source() userDefinedId() balance()?.validate() validated = true @@ -277,50 +277,56 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() + private var direction: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var direction: JsonField = JsonMissing.of() - private var financialAccountToken: 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() internal fun from(paymentCreateResponse: PaymentCreateResponse) = apply { + token = paymentCreateResponse.token category = paymentCreateResponse.category created = paymentCreateResponse.created currency = paymentCreateResponse.currency descriptor = paymentCreateResponse.descriptor + direction = paymentCreateResponse.direction events = paymentCreateResponse.events + externalBankAccountToken = paymentCreateResponse.externalBankAccountToken + financialAccountToken = paymentCreateResponse.financialAccountToken + method = paymentCreateResponse.method + methodAttributes = paymentCreateResponse.methodAttributes pendingAmount = paymentCreateResponse.pendingAmount result = paymentCreateResponse.result settledAmount = paymentCreateResponse.settledAmount + source = paymentCreateResponse.source status = paymentCreateResponse.status - token = paymentCreateResponse.token updated = paymentCreateResponse.updated - direction = paymentCreateResponse.direction - financialAccountToken = paymentCreateResponse.financialAccountToken - externalBankAccountToken = paymentCreateResponse.externalBankAccountToken - method = paymentCreateResponse.method - methodAttributes = paymentCreateResponse.methodAttributes - source = paymentCreateResponse.source userDefinedId = paymentCreateResponse.userDefinedId balance = paymentCreateResponse.balance additionalProperties = paymentCreateResponse.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Payment category */ fun category(category: Payment.Category) = category(JsonField.of(category)) @@ -349,12 +355,43 @@ private constructor( */ fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } + fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) + + fun direction(direction: JsonField) = apply { + this.direction = direction + } + /** A list of all payment events that have modified this payment. */ fun events(events: List) = events(JsonField.of(events)) /** A list of all payment events that have modified this payment. */ fun events(events: JsonField>) = apply { this.events = events } + fun externalBankAccountToken(externalBankAccountToken: String) = + externalBankAccountToken(JsonField.of(externalBankAccountToken)) + + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken + } + + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + fun method(method: Payment.Method) = method(JsonField.of(method)) + + fun method(method: JsonField) = apply { this.method = method } + + fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes + } + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -395,6 +432,10 @@ private constructor( this.settledAmount = settledAmount } + fun source(source: Payment.Source) = source(JsonField.of(source)) + + fun source(source: JsonField) = apply { this.source = source } + /** * Status types: * - `DECLINED` - The payment was declined. @@ -415,53 +456,12 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: JsonField) = apply { this.updated = updated } - fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) - - fun direction(direction: JsonField) = apply { - this.direction = direction - } - - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - fun externalBankAccountToken(externalBankAccountToken: String) = - externalBankAccountToken(JsonField.of(externalBankAccountToken)) - - fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { - this.externalBankAccountToken = externalBankAccountToken - } - - fun method(method: Payment.Method) = method(JsonField.of(method)) - - fun method(method: JsonField) = apply { this.method = method } - - fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) - - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes - } - - fun source(source: Payment.Source) = source(JsonField.of(source)) - - fun source(source: JsonField) = apply { this.source = source } - fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) fun userDefinedId(userDefinedId: JsonField) = apply { @@ -495,23 +495,23 @@ private constructor( fun build(): PaymentCreateResponse = PaymentCreateResponse( + token, category, created, currency, descriptor, + direction, events.map { it.toImmutable() }, + externalBankAccountToken, + financialAccountToken, + method, + methodAttributes, pendingAmount, result, settledAmount, + source, status, - token, updated, - direction, - financialAccountToken, - externalBankAccountToken, - method, - methodAttributes, - source, userDefinedId, balance, additionalProperties.toImmutable(), @@ -523,15 +523,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentCreateResponse && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && token == other.token && updated == other.updated && direction == other.direction && financialAccountToken == other.financialAccountToken && externalBankAccountToken == other.externalBankAccountToken && method == other.method && methodAttributes == other.methodAttributes && source == other.source && userDefinedId == other.userDefinedId && balance == other.balance && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentCreateResponse && token == other.token && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && direction == other.direction && events == other.events && externalBankAccountToken == other.externalBankAccountToken && financialAccountToken == other.financialAccountToken && method == other.method && methodAttributes == other.methodAttributes && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && source == other.source && status == other.status && updated == other.updated && userDefinedId == other.userDefinedId && balance == other.balance && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, descriptor, events, pendingAmount, result, settledAmount, status, token, updated, direction, financialAccountToken, externalBankAccountToken, method, methodAttributes, source, userDefinedId, balance, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, descriptor, direction, events, externalBankAccountToken, financialAccountToken, method, methodAttributes, pendingAmount, result, settledAmount, source, status, updated, userDefinedId, balance, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode 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, direction=$direction, financialAccountToken=$financialAccountToken, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentCreateResponse{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, direction=$direction, events=$events, externalBankAccountToken=$externalBankAccountToken, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt index e2d8c9b5..91418121 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentRetryResponse.kt @@ -20,6 +20,7 @@ import java.util.Objects class PaymentRetryResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -32,9 +33,24 @@ private constructor( @JsonProperty("descriptor") @ExcludeMissing private val descriptor: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + private val direction: JsonField = JsonMissing.of(), @JsonProperty("events") @ExcludeMissing private val events: JsonField> = JsonMissing.of(), + @JsonProperty("external_bank_account_token") + @ExcludeMissing + private val externalBankAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("method") + @ExcludeMissing + private val method: JsonField = JsonMissing.of(), + @JsonProperty("method_attributes") + @ExcludeMissing + private val methodAttributes: JsonField = JsonMissing.of(), @JsonProperty("pending_amount") @ExcludeMissing private val pendingAmount: JsonField = JsonMissing.of(), @@ -44,31 +60,15 @@ private constructor( @JsonProperty("settled_amount") @ExcludeMissing private val settledAmount: JsonField = JsonMissing.of(), + @JsonProperty("source") + @ExcludeMissing + private val source: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), - @JsonProperty("direction") - @ExcludeMissing - private val direction: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("external_bank_account_token") - @ExcludeMissing - private val externalBankAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("method") - @ExcludeMissing - private val method: JsonField = JsonMissing.of(), - @JsonProperty("method_attributes") - @ExcludeMissing - private val methodAttributes: JsonField = JsonMissing.of(), - @JsonProperty("source") - @ExcludeMissing - private val source: JsonField = JsonMissing.of(), @JsonProperty("user_defined_id") @ExcludeMissing private val userDefinedId: JsonField = JsonMissing.of(), @@ -78,6 +78,9 @@ private constructor( @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + /** Payment category */ fun category(): Payment.Category = category.getRequired("category") @@ -90,9 +93,22 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ fun descriptor(): String = descriptor.getRequired("descriptor") + fun direction(): Payment.Direction = direction.getRequired("direction") + /** A list of all payment events that have modified this payment. */ fun events(): List = events.getRequired("events") + fun externalBankAccountToken(): String? = + externalBankAccountToken.getNullable("external_bank_account_token") + + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + fun method(): Payment.Method = method.getRequired("method") + + fun methodAttributes(): Payment.PaymentMethodAttributes = + methodAttributes.getRequired("method_attributes") + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -110,6 +126,8 @@ private constructor( */ fun settledAmount(): Long = settledAmount.getRequired("settled_amount") + fun source(): Payment.Source = source.getRequired("source") + /** * Status types: * - `DECLINED` - The payment was declined. @@ -120,32 +138,17 @@ private constructor( */ fun status(): Payment.Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") - fun direction(): Payment.Direction = direction.getRequired("direction") - - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") - - fun externalBankAccountToken(): String? = - externalBankAccountToken.getNullable("external_bank_account_token") - - fun method(): Payment.Method = method.getRequired("method") - - fun methodAttributes(): Payment.PaymentMethodAttributes = - methodAttributes.getRequired("method_attributes") - - fun source(): Payment.Source = source.getRequired("source") - fun userDefinedId(): String? = userDefinedId.getNullable("user_defined_id") /** Balance */ fun balance(): Balance? = balance.getNullable("balance") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Payment category */ @JsonProperty("category") @ExcludeMissing fun _category() = category @@ -158,9 +161,23 @@ private constructor( /** A string that provides a description of the payment; may be useful to display to users. */ @JsonProperty("descriptor") @ExcludeMissing fun _descriptor() = descriptor + @JsonProperty("direction") @ExcludeMissing fun _direction() = direction + /** A list of all payment events that have modified this payment. */ @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonProperty("external_bank_account_token") + @ExcludeMissing + fun _externalBankAccountToken() = externalBankAccountToken + + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken + + @JsonProperty("method") @ExcludeMissing fun _method() = method + + @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -178,6 +195,8 @@ private constructor( */ @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount + @JsonProperty("source") @ExcludeMissing fun _source() = source + /** * Status types: * - `DECLINED` - The payment was declined. @@ -188,28 +207,9 @@ private constructor( */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @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 - @JsonProperty("direction") @ExcludeMissing fun _direction() = direction - - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken - - @JsonProperty("external_bank_account_token") - @ExcludeMissing - fun _externalBankAccountToken() = externalBankAccountToken - - @JsonProperty("method") @ExcludeMissing fun _method() = method - - @JsonProperty("method_attributes") @ExcludeMissing fun _methodAttributes() = methodAttributes - - @JsonProperty("source") @ExcludeMissing fun _source() = source - @JsonProperty("user_defined_id") @ExcludeMissing fun _userDefinedId() = userDefinedId /** Balance */ @@ -221,23 +221,23 @@ private constructor( fun toPayment(): Payment = Payment.builder() + .token(token) .category(category) .created(created) .currency(currency) .descriptor(descriptor) + .direction(direction) .events(events) + .externalBankAccountToken(externalBankAccountToken) + .financialAccountToken(financialAccountToken) + .method(method) + .methodAttributes(methodAttributes) .pendingAmount(pendingAmount) .result(result) .settledAmount(settledAmount) + .source(source) .status(status) - .token(token) .updated(updated) - .direction(direction) - .financialAccountToken(financialAccountToken) - .externalBankAccountToken(externalBankAccountToken) - .method(method) - .methodAttributes(methodAttributes) - .source(source) .userDefinedId(userDefinedId) .build() @@ -245,23 +245,23 @@ private constructor( fun validate(): PaymentRetryResponse = apply { if (!validated) { + token() category() created() currency() descriptor() + direction() events().forEach { it.validate() } + externalBankAccountToken() + financialAccountToken() + method() + methodAttributes().validate() pendingAmount() result() settledAmount() + source() status() - token() updated() - direction() - financialAccountToken() - externalBankAccountToken() - method() - methodAttributes().validate() - source() userDefinedId() balance()?.validate() validated = true @@ -277,50 +277,56 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() + private var direction: JsonField = JsonMissing.of() private var events: JsonField> = JsonMissing.of() + private var externalBankAccountToken: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var method: JsonField = JsonMissing.of() + private var methodAttributes: JsonField = JsonMissing.of() private var pendingAmount: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() + private var source: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var direction: JsonField = JsonMissing.of() - private var financialAccountToken: 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() internal fun from(paymentRetryResponse: PaymentRetryResponse) = apply { + token = paymentRetryResponse.token category = paymentRetryResponse.category created = paymentRetryResponse.created currency = paymentRetryResponse.currency descriptor = paymentRetryResponse.descriptor + direction = paymentRetryResponse.direction events = paymentRetryResponse.events + externalBankAccountToken = paymentRetryResponse.externalBankAccountToken + financialAccountToken = paymentRetryResponse.financialAccountToken + method = paymentRetryResponse.method + methodAttributes = paymentRetryResponse.methodAttributes pendingAmount = paymentRetryResponse.pendingAmount result = paymentRetryResponse.result settledAmount = paymentRetryResponse.settledAmount + source = paymentRetryResponse.source status = paymentRetryResponse.status - token = paymentRetryResponse.token updated = paymentRetryResponse.updated - direction = paymentRetryResponse.direction - financialAccountToken = paymentRetryResponse.financialAccountToken - externalBankAccountToken = paymentRetryResponse.externalBankAccountToken - method = paymentRetryResponse.method - methodAttributes = paymentRetryResponse.methodAttributes - source = paymentRetryResponse.source userDefinedId = paymentRetryResponse.userDefinedId balance = paymentRetryResponse.balance additionalProperties = paymentRetryResponse.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Payment category */ fun category(category: Payment.Category) = category(JsonField.of(category)) @@ -349,12 +355,43 @@ private constructor( */ fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } + fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) + + fun direction(direction: JsonField) = apply { + this.direction = direction + } + /** A list of all payment events that have modified this payment. */ fun events(events: List) = events(JsonField.of(events)) /** A list of all payment events that have modified this payment. */ fun events(events: JsonField>) = apply { this.events = events } + fun externalBankAccountToken(externalBankAccountToken: String) = + externalBankAccountToken(JsonField.of(externalBankAccountToken)) + + fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { + this.externalBankAccountToken = externalBankAccountToken + } + + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + fun method(method: Payment.Method) = method(JsonField.of(method)) + + fun method(method: JsonField) = apply { this.method = method } + + fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = + methodAttributes(JsonField.of(methodAttributes)) + + fun methodAttributes(methodAttributes: JsonField) = apply { + this.methodAttributes = methodAttributes + } + /** * Pending amount of the payment in the currency's smallest unit (e.g., cents). The value of * this field will go to zero over time once the payment is settled. @@ -395,6 +432,10 @@ private constructor( this.settledAmount = settledAmount } + fun source(source: Payment.Source) = source(JsonField.of(source)) + + fun source(source: JsonField) = apply { this.source = source } + /** * Status types: * - `DECLINED` - The payment was declined. @@ -415,53 +456,12 @@ private constructor( */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: JsonField) = apply { this.updated = updated } - fun direction(direction: Payment.Direction) = direction(JsonField.of(direction)) - - fun direction(direction: JsonField) = apply { - this.direction = direction - } - - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) - - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } - - fun externalBankAccountToken(externalBankAccountToken: String) = - externalBankAccountToken(JsonField.of(externalBankAccountToken)) - - fun externalBankAccountToken(externalBankAccountToken: JsonField) = apply { - this.externalBankAccountToken = externalBankAccountToken - } - - fun method(method: Payment.Method) = method(JsonField.of(method)) - - fun method(method: JsonField) = apply { this.method = method } - - fun methodAttributes(methodAttributes: Payment.PaymentMethodAttributes) = - methodAttributes(JsonField.of(methodAttributes)) - - fun methodAttributes(methodAttributes: JsonField) = apply { - this.methodAttributes = methodAttributes - } - - fun source(source: Payment.Source) = source(JsonField.of(source)) - - fun source(source: JsonField) = apply { this.source = source } - fun userDefinedId(userDefinedId: String) = userDefinedId(JsonField.of(userDefinedId)) fun userDefinedId(userDefinedId: JsonField) = apply { @@ -495,23 +495,23 @@ private constructor( fun build(): PaymentRetryResponse = PaymentRetryResponse( + token, category, created, currency, descriptor, + direction, events.map { it.toImmutable() }, + externalBankAccountToken, + financialAccountToken, + method, + methodAttributes, pendingAmount, result, settledAmount, + source, status, - token, updated, - direction, - financialAccountToken, - externalBankAccountToken, - method, - methodAttributes, - source, userDefinedId, balance, additionalProperties.toImmutable(), @@ -523,15 +523,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentRetryResponse && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && token == other.token && updated == other.updated && direction == other.direction && financialAccountToken == other.financialAccountToken && externalBankAccountToken == other.externalBankAccountToken && method == other.method && methodAttributes == other.methodAttributes && source == other.source && userDefinedId == other.userDefinedId && balance == other.balance && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentRetryResponse && token == other.token && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && direction == other.direction && events == other.events && externalBankAccountToken == other.externalBankAccountToken && financialAccountToken == other.financialAccountToken && method == other.method && methodAttributes == other.methodAttributes && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && source == other.source && status == other.status && updated == other.updated && userDefinedId == other.userDefinedId && balance == other.balance && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, descriptor, events, pendingAmount, result, settledAmount, status, token, updated, direction, financialAccountToken, externalBankAccountToken, method, methodAttributes, source, userDefinedId, balance, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, descriptor, direction, events, externalBankAccountToken, financialAccountToken, method, methodAttributes, pendingAmount, result, settledAmount, source, status, updated, userDefinedId, balance, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode 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, direction=$direction, financialAccountToken=$financialAccountToken, externalBankAccountToken=$externalBankAccountToken, method=$method, methodAttributes=$methodAttributes, source=$source, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" + "PaymentRetryResponse{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, direction=$direction, events=$events, externalBankAccountToken=$externalBankAccountToken, financialAccountToken=$financialAccountToken, method=$method, methodAttributes=$methodAttributes, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, source=$source, status=$status, updated=$updated, userDefinedId=$userDefinedId, balance=$balance, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt index 16a0fbc6..5ba55c07 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateActionResponse.kt @@ -21,18 +21,21 @@ import java.util.Objects class PaymentSimulateActionResponse @JsonCreator private constructor( + @JsonProperty("debugging_request_id") + @ExcludeMissing + private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), @JsonProperty("transaction_event_token") @ExcludeMissing private val transactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("debugging_request_id") - @ExcludeMissing - private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ fun result(): Result = result.getRequired("result") @@ -41,7 +44,9 @@ private constructor( transactionEventToken.getRequired("transaction_event_token") /** Debugging Request Id */ - fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result @@ -51,11 +56,6 @@ private constructor( @ExcludeMissing fun _transactionEventToken() = transactionEventToken - /** Debugging Request Id */ - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -64,9 +64,9 @@ private constructor( fun validate(): PaymentSimulateActionResponse = apply { if (!validated) { + debuggingRequestId() result() transactionEventToken() - debuggingRequestId() validated = true } } @@ -80,18 +80,27 @@ private constructor( class Builder { + private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() - private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(paymentSimulateActionResponse: PaymentSimulateActionResponse) = apply { + debuggingRequestId = paymentSimulateActionResponse.debuggingRequestId result = paymentSimulateActionResponse.result transactionEventToken = paymentSimulateActionResponse.transactionEventToken - debuggingRequestId = paymentSimulateActionResponse.debuggingRequestId additionalProperties = paymentSimulateActionResponse.additionalProperties.toMutableMap() } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) @@ -107,15 +116,6 @@ private constructor( this.transactionEventToken = transactionEventToken } - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -137,9 +137,9 @@ private constructor( fun build(): PaymentSimulateActionResponse = PaymentSimulateActionResponse( + debuggingRequestId, result, transactionEventToken, - debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -206,15 +206,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentSimulateActionResponse && result == other.result && transactionEventToken == other.transactionEventToken && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentSimulateActionResponse && debuggingRequestId == other.debuggingRequestId && result == other.result && transactionEventToken == other.transactionEventToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(result, transactionEventToken, debuggingRequestId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, result, transactionEventToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentSimulateActionResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + "PaymentSimulateActionResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt index 6f73836f..78896344 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReceiptResponse.kt @@ -21,18 +21,21 @@ import java.util.Objects class PaymentSimulateReceiptResponse @JsonCreator private constructor( + @JsonProperty("debugging_request_id") + @ExcludeMissing + private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), @JsonProperty("transaction_event_token") @ExcludeMissing private val transactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("debugging_request_id") - @ExcludeMissing - private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ fun result(): Result = result.getRequired("result") @@ -41,7 +44,9 @@ private constructor( transactionEventToken.getRequired("transaction_event_token") /** Debugging Request Id */ - fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result @@ -51,11 +56,6 @@ private constructor( @ExcludeMissing fun _transactionEventToken() = transactionEventToken - /** Debugging Request Id */ - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -64,9 +64,9 @@ private constructor( fun validate(): PaymentSimulateReceiptResponse = apply { if (!validated) { + debuggingRequestId() result() transactionEventToken() - debuggingRequestId() validated = true } } @@ -80,19 +80,28 @@ private constructor( class Builder { + private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() - private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(paymentSimulateReceiptResponse: PaymentSimulateReceiptResponse) = apply { + debuggingRequestId = paymentSimulateReceiptResponse.debuggingRequestId result = paymentSimulateReceiptResponse.result transactionEventToken = paymentSimulateReceiptResponse.transactionEventToken - debuggingRequestId = paymentSimulateReceiptResponse.debuggingRequestId additionalProperties = paymentSimulateReceiptResponse.additionalProperties.toMutableMap() } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) @@ -108,15 +117,6 @@ private constructor( this.transactionEventToken = transactionEventToken } - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -138,9 +138,9 @@ private constructor( fun build(): PaymentSimulateReceiptResponse = PaymentSimulateReceiptResponse( + debuggingRequestId, result, transactionEventToken, - debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -207,15 +207,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentSimulateReceiptResponse && result == other.result && transactionEventToken == other.transactionEventToken && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentSimulateReceiptResponse && debuggingRequestId == other.debuggingRequestId && result == other.result && transactionEventToken == other.transactionEventToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(result, transactionEventToken, debuggingRequestId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, result, transactionEventToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentSimulateReceiptResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + "PaymentSimulateReceiptResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt index ab0c55e7..24159b4a 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReleaseResponse.kt @@ -21,18 +21,21 @@ import java.util.Objects class PaymentSimulateReleaseResponse @JsonCreator private constructor( + @JsonProperty("debugging_request_id") + @ExcludeMissing + private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), @JsonProperty("transaction_event_token") @ExcludeMissing private val transactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("debugging_request_id") - @ExcludeMissing - private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ fun result(): Result = result.getRequired("result") @@ -41,7 +44,9 @@ private constructor( transactionEventToken.getRequired("transaction_event_token") /** Debugging Request Id */ - fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result @@ -51,11 +56,6 @@ private constructor( @ExcludeMissing fun _transactionEventToken() = transactionEventToken - /** Debugging Request Id */ - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -64,9 +64,9 @@ private constructor( fun validate(): PaymentSimulateReleaseResponse = apply { if (!validated) { + debuggingRequestId() result() transactionEventToken() - debuggingRequestId() validated = true } } @@ -80,19 +80,28 @@ private constructor( class Builder { + private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() - private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(paymentSimulateReleaseResponse: PaymentSimulateReleaseResponse) = apply { + debuggingRequestId = paymentSimulateReleaseResponse.debuggingRequestId result = paymentSimulateReleaseResponse.result transactionEventToken = paymentSimulateReleaseResponse.transactionEventToken - debuggingRequestId = paymentSimulateReleaseResponse.debuggingRequestId additionalProperties = paymentSimulateReleaseResponse.additionalProperties.toMutableMap() } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) @@ -108,15 +117,6 @@ private constructor( this.transactionEventToken = transactionEventToken } - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -138,9 +138,9 @@ private constructor( fun build(): PaymentSimulateReleaseResponse = PaymentSimulateReleaseResponse( + debuggingRequestId, result, transactionEventToken, - debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -207,15 +207,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentSimulateReleaseResponse && result == other.result && transactionEventToken == other.transactionEventToken && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentSimulateReleaseResponse && debuggingRequestId == other.debuggingRequestId && result == other.result && transactionEventToken == other.transactionEventToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(result, transactionEventToken, debuggingRequestId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, result, transactionEventToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentSimulateReleaseResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + "PaymentSimulateReleaseResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt index 6ee5daa8..01dbd8a0 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/PaymentSimulateReturnResponse.kt @@ -21,18 +21,21 @@ import java.util.Objects class PaymentSimulateReturnResponse @JsonCreator private constructor( + @JsonProperty("debugging_request_id") + @ExcludeMissing + private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), @JsonProperty("transaction_event_token") @ExcludeMissing private val transactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("debugging_request_id") - @ExcludeMissing - private val debuggingRequestId: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Debugging Request Id */ + fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + /** Request Result */ fun result(): Result = result.getRequired("result") @@ -41,7 +44,9 @@ private constructor( transactionEventToken.getRequired("transaction_event_token") /** Debugging Request Id */ - fun debuggingRequestId(): String = debuggingRequestId.getRequired("debugging_request_id") + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId /** Request Result */ @JsonProperty("result") @ExcludeMissing fun _result() = result @@ -51,11 +56,6 @@ private constructor( @ExcludeMissing fun _transactionEventToken() = transactionEventToken - /** Debugging Request Id */ - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -64,9 +64,9 @@ private constructor( fun validate(): PaymentSimulateReturnResponse = apply { if (!validated) { + debuggingRequestId() result() transactionEventToken() - debuggingRequestId() validated = true } } @@ -80,18 +80,27 @@ private constructor( class Builder { + private var debuggingRequestId: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() private var transactionEventToken: JsonField = JsonMissing.of() - private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(paymentSimulateReturnResponse: PaymentSimulateReturnResponse) = apply { + debuggingRequestId = paymentSimulateReturnResponse.debuggingRequestId result = paymentSimulateReturnResponse.result transactionEventToken = paymentSimulateReturnResponse.transactionEventToken - debuggingRequestId = paymentSimulateReturnResponse.debuggingRequestId additionalProperties = paymentSimulateReturnResponse.additionalProperties.toMutableMap() } + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging Request Id */ + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + /** Request Result */ fun result(result: Result) = result(JsonField.of(result)) @@ -107,15 +116,6 @@ private constructor( this.transactionEventToken = transactionEventToken } - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - /** Debugging Request Id */ - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -137,9 +137,9 @@ private constructor( fun build(): PaymentSimulateReturnResponse = PaymentSimulateReturnResponse( + debuggingRequestId, result, transactionEventToken, - debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -206,15 +206,15 @@ private constructor( return true } - return /* spotless:off */ other is PaymentSimulateReturnResponse && result == other.result && transactionEventToken == other.transactionEventToken && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is PaymentSimulateReturnResponse && debuggingRequestId == other.debuggingRequestId && result == other.result && transactionEventToken == other.transactionEventToken && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(result, transactionEventToken, debuggingRequestId, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, result, transactionEventToken, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "PaymentSimulateReturnResponse{result=$result, transactionEventToken=$transactionEventToken, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" + "PaymentSimulateReturnResponse{debuggingRequestId=$debuggingRequestId, result=$result, transactionEventToken=$transactionEventToken, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt index ec76be79..d9beb638 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/RequiredDocument.kt @@ -22,12 +22,12 @@ private constructor( @JsonProperty("entity_token") @ExcludeMissing private val entityToken: JsonField = JsonMissing.of(), - @JsonProperty("valid_documents") - @ExcludeMissing - private val validDocuments: JsonField> = JsonMissing.of(), @JsonProperty("status_reasons") @ExcludeMissing private val statusReasons: JsonField> = JsonMissing.of(), + @JsonProperty("valid_documents") + @ExcludeMissing + private val validDocuments: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -35,27 +35,27 @@ private constructor( fun entityToken(): String = entityToken.getRequired("entity_token") /** - * A list of valid documents that will satisfy the KYC requirements for the specified entity. + * rovides the status reasons that will be satisfied by providing one of the valid documents. */ - fun validDocuments(): List = validDocuments.getRequired("valid_documents") + fun statusReasons(): List = statusReasons.getRequired("status_reasons") /** - * rovides the status reasons that will be satisfied by providing one of the valid documents. + * A list of valid documents that will satisfy the KYC requirements for the specified entity. */ - fun statusReasons(): List = statusReasons.getRequired("status_reasons") + fun validDocuments(): List = validDocuments.getRequired("valid_documents") /** Globally unique identifier for an entity. */ @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken /** - * A list of valid documents that will satisfy the KYC requirements for the specified entity. + * rovides the status reasons that will be satisfied by providing one of the valid documents. */ - @JsonProperty("valid_documents") @ExcludeMissing fun _validDocuments() = validDocuments + @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons /** - * rovides the status reasons that will be satisfied by providing one of the valid documents. + * A list of valid documents that will satisfy the KYC requirements for the specified entity. */ - @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons + @JsonProperty("valid_documents") @ExcludeMissing fun _validDocuments() = validDocuments @JsonAnyGetter @ExcludeMissing @@ -66,8 +66,8 @@ private constructor( fun validate(): RequiredDocument = apply { if (!validated) { entityToken() - validDocuments() statusReasons() + validDocuments() validated = true } } @@ -82,14 +82,14 @@ private constructor( class Builder { private var entityToken: JsonField = JsonMissing.of() - private var validDocuments: JsonField> = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() + private var validDocuments: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(requiredDocument: RequiredDocument) = apply { entityToken = requiredDocument.entityToken - validDocuments = requiredDocument.validDocuments statusReasons = requiredDocument.statusReasons + validDocuments = requiredDocument.validDocuments additionalProperties = requiredDocument.additionalProperties.toMutableMap() } @@ -99,6 +99,20 @@ private constructor( /** Globally unique identifier for an entity. */ fun entityToken(entityToken: JsonField) = apply { this.entityToken = entityToken } + /** + * rovides the status reasons that will be satisfied by providing one of the valid + * documents. + */ + fun statusReasons(statusReasons: List) = statusReasons(JsonField.of(statusReasons)) + + /** + * rovides the status reasons that will be satisfied by providing one of the valid + * documents. + */ + fun statusReasons(statusReasons: JsonField>) = apply { + this.statusReasons = statusReasons + } + /** * A list of valid documents that will satisfy the KYC requirements for the specified * entity. @@ -114,20 +128,6 @@ private constructor( this.validDocuments = validDocuments } - /** - * rovides the status reasons that will be satisfied by providing one of the valid - * documents. - */ - fun statusReasons(statusReasons: List) = statusReasons(JsonField.of(statusReasons)) - - /** - * rovides the status reasons that will be satisfied by providing one of the valid - * documents. - */ - fun statusReasons(statusReasons: JsonField>) = apply { - this.statusReasons = statusReasons - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -150,8 +150,8 @@ private constructor( fun build(): RequiredDocument = RequiredDocument( entityToken, - validDocuments.map { it.toImmutable() }, statusReasons.map { it.toImmutable() }, + validDocuments.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -161,15 +161,15 @@ private constructor( return true } - return /* spotless:off */ other is RequiredDocument && entityToken == other.entityToken && validDocuments == other.validDocuments && statusReasons == other.statusReasons && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is RequiredDocument && entityToken == other.entityToken && statusReasons == other.statusReasons && validDocuments == other.validDocuments && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(entityToken, validDocuments, statusReasons, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(entityToken, statusReasons, validDocuments, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "RequiredDocument{entityToken=$entityToken, validDocuments=$validDocuments, statusReasons=$statusReasons, additionalProperties=$additionalProperties}" + "RequiredDocument{entityToken=$entityToken, statusReasons=$statusReasons, validDocuments=$validDocuments, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt index def76946..cf2e2f19 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/SettlementDetail.kt @@ -22,6 +22,7 @@ import java.util.Objects class SettlementDetail @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), @@ -43,9 +44,6 @@ private constructor( @JsonProperty("event_tokens") @ExcludeMissing private val eventTokens: JsonField> = JsonMissing.of(), - @JsonProperty("fee_description") - @ExcludeMissing - private val feeDescription: JsonField = JsonMissing.of(), @JsonProperty("institution") @ExcludeMissing private val institution: JsonField = JsonMissing.of(), @@ -70,7 +68,6 @@ private constructor( @JsonProperty("settlement_date") @ExcludeMissing private val settlementDate: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("transaction_token") @ExcludeMissing private val transactionToken: JsonField = JsonMissing.of(), @@ -81,9 +78,15 @@ private constructor( @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), + @JsonProperty("fee_description") + @ExcludeMissing + private val feeDescription: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** 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 accountToken(): String = accountToken.getRequired("account_token") @@ -108,9 +111,6 @@ private constructor( /** Globally unique identifiers denoting the Events associated with this settlement. */ fun eventTokens(): List = eventTokens.getRequired("event_tokens") - /** Network's description of a fee, only present on records with type `FEE`. */ - fun feeDescription(): String? = feeDescription.getNullable("fee_description") - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ fun institution(): String = institution.getRequired("institution") @@ -137,9 +137,6 @@ private constructor( /** Date of when money movement is triggered for the transaction. */ fun settlementDate(): String = settlementDate.getRequired("settlement_date") - /** Globally unique identifier denoting the Settlement Detail. */ - fun token(): String = token.getRequired("token") - /** Globally unique identifier denoting the associated Transaction object. */ fun transactionToken(): String = transactionToken.getRequired("transaction_token") @@ -156,6 +153,12 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") + /** Network's description of a fee, only present on records with type `FEE`. */ + fun feeDescription(): String? = feeDescription.getNullable("fee_description") + + /** 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("account_token") @ExcludeMissing fun _accountToken() = accountToken @@ -182,9 +185,6 @@ private constructor( /** Globally unique identifiers denoting the Events associated with this settlement. */ @JsonProperty("event_tokens") @ExcludeMissing fun _eventTokens() = eventTokens - /** Network's description of a fee, only present on records with type `FEE`. */ - @JsonProperty("fee_description") @ExcludeMissing fun _feeDescription() = feeDescription - /** The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ @JsonProperty("institution") @ExcludeMissing fun _institution() = institution @@ -215,9 +215,6 @@ private constructor( /** Date of when money movement is triggered for the transaction. */ @JsonProperty("settlement_date") @ExcludeMissing fun _settlementDate() = settlementDate - /** 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 @@ -235,6 +232,9 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + /** Network's description of a fee, only present on records with type `FEE`. */ + @JsonProperty("fee_description") @ExcludeMissing fun _feeDescription() = feeDescription + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -243,6 +243,7 @@ private constructor( fun validate(): SettlementDetail = apply { if (!validated) { + token() accountToken() cardProgramToken() cardToken() @@ -250,7 +251,6 @@ private constructor( currency() disputesGrossAmount() eventTokens() - feeDescription() institution() interchangeFeeExtendedPrecision() interchangeGrossAmount() @@ -259,11 +259,11 @@ private constructor( otherFeesGrossAmount() reportDate() settlementDate() - token() transactionToken() transactionsGrossAmount() type() updated() + feeDescription() validated = true } } @@ -277,6 +277,7 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() private var cardProgramToken: JsonField = JsonMissing.of() private var cardToken: JsonField = JsonMissing.of() @@ -284,7 +285,6 @@ private constructor( private var currency: JsonField = JsonMissing.of() private var disputesGrossAmount: JsonField = JsonMissing.of() private var eventTokens: JsonField> = JsonMissing.of() - private var feeDescription: JsonField = JsonMissing.of() private var institution: JsonField = JsonMissing.of() private var interchangeFeeExtendedPrecision: JsonField = JsonMissing.of() private var interchangeGrossAmount: JsonField = JsonMissing.of() @@ -293,14 +293,15 @@ private constructor( 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 type: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() + private var feeDescription: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(settlementDetail: SettlementDetail) = apply { + token = settlementDetail.token accountToken = settlementDetail.accountToken cardProgramToken = settlementDetail.cardProgramToken cardToken = settlementDetail.cardToken @@ -308,7 +309,6 @@ private constructor( currency = settlementDetail.currency disputesGrossAmount = settlementDetail.disputesGrossAmount eventTokens = settlementDetail.eventTokens - feeDescription = settlementDetail.feeDescription institution = settlementDetail.institution interchangeFeeExtendedPrecision = settlementDetail.interchangeFeeExtendedPrecision interchangeGrossAmount = settlementDetail.interchangeGrossAmount @@ -317,14 +317,20 @@ private constructor( otherFeesGrossAmount = settlementDetail.otherFeesGrossAmount reportDate = settlementDetail.reportDate settlementDate = settlementDetail.settlementDate - token = settlementDetail.token transactionToken = settlementDetail.transactionToken transactionsGrossAmount = settlementDetail.transactionsGrossAmount type = settlementDetail.type updated = settlementDetail.updated + feeDescription = settlementDetail.feeDescription additionalProperties = settlementDetail.additionalProperties.toMutableMap() } + /** Globally unique identifier denoting the Settlement Detail. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier denoting the Settlement Detail. */ + fun token(token: JsonField) = apply { this.token = token } + /** * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ @@ -391,14 +397,6 @@ private constructor( this.eventTokens = eventTokens } - /** Network's description of a fee, only present on records with type `FEE`. */ - fun feeDescription(feeDescription: String) = feeDescription(JsonField.of(feeDescription)) - - /** Network's description of a fee, only present on records with type `FEE`. */ - fun feeDescription(feeDescription: JsonField) = apply { - this.feeDescription = feeDescription - } - /** * The most granular ID the network settles with (e.g., ICA for Mastercard, FTSRE for Visa). */ @@ -466,12 +464,6 @@ private constructor( this.settlementDate = settlementDate } - /** Globally unique identifier denoting the Settlement Detail. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier denoting the Settlement Detail. */ - fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier denoting the associated Transaction object. */ fun transactionToken(transactionToken: String) = transactionToken(JsonField.of(transactionToken)) @@ -508,6 +500,14 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ fun updated(updated: JsonField) = apply { this.updated = updated } + /** Network's description of a fee, only present on records with type `FEE`. */ + fun feeDescription(feeDescription: String) = feeDescription(JsonField.of(feeDescription)) + + /** Network's description of a fee, only present on records with type `FEE`. */ + fun feeDescription(feeDescription: JsonField) = apply { + this.feeDescription = feeDescription + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -529,6 +529,7 @@ private constructor( fun build(): SettlementDetail = SettlementDetail( + token, accountToken, cardProgramToken, cardToken, @@ -536,7 +537,6 @@ private constructor( currency, disputesGrossAmount, eventTokens.map { it.toImmutable() }, - feeDescription, institution, interchangeFeeExtendedPrecision, interchangeGrossAmount, @@ -545,11 +545,11 @@ private constructor( otherFeesGrossAmount, reportDate, settlementDate, - token, transactionToken, transactionsGrossAmount, type, updated, + feeDescription, additionalProperties.toImmutable(), ) } @@ -822,15 +822,15 @@ private constructor( return true } - return /* spotless:off */ other is SettlementDetail && accountToken == other.accountToken && cardProgramToken == other.cardProgramToken && cardToken == other.cardToken && created == other.created && currency == other.currency && disputesGrossAmount == other.disputesGrossAmount && eventTokens == other.eventTokens && feeDescription == other.feeDescription && institution == other.institution && interchangeFeeExtendedPrecision == other.interchangeFeeExtendedPrecision && interchangeGrossAmount == other.interchangeGrossAmount && network == other.network && otherFeesDetails == other.otherFeesDetails && otherFeesGrossAmount == other.otherFeesGrossAmount && reportDate == other.reportDate && settlementDate == other.settlementDate && token == other.token && transactionToken == other.transactionToken && transactionsGrossAmount == other.transactionsGrossAmount && type == other.type && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is SettlementDetail && token == other.token && accountToken == other.accountToken && cardProgramToken == other.cardProgramToken && cardToken == other.cardToken && created == other.created && currency == other.currency && disputesGrossAmount == other.disputesGrossAmount && eventTokens == other.eventTokens && institution == other.institution && interchangeFeeExtendedPrecision == other.interchangeFeeExtendedPrecision && interchangeGrossAmount == other.interchangeGrossAmount && network == other.network && otherFeesDetails == other.otherFeesDetails && otherFeesGrossAmount == other.otherFeesGrossAmount && reportDate == other.reportDate && settlementDate == other.settlementDate && transactionToken == other.transactionToken && transactionsGrossAmount == other.transactionsGrossAmount && type == other.type && updated == other.updated && feeDescription == other.feeDescription && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, cardProgramToken, cardToken, created, currency, disputesGrossAmount, eventTokens, feeDescription, institution, interchangeFeeExtendedPrecision, interchangeGrossAmount, network, otherFeesDetails, otherFeesGrossAmount, reportDate, settlementDate, token, transactionToken, transactionsGrossAmount, type, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, cardProgramToken, cardToken, created, currency, disputesGrossAmount, eventTokens, institution, interchangeFeeExtendedPrecision, interchangeGrossAmount, network, otherFeesDetails, otherFeesGrossAmount, reportDate, settlementDate, transactionToken, transactionsGrossAmount, type, updated, feeDescription, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "SettlementDetail{accountToken=$accountToken, cardProgramToken=$cardProgramToken, cardToken=$cardToken, created=$created, currency=$currency, disputesGrossAmount=$disputesGrossAmount, eventTokens=$eventTokens, feeDescription=$feeDescription, institution=$institution, interchangeFeeExtendedPrecision=$interchangeFeeExtendedPrecision, interchangeGrossAmount=$interchangeGrossAmount, network=$network, otherFeesDetails=$otherFeesDetails, otherFeesGrossAmount=$otherFeesGrossAmount, reportDate=$reportDate, settlementDate=$settlementDate, token=$token, transactionToken=$transactionToken, transactionsGrossAmount=$transactionsGrossAmount, type=$type, updated=$updated, additionalProperties=$additionalProperties}" + "SettlementDetail{token=$token, accountToken=$accountToken, cardProgramToken=$cardProgramToken, cardToken=$cardToken, created=$created, currency=$currency, disputesGrossAmount=$disputesGrossAmount, eventTokens=$eventTokens, institution=$institution, interchangeFeeExtendedPrecision=$interchangeFeeExtendedPrecision, interchangeGrossAmount=$interchangeGrossAmount, network=$network, otherFeesDetails=$otherFeesDetails, otherFeesGrossAmount=$otherFeesGrossAmount, reportDate=$reportDate, settlementDate=$settlementDate, transactionToken=$transactionToken, transactionsGrossAmount=$transactionsGrossAmount, type=$type, updated=$updated, feeDescription=$feeDescription, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt index 6a2b1cf4..1f10826b 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ShippingAddress.kt @@ -22,51 +22,42 @@ private constructor( @JsonProperty("address1") @ExcludeMissing private val address1: JsonField = JsonMissing.of(), - @JsonProperty("address2") - @ExcludeMissing - private val address2: JsonField = JsonMissing.of(), @JsonProperty("city") @ExcludeMissing private val city: JsonField = JsonMissing.of(), @JsonProperty("country") @ExcludeMissing private val country: JsonField = JsonMissing.of(), - @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), @JsonProperty("first_name") @ExcludeMissing private val firstName: JsonField = JsonMissing.of(), @JsonProperty("last_name") @ExcludeMissing private val lastName: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + private val postalCode: JsonField = JsonMissing.of(), + @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), + @JsonProperty("address2") + @ExcludeMissing + private val address2: JsonField = JsonMissing.of(), + @JsonProperty("email") @ExcludeMissing private val email: JsonField = JsonMissing.of(), @JsonProperty("line2_text") @ExcludeMissing private val line2Text: JsonField = JsonMissing.of(), @JsonProperty("phone_number") @ExcludeMissing private val phoneNumber: JsonField = JsonMissing.of(), - @JsonProperty("postal_code") - @ExcludeMissing - private val postalCode: JsonField = JsonMissing.of(), - @JsonProperty("state") @ExcludeMissing private val state: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Valid USPS routable address. */ fun address1(): String = address1.getRequired("address1") - /** Unit number (if applicable). */ - fun address2(): String? = 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(): String? = email.getNullable("email") - /** * Customer's first name. This will be the first name printed on the physical card. The combined * length of `first_name` and `last_name` may not exceed 25 characters. @@ -79,18 +70,6 @@ private constructor( */ fun lastName(): String = lastName.getRequired("last_name") - /** - * Text to be printed on line two of the physical card. Use of this field requires additional - * permissions. - */ - fun line2Text(): String? = line2Text.getNullable("line2_text") - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. - */ - fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") - /** * Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit * postal code (ZIP+4) using the format 12345-1234. @@ -103,24 +82,36 @@ private constructor( */ fun state(): String = state.getRequired("state") + /** Unit number (if applicable). */ + fun address2(): String? = address2.getNullable("address2") + + /** + * Email address to be contacted for expedited shipping process purposes. Required if + * `shipping_method` is `EXPEDITED`. + */ + fun email(): String? = email.getNullable("email") + + /** + * Text to be printed on line two of the physical card. Use of this field requires additional + * permissions. + */ + fun line2Text(): String? = line2Text.getNullable("line2_text") + + /** + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. + */ + fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") + /** 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. */ @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 - /** * Customer's first name. This will be the first name printed on the physical card. The combined * length of `first_name` and `last_name` may not exceed 25 characters. @@ -133,18 +124,6 @@ private constructor( */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName - /** - * Text to be printed on line two of the physical card. Use of this field requires additional - * permissions. - */ - @JsonProperty("line2_text") @ExcludeMissing fun _line2Text() = line2Text - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. - */ - @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber - /** * Postal code (formerly zipcode). For US addresses, either five-digit postal code or nine-digit * postal code (ZIP+4) using the format 12345-1234. @@ -157,6 +136,27 @@ private constructor( */ @JsonProperty("state") @ExcludeMissing fun _state() = state + /** Unit number (if applicable). */ + @JsonProperty("address2") @ExcludeMissing fun _address2() = address2 + + /** + * Email address to be contacted for expedited shipping process purposes. Required if + * `shipping_method` is `EXPEDITED`. + */ + @JsonProperty("email") @ExcludeMissing fun _email() = email + + /** + * Text to be printed on line two of the physical card. Use of this field requires additional + * permissions. + */ + @JsonProperty("line2_text") @ExcludeMissing fun _line2Text() = line2Text + + /** + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. + */ + @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -166,16 +166,16 @@ private constructor( fun validate(): ShippingAddress = apply { if (!validated) { address1() - address2() city() country() - email() firstName() lastName() - line2Text() - phoneNumber() postalCode() state() + address2() + email() + line2Text() + phoneNumber() validated = true } } @@ -190,30 +190,30 @@ private constructor( class Builder { private var address1: JsonField = JsonMissing.of() - private var address2: JsonField = JsonMissing.of() private var city: 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 address2: JsonField = JsonMissing.of() + private var email: JsonField = JsonMissing.of() + private var line2Text: JsonField = JsonMissing.of() + private var phoneNumber: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(shippingAddress: ShippingAddress) = apply { address1 = shippingAddress.address1 - address2 = shippingAddress.address2 city = shippingAddress.city country = shippingAddress.country - email = shippingAddress.email firstName = shippingAddress.firstName lastName = shippingAddress.lastName - line2Text = shippingAddress.line2Text - phoneNumber = shippingAddress.phoneNumber postalCode = shippingAddress.postalCode state = shippingAddress.state + address2 = shippingAddress.address2 + email = shippingAddress.email + line2Text = shippingAddress.line2Text + phoneNumber = shippingAddress.phoneNumber additionalProperties = shippingAddress.additionalProperties.toMutableMap() } @@ -223,12 +223,6 @@ private constructor( /** Valid USPS routable address. */ fun address1(address1: JsonField) = apply { this.address1 = address1 } - /** Unit number (if applicable). */ - fun address2(address2: String) = address2(JsonField.of(address2)) - - /** Unit number (if applicable). */ - fun address2(address2: JsonField) = apply { this.address2 = address2 } - /** City */ fun city(city: String) = city(JsonField.of(city)) @@ -241,18 +235,6 @@ private constructor( /** Uppercase ISO 3166-1 alpha-3 three character abbreviation. */ 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`. - */ - fun email(email: JsonField) = apply { this.email = email } - /** * Customer's first name. This will be the first name printed on the physical card. The * combined length of `first_name` and `last_name` may not exceed 25 characters. @@ -277,30 +259,6 @@ private constructor( */ fun lastName(lastName: JsonField) = apply { this.lastName = lastName } - /** - * Text to be printed on line two of the physical card. Use of this field requires - * additional permissions. - */ - fun line2Text(line2Text: String) = line2Text(JsonField.of(line2Text)) - - /** - * Text to be printed on line two of the physical card. Use of this field requires - * additional permissions. - */ - fun line2Text(line2Text: JsonField) = apply { this.line2Text = line2Text } - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. - */ - fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) - - /** - * Cardholder's phone number in E.164 format to be contacted for expedited shipping process - * purposes. Required if `shipping_method` is `EXPEDITED`. - */ - fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } - /** * Postal code (formerly zipcode). For US addresses, either five-digit postal code or * nine-digit postal code (ZIP+4) using the format 12345-1234. @@ -325,6 +283,48 @@ private constructor( */ fun state(state: JsonField) = apply { this.state = state } + /** Unit number (if applicable). */ + fun address2(address2: String) = address2(JsonField.of(address2)) + + /** Unit number (if applicable). */ + fun address2(address2: JsonField) = apply { this.address2 = address2 } + + /** + * 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`. + */ + fun email(email: JsonField) = apply { this.email = email } + + /** + * Text to be printed on line two of the physical card. Use of this field requires + * additional permissions. + */ + fun line2Text(line2Text: String) = line2Text(JsonField.of(line2Text)) + + /** + * Text to be printed on line two of the physical card. Use of this field requires + * additional permissions. + */ + fun line2Text(line2Text: JsonField) = apply { this.line2Text = line2Text } + + /** + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. + */ + fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) + + /** + * Cardholder's phone number in E.164 format to be contacted for expedited shipping process + * purposes. Required if `shipping_method` is `EXPEDITED`. + */ + fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -347,16 +347,16 @@ private constructor( fun build(): ShippingAddress = ShippingAddress( address1, - address2, city, country, - email, firstName, lastName, - line2Text, - phoneNumber, postalCode, state, + address2, + email, + line2Text, + phoneNumber, additionalProperties.toImmutable(), ) } @@ -366,15 +366,15 @@ private constructor( return true } - return /* spotless:off */ other is ShippingAddress && address1 == other.address1 && address2 == other.address2 && city == other.city && country == other.country && email == other.email && firstName == other.firstName && lastName == other.lastName && line2Text == other.line2Text && phoneNumber == other.phoneNumber && postalCode == other.postalCode && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is ShippingAddress && address1 == other.address1 && city == other.city && country == other.country && firstName == other.firstName && lastName == other.lastName && postalCode == other.postalCode && state == other.state && address2 == other.address2 && email == other.email && line2Text == other.line2Text && phoneNumber == other.phoneNumber && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(address1, address2, city, country, email, firstName, lastName, line2Text, phoneNumber, postalCode, state, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(address1, city, country, firstName, lastName, postalCode, state, address2, email, line2Text, phoneNumber, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "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}" + "ShippingAddress{address1=$address1, city=$city, country=$country, firstName=$firstName, lastName=$lastName, postalCode=$postalCode, state=$state, address2=$address2, email=$email, line2Text=$line2Text, phoneNumber=$phoneNumber, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Statement.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Statement.kt index ffce2cfb..c1dc4dbc 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Statement.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Statement.kt @@ -24,103 +24,90 @@ class Statement @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") - @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("statement_start_date") - @ExcludeMissing - private val statementStartDate: JsonField = JsonMissing.of(), - @JsonProperty("statement_end_date") - @ExcludeMissing - private val statementEndDate: JsonField = JsonMissing.of(), - @JsonProperty("next_statement_end_date") + @JsonProperty("account_standing") @ExcludeMissing - private val nextStatementEndDate: JsonField = JsonMissing.of(), - @JsonProperty("payment_due_date") + private val accountStanding: JsonField = JsonMissing.of(), + @JsonProperty("amount_due") @ExcludeMissing - private val paymentDueDate: JsonField = JsonMissing.of(), - @JsonProperty("next_payment_due_date") + private val amountDue: JsonField = JsonMissing.of(), + @JsonProperty("available_credit") @ExcludeMissing - private val nextPaymentDueDate: JsonField = JsonMissing.of(), - @JsonProperty("days_in_billing_cycle") + private val availableCredit: JsonField = JsonMissing.of(), + @JsonProperty("created") @ExcludeMissing - private val daysInBillingCycle: JsonField = JsonMissing.of(), + private val created: JsonField = JsonMissing.of(), @JsonProperty("credit_limit") @ExcludeMissing private val creditLimit: JsonField = JsonMissing.of(), - @JsonProperty("available_credit") + @JsonProperty("credit_product_token") @ExcludeMissing - private val availableCredit: JsonField = JsonMissing.of(), - @JsonProperty("starting_balance") + private val creditProductToken: JsonField = JsonMissing.of(), + @JsonProperty("days_in_billing_cycle") @ExcludeMissing - private val startingBalance: JsonField = JsonMissing.of(), + private val daysInBillingCycle: JsonField = JsonMissing.of(), @JsonProperty("ending_balance") @ExcludeMissing private val endingBalance: JsonField = JsonMissing.of(), + @JsonProperty("financial_account_token") + @ExcludeMissing + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("payment_due_date") + @ExcludeMissing + private val paymentDueDate: JsonField = JsonMissing.of(), @JsonProperty("period_totals") @ExcludeMissing private val periodTotals: JsonField = JsonMissing.of(), - @JsonProperty("ytd_totals") + @JsonProperty("starting_balance") @ExcludeMissing - private val ytdTotals: JsonField = JsonMissing.of(), - @JsonProperty("created") + private val startingBalance: JsonField = JsonMissing.of(), + @JsonProperty("statement_end_date") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), - @JsonProperty("updated") + private val statementEndDate: JsonField = JsonMissing.of(), + @JsonProperty("statement_start_date") @ExcludeMissing - private val updated: JsonField = JsonMissing.of(), - @JsonProperty("credit_product_token") + private val statementStartDate: JsonField = JsonMissing.of(), + @JsonProperty("statement_type") @ExcludeMissing - private val creditProductToken: JsonField = JsonMissing.of(), - @JsonProperty("account_standing") + private val statementType: JsonField = JsonMissing.of(), + @JsonProperty("updated") @ExcludeMissing - private val accountStanding: JsonField = JsonMissing.of(), - @JsonProperty("amount_due") + private val updated: JsonField = JsonMissing.of(), + @JsonProperty("ytd_totals") @ExcludeMissing - private val amountDue: JsonField = JsonMissing.of(), + private val ytdTotals: JsonField = JsonMissing.of(), @JsonProperty("interest_details") @ExcludeMissing private val interestDetails: JsonField = JsonMissing.of(), - @JsonProperty("statement_type") + @JsonProperty("next_payment_due_date") @ExcludeMissing - private val statementType: JsonField = JsonMissing.of(), + private val nextPaymentDueDate: JsonField = JsonMissing.of(), + @JsonProperty("next_statement_end_date") + @ExcludeMissing + private val nextStatementEndDate: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Globally unique identifier for a statement */ fun token(): String = token.getRequired("token") - /** Globally unique identifier for a financial account */ - fun financialAccountToken(): String = - financialAccountToken.getRequired("financial_account_token") - - /** Date when the billing period began */ - fun statementStartDate(): LocalDate = statementStartDate.getRequired("statement_start_date") - - /** Date when the billing period ended */ - fun statementEndDate(): LocalDate = statementEndDate.getRequired("statement_end_date") - - /** Date when the next billing period will end */ - fun nextStatementEndDate(): LocalDate? = - nextStatementEndDate.getNullable("next_statement_end_date") + fun accountStanding(): AccountStanding = accountStanding.getRequired("account_standing") - /** Date when the payment is due */ - fun paymentDueDate(): LocalDate = paymentDueDate.getRequired("payment_due_date") + fun amountDue(): AmountDue = amountDue.getRequired("amount_due") - /** Date when the next payment is due */ - fun nextPaymentDueDate(): LocalDate? = nextPaymentDueDate.getNullable("next_payment_due_date") + /** Amount of credit available to spend in cents */ + fun availableCredit(): Long = availableCredit.getRequired("available_credit") - /** Number of days in the billing cycle */ - fun daysInBillingCycle(): Long = daysInBillingCycle.getRequired("days_in_billing_cycle") + /** Timestamp of when the statement was created */ + fun created(): OffsetDateTime = created.getRequired("created") /** This is the maximum credit balance extended by the lender in cents */ fun creditLimit(): Long = creditLimit.getRequired("credit_limit") - /** Amount of credit available to spend in cents */ - fun availableCredit(): Long = availableCredit.getRequired("available_credit") + /** Globally unique identifier for a credit product */ + fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") - /** Balance at the start of the billing period */ - fun startingBalance(): Long = startingBalance.getRequired("starting_balance") + /** Number of days in the billing cycle */ + fun daysInBillingCycle(): Long = daysInBillingCycle.getRequired("days_in_billing_cycle") /** * Balance at the end of the billing period. For charge cards, this should be the same at the @@ -128,98 +115,111 @@ private constructor( */ fun endingBalance(): Long = endingBalance.getRequired("ending_balance") + /** Globally unique identifier for a financial account */ + fun financialAccountToken(): String = + financialAccountToken.getRequired("financial_account_token") + + /** Date when the payment is due */ + fun paymentDueDate(): LocalDate = paymentDueDate.getRequired("payment_due_date") + fun periodTotals(): StatementTotals = periodTotals.getRequired("period_totals") - fun ytdTotals(): StatementTotals = ytdTotals.getRequired("ytd_totals") + /** Balance at the start of the billing period */ + fun startingBalance(): Long = startingBalance.getRequired("starting_balance") - /** Timestamp of when the statement was created */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Date when the billing period ended */ + fun statementEndDate(): LocalDate = statementEndDate.getRequired("statement_end_date") - /** Timestamp of when the statement was updated */ - fun updated(): OffsetDateTime = updated.getRequired("updated") + /** Date when the billing period began */ + fun statementStartDate(): LocalDate = statementStartDate.getRequired("statement_start_date") - /** Globally unique identifier for a credit product */ - fun creditProductToken(): String = creditProductToken.getRequired("credit_product_token") + fun statementType(): StatementType = statementType.getRequired("statement_type") - fun accountStanding(): AccountStanding = accountStanding.getRequired("account_standing") + /** Timestamp of when the statement was updated */ + fun updated(): OffsetDateTime = updated.getRequired("updated") - fun amountDue(): AmountDue = amountDue.getRequired("amount_due") + fun ytdTotals(): StatementTotals = ytdTotals.getRequired("ytd_totals") fun interestDetails(): InterestDetails? = interestDetails.getNullable("interest_details") - fun statementType(): StatementType = statementType.getRequired("statement_type") + /** Date when the next payment is due */ + fun nextPaymentDueDate(): LocalDate? = nextPaymentDueDate.getNullable("next_payment_due_date") + + /** Date when the next billing period will end */ + fun nextStatementEndDate(): LocalDate? = + nextStatementEndDate.getNullable("next_statement_end_date") /** Globally unique identifier for a statement */ @JsonProperty("token") @ExcludeMissing fun _token() = token - /** Globally unique identifier for a financial account */ - @JsonProperty("financial_account_token") - @ExcludeMissing - fun _financialAccountToken() = financialAccountToken + @JsonProperty("account_standing") @ExcludeMissing fun _accountStanding() = accountStanding - /** Date when the billing period began */ - @JsonProperty("statement_start_date") - @ExcludeMissing - fun _statementStartDate() = statementStartDate + @JsonProperty("amount_due") @ExcludeMissing fun _amountDue() = amountDue - /** Date when the billing period ended */ - @JsonProperty("statement_end_date") @ExcludeMissing fun _statementEndDate() = statementEndDate + /** Amount of credit available to spend in cents */ + @JsonProperty("available_credit") @ExcludeMissing fun _availableCredit() = availableCredit - /** Date when the next billing period will end */ - @JsonProperty("next_statement_end_date") - @ExcludeMissing - fun _nextStatementEndDate() = nextStatementEndDate + /** Timestamp of when the statement was created */ + @JsonProperty("created") @ExcludeMissing fun _created() = created - /** Date when the payment is due */ - @JsonProperty("payment_due_date") @ExcludeMissing fun _paymentDueDate() = paymentDueDate + /** This is the maximum credit balance extended by the lender in cents */ + @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit - /** Date when the next payment is due */ - @JsonProperty("next_payment_due_date") + /** Globally unique identifier for a credit product */ + @JsonProperty("credit_product_token") @ExcludeMissing - fun _nextPaymentDueDate() = nextPaymentDueDate + fun _creditProductToken() = creditProductToken /** Number of days in the billing cycle */ @JsonProperty("days_in_billing_cycle") @ExcludeMissing fun _daysInBillingCycle() = daysInBillingCycle - /** This is the maximum credit balance extended by the lender in cents */ - @JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit - - /** Amount of credit available to spend in cents */ - @JsonProperty("available_credit") @ExcludeMissing fun _availableCredit() = availableCredit - - /** Balance at the start of the billing period */ - @JsonProperty("starting_balance") @ExcludeMissing fun _startingBalance() = startingBalance - /** * Balance at the end of the billing period. For charge cards, this should be the same at the * statement amount due in cents */ @JsonProperty("ending_balance") @ExcludeMissing fun _endingBalance() = endingBalance - @JsonProperty("period_totals") @ExcludeMissing fun _periodTotals() = periodTotals + /** Globally unique identifier for a financial account */ + @JsonProperty("financial_account_token") + @ExcludeMissing + fun _financialAccountToken() = financialAccountToken - @JsonProperty("ytd_totals") @ExcludeMissing fun _ytdTotals() = ytdTotals + /** Date when the payment is due */ + @JsonProperty("payment_due_date") @ExcludeMissing fun _paymentDueDate() = paymentDueDate - /** Timestamp of when the statement was created */ - @JsonProperty("created") @ExcludeMissing fun _created() = created + @JsonProperty("period_totals") @ExcludeMissing fun _periodTotals() = periodTotals - /** Timestamp of when the statement was updated */ - @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + /** Balance at the start of the billing period */ + @JsonProperty("starting_balance") @ExcludeMissing fun _startingBalance() = startingBalance - /** Globally unique identifier for a credit product */ - @JsonProperty("credit_product_token") + /** Date when the billing period ended */ + @JsonProperty("statement_end_date") @ExcludeMissing fun _statementEndDate() = statementEndDate + + /** Date when the billing period began */ + @JsonProperty("statement_start_date") @ExcludeMissing - fun _creditProductToken() = creditProductToken + fun _statementStartDate() = statementStartDate - @JsonProperty("account_standing") @ExcludeMissing fun _accountStanding() = accountStanding + @JsonProperty("statement_type") @ExcludeMissing fun _statementType() = statementType - @JsonProperty("amount_due") @ExcludeMissing fun _amountDue() = amountDue + /** Timestamp of when the statement was updated */ + @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + + @JsonProperty("ytd_totals") @ExcludeMissing fun _ytdTotals() = ytdTotals @JsonProperty("interest_details") @ExcludeMissing fun _interestDetails() = interestDetails - @JsonProperty("statement_type") @ExcludeMissing fun _statementType() = statementType + /** Date when the next payment is due */ + @JsonProperty("next_payment_due_date") + @ExcludeMissing + fun _nextPaymentDueDate() = nextPaymentDueDate + + /** Date when the next billing period will end */ + @JsonProperty("next_statement_end_date") + @ExcludeMissing + fun _nextStatementEndDate() = nextStatementEndDate @JsonAnyGetter @ExcludeMissing @@ -230,26 +230,26 @@ private constructor( fun validate(): Statement = apply { if (!validated) { token() - financialAccountToken() - statementStartDate() - statementEndDate() - nextStatementEndDate() - paymentDueDate() - nextPaymentDueDate() - daysInBillingCycle() - creditLimit() + accountStanding().validate() + amountDue().validate() availableCredit() - startingBalance() + created() + creditLimit() + creditProductToken() + daysInBillingCycle() endingBalance() + financialAccountToken() + paymentDueDate() periodTotals().validate() - ytdTotals().validate() - created() + startingBalance() + statementEndDate() + statementStartDate() + statementType() updated() - creditProductToken() - accountStanding().validate() - amountDue().validate() + ytdTotals().validate() interestDetails()?.validate() - statementType() + nextPaymentDueDate() + nextStatementEndDate() validated = true } } @@ -264,50 +264,50 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var statementStartDate: JsonField = JsonMissing.of() - private var statementEndDate: JsonField = JsonMissing.of() - private var nextStatementEndDate: JsonField = JsonMissing.of() - private var paymentDueDate: JsonField = JsonMissing.of() - private var nextPaymentDueDate: JsonField = JsonMissing.of() - private var daysInBillingCycle: JsonField = JsonMissing.of() - private var creditLimit: JsonField = JsonMissing.of() + private var accountStanding: JsonField = JsonMissing.of() + private var amountDue: JsonField = JsonMissing.of() private var availableCredit: JsonField = JsonMissing.of() - private var startingBalance: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var creditLimit: JsonField = JsonMissing.of() + private var creditProductToken: JsonField = JsonMissing.of() + private var daysInBillingCycle: JsonField = JsonMissing.of() private var endingBalance: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var paymentDueDate: JsonField = JsonMissing.of() private var periodTotals: JsonField = JsonMissing.of() - private var ytdTotals: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() + private var startingBalance: JsonField = JsonMissing.of() + private var statementEndDate: JsonField = JsonMissing.of() + private var statementStartDate: JsonField = JsonMissing.of() + private var statementType: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() - private var creditProductToken: JsonField = JsonMissing.of() - private var accountStanding: JsonField = JsonMissing.of() - private var amountDue: JsonField = JsonMissing.of() + private var ytdTotals: JsonField = JsonMissing.of() private var interestDetails: JsonField = JsonMissing.of() - private var statementType: JsonField = JsonMissing.of() + private var nextPaymentDueDate: JsonField = JsonMissing.of() + private var nextStatementEndDate: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(statement: Statement) = apply { token = statement.token - financialAccountToken = statement.financialAccountToken - statementStartDate = statement.statementStartDate - statementEndDate = statement.statementEndDate - nextStatementEndDate = statement.nextStatementEndDate - paymentDueDate = statement.paymentDueDate - nextPaymentDueDate = statement.nextPaymentDueDate - daysInBillingCycle = statement.daysInBillingCycle - creditLimit = statement.creditLimit + accountStanding = statement.accountStanding + amountDue = statement.amountDue availableCredit = statement.availableCredit - startingBalance = statement.startingBalance + created = statement.created + creditLimit = statement.creditLimit + creditProductToken = statement.creditProductToken + daysInBillingCycle = statement.daysInBillingCycle endingBalance = statement.endingBalance + financialAccountToken = statement.financialAccountToken + paymentDueDate = statement.paymentDueDate periodTotals = statement.periodTotals - ytdTotals = statement.ytdTotals - created = statement.created + startingBalance = statement.startingBalance + statementEndDate = statement.statementEndDate + statementStartDate = statement.statementStartDate + statementType = statement.statementType updated = statement.updated - creditProductToken = statement.creditProductToken - accountStanding = statement.accountStanding - amountDue = statement.amountDue + ytdTotals = statement.ytdTotals interestDetails = statement.interestDetails - statementType = statement.statementType + nextPaymentDueDate = statement.nextPaymentDueDate + nextStatementEndDate = statement.nextStatementEndDate additionalProperties = statement.additionalProperties.toMutableMap() } @@ -317,57 +317,44 @@ private constructor( /** Globally unique identifier for a statement */ fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) + fun accountStanding(accountStanding: AccountStanding) = + accountStanding(JsonField.of(accountStanding)) - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken + fun accountStanding(accountStanding: JsonField) = apply { + this.accountStanding = accountStanding } - /** Date when the billing period began */ - fun statementStartDate(statementStartDate: LocalDate) = - statementStartDate(JsonField.of(statementStartDate)) + fun amountDue(amountDue: AmountDue) = amountDue(JsonField.of(amountDue)) - /** Date when the billing period began */ - fun statementStartDate(statementStartDate: JsonField) = apply { - this.statementStartDate = statementStartDate - } + fun amountDue(amountDue: JsonField) = apply { this.amountDue = amountDue } - /** Date when the billing period ended */ - fun statementEndDate(statementEndDate: LocalDate) = - statementEndDate(JsonField.of(statementEndDate)) + /** Amount of credit available to spend in cents */ + fun availableCredit(availableCredit: Long) = availableCredit(JsonField.of(availableCredit)) - /** Date when the billing period ended */ - fun statementEndDate(statementEndDate: JsonField) = apply { - this.statementEndDate = statementEndDate + /** Amount of credit available to spend in cents */ + fun availableCredit(availableCredit: JsonField) = apply { + this.availableCredit = availableCredit } - /** Date when the next billing period will end */ - fun nextStatementEndDate(nextStatementEndDate: LocalDate) = - nextStatementEndDate(JsonField.of(nextStatementEndDate)) + /** Timestamp of when the statement was created */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Date when the next billing period will end */ - fun nextStatementEndDate(nextStatementEndDate: JsonField) = apply { - this.nextStatementEndDate = nextStatementEndDate - } + /** Timestamp of when the statement was created */ + fun created(created: JsonField) = apply { this.created = created } - /** Date when the payment is due */ - fun paymentDueDate(paymentDueDate: LocalDate) = paymentDueDate(JsonField.of(paymentDueDate)) + /** This is the maximum credit balance extended by the lender in cents */ + fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - /** Date when the payment is due */ - fun paymentDueDate(paymentDueDate: JsonField) = apply { - this.paymentDueDate = paymentDueDate - } + /** This is the maximum credit balance extended by the lender in cents */ + fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } - /** Date when the next payment is due */ - fun nextPaymentDueDate(nextPaymentDueDate: LocalDate) = - nextPaymentDueDate(JsonField.of(nextPaymentDueDate)) + /** Globally unique identifier for a credit product */ + fun creditProductToken(creditProductToken: String) = + creditProductToken(JsonField.of(creditProductToken)) - /** Date when the next payment is due */ - fun nextPaymentDueDate(nextPaymentDueDate: JsonField) = apply { - this.nextPaymentDueDate = nextPaymentDueDate + /** Globally unique identifier for a credit product */ + fun creditProductToken(creditProductToken: JsonField) = apply { + this.creditProductToken = creditProductToken } /** Number of days in the billing cycle */ @@ -379,28 +366,6 @@ private constructor( this.daysInBillingCycle = daysInBillingCycle } - /** This is the maximum credit balance extended by the lender in cents */ - fun creditLimit(creditLimit: Long) = creditLimit(JsonField.of(creditLimit)) - - /** This is the maximum credit balance extended by the lender in cents */ - fun creditLimit(creditLimit: JsonField) = apply { this.creditLimit = creditLimit } - - /** Amount of credit available to spend in cents */ - fun availableCredit(availableCredit: Long) = availableCredit(JsonField.of(availableCredit)) - - /** Amount of credit available to spend in cents */ - fun availableCredit(availableCredit: JsonField) = apply { - this.availableCredit = availableCredit - } - - /** Balance at the start of the billing period */ - fun startingBalance(startingBalance: Long) = startingBalance(JsonField.of(startingBalance)) - - /** Balance at the start of the billing period */ - fun startingBalance(startingBalance: JsonField) = apply { - this.startingBalance = startingBalance - } - /** * Balance at the end of the billing period. For charge cards, this should be the same at * the statement amount due in cents @@ -415,47 +380,70 @@ private constructor( this.endingBalance = endingBalance } + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) + + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken + } + + /** Date when the payment is due */ + fun paymentDueDate(paymentDueDate: LocalDate) = paymentDueDate(JsonField.of(paymentDueDate)) + + /** Date when the payment is due */ + fun paymentDueDate(paymentDueDate: JsonField) = apply { + this.paymentDueDate = paymentDueDate + } + fun periodTotals(periodTotals: StatementTotals) = periodTotals(JsonField.of(periodTotals)) fun periodTotals(periodTotals: JsonField) = apply { this.periodTotals = periodTotals } - fun ytdTotals(ytdTotals: StatementTotals) = ytdTotals(JsonField.of(ytdTotals)) - - fun ytdTotals(ytdTotals: JsonField) = apply { this.ytdTotals = ytdTotals } - - /** Timestamp of when the statement was created */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + /** Balance at the start of the billing period */ + fun startingBalance(startingBalance: Long) = startingBalance(JsonField.of(startingBalance)) - /** Timestamp of when the statement was created */ - fun created(created: JsonField) = apply { this.created = created } + /** Balance at the start of the billing period */ + fun startingBalance(startingBalance: JsonField) = apply { + this.startingBalance = startingBalance + } - /** Timestamp of when the statement was updated */ - fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) + /** Date when the billing period ended */ + fun statementEndDate(statementEndDate: LocalDate) = + statementEndDate(JsonField.of(statementEndDate)) - /** Timestamp of when the statement was updated */ - fun updated(updated: JsonField) = apply { this.updated = updated } + /** Date when the billing period ended */ + fun statementEndDate(statementEndDate: JsonField) = apply { + this.statementEndDate = statementEndDate + } - /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: String) = - creditProductToken(JsonField.of(creditProductToken)) + /** Date when the billing period began */ + fun statementStartDate(statementStartDate: LocalDate) = + statementStartDate(JsonField.of(statementStartDate)) - /** Globally unique identifier for a credit product */ - fun creditProductToken(creditProductToken: JsonField) = apply { - this.creditProductToken = creditProductToken + /** Date when the billing period began */ + fun statementStartDate(statementStartDate: JsonField) = apply { + this.statementStartDate = statementStartDate } - fun accountStanding(accountStanding: AccountStanding) = - accountStanding(JsonField.of(accountStanding)) + fun statementType(statementType: StatementType) = statementType(JsonField.of(statementType)) - fun accountStanding(accountStanding: JsonField) = apply { - this.accountStanding = accountStanding + fun statementType(statementType: JsonField) = apply { + this.statementType = statementType } - fun amountDue(amountDue: AmountDue) = amountDue(JsonField.of(amountDue)) + /** Timestamp of when the statement was updated */ + fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) - fun amountDue(amountDue: JsonField) = apply { this.amountDue = amountDue } + /** Timestamp of when the statement was updated */ + fun updated(updated: JsonField) = apply { this.updated = updated } + + fun ytdTotals(ytdTotals: StatementTotals) = ytdTotals(JsonField.of(ytdTotals)) + + fun ytdTotals(ytdTotals: JsonField) = apply { this.ytdTotals = ytdTotals } fun interestDetails(interestDetails: InterestDetails) = interestDetails(JsonField.of(interestDetails)) @@ -464,10 +452,22 @@ private constructor( this.interestDetails = interestDetails } - fun statementType(statementType: StatementType) = statementType(JsonField.of(statementType)) + /** Date when the next payment is due */ + fun nextPaymentDueDate(nextPaymentDueDate: LocalDate) = + nextPaymentDueDate(JsonField.of(nextPaymentDueDate)) - fun statementType(statementType: JsonField) = apply { - this.statementType = statementType + /** Date when the next payment is due */ + fun nextPaymentDueDate(nextPaymentDueDate: JsonField) = apply { + this.nextPaymentDueDate = nextPaymentDueDate + } + + /** Date when the next billing period will end */ + fun nextStatementEndDate(nextStatementEndDate: LocalDate) = + nextStatementEndDate(JsonField.of(nextStatementEndDate)) + + /** Date when the next billing period will end */ + fun nextStatementEndDate(nextStatementEndDate: JsonField) = apply { + this.nextStatementEndDate = nextStatementEndDate } fun additionalProperties(additionalProperties: Map) = apply { @@ -492,26 +492,26 @@ private constructor( fun build(): Statement = Statement( token, - financialAccountToken, - statementStartDate, - statementEndDate, - nextStatementEndDate, - paymentDueDate, - nextPaymentDueDate, - daysInBillingCycle, - creditLimit, + accountStanding, + amountDue, availableCredit, - startingBalance, + created, + creditLimit, + creditProductToken, + daysInBillingCycle, endingBalance, + financialAccountToken, + paymentDueDate, periodTotals, - ytdTotals, - created, + startingBalance, + statementEndDate, + statementStartDate, + statementType, updated, - creditProductToken, - accountStanding, - amountDue, + ytdTotals, interestDetails, - statementType, + nextPaymentDueDate, + nextStatementEndDate, additionalProperties.toImmutable(), ) } @@ -520,35 +520,34 @@ private constructor( class AccountStanding @JsonCreator private constructor( - @JsonProperty("period_state") - @ExcludeMissing - private val periodState: JsonField = JsonMissing.of(), - @JsonProperty("period_number") + @JsonProperty("consecutive_full_payments_made") @ExcludeMissing - private val periodNumber: JsonField = JsonMissing.of(), + private val consecutiveFullPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("consecutive_minimum_payments_made") @ExcludeMissing private val consecutiveMinimumPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("consecutive_minimum_payments_missed") @ExcludeMissing private val consecutiveMinimumPaymentsMissed: JsonField = JsonMissing.of(), - @JsonProperty("consecutive_full_payments_made") - @ExcludeMissing - private val consecutiveFullPaymentsMade: JsonField = JsonMissing.of(), @JsonProperty("days_past_due") @ExcludeMissing private val daysPastDue: JsonField = JsonMissing.of(), @JsonProperty("has_grace") @ExcludeMissing private val hasGrace: JsonField = JsonMissing.of(), + @JsonProperty("period_number") + @ExcludeMissing + private val periodNumber: JsonField = JsonMissing.of(), + @JsonProperty("period_state") + @ExcludeMissing + private val periodState: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun periodState(): PeriodState = periodState.getRequired("period_state") - - /** Current overall period number */ - fun periodNumber(): Long = periodNumber.getRequired("period_number") + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(): Long = + consecutiveFullPaymentsMade.getRequired("consecutive_full_payments_made") /** Number of consecutive minimum payments made */ fun consecutiveMinimumPaymentsMade(): Long = @@ -558,20 +557,21 @@ private constructor( fun consecutiveMinimumPaymentsMissed(): Long = consecutiveMinimumPaymentsMissed.getRequired("consecutive_minimum_payments_missed") - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(): Long = - consecutiveFullPaymentsMade.getRequired("consecutive_full_payments_made") - /** Number of days past due */ fun daysPastDue(): Long = daysPastDue.getRequired("days_past_due") /** Whether the account currently has grace or not */ fun hasGrace(): Boolean = hasGrace.getRequired("has_grace") - @JsonProperty("period_state") @ExcludeMissing fun _periodState() = periodState - /** Current overall period number */ - @JsonProperty("period_number") @ExcludeMissing fun _periodNumber() = periodNumber + fun periodNumber(): Long = periodNumber.getRequired("period_number") + + fun periodState(): PeriodState = periodState.getRequired("period_state") + + /** Number of consecutive full payments made */ + @JsonProperty("consecutive_full_payments_made") + @ExcludeMissing + fun _consecutiveFullPaymentsMade() = consecutiveFullPaymentsMade /** Number of consecutive minimum payments made */ @JsonProperty("consecutive_minimum_payments_made") @@ -583,17 +583,17 @@ private constructor( @ExcludeMissing fun _consecutiveMinimumPaymentsMissed() = consecutiveMinimumPaymentsMissed - /** Number of consecutive full payments made */ - @JsonProperty("consecutive_full_payments_made") - @ExcludeMissing - fun _consecutiveFullPaymentsMade() = consecutiveFullPaymentsMade - /** Number of days past due */ @JsonProperty("days_past_due") @ExcludeMissing fun _daysPastDue() = daysPastDue /** Whether the account currently has grace or not */ @JsonProperty("has_grace") @ExcludeMissing fun _hasGrace() = hasGrace + /** Current overall period number */ + @JsonProperty("period_number") @ExcludeMissing fun _periodNumber() = periodNumber + + @JsonProperty("period_state") @ExcludeMissing fun _periodState() = periodState + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -602,13 +602,13 @@ private constructor( fun validate(): AccountStanding = apply { if (!validated) { - periodState() - periodNumber() + consecutiveFullPaymentsMade() consecutiveMinimumPaymentsMade() consecutiveMinimumPaymentsMissed() - consecutiveFullPaymentsMade() daysPastDue() hasGrace() + periodNumber() + periodState() validated = true } } @@ -622,38 +622,33 @@ private constructor( class Builder { - private var periodState: JsonField = JsonMissing.of() - private var periodNumber: JsonField = JsonMissing.of() + private var consecutiveFullPaymentsMade: JsonField = JsonMissing.of() private var consecutiveMinimumPaymentsMade: JsonField = JsonMissing.of() private var consecutiveMinimumPaymentsMissed: JsonField = JsonMissing.of() - private var consecutiveFullPaymentsMade: JsonField = JsonMissing.of() private var daysPastDue: JsonField = JsonMissing.of() private var hasGrace: JsonField = JsonMissing.of() + private var periodNumber: JsonField = JsonMissing.of() + private var periodState: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountStanding: AccountStanding) = apply { - periodState = accountStanding.periodState - periodNumber = accountStanding.periodNumber + consecutiveFullPaymentsMade = accountStanding.consecutiveFullPaymentsMade consecutiveMinimumPaymentsMade = accountStanding.consecutiveMinimumPaymentsMade consecutiveMinimumPaymentsMissed = accountStanding.consecutiveMinimumPaymentsMissed - consecutiveFullPaymentsMade = accountStanding.consecutiveFullPaymentsMade daysPastDue = accountStanding.daysPastDue hasGrace = accountStanding.hasGrace + periodNumber = accountStanding.periodNumber + periodState = accountStanding.periodState additionalProperties = accountStanding.additionalProperties.toMutableMap() } - fun periodState(periodState: PeriodState) = periodState(JsonField.of(periodState)) - - fun periodState(periodState: JsonField) = apply { - this.periodState = periodState - } - - /** Current overall period number */ - fun periodNumber(periodNumber: Long) = periodNumber(JsonField.of(periodNumber)) + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: Long) = + consecutiveFullPaymentsMade(JsonField.of(consecutiveFullPaymentsMade)) - /** Current overall period number */ - fun periodNumber(periodNumber: JsonField) = apply { - this.periodNumber = periodNumber + /** Number of consecutive full payments made */ + fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: JsonField) = apply { + this.consecutiveFullPaymentsMade = consecutiveFullPaymentsMade } /** Number of consecutive minimum payments made */ @@ -675,15 +670,6 @@ private constructor( consecutiveMinimumPaymentsMissed: JsonField ) = apply { this.consecutiveMinimumPaymentsMissed = consecutiveMinimumPaymentsMissed } - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: Long) = - consecutiveFullPaymentsMade(JsonField.of(consecutiveFullPaymentsMade)) - - /** Number of consecutive full payments made */ - fun consecutiveFullPaymentsMade(consecutiveFullPaymentsMade: JsonField) = apply { - this.consecutiveFullPaymentsMade = consecutiveFullPaymentsMade - } - /** Number of days past due */ fun daysPastDue(daysPastDue: Long) = daysPastDue(JsonField.of(daysPastDue)) @@ -696,6 +682,20 @@ private constructor( /** Whether the account currently has grace or not */ fun hasGrace(hasGrace: JsonField) = apply { this.hasGrace = hasGrace } + /** Current overall period number */ + fun periodNumber(periodNumber: Long) = periodNumber(JsonField.of(periodNumber)) + + /** Current overall period number */ + fun periodNumber(periodNumber: JsonField) = apply { + this.periodNumber = periodNumber + } + + fun periodState(periodState: PeriodState) = periodState(JsonField.of(periodState)) + + fun periodState(periodState: JsonField) = apply { + this.periodState = periodState + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -717,13 +717,13 @@ private constructor( fun build(): AccountStanding = AccountStanding( - periodState, - periodNumber, + consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, - consecutiveFullPaymentsMade, daysPastDue, hasGrace, + periodNumber, + periodState, additionalProperties.toImmutable(), ) } @@ -796,17 +796,17 @@ private constructor( return true } - return /* spotless:off */ other is AccountStanding && periodState == other.periodState && periodNumber == other.periodNumber && consecutiveMinimumPaymentsMade == other.consecutiveMinimumPaymentsMade && consecutiveMinimumPaymentsMissed == other.consecutiveMinimumPaymentsMissed && consecutiveFullPaymentsMade == other.consecutiveFullPaymentsMade && daysPastDue == other.daysPastDue && hasGrace == other.hasGrace && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is AccountStanding && consecutiveFullPaymentsMade == other.consecutiveFullPaymentsMade && consecutiveMinimumPaymentsMade == other.consecutiveMinimumPaymentsMade && consecutiveMinimumPaymentsMissed == other.consecutiveMinimumPaymentsMissed && daysPastDue == other.daysPastDue && hasGrace == other.hasGrace && periodNumber == other.periodNumber && periodState == other.periodState && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(periodState, periodNumber, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, consecutiveFullPaymentsMade, daysPastDue, hasGrace, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed, daysPastDue, hasGrace, periodNumber, periodState, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "AccountStanding{periodState=$periodState, periodNumber=$periodNumber, consecutiveMinimumPaymentsMade=$consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed=$consecutiveMinimumPaymentsMissed, consecutiveFullPaymentsMade=$consecutiveFullPaymentsMade, daysPastDue=$daysPastDue, hasGrace=$hasGrace, additionalProperties=$additionalProperties}" + "AccountStanding{consecutiveFullPaymentsMade=$consecutiveFullPaymentsMade, consecutiveMinimumPaymentsMade=$consecutiveMinimumPaymentsMade, consecutiveMinimumPaymentsMissed=$consecutiveMinimumPaymentsMissed, daysPastDue=$daysPastDue, hasGrace=$hasGrace, periodNumber=$periodNumber, periodState=$periodState, additionalProperties=$additionalProperties}" } @NoAutoDetect @@ -949,76 +949,76 @@ private constructor( class StatementTotals @JsonCreator private constructor( - @JsonProperty("payments") + @JsonProperty("balance_transfers") @ExcludeMissing - private val payments: JsonField = JsonMissing.of(), - @JsonProperty("purchases") + private val balanceTransfers: JsonField = JsonMissing.of(), + @JsonProperty("cash_advances") @ExcludeMissing - private val purchases: JsonField = JsonMissing.of(), - @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), + private val cashAdvances: JsonField = JsonMissing.of(), @JsonProperty("credits") @ExcludeMissing private val credits: JsonField = JsonMissing.of(), + @JsonProperty("fees") @ExcludeMissing private val fees: JsonField = JsonMissing.of(), @JsonProperty("interest") @ExcludeMissing private val interest: JsonField = JsonMissing.of(), - @JsonProperty("cash_advances") + @JsonProperty("payments") @ExcludeMissing - private val cashAdvances: JsonField = JsonMissing.of(), - @JsonProperty("balance_transfers") + private val payments: JsonField = JsonMissing.of(), + @JsonProperty("purchases") @ExcludeMissing - private val balanceTransfers: JsonField = JsonMissing.of(), + private val purchases: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Any funds transfers which affective the balance in cents */ - fun payments(): Long = payments.getRequired("payments") - - /** Net card transaction volume less any cash advances in cents */ - fun purchases(): Long = purchases.getRequired("purchases") + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(): Long = balanceTransfers.getRequired("balance_transfers") - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(): Long = fees.getRequired("fees") + /** ATM and cashback transactions in cents */ + fun cashAdvances(): Long = cashAdvances.getRequired("cash_advances") /** * Volume of credit management operation transactions less any balance transfers in cents */ fun credits(): Long = credits.getRequired("credits") + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(): Long = fees.getRequired("fees") + /** Interest accrued in cents */ fun interest(): Long = interest.getRequired("interest") - /** ATM and cashback transactions in cents */ - fun cashAdvances(): Long = cashAdvances.getRequired("cash_advances") - - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(): Long = balanceTransfers.getRequired("balance_transfers") - /** Any funds transfers which affective the balance in cents */ - @JsonProperty("payments") @ExcludeMissing fun _payments() = payments + fun payments(): Long = payments.getRequired("payments") /** Net card transaction volume less any cash advances in cents */ - @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + fun purchases(): Long = purchases.getRequired("purchases") - /** Volume of debit management operation transactions less any interest in cents */ - @JsonProperty("fees") @ExcludeMissing fun _fees() = fees + /** Opening balance transferred from previous account in cents */ + @JsonProperty("balance_transfers") + @ExcludeMissing + fun _balanceTransfers() = balanceTransfers + + /** ATM and cashback transactions in cents */ + @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances /** * Volume of credit management operation transactions less any balance transfers in cents */ @JsonProperty("credits") @ExcludeMissing fun _credits() = credits + /** Volume of debit management operation transactions less any interest in cents */ + @JsonProperty("fees") @ExcludeMissing fun _fees() = fees + /** Interest accrued in cents */ @JsonProperty("interest") @ExcludeMissing fun _interest() = interest - /** ATM and cashback transactions in cents */ - @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + /** Any funds transfers which affective the balance in cents */ + @JsonProperty("payments") @ExcludeMissing fun _payments() = payments - /** Opening balance transferred from previous account in cents */ - @JsonProperty("balance_transfers") - @ExcludeMissing - fun _balanceTransfers() = balanceTransfers + /** Net card transaction volume less any cash advances in cents */ + @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases @JsonAnyGetter @ExcludeMissing @@ -1028,13 +1028,13 @@ private constructor( fun validate(): StatementTotals = apply { if (!validated) { - payments() - purchases() - fees() + balanceTransfers() + cashAdvances() credits() + fees() interest() - cashAdvances() - balanceTransfers() + payments() + purchases() validated = true } } @@ -1047,44 +1047,43 @@ private constructor( } class Builder { - - private var payments: JsonField = JsonMissing.of() - private var purchases: JsonField = JsonMissing.of() - private var fees: JsonField = JsonMissing.of() + + private var balanceTransfers: JsonField = JsonMissing.of() + private var cashAdvances: JsonField = JsonMissing.of() private var credits: JsonField = JsonMissing.of() + private var fees: JsonField = JsonMissing.of() private var interest: JsonField = JsonMissing.of() - private var cashAdvances: JsonField = JsonMissing.of() - private var balanceTransfers: JsonField = JsonMissing.of() + private var payments: JsonField = JsonMissing.of() + private var purchases: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(statementTotals: StatementTotals) = apply { - payments = statementTotals.payments - purchases = statementTotals.purchases - fees = statementTotals.fees + balanceTransfers = statementTotals.balanceTransfers + cashAdvances = statementTotals.cashAdvances credits = statementTotals.credits + fees = statementTotals.fees interest = statementTotals.interest - cashAdvances = statementTotals.cashAdvances - balanceTransfers = statementTotals.balanceTransfers + payments = statementTotals.payments + purchases = statementTotals.purchases additionalProperties = statementTotals.additionalProperties.toMutableMap() } - /** Any funds transfers which affective the balance in cents */ - fun payments(payments: Long) = payments(JsonField.of(payments)) - - /** Any funds transfers which affective the balance in cents */ - fun payments(payments: JsonField) = apply { this.payments = payments } - - /** Net card transaction volume less any cash advances in cents */ - fun purchases(purchases: Long) = purchases(JsonField.of(purchases)) + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(balanceTransfers: Long) = + balanceTransfers(JsonField.of(balanceTransfers)) - /** Net card transaction volume less any cash advances in cents */ - fun purchases(purchases: JsonField) = apply { this.purchases = purchases } + /** Opening balance transferred from previous account in cents */ + fun balanceTransfers(balanceTransfers: JsonField) = apply { + this.balanceTransfers = balanceTransfers + } - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(fees: Long) = fees(JsonField.of(fees)) + /** ATM and cashback transactions in cents */ + fun cashAdvances(cashAdvances: Long) = cashAdvances(JsonField.of(cashAdvances)) - /** Volume of debit management operation transactions less any interest in cents */ - fun fees(fees: JsonField) = apply { this.fees = fees } + /** ATM and cashback transactions in cents */ + fun cashAdvances(cashAdvances: JsonField) = apply { + this.cashAdvances = cashAdvances + } /** * Volume of credit management operation transactions less any balance transfers in @@ -1098,28 +1097,29 @@ private constructor( */ fun credits(credits: JsonField) = apply { this.credits = credits } + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(fees: Long) = fees(JsonField.of(fees)) + + /** Volume of debit management operation transactions less any interest in cents */ + fun fees(fees: JsonField) = apply { this.fees = fees } + /** Interest accrued in cents */ fun interest(interest: Long) = interest(JsonField.of(interest)) /** Interest accrued in cents */ fun interest(interest: JsonField) = apply { this.interest = interest } - /** ATM and cashback transactions in cents */ - fun cashAdvances(cashAdvances: Long) = cashAdvances(JsonField.of(cashAdvances)) + /** Any funds transfers which affective the balance in cents */ + fun payments(payments: Long) = payments(JsonField.of(payments)) - /** ATM and cashback transactions in cents */ - fun cashAdvances(cashAdvances: JsonField) = apply { - this.cashAdvances = cashAdvances - } + /** Any funds transfers which affective the balance in cents */ + fun payments(payments: JsonField) = apply { this.payments = payments } - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(balanceTransfers: Long) = - balanceTransfers(JsonField.of(balanceTransfers)) + /** Net card transaction volume less any cash advances in cents */ + fun purchases(purchases: Long) = purchases(JsonField.of(purchases)) - /** Opening balance transferred from previous account in cents */ - fun balanceTransfers(balanceTransfers: JsonField) = apply { - this.balanceTransfers = balanceTransfers - } + /** Net card transaction volume less any cash advances in cents */ + fun purchases(purchases: JsonField) = apply { this.purchases = purchases } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1142,13 +1142,13 @@ private constructor( fun build(): StatementTotals = StatementTotals( - payments, - purchases, - fees, + balanceTransfers, + cashAdvances, credits, + fees, interest, - cashAdvances, - balanceTransfers, + payments, + purchases, additionalProperties.toImmutable(), ) } @@ -1158,17 +1158,17 @@ private constructor( return true } - return /* spotless:off */ other is StatementTotals && payments == other.payments && purchases == other.purchases && fees == other.fees && credits == other.credits && interest == other.interest && cashAdvances == other.cashAdvances && balanceTransfers == other.balanceTransfers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is StatementTotals && balanceTransfers == other.balanceTransfers && cashAdvances == other.cashAdvances && credits == other.credits && fees == other.fees && interest == other.interest && payments == other.payments && purchases == other.purchases && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(payments, purchases, fees, credits, interest, cashAdvances, balanceTransfers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(balanceTransfers, cashAdvances, credits, fees, interest, payments, purchases, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "StatementTotals{payments=$payments, purchases=$purchases, fees=$fees, credits=$credits, interest=$interest, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}" + "StatementTotals{balanceTransfers=$balanceTransfers, cashAdvances=$cashAdvances, credits=$credits, fees=$fees, interest=$interest, payments=$payments, purchases=$purchases, additionalProperties=$additionalProperties}" } class StatementType @@ -1232,75 +1232,75 @@ private constructor( class InterestDetails @JsonCreator private constructor( - @JsonProperty("prime_rate") + @JsonProperty("actual_interest_charged") @ExcludeMissing - private val primeRate: JsonField = JsonMissing.of(), - @JsonProperty("interest_calculation_method") + private val actualInterestCharged: JsonField = JsonMissing.of(), + @JsonProperty("daily_balance_amounts") @ExcludeMissing - private val interestCalculationMethod: JsonField = - JsonMissing.of(), + private val dailyBalanceAmounts: JsonField = JsonMissing.of(), @JsonProperty("effective_apr") @ExcludeMissing private val effectiveApr: JsonField = JsonMissing.of(), + @JsonProperty("interest_calculation_method") + @ExcludeMissing + private val interestCalculationMethod: JsonField = + JsonMissing.of(), @JsonProperty("interest_for_period") @ExcludeMissing private val interestForPeriod: JsonField = JsonMissing.of(), - @JsonProperty("daily_balance_amounts") + @JsonProperty("prime_rate") @ExcludeMissing - private val dailyBalanceAmounts: JsonField = JsonMissing.of(), + private val primeRate: JsonField = JsonMissing.of(), @JsonProperty("minimum_interest_charged") @ExcludeMissing private val minimumInterestCharged: JsonField = JsonMissing.of(), - @JsonProperty("actual_interest_charged") - @ExcludeMissing - private val actualInterestCharged: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun primeRate(): String? = primeRate.getNullable("prime_rate") + fun actualInterestCharged(): Long? = + actualInterestCharged.getNullable("actual_interest_charged") - fun interestCalculationMethod(): InterestCalculationMethod = - interestCalculationMethod.getRequired("interest_calculation_method") + fun dailyBalanceAmounts(): CategoryDetails = + dailyBalanceAmounts.getRequired("daily_balance_amounts") fun effectiveApr(): CategoryDetails = effectiveApr.getRequired("effective_apr") + fun interestCalculationMethod(): InterestCalculationMethod = + interestCalculationMethod.getRequired("interest_calculation_method") + fun interestForPeriod(): CategoryDetails = interestForPeriod.getRequired("interest_for_period") - fun dailyBalanceAmounts(): CategoryDetails = - dailyBalanceAmounts.getRequired("daily_balance_amounts") + fun primeRate(): String? = primeRate.getNullable("prime_rate") fun minimumInterestCharged(): Long? = minimumInterestCharged.getNullable("minimum_interest_charged") - fun actualInterestCharged(): Long? = - actualInterestCharged.getNullable("actual_interest_charged") + @JsonProperty("actual_interest_charged") + @ExcludeMissing + fun _actualInterestCharged() = actualInterestCharged - @JsonProperty("prime_rate") @ExcludeMissing fun _primeRate() = primeRate + @JsonProperty("daily_balance_amounts") + @ExcludeMissing + fun _dailyBalanceAmounts() = dailyBalanceAmounts + + @JsonProperty("effective_apr") @ExcludeMissing fun _effectiveApr() = effectiveApr @JsonProperty("interest_calculation_method") @ExcludeMissing fun _interestCalculationMethod() = interestCalculationMethod - @JsonProperty("effective_apr") @ExcludeMissing fun _effectiveApr() = effectiveApr - @JsonProperty("interest_for_period") @ExcludeMissing fun _interestForPeriod() = interestForPeriod - @JsonProperty("daily_balance_amounts") - @ExcludeMissing - fun _dailyBalanceAmounts() = dailyBalanceAmounts + @JsonProperty("prime_rate") @ExcludeMissing fun _primeRate() = primeRate @JsonProperty("minimum_interest_charged") @ExcludeMissing fun _minimumInterestCharged() = minimumInterestCharged - @JsonProperty("actual_interest_charged") - @ExcludeMissing - fun _actualInterestCharged() = actualInterestCharged - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1309,13 +1309,13 @@ private constructor( fun validate(): InterestDetails = apply { if (!validated) { - primeRate() - interestCalculationMethod() + actualInterestCharged() + dailyBalanceAmounts().validate() effectiveApr().validate() + interestCalculationMethod() interestForPeriod().validate() - dailyBalanceAmounts().validate() + primeRate() minimumInterestCharged() - actualInterestCharged() validated = true } } @@ -1329,37 +1329,40 @@ private constructor( class Builder { - private var primeRate: JsonField = JsonMissing.of() + private var actualInterestCharged: JsonField = JsonMissing.of() + private var dailyBalanceAmounts: JsonField = JsonMissing.of() + private var effectiveApr: JsonField = JsonMissing.of() private var interestCalculationMethod: JsonField = JsonMissing.of() - private var effectiveApr: JsonField = JsonMissing.of() private var interestForPeriod: JsonField = JsonMissing.of() - private var dailyBalanceAmounts: JsonField = JsonMissing.of() + private var primeRate: JsonField = JsonMissing.of() private var minimumInterestCharged: JsonField = JsonMissing.of() - private var actualInterestCharged: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(interestDetails: InterestDetails) = apply { - primeRate = interestDetails.primeRate - interestCalculationMethod = interestDetails.interestCalculationMethod + actualInterestCharged = interestDetails.actualInterestCharged + dailyBalanceAmounts = interestDetails.dailyBalanceAmounts effectiveApr = interestDetails.effectiveApr + interestCalculationMethod = interestDetails.interestCalculationMethod interestForPeriod = interestDetails.interestForPeriod - dailyBalanceAmounts = interestDetails.dailyBalanceAmounts + primeRate = interestDetails.primeRate minimumInterestCharged = interestDetails.minimumInterestCharged - actualInterestCharged = interestDetails.actualInterestCharged additionalProperties = interestDetails.additionalProperties.toMutableMap() } - fun primeRate(primeRate: String) = primeRate(JsonField.of(primeRate)) + fun actualInterestCharged(actualInterestCharged: Long) = + actualInterestCharged(JsonField.of(actualInterestCharged)) - fun primeRate(primeRate: JsonField) = apply { this.primeRate = primeRate } + fun actualInterestCharged(actualInterestCharged: JsonField) = apply { + this.actualInterestCharged = actualInterestCharged + } - fun interestCalculationMethod(interestCalculationMethod: InterestCalculationMethod) = - interestCalculationMethod(JsonField.of(interestCalculationMethod)) + fun dailyBalanceAmounts(dailyBalanceAmounts: CategoryDetails) = + dailyBalanceAmounts(JsonField.of(dailyBalanceAmounts)) - fun interestCalculationMethod( - interestCalculationMethod: JsonField - ) = apply { this.interestCalculationMethod = interestCalculationMethod } + fun dailyBalanceAmounts(dailyBalanceAmounts: JsonField) = apply { + this.dailyBalanceAmounts = dailyBalanceAmounts + } fun effectiveApr(effectiveApr: CategoryDetails) = effectiveApr(JsonField.of(effectiveApr)) @@ -1368,6 +1371,13 @@ private constructor( this.effectiveApr = effectiveApr } + fun interestCalculationMethod(interestCalculationMethod: InterestCalculationMethod) = + interestCalculationMethod(JsonField.of(interestCalculationMethod)) + + fun interestCalculationMethod( + interestCalculationMethod: JsonField + ) = apply { this.interestCalculationMethod = interestCalculationMethod } + fun interestForPeriod(interestForPeriod: CategoryDetails) = interestForPeriod(JsonField.of(interestForPeriod)) @@ -1375,12 +1385,9 @@ private constructor( this.interestForPeriod = interestForPeriod } - fun dailyBalanceAmounts(dailyBalanceAmounts: CategoryDetails) = - dailyBalanceAmounts(JsonField.of(dailyBalanceAmounts)) + fun primeRate(primeRate: String) = primeRate(JsonField.of(primeRate)) - fun dailyBalanceAmounts(dailyBalanceAmounts: JsonField) = apply { - this.dailyBalanceAmounts = dailyBalanceAmounts - } + fun primeRate(primeRate: JsonField) = apply { this.primeRate = primeRate } fun minimumInterestCharged(minimumInterestCharged: Long) = minimumInterestCharged(JsonField.of(minimumInterestCharged)) @@ -1389,13 +1396,6 @@ private constructor( this.minimumInterestCharged = minimumInterestCharged } - fun actualInterestCharged(actualInterestCharged: Long) = - actualInterestCharged(JsonField.of(actualInterestCharged)) - - fun actualInterestCharged(actualInterestCharged: JsonField) = apply { - this.actualInterestCharged = actualInterestCharged - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1417,13 +1417,13 @@ private constructor( fun build(): InterestDetails = InterestDetails( - primeRate, - interestCalculationMethod, + actualInterestCharged, + dailyBalanceAmounts, effectiveApr, + interestCalculationMethod, interestForPeriod, - dailyBalanceAmounts, + primeRate, minimumInterestCharged, - actualInterestCharged, additionalProperties.toImmutable(), ) } @@ -1432,33 +1432,33 @@ private constructor( class CategoryDetails @JsonCreator private constructor( - @JsonProperty("purchases") + @JsonProperty("balance_transfers") @ExcludeMissing - private val purchases: JsonField = JsonMissing.of(), + private val balanceTransfers: JsonField = JsonMissing.of(), @JsonProperty("cash_advances") @ExcludeMissing private val cashAdvances: JsonField = JsonMissing.of(), - @JsonProperty("balance_transfers") + @JsonProperty("purchases") @ExcludeMissing - private val balanceTransfers: JsonField = JsonMissing.of(), + private val purchases: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun purchases(): String = purchases.getRequired("purchases") - - fun cashAdvances(): String = cashAdvances.getRequired("cash_advances") - fun balanceTransfers(): String = balanceTransfers.getRequired("balance_transfers") - @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + fun cashAdvances(): String = cashAdvances.getRequired("cash_advances") - @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + fun purchases(): String = purchases.getRequired("purchases") @JsonProperty("balance_transfers") @ExcludeMissing fun _balanceTransfers() = balanceTransfers + @JsonProperty("cash_advances") @ExcludeMissing fun _cashAdvances() = cashAdvances + + @JsonProperty("purchases") @ExcludeMissing fun _purchases() = purchases + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -1467,9 +1467,9 @@ private constructor( fun validate(): CategoryDetails = apply { if (!validated) { - purchases() - cashAdvances() balanceTransfers() + cashAdvances() + purchases() validated = true } } @@ -1483,21 +1483,24 @@ private constructor( class Builder { - private var purchases: JsonField = JsonMissing.of() - private var cashAdvances: JsonField = JsonMissing.of() private var balanceTransfers: JsonField = JsonMissing.of() + private var cashAdvances: JsonField = JsonMissing.of() + private var purchases: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(categoryDetails: CategoryDetails) = apply { - purchases = categoryDetails.purchases - cashAdvances = categoryDetails.cashAdvances balanceTransfers = categoryDetails.balanceTransfers + cashAdvances = categoryDetails.cashAdvances + purchases = categoryDetails.purchases additionalProperties = categoryDetails.additionalProperties.toMutableMap() } - fun purchases(purchases: String) = purchases(JsonField.of(purchases)) + fun balanceTransfers(balanceTransfers: String) = + balanceTransfers(JsonField.of(balanceTransfers)) - fun purchases(purchases: JsonField) = apply { this.purchases = purchases } + fun balanceTransfers(balanceTransfers: JsonField) = apply { + this.balanceTransfers = balanceTransfers + } fun cashAdvances(cashAdvances: String) = cashAdvances(JsonField.of(cashAdvances)) @@ -1505,12 +1508,9 @@ private constructor( this.cashAdvances = cashAdvances } - fun balanceTransfers(balanceTransfers: String) = - balanceTransfers(JsonField.of(balanceTransfers)) + fun purchases(purchases: String) = purchases(JsonField.of(purchases)) - fun balanceTransfers(balanceTransfers: JsonField) = apply { - this.balanceTransfers = balanceTransfers - } + fun purchases(purchases: JsonField) = apply { this.purchases = purchases } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1536,9 +1536,9 @@ private constructor( fun build(): CategoryDetails = CategoryDetails( - purchases, - cashAdvances, balanceTransfers, + cashAdvances, + purchases, additionalProperties.toImmutable(), ) } @@ -1548,17 +1548,17 @@ private constructor( return true } - return /* spotless:off */ other is CategoryDetails && purchases == other.purchases && cashAdvances == other.cashAdvances && balanceTransfers == other.balanceTransfers && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is CategoryDetails && balanceTransfers == other.balanceTransfers && cashAdvances == other.cashAdvances && purchases == other.purchases && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(purchases, cashAdvances, balanceTransfers, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(balanceTransfers, cashAdvances, purchases, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "CategoryDetails{purchases=$purchases, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}" + "CategoryDetails{balanceTransfers=$balanceTransfers, cashAdvances=$cashAdvances, purchases=$purchases, additionalProperties=$additionalProperties}" } class InterestCalculationMethod @@ -1626,17 +1626,17 @@ private constructor( return true } - return /* spotless:off */ other is InterestDetails && primeRate == other.primeRate && interestCalculationMethod == other.interestCalculationMethod && effectiveApr == other.effectiveApr && interestForPeriod == other.interestForPeriod && dailyBalanceAmounts == other.dailyBalanceAmounts && minimumInterestCharged == other.minimumInterestCharged && actualInterestCharged == other.actualInterestCharged && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is InterestDetails && actualInterestCharged == other.actualInterestCharged && dailyBalanceAmounts == other.dailyBalanceAmounts && effectiveApr == other.effectiveApr && interestCalculationMethod == other.interestCalculationMethod && interestForPeriod == other.interestForPeriod && primeRate == other.primeRate && minimumInterestCharged == other.minimumInterestCharged && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(primeRate, interestCalculationMethod, effectiveApr, interestForPeriod, dailyBalanceAmounts, minimumInterestCharged, actualInterestCharged, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(actualInterestCharged, dailyBalanceAmounts, effectiveApr, interestCalculationMethod, interestForPeriod, primeRate, minimumInterestCharged, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "InterestDetails{primeRate=$primeRate, interestCalculationMethod=$interestCalculationMethod, effectiveApr=$effectiveApr, interestForPeriod=$interestForPeriod, dailyBalanceAmounts=$dailyBalanceAmounts, minimumInterestCharged=$minimumInterestCharged, actualInterestCharged=$actualInterestCharged, additionalProperties=$additionalProperties}" + "InterestDetails{actualInterestCharged=$actualInterestCharged, dailyBalanceAmounts=$dailyBalanceAmounts, effectiveApr=$effectiveApr, interestCalculationMethod=$interestCalculationMethod, interestForPeriod=$interestForPeriod, primeRate=$primeRate, minimumInterestCharged=$minimumInterestCharged, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1644,15 +1644,15 @@ private constructor( return true } - return /* spotless:off */ other is Statement && token == other.token && financialAccountToken == other.financialAccountToken && statementStartDate == other.statementStartDate && statementEndDate == other.statementEndDate && nextStatementEndDate == other.nextStatementEndDate && paymentDueDate == other.paymentDueDate && nextPaymentDueDate == other.nextPaymentDueDate && daysInBillingCycle == other.daysInBillingCycle && creditLimit == other.creditLimit && availableCredit == other.availableCredit && startingBalance == other.startingBalance && endingBalance == other.endingBalance && periodTotals == other.periodTotals && ytdTotals == other.ytdTotals && created == other.created && updated == other.updated && creditProductToken == other.creditProductToken && accountStanding == other.accountStanding && amountDue == other.amountDue && interestDetails == other.interestDetails && statementType == other.statementType && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Statement && token == other.token && accountStanding == other.accountStanding && amountDue == other.amountDue && availableCredit == other.availableCredit && created == other.created && creditLimit == other.creditLimit && creditProductToken == other.creditProductToken && daysInBillingCycle == other.daysInBillingCycle && endingBalance == other.endingBalance && financialAccountToken == other.financialAccountToken && paymentDueDate == other.paymentDueDate && periodTotals == other.periodTotals && startingBalance == other.startingBalance && statementEndDate == other.statementEndDate && statementStartDate == other.statementStartDate && statementType == other.statementType && updated == other.updated && ytdTotals == other.ytdTotals && interestDetails == other.interestDetails && nextPaymentDueDate == other.nextPaymentDueDate && nextStatementEndDate == other.nextStatementEndDate && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, financialAccountToken, statementStartDate, statementEndDate, nextStatementEndDate, paymentDueDate, nextPaymentDueDate, daysInBillingCycle, creditLimit, availableCredit, startingBalance, endingBalance, periodTotals, ytdTotals, created, updated, creditProductToken, accountStanding, amountDue, interestDetails, statementType, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountStanding, amountDue, availableCredit, created, creditLimit, creditProductToken, daysInBillingCycle, endingBalance, financialAccountToken, paymentDueDate, periodTotals, startingBalance, statementEndDate, statementStartDate, statementType, updated, ytdTotals, interestDetails, nextPaymentDueDate, nextStatementEndDate, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Statement{token=$token, financialAccountToken=$financialAccountToken, statementStartDate=$statementStartDate, statementEndDate=$statementEndDate, nextStatementEndDate=$nextStatementEndDate, paymentDueDate=$paymentDueDate, nextPaymentDueDate=$nextPaymentDueDate, daysInBillingCycle=$daysInBillingCycle, creditLimit=$creditLimit, availableCredit=$availableCredit, startingBalance=$startingBalance, endingBalance=$endingBalance, periodTotals=$periodTotals, ytdTotals=$ytdTotals, created=$created, updated=$updated, creditProductToken=$creditProductToken, accountStanding=$accountStanding, amountDue=$amountDue, interestDetails=$interestDetails, statementType=$statementType, additionalProperties=$additionalProperties}" + "Statement{token=$token, accountStanding=$accountStanding, amountDue=$amountDue, availableCredit=$availableCredit, created=$created, creditLimit=$creditLimit, creditProductToken=$creditProductToken, daysInBillingCycle=$daysInBillingCycle, endingBalance=$endingBalance, financialAccountToken=$financialAccountToken, paymentDueDate=$paymentDueDate, periodTotals=$periodTotals, startingBalance=$startingBalance, statementEndDate=$statementEndDate, statementStartDate=$statementStartDate, statementType=$statementType, updated=$updated, ytdTotals=$ytdTotals, interestDetails=$interestDetails, nextPaymentDueDate=$nextPaymentDueDate, nextStatementEndDate=$nextStatementEndDate, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt index 0293514a..5ca0d90d 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/StatementLineItems.kt @@ -115,39 +115,39 @@ private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("financial_account_token") + @JsonProperty("amount") @ExcludeMissing - private val financialAccountToken: JsonField = JsonMissing.of(), - @JsonProperty("card_token") + private val amount: JsonField = JsonMissing.of(), + @JsonProperty("category") @ExcludeMissing - private val cardToken: JsonField = JsonMissing.of(), - @JsonProperty("financial_transaction_token") + private val category: JsonField = JsonMissing.of(), + @JsonProperty("created") @ExcludeMissing - private val financialTransactionToken: JsonField = JsonMissing.of(), - @JsonProperty("financial_transaction_event_token") + private val created: JsonField = JsonMissing.of(), + @JsonProperty("currency") @ExcludeMissing - private val financialTransactionEventToken: JsonField = JsonMissing.of(), - @JsonProperty("category") + private val currency: JsonField = JsonMissing.of(), + @JsonProperty("effective_date") @ExcludeMissing - private val category: JsonField = JsonMissing.of(), + private val effectiveDate: JsonField = JsonMissing.of(), @JsonProperty("event_type") @ExcludeMissing private val eventType: JsonField = JsonMissing.of(), - @JsonProperty("effective_date") + @JsonProperty("financial_account_token") @ExcludeMissing - private val effectiveDate: JsonField = JsonMissing.of(), - @JsonProperty("descriptor") + private val financialAccountToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_transaction_event_token") @ExcludeMissing - private val descriptor: JsonField = JsonMissing.of(), - @JsonProperty("amount") + private val financialTransactionEventToken: JsonField = JsonMissing.of(), + @JsonProperty("financial_transaction_token") @ExcludeMissing - private val amount: JsonField = JsonMissing.of(), - @JsonProperty("currency") + private val financialTransactionToken: JsonField = JsonMissing.of(), + @JsonProperty("card_token") @ExcludeMissing - private val currency: JsonField = JsonMissing.of(), - @JsonProperty("created") + private val cardToken: JsonField = JsonMissing.of(), + @JsonProperty("descriptor") @ExcludeMissing - private val created: JsonField = JsonMissing.of(), + private val descriptor: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -155,78 +155,78 @@ private constructor( /** Globally unique identifier for a Statement Line Item */ fun token(): String = token.getRequired("token") + /** Transaction amount in cents */ + fun amount(): Long = amount.getRequired("amount") + + fun category(): TransactionCategory = category.getRequired("category") + + /** Timestamp of when the line item was generated */ + fun created(): OffsetDateTime = created.getRequired("created") + + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(): String = currency.getRequired("currency") + + /** Date that the transaction effected the account balance */ + fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") + + fun eventType(): FinancialEventType = eventType.getRequired("event_type") + /** Globally unique identifier for a financial account */ fun financialAccountToken(): String = financialAccountToken.getRequired("financial_account_token") - /** Globally unique identifier for a card */ - fun cardToken(): String? = cardToken.getNullable("card_token") + /** Globally unique identifier for a financial transaction event */ + fun financialTransactionEventToken(): String = + financialTransactionEventToken.getRequired("financial_transaction_event_token") /** Globally unique identifier for a financial transaction */ fun financialTransactionToken(): String = financialTransactionToken.getRequired("financial_transaction_token") - /** Globally unique identifier for a financial transaction event */ - fun financialTransactionEventToken(): String = - financialTransactionEventToken.getRequired("financial_transaction_event_token") + /** Globally unique identifier for a card */ + fun cardToken(): String? = cardToken.getNullable("card_token") - fun category(): TransactionCategory = category.getRequired("category") + fun descriptor(): String? = descriptor.getNullable("descriptor") - fun eventType(): FinancialEventType = eventType.getRequired("event_type") + /** Globally unique identifier for a Statement Line Item */ + @JsonProperty("token") @ExcludeMissing fun _token() = token - /** Date that the transaction effected the account balance */ - fun effectiveDate(): LocalDate = effectiveDate.getRequired("effective_date") + /** Transaction amount in cents */ + @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - fun descriptor(): String? = descriptor.getNullable("descriptor") + @JsonProperty("category") @ExcludeMissing fun _category() = category - /** Transaction amount in cents */ - fun amount(): Long = amount.getRequired("amount") + /** Timestamp of when the line item was generated */ + @JsonProperty("created") @ExcludeMissing fun _created() = created /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(): String = currency.getRequired("currency") + @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - /** Timestamp of when the line item was generated */ - fun created(): OffsetDateTime = created.getRequired("created") + /** Date that the transaction effected the account balance */ + @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate - /** Globally unique identifier for a Statement Line Item */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType /** Globally unique identifier for a financial account */ @JsonProperty("financial_account_token") @ExcludeMissing fun _financialAccountToken() = financialAccountToken - /** Globally unique identifier for a card */ - @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken - - /** Globally unique identifier for a financial transaction */ - @JsonProperty("financial_transaction_token") - @ExcludeMissing - fun _financialTransactionToken() = financialTransactionToken - /** Globally unique identifier for a financial transaction event */ @JsonProperty("financial_transaction_event_token") @ExcludeMissing fun _financialTransactionEventToken() = financialTransactionEventToken - @JsonProperty("category") @ExcludeMissing fun _category() = category - - @JsonProperty("event_type") @ExcludeMissing fun _eventType() = eventType + /** Globally unique identifier for a financial transaction */ + @JsonProperty("financial_transaction_token") + @ExcludeMissing + fun _financialTransactionToken() = financialTransactionToken - /** Date that the transaction effected the account balance */ - @JsonProperty("effective_date") @ExcludeMissing fun _effectiveDate() = effectiveDate + /** Globally unique identifier for a card */ + @JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken @JsonProperty("descriptor") @ExcludeMissing fun _descriptor() = descriptor - /** Transaction amount in cents */ - @JsonProperty("amount") @ExcludeMissing fun _amount() = amount - - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - @JsonProperty("currency") @ExcludeMissing fun _currency() = currency - - /** Timestamp of when the line item was generated */ - @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -236,17 +236,17 @@ private constructor( fun validate(): StatementLineItemResponse = apply { if (!validated) { token() - financialAccountToken() - cardToken() - financialTransactionToken() - financialTransactionEventToken() + amount() category() - eventType() + created() + currency() effectiveDate() + eventType() + financialAccountToken() + financialTransactionEventToken() + financialTransactionToken() + cardToken() descriptor() - amount() - currency() - created() validated = true } } @@ -261,33 +261,33 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var financialAccountToken: JsonField = JsonMissing.of() - private var cardToken: JsonField = JsonMissing.of() - private var financialTransactionToken: JsonField = JsonMissing.of() - private var financialTransactionEventToken: JsonField = JsonMissing.of() + private var amount: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() - private var eventType: JsonField = JsonMissing.of() + private var created: JsonField = JsonMissing.of() + private var currency: JsonField = JsonMissing.of() private var effectiveDate: JsonField = JsonMissing.of() + private var eventType: JsonField = JsonMissing.of() + private var financialAccountToken: JsonField = JsonMissing.of() + private var financialTransactionEventToken: JsonField = JsonMissing.of() + private var financialTransactionToken: JsonField = JsonMissing.of() + private var cardToken: JsonField = JsonMissing.of() private var descriptor: JsonField = JsonMissing.of() - private var amount: JsonField = JsonMissing.of() - private var currency: JsonField = JsonMissing.of() - private var created: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(statementLineItemResponse: StatementLineItemResponse) = apply { token = statementLineItemResponse.token + amount = statementLineItemResponse.amount + category = statementLineItemResponse.category + created = statementLineItemResponse.created + currency = statementLineItemResponse.currency + effectiveDate = statementLineItemResponse.effectiveDate + eventType = statementLineItemResponse.eventType financialAccountToken = statementLineItemResponse.financialAccountToken - cardToken = statementLineItemResponse.cardToken - financialTransactionToken = statementLineItemResponse.financialTransactionToken financialTransactionEventToken = statementLineItemResponse.financialTransactionEventToken - category = statementLineItemResponse.category - eventType = statementLineItemResponse.eventType - effectiveDate = statementLineItemResponse.effectiveDate + financialTransactionToken = statementLineItemResponse.financialTransactionToken + cardToken = statementLineItemResponse.cardToken descriptor = statementLineItemResponse.descriptor - amount = statementLineItemResponse.amount - currency = statementLineItemResponse.currency - created = statementLineItemResponse.created additionalProperties = statementLineItemResponse.additionalProperties.toMutableMap() } @@ -297,44 +297,36 @@ private constructor( /** Globally unique identifier for a Statement Line Item */ fun token(token: JsonField) = apply { this.token = token } - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: String) = - financialAccountToken(JsonField.of(financialAccountToken)) + /** Transaction amount in cents */ + fun amount(amount: Long) = amount(JsonField.of(amount)) - /** Globally unique identifier for a financial account */ - fun financialAccountToken(financialAccountToken: JsonField) = apply { - this.financialAccountToken = financialAccountToken - } + /** Transaction amount in cents */ + fun amount(amount: JsonField) = apply { this.amount = amount } - /** Globally unique identifier for a card */ - fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) + fun category(category: TransactionCategory) = category(JsonField.of(category)) - /** Globally unique identifier for a card */ - fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } + fun category(category: JsonField) = apply { + this.category = category + } - /** Globally unique identifier for a financial transaction */ - fun financialTransactionToken(financialTransactionToken: String) = - financialTransactionToken(JsonField.of(financialTransactionToken)) + /** Timestamp of when the line item was generated */ + fun created(created: OffsetDateTime) = created(JsonField.of(created)) - /** Globally unique identifier for a financial transaction */ - fun financialTransactionToken(financialTransactionToken: JsonField) = apply { - this.financialTransactionToken = financialTransactionToken - } + /** Timestamp of when the line item was generated */ + fun created(created: JsonField) = apply { this.created = created } - /** Globally unique identifier for a financial transaction event */ - fun financialTransactionEventToken(financialTransactionEventToken: String) = - financialTransactionEventToken(JsonField.of(financialTransactionEventToken)) + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(currency: String) = currency(JsonField.of(currency)) - /** Globally unique identifier for a financial transaction event */ - fun financialTransactionEventToken(financialTransactionEventToken: JsonField) = - apply { - this.financialTransactionEventToken = financialTransactionEventToken - } + /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ + fun currency(currency: JsonField) = apply { this.currency = currency } - fun category(category: TransactionCategory) = category(JsonField.of(category)) + /** Date that the transaction effected the account balance */ + fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) - fun category(category: JsonField) = apply { - this.category = category + /** Date that the transaction effected the account balance */ + fun effectiveDate(effectiveDate: JsonField) = apply { + this.effectiveDate = effectiveDate } fun eventType(eventType: FinancialEventType) = eventType(JsonField.of(eventType)) @@ -343,35 +335,43 @@ private constructor( this.eventType = eventType } - /** Date that the transaction effected the account balance */ - fun effectiveDate(effectiveDate: LocalDate) = effectiveDate(JsonField.of(effectiveDate)) + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: String) = + financialAccountToken(JsonField.of(financialAccountToken)) - /** Date that the transaction effected the account balance */ - fun effectiveDate(effectiveDate: JsonField) = apply { - this.effectiveDate = effectiveDate + /** Globally unique identifier for a financial account */ + fun financialAccountToken(financialAccountToken: JsonField) = apply { + this.financialAccountToken = financialAccountToken } - fun descriptor(descriptor: String) = descriptor(JsonField.of(descriptor)) + /** Globally unique identifier for a financial transaction event */ + fun financialTransactionEventToken(financialTransactionEventToken: String) = + financialTransactionEventToken(JsonField.of(financialTransactionEventToken)) - fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } + /** Globally unique identifier for a financial transaction event */ + fun financialTransactionEventToken(financialTransactionEventToken: JsonField) = + apply { + this.financialTransactionEventToken = financialTransactionEventToken + } - /** Transaction amount in cents */ - fun amount(amount: Long) = amount(JsonField.of(amount)) + /** Globally unique identifier for a financial transaction */ + fun financialTransactionToken(financialTransactionToken: String) = + financialTransactionToken(JsonField.of(financialTransactionToken)) - /** Transaction amount in cents */ - fun amount(amount: JsonField) = apply { this.amount = amount } + /** Globally unique identifier for a financial transaction */ + fun financialTransactionToken(financialTransactionToken: JsonField) = apply { + this.financialTransactionToken = financialTransactionToken + } - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(currency: String) = currency(JsonField.of(currency)) + /** Globally unique identifier for a card */ + fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken)) - /** 3-digit alphabetic ISO 4217 code for the settling currency of the transaction */ - fun currency(currency: JsonField) = apply { this.currency = currency } + /** Globally unique identifier for a card */ + fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken } - /** Timestamp of when the line item was generated */ - fun created(created: OffsetDateTime) = created(JsonField.of(created)) + fun descriptor(descriptor: String) = descriptor(JsonField.of(descriptor)) - /** Timestamp of when the line item was generated */ - fun created(created: JsonField) = apply { this.created = created } + fun descriptor(descriptor: JsonField) = apply { this.descriptor = descriptor } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -395,17 +395,17 @@ private constructor( fun build(): StatementLineItemResponse = StatementLineItemResponse( token, - financialAccountToken, - cardToken, - financialTransactionToken, - financialTransactionEventToken, + amount, category, - eventType, + created, + currency, effectiveDate, + eventType, + financialAccountToken, + financialTransactionEventToken, + financialTransactionToken, + cardToken, descriptor, - amount, - currency, - created, additionalProperties.toImmutable(), ) } @@ -943,17 +943,17 @@ private constructor( return true } - return /* spotless:off */ other is StatementLineItemResponse && token == other.token && financialAccountToken == other.financialAccountToken && cardToken == other.cardToken && financialTransactionToken == other.financialTransactionToken && financialTransactionEventToken == other.financialTransactionEventToken && category == other.category && eventType == other.eventType && effectiveDate == other.effectiveDate && descriptor == other.descriptor && amount == other.amount && currency == other.currency && created == other.created && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is StatementLineItemResponse && token == other.token && amount == other.amount && category == other.category && created == other.created && currency == other.currency && effectiveDate == other.effectiveDate && eventType == other.eventType && financialAccountToken == other.financialAccountToken && financialTransactionEventToken == other.financialTransactionEventToken && financialTransactionToken == other.financialTransactionToken && cardToken == other.cardToken && descriptor == other.descriptor && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, financialAccountToken, cardToken, financialTransactionToken, financialTransactionEventToken, category, eventType, effectiveDate, descriptor, amount, currency, created, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, category, created, currency, effectiveDate, eventType, financialAccountToken, financialTransactionEventToken, financialTransactionToken, cardToken, descriptor, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "StatementLineItemResponse{token=$token, financialAccountToken=$financialAccountToken, cardToken=$cardToken, financialTransactionToken=$financialTransactionToken, financialTransactionEventToken=$financialTransactionEventToken, category=$category, eventType=$eventType, effectiveDate=$effectiveDate, descriptor=$descriptor, amount=$amount, currency=$currency, created=$created, additionalProperties=$additionalProperties}" + "StatementLineItemResponse{token=$token, amount=$amount, category=$category, created=$created, currency=$currency, effectiveDate=$effectiveDate, eventType=$eventType, financialAccountToken=$financialAccountToken, financialTransactionEventToken=$financialTransactionEventToken, financialTransactionToken=$financialTransactionToken, cardToken=$cardToken, descriptor=$descriptor, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt index 348a7191..60774960 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/ThreeDSAuthenticationSimulateParams.kt @@ -335,25 +335,25 @@ constructor( class Merchant @JsonCreator private constructor( - @JsonProperty("country") private val country: String, @JsonProperty("id") private val id: String, + @JsonProperty("country") private val country: String, @JsonProperty("mcc") private val mcc: String, @JsonProperty("name") private val name: String, @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (e.g. USA) - */ - @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 + /** + * Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (e.g. USA) + */ + @JsonProperty("country") fun country(): String = country + /** * Merchant category code for the transaction to be simulated. A four-digit number listed in * ISO 18245. Supported merchant category codes can be found @@ -377,32 +377,32 @@ constructor( class Builder { - private var country: String? = null private var id: String? = null + private var country: String? = null private var mcc: String? = null private var name: String? = null private var additionalProperties: MutableMap = mutableMapOf() internal fun from(merchant: Merchant) = apply { - country = merchant.country id = merchant.id + country = merchant.country mcc = merchant.mcc name = merchant.name additionalProperties = merchant.additionalProperties.toMutableMap() } - /** - * Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (e.g. - * USA) - */ - fun country(country: String) = apply { this.country = country } - /** * Unique identifier to identify the payment card acceptor. Corresponds to * `merchant_acceptor_id` in authorization. */ fun id(id: String) = apply { this.id = id } + /** + * Country of the address provided by the cardholder in ISO 3166-1 alpha-3 format (e.g. + * USA) + */ + fun country(country: String) = apply { this.country = country } + /** * Merchant category code for the transaction to be simulated. A four-digit number * listed in ISO 18245. Supported merchant category codes can be found @@ -434,8 +434,8 @@ constructor( fun build(): Merchant = Merchant( - checkNotNull(country) { "`country` is required but was not set" }, checkNotNull(id) { "`id` is required but was not set" }, + checkNotNull(country) { "`country` 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.toImmutable(), @@ -447,17 +447,17 @@ constructor( return true } - return /* spotless:off */ other is Merchant && country == other.country && id == other.id && mcc == other.mcc && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Merchant && id == other.id && country == other.country && mcc == other.mcc && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(country, id, mcc, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(id, country, mcc, name, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Merchant{country=$country, id=$id, mcc=$mcc, name=$name, additionalProperties=$additionalProperties}" + "Merchant{id=$id, country=$country, mcc=$mcc, name=$name, additionalProperties=$additionalProperties}" } @NoAutoDetect diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt index 5d74a9bb..d2c1074d 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Tokenization.kt @@ -22,6 +22,7 @@ import java.util.Objects class Tokenization @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("account_token") @ExcludeMissing private val accountToken: JsonField = JsonMissing.of(), @@ -31,16 +32,9 @@ private constructor( @JsonProperty("created_at") @ExcludeMissing private val createdAt: JsonField = JsonMissing.of(), - @JsonProperty("digital_card_art_token") - @ExcludeMissing - private val digitalCardArtToken: JsonField = JsonMissing.of(), - @JsonProperty("events") - @ExcludeMissing - private val events: JsonField> = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("token_requestor_name") @ExcludeMissing private val tokenRequestorName: JsonField = JsonMissing.of(), @@ -53,9 +47,18 @@ private constructor( @JsonProperty("updated_at") @ExcludeMissing private val updatedAt: JsonField = JsonMissing.of(), + @JsonProperty("digital_card_art_token") + @ExcludeMissing + private val digitalCardArtToken: JsonField = JsonMissing.of(), + @JsonProperty("events") + @ExcludeMissing + private val events: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for a Tokenization */ + fun token(): String = token.getRequired("token") + /** The account token associated with the card being tokenized. */ fun accountToken(): String = accountToken.getRequired("account_token") @@ -65,22 +68,9 @@ private constructor( /** Date and time when the tokenization first occurred. UTC time zone. */ fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - /** - * Specifies the digital card art displayed in the user’s digital wallet after tokenization. - * This will be null if the tokenization was created without an associated digital card art. See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). - */ - fun digitalCardArtToken(): String? = digitalCardArtToken.getNullable("digital_card_art_token") - - /** A list of events related to the tokenization. */ - fun events(): List? = events.getNullable("events") - /** The status of the tokenization request */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier for a Tokenization */ - fun token(): String = token.getRequired("token") - /** The entity that requested the tokenization. Represents a Digital Wallet or merchant. */ fun tokenRequestorName(): TokenRequestorName = tokenRequestorName.getRequired("token_requestor_name") @@ -95,6 +85,19 @@ private constructor( /** Latest date and time when the tokenization was updated. UTC time zone. */ fun updatedAt(): OffsetDateTime = updatedAt.getRequired("updated_at") + /** + * Specifies the digital card art displayed in the user’s digital wallet after tokenization. + * This will be null if the tokenization was created without an associated digital card art. See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + */ + fun digitalCardArtToken(): String? = digitalCardArtToken.getNullable("digital_card_art_token") + + /** A list of events related to the tokenization. */ + fun events(): List? = events.getNullable("events") + + /** Globally unique identifier for a Tokenization */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** The account token associated with the card being tokenized. */ @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken @@ -104,24 +107,9 @@ private constructor( /** Date and time when the tokenization first occurred. UTC time zone. */ @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt - /** - * Specifies the digital card art displayed in the user’s digital wallet after tokenization. - * This will be null if the tokenization was created without an associated digital card art. 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 - - /** A list of events related to the tokenization. */ - @JsonProperty("events") @ExcludeMissing fun _events() = events - /** The status of the tokenization request */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier for a Tokenization */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** The entity that requested the tokenization. Represents a Digital Wallet or merchant. */ @JsonProperty("token_requestor_name") @ExcludeMissing @@ -140,6 +128,18 @@ private constructor( /** Latest date and time when the tokenization was updated. UTC time zone. */ @JsonProperty("updated_at") @ExcludeMissing fun _updatedAt() = updatedAt + /** + * Specifies the digital card art displayed in the user’s digital wallet after tokenization. + * This will be null if the tokenization was created without an associated digital card art. 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 + + /** A list of events related to the tokenization. */ + @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -148,17 +148,17 @@ private constructor( fun validate(): Tokenization = apply { if (!validated) { + token() accountToken() cardToken() createdAt() - digitalCardArtToken() - events()?.forEach { it.validate() } status() - token() tokenRequestorName() tokenUniqueReference() tokenizationChannel() updatedAt() + digitalCardArtToken() + events()?.forEach { it.validate() } validated = true } } @@ -172,34 +172,40 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var accountToken: JsonField = JsonMissing.of() private var cardToken: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() - private var digitalCardArtToken: JsonField = JsonMissing.of() - private var events: 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 tokenizationChannel: JsonField = JsonMissing.of() private var updatedAt: JsonField = JsonMissing.of() + private var digitalCardArtToken: JsonField = JsonMissing.of() + private var events: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(tokenization: Tokenization) = apply { + token = tokenization.token accountToken = tokenization.accountToken cardToken = tokenization.cardToken createdAt = tokenization.createdAt - digitalCardArtToken = tokenization.digitalCardArtToken - events = tokenization.events status = tokenization.status - token = tokenization.token tokenRequestorName = tokenization.tokenRequestorName tokenUniqueReference = tokenization.tokenUniqueReference tokenizationChannel = tokenization.tokenizationChannel updatedAt = tokenization.updatedAt + digitalCardArtToken = tokenization.digitalCardArtToken + events = tokenization.events additionalProperties = tokenization.additionalProperties.toMutableMap() } + /** Globally unique identifier for a Tokenization */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for a Tokenization */ + fun token(token: JsonField) = apply { this.token = token } + /** The account token associated with the card being tokenized. */ fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) @@ -220,43 +226,12 @@ private constructor( /** Date and time when the tokenization first occurred. UTC time zone. */ fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt } - /** - * Specifies the digital card art displayed in the user’s digital wallet after tokenization. - * This will be null if the tokenization was created without an associated digital card art. - * 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 displayed in the user’s digital wallet after tokenization. - * This will be null if the tokenization was created without an associated digital card art. - * See - * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). - */ - fun digitalCardArtToken(digitalCardArtToken: JsonField) = apply { - this.digitalCardArtToken = digitalCardArtToken - } - - /** A list of events related to the tokenization. */ - fun events(events: List) = events(JsonField.of(events)) - - /** A list of events related to the tokenization. */ - fun events(events: JsonField>) = apply { this.events = events } - /** The status of the tokenization request */ fun status(status: Status) = status(JsonField.of(status)) /** The status of the tokenization request */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier for a Tokenization */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for a Tokenization */ - fun token(token: JsonField) = apply { this.token = token } - /** The entity that requested the tokenization. Represents a Digital Wallet or merchant. */ fun tokenRequestorName(tokenRequestorName: TokenRequestorName) = tokenRequestorName(JsonField.of(tokenRequestorName)) @@ -290,6 +265,31 @@ private constructor( /** Latest date and time when the tokenization was updated. UTC time zone. */ fun updatedAt(updatedAt: JsonField) = apply { this.updatedAt = updatedAt } + /** + * Specifies the digital card art displayed in the user’s digital wallet after tokenization. + * This will be null if the tokenization was created without an associated digital card art. + * 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 displayed in the user’s digital wallet after tokenization. + * This will be null if the tokenization was created without an associated digital card art. + * See + * [Flexible Card Art Guide](https://docs.lithic.com/docs/about-digital-wallets#flexible-card-art). + */ + fun digitalCardArtToken(digitalCardArtToken: JsonField) = apply { + this.digitalCardArtToken = digitalCardArtToken + } + + /** A list of events related to the tokenization. */ + fun events(events: List) = events(JsonField.of(events)) + + /** A list of events related to the tokenization. */ + fun events(events: JsonField>) = apply { this.events = events } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -311,17 +311,17 @@ private constructor( fun build(): Tokenization = Tokenization( + token, accountToken, cardToken, createdAt, - digitalCardArtToken, - events.map { it.toImmutable() }, status, - token, tokenRequestorName, tokenUniqueReference, tokenizationChannel, updatedAt, + digitalCardArtToken, + events.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -585,41 +585,41 @@ private constructor( class TokenizationEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("created_at") @ExcludeMissing private val createdAt: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for a Tokenization Event */ + fun token(): String? = token.getNullable("token") + /** Date and time when the tokenization event first occurred. UTC time zone. */ fun createdAt(): OffsetDateTime? = createdAt.getNullable("created_at") /** Enum representing the result of the tokenization event */ fun result(): Result? = result.getNullable("result") - /** Globally unique identifier for a Tokenization Event */ - fun token(): String? = token.getNullable("token") - /** Enum representing the type of tokenization event that occurred */ fun type(): Type? = type.getNullable("type") + /** Globally unique identifier for a Tokenization Event */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Date and time when the tokenization event first occurred. UTC time zone. */ @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt /** Enum representing the result of the tokenization event */ @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Globally unique identifier for a Tokenization Event */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - /** Enum representing the type of tokenization event that occurred */ @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -631,9 +631,9 @@ private constructor( fun validate(): TokenizationEvent = apply { if (!validated) { + token() createdAt() result() - token() type() validated = true } @@ -648,20 +648,26 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var createdAt: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(tokenizationEvent: TokenizationEvent) = apply { + token = tokenizationEvent.token createdAt = tokenizationEvent.createdAt result = tokenizationEvent.result - token = tokenizationEvent.token type = tokenizationEvent.type additionalProperties = tokenizationEvent.additionalProperties.toMutableMap() } + /** Globally unique identifier for a Tokenization Event */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for a Tokenization Event */ + fun token(token: JsonField) = apply { this.token = token } + /** Date and time when the tokenization event first occurred. UTC time zone. */ fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt)) @@ -676,12 +682,6 @@ private constructor( /** Enum representing the result of the tokenization event */ fun result(result: JsonField) = apply { this.result = result } - /** Globally unique identifier for a Tokenization Event */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for a Tokenization Event */ - fun token(token: JsonField) = apply { this.token = token } - /** Enum representing the type of tokenization event that occurred */ fun type(type: Type) = type(JsonField.of(type)) @@ -709,9 +709,9 @@ private constructor( fun build(): TokenizationEvent = TokenizationEvent( + token, createdAt, result, - token, type, additionalProperties.toImmutable(), ) @@ -908,17 +908,17 @@ private constructor( return true } - return /* spotless:off */ other is TokenizationEvent && createdAt == other.createdAt && result == other.result && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TokenizationEvent && token == other.token && createdAt == other.createdAt && result == other.result && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(createdAt, result, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, createdAt, result, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TokenizationEvent{createdAt=$createdAt, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "TokenizationEvent{token=$token, createdAt=$createdAt, result=$result, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -926,15 +926,15 @@ private constructor( return true } - return /* spotless:off */ other is Tokenization && accountToken == other.accountToken && cardToken == other.cardToken && createdAt == other.createdAt && digitalCardArtToken == other.digitalCardArtToken && events == other.events && status == other.status && token == other.token && tokenRequestorName == other.tokenRequestorName && tokenUniqueReference == other.tokenUniqueReference && tokenizationChannel == other.tokenizationChannel && updatedAt == other.updatedAt && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Tokenization && token == other.token && accountToken == other.accountToken && cardToken == other.cardToken && createdAt == other.createdAt && status == other.status && tokenRequestorName == other.tokenRequestorName && tokenUniqueReference == other.tokenUniqueReference && tokenizationChannel == other.tokenizationChannel && updatedAt == other.updatedAt && digitalCardArtToken == other.digitalCardArtToken && events == other.events && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(accountToken, cardToken, createdAt, digitalCardArtToken, events, status, token, tokenRequestorName, tokenUniqueReference, tokenizationChannel, updatedAt, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, cardToken, createdAt, status, tokenRequestorName, tokenUniqueReference, tokenizationChannel, updatedAt, digitalCardArtToken, events, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Tokenization{accountToken=$accountToken, cardToken=$cardToken, createdAt=$createdAt, digitalCardArtToken=$digitalCardArtToken, events=$events, status=$status, token=$token, tokenRequestorName=$tokenRequestorName, tokenUniqueReference=$tokenUniqueReference, tokenizationChannel=$tokenizationChannel, updatedAt=$updatedAt, additionalProperties=$additionalProperties}" + "Tokenization{token=$token, accountToken=$accountToken, cardToken=$cardToken, createdAt=$createdAt, status=$status, tokenRequestorName=$tokenRequestorName, tokenUniqueReference=$tokenUniqueReference, tokenizationChannel=$tokenizationChannel, updatedAt=$updatedAt, digitalCardArtToken=$digitalCardArtToken, events=$events, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transaction.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transaction.kt index b21104c9..3143c6b6 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transaction.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transaction.kt @@ -22,15 +22,16 @@ import java.util.Objects class Transaction @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), + @JsonProperty("account_token") + @ExcludeMissing + private val accountToken: JsonField = JsonMissing.of(), @JsonProperty("acquirer_fee") @ExcludeMissing private val acquirerFee: JsonField = JsonMissing.of(), @JsonProperty("acquirer_reference_number") @ExcludeMissing private val acquirerReferenceNumber: JsonField = JsonMissing.of(), - @JsonProperty("account_token") - @ExcludeMissing - private val accountToken: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @JsonProperty("amounts") @ExcludeMissing @@ -51,9 +52,6 @@ private constructor( @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), - @JsonProperty("events") - @ExcludeMissing - private val events: JsonField> = JsonMissing.of(), @JsonProperty("merchant") @ExcludeMissing private val merchant: JsonField = JsonMissing.of(), @@ -72,26 +70,34 @@ private constructor( @JsonProperty("network_risk_score") @ExcludeMissing private val networkRiskScore: JsonField = JsonMissing.of(), + @JsonProperty("pos") @ExcludeMissing private val pos: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("pos") @ExcludeMissing private val pos: JsonField = JsonMissing.of(), @JsonProperty("settled_amount") @ExcludeMissing private val settledAmount: JsonField = JsonMissing.of(), @JsonProperty("status") @ExcludeMissing private val status: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("token_info") @ExcludeMissing private val tokenInfo: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), + @JsonProperty("events") + @ExcludeMissing + private val events: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String = token.getRequired("token") + + /** The token for the account associated with this transaction. */ + fun accountToken(): String = accountToken.getRequired("account_token") + /** * Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the * currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative value @@ -106,9 +112,6 @@ private constructor( fun acquirerReferenceNumber(): String? = acquirerReferenceNumber.getNullable("acquirer_reference_number") - /** The token for the account associated with this transaction. */ - fun accountToken(): String = accountToken.getRequired("account_token") - /** * When the transaction is pending, this represents the authorization amount of the transaction * in the anticipated settlement currency. Once the transaction has settled, this field @@ -138,8 +141,6 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ fun created(): OffsetDateTime = created.getRequired("created") - fun events(): List? = events.getNullable("events") - fun merchant(): Merchant = merchant.getRequired("merchant") /** Analogous to the 'amount', but in the merchant currency. */ @@ -167,24 +168,29 @@ private constructor( */ fun networkRiskScore(): Long? = networkRiskScore.getNullable("network_risk_score") - fun result(): DeclineResult = result.getRequired("result") - fun pos(): Pos = pos.getRequired("pos") + fun result(): DeclineResult = result.getRequired("result") + /** The settled amount of the transaction in the settlement currency. */ fun settledAmount(): Long = settledAmount.getRequired("settled_amount") /** Status of the transaction. */ fun status(): Status = status.getRequired("status") - /** Globally unique identifier. */ - fun token(): String = token.getRequired("token") - fun tokenInfo(): TokenInfo? = tokenInfo.getNullable("token_info") /** Date and time when the transaction last updated. UTC time zone. */ fun updated(): OffsetDateTime = updated.getRequired("updated") + fun events(): List? = events.getNullable("events") + + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + + /** The token for the account associated with this transaction. */ + @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken + /** * Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the * currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative value @@ -200,9 +206,6 @@ private constructor( @ExcludeMissing fun _acquirerReferenceNumber() = acquirerReferenceNumber - /** The token for the account associated with this transaction. */ - @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken - /** * When the transaction is pending, this represents the authorization amount of the transaction * in the anticipated settlement currency. Once the transaction has settled, this field @@ -235,8 +238,6 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ @JsonProperty("created") @ExcludeMissing fun _created() = created - @JsonProperty("events") @ExcludeMissing fun _events() = events - @JsonProperty("merchant") @ExcludeMissing fun _merchant() = merchant /** Analogous to the 'amount', but in the merchant currency. */ @@ -265,24 +266,23 @@ private constructor( */ @JsonProperty("network_risk_score") @ExcludeMissing fun _networkRiskScore() = networkRiskScore - @JsonProperty("result") @ExcludeMissing fun _result() = result - @JsonProperty("pos") @ExcludeMissing fun _pos() = pos + @JsonProperty("result") @ExcludeMissing fun _result() = result + /** The settled amount of the transaction in the settlement currency. */ @JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount /** Status of the transaction. */ @JsonProperty("status") @ExcludeMissing fun _status() = status - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("token_info") @ExcludeMissing fun _tokenInfo() = tokenInfo /** Date and time when the transaction last updated. UTC time zone. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated + @JsonProperty("events") @ExcludeMissing fun _events() = events + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -291,9 +291,10 @@ private constructor( fun validate(): Transaction = apply { if (!validated) { + token() + accountToken() acquirerFee() acquirerReferenceNumber() - accountToken() amount() amounts().validate() authorizationAmount() @@ -302,20 +303,19 @@ private constructor( cardToken() cardholderAuthentication()?.validate() created() - events()?.forEach { it.validate() } merchant().validate() merchantAmount() merchantAuthorizationAmount() merchantCurrency() network() networkRiskScore() - result() pos().validate() + result() settledAmount() status() - token() tokenInfo()?.validate() updated() + events()?.forEach { it.validate() } validated = true } } @@ -329,9 +329,10 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() + private var accountToken: JsonField = JsonMissing.of() private var acquirerFee: JsonField = JsonMissing.of() private var acquirerReferenceNumber: JsonField = JsonMissing.of() - private var accountToken: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var amounts: JsonField = JsonMissing.of() private var authorizationAmount: JsonField = JsonMissing.of() @@ -340,26 +341,26 @@ private constructor( private var cardToken: JsonField = JsonMissing.of() private var cardholderAuthentication: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var events: JsonField> = JsonMissing.of() private var merchant: JsonField = JsonMissing.of() private var merchantAmount: JsonField = JsonMissing.of() private var merchantAuthorizationAmount: JsonField = JsonMissing.of() private var merchantCurrency: JsonField = JsonMissing.of() private var network: JsonField = JsonMissing.of() private var networkRiskScore: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() private var pos: JsonField = JsonMissing.of() + private var result: JsonField = JsonMissing.of() private var settledAmount: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var tokenInfo: JsonField = JsonMissing.of() private var updated: JsonField = JsonMissing.of() + private var events: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(transaction: Transaction) = apply { + token = transaction.token + accountToken = transaction.accountToken acquirerFee = transaction.acquirerFee acquirerReferenceNumber = transaction.acquirerReferenceNumber - accountToken = transaction.accountToken amount = transaction.amount amounts = transaction.amounts authorizationAmount = transaction.authorizationAmount @@ -368,23 +369,36 @@ private constructor( cardToken = transaction.cardToken cardholderAuthentication = transaction.cardholderAuthentication created = transaction.created - events = transaction.events merchant = transaction.merchant merchantAmount = transaction.merchantAmount merchantAuthorizationAmount = transaction.merchantAuthorizationAmount merchantCurrency = transaction.merchantCurrency network = transaction.network networkRiskScore = transaction.networkRiskScore - result = transaction.result pos = transaction.pos + result = transaction.result settledAmount = transaction.settledAmount status = transaction.status - token = transaction.token tokenInfo = transaction.tokenInfo updated = transaction.updated + events = transaction.events additionalProperties = transaction.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + + /** The token for the account associated with this transaction. */ + fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) + + /** The token for the account associated with this transaction. */ + fun accountToken(accountToken: JsonField) = apply { + this.accountToken = accountToken + } + /** * Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the * currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative @@ -414,14 +428,6 @@ private constructor( this.acquirerReferenceNumber = acquirerReferenceNumber } - /** The token for the account associated with this transaction. */ - fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken)) - - /** The token for the account associated with this transaction. */ - fun accountToken(accountToken: JsonField) = apply { - this.accountToken = accountToken - } - /** * When the transaction is pending, this represents the authorization amount of the * transaction in the anticipated settlement currency. Once the transaction has settled, @@ -487,10 +493,6 @@ private constructor( /** Date and time when the transaction first occurred. UTC time zone. */ fun created(created: JsonField) = apply { this.created = created } - fun events(events: List) = events(JsonField.of(events)) - - fun events(events: JsonField>) = apply { this.events = events } - fun merchant(merchant: Merchant) = merchant(JsonField.of(merchant)) fun merchant(merchant: JsonField) = apply { this.merchant = merchant } @@ -554,14 +556,14 @@ private constructor( this.networkRiskScore = networkRiskScore } - fun result(result: DeclineResult) = result(JsonField.of(result)) - - fun result(result: JsonField) = apply { this.result = result } - fun pos(pos: Pos) = pos(JsonField.of(pos)) fun pos(pos: JsonField) = apply { this.pos = pos } + fun result(result: DeclineResult) = result(JsonField.of(result)) + + fun result(result: JsonField) = apply { this.result = result } + /** The settled amount of the transaction in the settlement currency. */ fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount)) @@ -576,12 +578,6 @@ private constructor( /** Status of the transaction. */ fun status(status: JsonField) = apply { this.status = status } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun tokenInfo(tokenInfo: TokenInfo) = tokenInfo(JsonField.of(tokenInfo)) fun tokenInfo(tokenInfo: JsonField) = apply { this.tokenInfo = tokenInfo } @@ -592,6 +588,10 @@ private constructor( /** Date and time when the transaction last updated. UTC time zone. */ fun updated(updated: JsonField) = apply { this.updated = updated } + fun events(events: List) = events(JsonField.of(events)) + + fun events(events: JsonField>) = apply { this.events = events } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -613,9 +613,10 @@ private constructor( fun build(): Transaction = Transaction( + token, + accountToken, acquirerFee, acquirerReferenceNumber, - accountToken, amount, amounts, authorizationAmount, @@ -624,20 +625,19 @@ private constructor( cardToken, cardholderAuthentication, created, - events.map { it.toImmutable() }, merchant, merchantAmount, merchantAuthorizationAmount, merchantCurrency, network, networkRiskScore, - result, pos, + result, settledAmount, status, - token, tokenInfo, updated, + events.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -4224,6 +4224,9 @@ private constructor( class TransactionEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @@ -4233,29 +4236,29 @@ private constructor( @JsonProperty("created") @ExcludeMissing private val created: JsonField = JsonMissing.of(), - @JsonProperty("network_info") - @ExcludeMissing - private val networkInfo: JsonField = JsonMissing.of(), @JsonProperty("detailed_results") @ExcludeMissing private val detailedResults: JsonField> = JsonMissing.of(), - @JsonProperty("rule_results") - @ExcludeMissing - private val ruleResults: JsonField> = JsonMissing.of(), @JsonProperty("effective_polarity") @ExcludeMissing private val effectivePolarity: JsonField = JsonMissing.of(), + @JsonProperty("network_info") + @ExcludeMissing + private val networkInfo: JsonField = JsonMissing.of(), @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("token") + @JsonProperty("rule_results") @ExcludeMissing - private val token: JsonField = JsonMissing.of(), + private val ruleResults: JsonField> = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Transaction event identifier. */ + fun token(): String = token.getRequired("token") + /** Amount of the event in the settlement currency. */ fun amount(): Long = amount.getRequired("amount") @@ -4264,6 +4267,13 @@ 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") + + /** Indicates whether the transaction event is a credit or debit to the account. */ + fun effectivePolarity(): EffectivePolarity = + effectivePolarity.getRequired("effective_polarity") + /** * Information provided by the card network in each event. This includes common identifiers * shared between you, Lithic, the card network and in some cases the acquirer. These @@ -4274,23 +4284,16 @@ private constructor( */ fun networkInfo(): NetworkInfo? = networkInfo.getNullable("network_info") - fun detailedResults(): List = - detailedResults.getRequired("detailed_results") - - fun ruleResults(): List = ruleResults.getRequired("rule_results") - - /** Indicates whether the transaction event is a credit or debit to the account. */ - fun effectivePolarity(): EffectivePolarity = - effectivePolarity.getRequired("effective_polarity") - fun result(): DeclineResult = result.getRequired("result") - /** Transaction event identifier. */ - fun token(): String = token.getRequired("token") + fun ruleResults(): List = ruleResults.getRequired("rule_results") /** Type of transaction event */ fun type(): Type = type.getRequired("type") + /** Transaction event identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Amount of the event in the settlement currency. */ @JsonProperty("amount") @ExcludeMissing fun _amount() = amount @@ -4299,6 +4302,13 @@ 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 + + /** Indicates whether the transaction event is a credit or debit to the account. */ + @JsonProperty("effective_polarity") + @ExcludeMissing + fun _effectivePolarity() = effectivePolarity + /** * Information provided by the card network in each event. This includes common identifiers * shared between you, Lithic, the card network and in some cases the acquirer. These @@ -4309,19 +4319,9 @@ private constructor( */ @JsonProperty("network_info") @ExcludeMissing fun _networkInfo() = networkInfo - @JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults - - @JsonProperty("rule_results") @ExcludeMissing fun _ruleResults() = ruleResults - - /** Indicates whether the transaction event is a credit or debit to the account. */ - @JsonProperty("effective_polarity") - @ExcludeMissing - fun _effectivePolarity() = effectivePolarity - @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Transaction event identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + @JsonProperty("rule_results") @ExcludeMissing fun _ruleResults() = ruleResults /** Type of transaction event */ @JsonProperty("type") @ExcludeMissing fun _type() = type @@ -4334,15 +4334,15 @@ private constructor( fun validate(): TransactionEvent = apply { if (!validated) { + token() amount() amounts().validate() created() - networkInfo()?.validate() detailedResults() - ruleResults().forEach { it.validate() } effectivePolarity() + networkInfo()?.validate() result() - token() + ruleResults().forEach { it.validate() } type() validated = true } @@ -4357,32 +4357,38 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var amounts: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() - private var networkInfo: JsonField = JsonMissing.of() private var detailedResults: JsonField> = JsonMissing.of() - private var ruleResults: JsonField> = JsonMissing.of() private var effectivePolarity: JsonField = JsonMissing.of() + private var networkInfo: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() + private var ruleResults: JsonField> = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(transactionEvent: TransactionEvent) = apply { + token = transactionEvent.token amount = transactionEvent.amount amounts = transactionEvent.amounts created = transactionEvent.created - networkInfo = transactionEvent.networkInfo detailedResults = transactionEvent.detailedResults - ruleResults = transactionEvent.ruleResults effectivePolarity = transactionEvent.effectivePolarity + networkInfo = transactionEvent.networkInfo result = transactionEvent.result - token = transactionEvent.token + ruleResults = transactionEvent.ruleResults type = transactionEvent.type additionalProperties = transactionEvent.additionalProperties.toMutableMap() } + /** Transaction event identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Transaction event identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** Amount of the event in the settlement currency. */ fun amount(amount: Long) = amount(JsonField.of(amount)) @@ -4401,6 +4407,22 @@ private constructor( /** RFC 3339 date and time this event entered the system. UTC time zone. */ fun created(created: JsonField) = apply { this.created = created } + fun detailedResults(detailedResults: List) = + detailedResults(JsonField.of(detailedResults)) + + fun detailedResults(detailedResults: JsonField>) = apply { + this.detailedResults = detailedResults + } + + /** Indicates whether the transaction event is a credit or debit to the account. */ + fun effectivePolarity(effectivePolarity: EffectivePolarity) = + effectivePolarity(JsonField.of(effectivePolarity)) + + /** Indicates whether the transaction event is a credit or debit to the account. */ + fun effectivePolarity(effectivePolarity: JsonField) = apply { + this.effectivePolarity = effectivePolarity + } + /** * Information provided by the card network in each event. This includes common * identifiers shared between you, Lithic, the card network and in some cases the @@ -4423,12 +4445,9 @@ private constructor( this.networkInfo = networkInfo } - fun detailedResults(detailedResults: List) = - detailedResults(JsonField.of(detailedResults)) + fun result(result: DeclineResult) = result(JsonField.of(result)) - fun detailedResults(detailedResults: JsonField>) = apply { - this.detailedResults = detailedResults - } + fun result(result: JsonField) = apply { this.result = result } fun ruleResults(ruleResults: List) = ruleResults(JsonField.of(ruleResults)) @@ -4436,25 +4455,6 @@ private constructor( this.ruleResults = ruleResults } - /** Indicates whether the transaction event is a credit or debit to the account. */ - fun effectivePolarity(effectivePolarity: EffectivePolarity) = - effectivePolarity(JsonField.of(effectivePolarity)) - - /** Indicates whether the transaction event is a credit or debit to the account. */ - fun effectivePolarity(effectivePolarity: JsonField) = apply { - this.effectivePolarity = effectivePolarity - } - - fun result(result: DeclineResult) = result(JsonField.of(result)) - - fun result(result: JsonField) = apply { this.result = result } - - /** Transaction event identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Transaction event identifier. */ - fun token(token: JsonField) = apply { this.token = token } - /** Type of transaction event */ fun type(type: Type) = type(JsonField.of(type)) @@ -4482,15 +4482,15 @@ private constructor( fun build(): TransactionEvent = TransactionEvent( + token, amount, amounts, created, - networkInfo, detailedResults.map { it.toImmutable() }, - ruleResults.map { it.toImmutable() }, effectivePolarity, + networkInfo, result, - token, + ruleResults.map { it.toImmutable() }, type, additionalProperties.toImmutable(), ) @@ -6264,15 +6264,15 @@ private constructor( @JsonProperty("auth_rule_token") @ExcludeMissing private val authRuleToken: JsonField = JsonMissing.of(), - @JsonProperty("result") + @JsonProperty("explanation") @ExcludeMissing - private val result: JsonField = JsonMissing.of(), + private val explanation: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), - @JsonProperty("explanation") + @JsonProperty("result") @ExcludeMissing - private val explanation: JsonField = JsonMissing.of(), + private val result: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { @@ -6285,14 +6285,14 @@ private constructor( */ fun authRuleToken(): String? = authRuleToken.getNullable("auth_rule_token") - /** The detailed_result associated with this rule's decline. */ - fun result(): DetailedResult = result.getRequired("result") + /** A human-readable explanation outlining the motivation for the rule's decline. */ + fun explanation(): String? = explanation.getNullable("explanation") /** The name for the rule, if any was configured. */ fun name(): String? = name.getNullable("name") - /** A human-readable explanation outlining the motivation for the rule's decline. */ - fun explanation(): String? = explanation.getNullable("explanation") + /** The detailed_result associated with this rule's decline. */ + fun result(): DetailedResult = result.getRequired("result") /** * The Auth Rule Token associated with the rule from which the decline originated. If @@ -6302,14 +6302,14 @@ private constructor( */ @JsonProperty("auth_rule_token") @ExcludeMissing fun _authRuleToken() = authRuleToken - /** The detailed_result associated with this rule's decline. */ - @JsonProperty("result") @ExcludeMissing fun _result() = result + /** A human-readable explanation outlining the motivation for the rule's decline. */ + @JsonProperty("explanation") @ExcludeMissing fun _explanation() = explanation /** The name for the rule, if any was configured. */ @JsonProperty("name") @ExcludeMissing fun _name() = name - /** A human-readable explanation outlining the motivation for the rule's decline. */ - @JsonProperty("explanation") @ExcludeMissing fun _explanation() = explanation + /** The detailed_result associated with this rule's decline. */ + @JsonProperty("result") @ExcludeMissing fun _result() = result @JsonAnyGetter @ExcludeMissing @@ -6320,9 +6320,9 @@ private constructor( fun validate(): RuleResult = apply { if (!validated) { authRuleToken() - result() - name() explanation() + name() + result() validated = true } } @@ -6337,16 +6337,16 @@ private constructor( class Builder { private var authRuleToken: JsonField = JsonMissing.of() - private var result: JsonField = JsonMissing.of() - private var name: JsonField = JsonMissing.of() private var explanation: JsonField = JsonMissing.of() + private var name: JsonField = JsonMissing.of() + private var result: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(ruleResult: RuleResult) = apply { authRuleToken = ruleResult.authRuleToken - result = ruleResult.result - name = ruleResult.name explanation = ruleResult.explanation + name = ruleResult.name + result = ruleResult.result additionalProperties = ruleResult.additionalProperties.toMutableMap() } @@ -6369,11 +6369,13 @@ private constructor( this.authRuleToken = authRuleToken } - /** The detailed_result associated with this rule's decline. */ - fun result(result: DetailedResult) = result(JsonField.of(result)) + /** A human-readable explanation outlining the motivation for the rule's decline. */ + fun explanation(explanation: String) = explanation(JsonField.of(explanation)) - /** The detailed_result associated with this rule's decline. */ - fun result(result: JsonField) = apply { this.result = result } + /** A human-readable explanation outlining the motivation for the rule's decline. */ + fun explanation(explanation: JsonField) = apply { + this.explanation = explanation + } /** The name for the rule, if any was configured. */ fun name(name: String) = name(JsonField.of(name)) @@ -6381,13 +6383,11 @@ private constructor( /** The name for the rule, if any was configured. */ fun name(name: JsonField) = apply { this.name = name } - /** A human-readable explanation outlining the motivation for the rule's decline. */ - fun explanation(explanation: String) = explanation(JsonField.of(explanation)) + /** The detailed_result associated with this rule's decline. */ + fun result(result: DetailedResult) = result(JsonField.of(result)) - /** A human-readable explanation outlining the motivation for the rule's decline. */ - fun explanation(explanation: JsonField) = apply { - this.explanation = explanation - } + /** The detailed_result associated with this rule's decline. */ + fun result(result: JsonField) = apply { this.result = result } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -6414,9 +6414,9 @@ private constructor( fun build(): RuleResult = RuleResult( authRuleToken, - result, - name, explanation, + name, + result, additionalProperties.toImmutable(), ) } @@ -6807,17 +6807,17 @@ private constructor( return true } - return /* spotless:off */ other is RuleResult && authRuleToken == other.authRuleToken && result == other.result && name == other.name && explanation == other.explanation && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is RuleResult && authRuleToken == other.authRuleToken && explanation == other.explanation && name == other.name && result == other.result && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(authRuleToken, result, name, explanation, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(authRuleToken, explanation, name, result, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "RuleResult{authRuleToken=$authRuleToken, result=$result, name=$name, explanation=$explanation, additionalProperties=$additionalProperties}" + "RuleResult{authRuleToken=$authRuleToken, explanation=$explanation, name=$name, result=$result, additionalProperties=$additionalProperties}" } class Type @@ -6954,17 +6954,17 @@ private constructor( return true } - return /* spotless:off */ other is TransactionEvent && amount == other.amount && amounts == other.amounts && created == other.created && networkInfo == other.networkInfo && detailedResults == other.detailedResults && ruleResults == other.ruleResults && effectivePolarity == other.effectivePolarity && result == other.result && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TransactionEvent && token == other.token && amount == other.amount && amounts == other.amounts && created == other.created && detailedResults == other.detailedResults && effectivePolarity == other.effectivePolarity && networkInfo == other.networkInfo && result == other.result && ruleResults == other.ruleResults && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, amounts, created, networkInfo, detailedResults, ruleResults, effectivePolarity, result, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, amounts, created, detailedResults, effectivePolarity, networkInfo, result, ruleResults, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TransactionEvent{amount=$amount, amounts=$amounts, created=$created, networkInfo=$networkInfo, detailedResults=$detailedResults, ruleResults=$ruleResults, effectivePolarity=$effectivePolarity, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "TransactionEvent{token=$token, amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, networkInfo=$networkInfo, result=$result, ruleResults=$ruleResults, type=$type, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -6972,15 +6972,15 @@ private constructor( return true } - return /* spotless:off */ other is Transaction && acquirerFee == other.acquirerFee && acquirerReferenceNumber == other.acquirerReferenceNumber && accountToken == other.accountToken && amount == other.amount && amounts == other.amounts && authorizationAmount == other.authorizationAmount && authorizationCode == other.authorizationCode && avs == other.avs && cardToken == other.cardToken && cardholderAuthentication == other.cardholderAuthentication && created == other.created && events == other.events && merchant == other.merchant && merchantAmount == other.merchantAmount && merchantAuthorizationAmount == other.merchantAuthorizationAmount && merchantCurrency == other.merchantCurrency && network == other.network && networkRiskScore == other.networkRiskScore && result == other.result && pos == other.pos && settledAmount == other.settledAmount && status == other.status && token == other.token && tokenInfo == other.tokenInfo && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Transaction && token == other.token && accountToken == other.accountToken && acquirerFee == other.acquirerFee && acquirerReferenceNumber == other.acquirerReferenceNumber && amount == other.amount && amounts == other.amounts && authorizationAmount == other.authorizationAmount && authorizationCode == other.authorizationCode && avs == other.avs && cardToken == other.cardToken && cardholderAuthentication == other.cardholderAuthentication && created == other.created && merchant == other.merchant && merchantAmount == other.merchantAmount && merchantAuthorizationAmount == other.merchantAuthorizationAmount && merchantCurrency == other.merchantCurrency && network == other.network && networkRiskScore == other.networkRiskScore && pos == other.pos && result == other.result && settledAmount == other.settledAmount && status == other.status && tokenInfo == other.tokenInfo && updated == other.updated && events == other.events && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(acquirerFee, acquirerReferenceNumber, accountToken, amount, amounts, authorizationAmount, authorizationCode, avs, cardToken, cardholderAuthentication, created, events, merchant, merchantAmount, merchantAuthorizationAmount, merchantCurrency, network, networkRiskScore, result, pos, settledAmount, status, token, tokenInfo, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountToken, acquirerFee, acquirerReferenceNumber, amount, amounts, authorizationAmount, authorizationCode, avs, cardToken, cardholderAuthentication, created, merchant, merchantAmount, merchantAuthorizationAmount, merchantCurrency, network, networkRiskScore, pos, result, settledAmount, status, tokenInfo, updated, events, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Transaction{acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, accountToken=$accountToken, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, events=$events, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, result=$result, pos=$pos, settledAmount=$settledAmount, status=$status, token=$token, tokenInfo=$tokenInfo, updated=$updated, additionalProperties=$additionalProperties}" + "Transaction{token=$token, accountToken=$accountToken, acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, tokenInfo=$tokenInfo, updated=$updated, events=$events, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt index e91cef8e..56c4d63b 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationAdviceResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class TransactionSimulateAuthorizationAdviceResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("debugging_request_id") @ExcludeMissing private val debuggingRequestId: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** A unique token to reference this transaction. */ + fun token(): String? = token.getNullable("token") + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(): String? = debuggingRequestId.getNullable("debugging_request_id") /** A unique token to reference this transaction. */ - fun token(): String? = token.getNullable("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Debugging request ID to share with Lithic Support team. */ @JsonProperty("debugging_request_id") @ExcludeMissing fun _debuggingRequestId() = debuggingRequestId - /** A unique token to reference this transaction. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): TransactionSimulateAuthorizationAdviceResponse = apply { if (!validated) { - debuggingRequestId() token() + debuggingRequestId() validated = true } } @@ -63,20 +63,26 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( transactionSimulateAuthorizationAdviceResponse: TransactionSimulateAuthorizationAdviceResponse ) = apply { - debuggingRequestId = transactionSimulateAuthorizationAdviceResponse.debuggingRequestId token = transactionSimulateAuthorizationAdviceResponse.token + debuggingRequestId = transactionSimulateAuthorizationAdviceResponse.debuggingRequestId additionalProperties = transactionSimulateAuthorizationAdviceResponse.additionalProperties.toMutableMap() } + /** A unique token to reference this transaction. */ + fun token(token: String) = token(JsonField.of(token)) + + /** A unique token to reference this transaction. */ + fun token(token: JsonField) = apply { this.token = token } + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(debuggingRequestId: String) = debuggingRequestId(JsonField.of(debuggingRequestId)) @@ -86,12 +92,6 @@ private constructor( this.debuggingRequestId = debuggingRequestId } - /** A unique token to reference this transaction. */ - fun token(token: String) = token(JsonField.of(token)) - - /** A unique token to reference this transaction. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -113,8 +113,8 @@ private constructor( fun build(): TransactionSimulateAuthorizationAdviceResponse = TransactionSimulateAuthorizationAdviceResponse( - debuggingRequestId, token, + debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -124,15 +124,15 @@ private constructor( return true } - return /* spotless:off */ other is TransactionSimulateAuthorizationAdviceResponse && debuggingRequestId == other.debuggingRequestId && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TransactionSimulateAuthorizationAdviceResponse && token == other.token && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, debuggingRequestId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TransactionSimulateAuthorizationAdviceResponse{debuggingRequestId=$debuggingRequestId, token=$token, additionalProperties=$additionalProperties}" + "TransactionSimulateAuthorizationAdviceResponse{token=$token, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt index 19913dc8..8f025c72 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateAuthorizationResponse.kt @@ -19,16 +19,13 @@ import java.util.Objects class TransactionSimulateAuthorizationResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("debugging_request_id") @ExcludeMissing private val debuggingRequestId: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** Debugging request ID to share with Lithic Support team. */ - fun debuggingRequestId(): String? = debuggingRequestId.getNullable("debugging_request_id") - /** * A unique token to reference this transaction with later calls to void or clear the * authorization. @@ -36,9 +33,7 @@ private constructor( fun token(): String? = token.getNullable("token") /** Debugging request ID to share with Lithic Support team. */ - @JsonProperty("debugging_request_id") - @ExcludeMissing - fun _debuggingRequestId() = debuggingRequestId + fun debuggingRequestId(): String? = debuggingRequestId.getNullable("debugging_request_id") /** * A unique token to reference this transaction with later calls to void or clear the @@ -46,6 +41,11 @@ private constructor( */ @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Debugging request ID to share with Lithic Support team. */ + @JsonProperty("debugging_request_id") + @ExcludeMissing + fun _debuggingRequestId() = debuggingRequestId + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -54,8 +54,8 @@ private constructor( fun validate(): TransactionSimulateAuthorizationResponse = apply { if (!validated) { - debuggingRequestId() token() + debuggingRequestId() validated = true } } @@ -69,28 +69,19 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( transactionSimulateAuthorizationResponse: TransactionSimulateAuthorizationResponse ) = apply { - debuggingRequestId = transactionSimulateAuthorizationResponse.debuggingRequestId token = transactionSimulateAuthorizationResponse.token + debuggingRequestId = transactionSimulateAuthorizationResponse.debuggingRequestId additionalProperties = transactionSimulateAuthorizationResponse.additionalProperties.toMutableMap() } - /** Debugging request ID to share with Lithic Support team. */ - fun debuggingRequestId(debuggingRequestId: String) = - debuggingRequestId(JsonField.of(debuggingRequestId)) - - /** Debugging request ID to share with Lithic Support team. */ - fun debuggingRequestId(debuggingRequestId: JsonField) = apply { - this.debuggingRequestId = debuggingRequestId - } - /** * A unique token to reference this transaction with later calls to void or clear the * authorization. @@ -103,6 +94,15 @@ private constructor( */ fun token(token: JsonField) = apply { this.token = token } + /** Debugging request ID to share with Lithic Support team. */ + fun debuggingRequestId(debuggingRequestId: String) = + debuggingRequestId(JsonField.of(debuggingRequestId)) + + /** Debugging request ID to share with Lithic Support team. */ + fun debuggingRequestId(debuggingRequestId: JsonField) = apply { + this.debuggingRequestId = debuggingRequestId + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -124,8 +124,8 @@ private constructor( fun build(): TransactionSimulateAuthorizationResponse = TransactionSimulateAuthorizationResponse( - debuggingRequestId, token, + debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -135,15 +135,15 @@ private constructor( return true } - return /* spotless:off */ other is TransactionSimulateAuthorizationResponse && debuggingRequestId == other.debuggingRequestId && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TransactionSimulateAuthorizationResponse && token == other.token && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, debuggingRequestId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TransactionSimulateAuthorizationResponse{debuggingRequestId=$debuggingRequestId, token=$token, additionalProperties=$additionalProperties}" + "TransactionSimulateAuthorizationResponse{token=$token, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt index 8f9e9c3a..217e1891 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateCreditAuthorizationResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class TransactionSimulateCreditAuthorizationResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("debugging_request_id") @ExcludeMissing private val debuggingRequestId: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** A unique token to reference this transaction. */ + fun token(): String? = token.getNullable("token") + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(): String? = debuggingRequestId.getNullable("debugging_request_id") /** A unique token to reference this transaction. */ - fun token(): String? = token.getNullable("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Debugging request ID to share with Lithic Support team. */ @JsonProperty("debugging_request_id") @ExcludeMissing fun _debuggingRequestId() = debuggingRequestId - /** A unique token to reference this transaction. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): TransactionSimulateCreditAuthorizationResponse = apply { if (!validated) { - debuggingRequestId() token() + debuggingRequestId() validated = true } } @@ -63,20 +63,26 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( transactionSimulateCreditAuthorizationResponse: TransactionSimulateCreditAuthorizationResponse ) = apply { - debuggingRequestId = transactionSimulateCreditAuthorizationResponse.debuggingRequestId token = transactionSimulateCreditAuthorizationResponse.token + debuggingRequestId = transactionSimulateCreditAuthorizationResponse.debuggingRequestId additionalProperties = transactionSimulateCreditAuthorizationResponse.additionalProperties.toMutableMap() } + /** A unique token to reference this transaction. */ + fun token(token: String) = token(JsonField.of(token)) + + /** A unique token to reference this transaction. */ + fun token(token: JsonField) = apply { this.token = token } + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(debuggingRequestId: String) = debuggingRequestId(JsonField.of(debuggingRequestId)) @@ -86,12 +92,6 @@ private constructor( this.debuggingRequestId = debuggingRequestId } - /** A unique token to reference this transaction. */ - fun token(token: String) = token(JsonField.of(token)) - - /** A unique token to reference this transaction. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -113,8 +113,8 @@ private constructor( fun build(): TransactionSimulateCreditAuthorizationResponse = TransactionSimulateCreditAuthorizationResponse( - debuggingRequestId, token, + debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -124,15 +124,15 @@ private constructor( return true } - return /* spotless:off */ other is TransactionSimulateCreditAuthorizationResponse && debuggingRequestId == other.debuggingRequestId && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TransactionSimulateCreditAuthorizationResponse && token == other.token && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, debuggingRequestId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TransactionSimulateCreditAuthorizationResponse{debuggingRequestId=$debuggingRequestId, token=$token, additionalProperties=$additionalProperties}" + "TransactionSimulateCreditAuthorizationResponse{token=$token, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt index 3a1cd9ef..7839b5ed 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/TransactionSimulateReturnResponse.kt @@ -19,27 +19,27 @@ import java.util.Objects class TransactionSimulateReturnResponse @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("debugging_request_id") @ExcludeMissing private val debuggingRequestId: JsonField = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** A unique token to reference this transaction. */ + fun token(): String? = token.getNullable("token") + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(): String? = debuggingRequestId.getNullable("debugging_request_id") /** A unique token to reference this transaction. */ - fun token(): String? = token.getNullable("token") + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Debugging request ID to share with Lithic Support team. */ @JsonProperty("debugging_request_id") @ExcludeMissing fun _debuggingRequestId() = debuggingRequestId - /** A unique token to reference this transaction. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -48,8 +48,8 @@ private constructor( fun validate(): TransactionSimulateReturnResponse = apply { if (!validated) { - debuggingRequestId() token() + debuggingRequestId() validated = true } } @@ -63,18 +63,24 @@ private constructor( class Builder { - private var debuggingRequestId: JsonField = JsonMissing.of() private var token: JsonField = JsonMissing.of() + private var debuggingRequestId: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(transactionSimulateReturnResponse: TransactionSimulateReturnResponse) = apply { - debuggingRequestId = transactionSimulateReturnResponse.debuggingRequestId token = transactionSimulateReturnResponse.token + debuggingRequestId = transactionSimulateReturnResponse.debuggingRequestId additionalProperties = transactionSimulateReturnResponse.additionalProperties.toMutableMap() } + /** A unique token to reference this transaction. */ + fun token(token: String) = token(JsonField.of(token)) + + /** A unique token to reference this transaction. */ + fun token(token: JsonField) = apply { this.token = token } + /** Debugging request ID to share with Lithic Support team. */ fun debuggingRequestId(debuggingRequestId: String) = debuggingRequestId(JsonField.of(debuggingRequestId)) @@ -84,12 +90,6 @@ private constructor( this.debuggingRequestId = debuggingRequestId } - /** A unique token to reference this transaction. */ - fun token(token: String) = token(JsonField.of(token)) - - /** A unique token to reference this transaction. */ - fun token(token: JsonField) = apply { this.token = token } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -111,8 +111,8 @@ private constructor( fun build(): TransactionSimulateReturnResponse = TransactionSimulateReturnResponse( - debuggingRequestId, token, + debuggingRequestId, additionalProperties.toImmutable(), ) } @@ -122,15 +122,15 @@ private constructor( return true } - return /* spotless:off */ other is TransactionSimulateReturnResponse && debuggingRequestId == other.debuggingRequestId && token == other.token && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is TransactionSimulateReturnResponse && token == other.token && debuggingRequestId == other.debuggingRequestId && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(debuggingRequestId, token, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, debuggingRequestId, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "TransactionSimulateReturnResponse{debuggingRequestId=$debuggingRequestId, token=$token, additionalProperties=$additionalProperties}" + "TransactionSimulateReturnResponse{token=$token, debuggingRequestId=$debuggingRequestId, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transfer.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transfer.kt index 6780ac24..91771628 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transfer.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/Transfer.kt @@ -22,6 +22,7 @@ import java.util.Objects class Transfer @JsonCreator private constructor( + @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("category") @ExcludeMissing private val category: JsonField = JsonMissing.of(), @@ -55,13 +56,15 @@ private constructor( @JsonProperty("to_balance") @ExcludeMissing private val toBalance: JsonField> = JsonMissing.of(), - @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), @JsonProperty("updated") @ExcludeMissing private val updated: JsonField = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier for the transfer event. */ + fun token(): String? = token.getNullable("token") + /** * Status types: * - `TRANSFER` - Internal transfer of funds between financial accounts in your program. @@ -115,12 +118,12 @@ private constructor( /** The updated balance of the receiving financial account. */ fun toBalance(): List? = toBalance.getNullable("to_balance") - /** Globally unique identifier for the transfer event. */ - fun token(): String? = token.getNullable("token") - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(): OffsetDateTime? = updated.getNullable("updated") + /** Globally unique identifier for the transfer event. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Status types: * - `TRANSFER` - Internal transfer of funds between financial accounts in your program. @@ -174,9 +177,6 @@ private constructor( /** 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 @@ -188,6 +188,7 @@ private constructor( fun validate(): Transfer = apply { if (!validated) { + token() category() created() currency() @@ -199,7 +200,6 @@ private constructor( settledAmount() status() toBalance()?.forEach { it.validate() } - token() updated() validated = true } @@ -214,6 +214,7 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var currency: JsonField = JsonMissing.of() @@ -225,11 +226,11 @@ private constructor( 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 additionalProperties: MutableMap = mutableMapOf() internal fun from(transfer: Transfer) = apply { + token = transfer.token category = transfer.category created = transfer.created currency = transfer.currency @@ -241,11 +242,16 @@ private constructor( settledAmount = transfer.settledAmount status = transfer.status toBalance = transfer.toBalance - token = transfer.token updated = transfer.updated additionalProperties = transfer.additionalProperties.toMutableMap() } + /** Globally unique identifier for the transfer event. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier for the transfer event. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Status types: * - `TRANSFER` - Internal transfer of funds between financial accounts in your program. @@ -362,12 +368,6 @@ private constructor( /** The updated balance of the receiving financial account. */ fun toBalance(toBalance: JsonField>) = apply { this.toBalance = toBalance } - /** Globally unique identifier for the transfer event. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier for the transfer event. */ - fun token(token: JsonField) = apply { this.token = token } - /** Date and time when the financial transaction was last updated. UTC time zone. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) @@ -395,6 +395,7 @@ private constructor( fun build(): Transfer = Transfer( + token, category, created, currency, @@ -406,7 +407,6 @@ private constructor( settledAmount, status, toBalance.map { it.toImmutable() }, - token, updated, additionalProperties.toImmutable(), ) @@ -467,6 +467,9 @@ private constructor( class FinancialEvent @JsonCreator private constructor( + @JsonProperty("token") + @ExcludeMissing + private val token: JsonField = JsonMissing.of(), @JsonProperty("amount") @ExcludeMissing private val amount: JsonField = JsonMissing.of(), @@ -476,9 +479,6 @@ private constructor( @JsonProperty("result") @ExcludeMissing private val result: JsonField = JsonMissing.of(), - @JsonProperty("token") - @ExcludeMissing - private val token: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing private val type: JsonField = JsonMissing.of(), @@ -486,6 +486,9 @@ private constructor( private val additionalProperties: Map = immutableEmptyMap(), ) { + /** Globally unique identifier. */ + fun token(): String? = token.getNullable("token") + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -501,11 +504,11 @@ private constructor( */ fun result(): Result? = result.getNullable("result") - /** Globally unique identifier. */ - fun token(): String? = token.getNullable("token") - fun type(): FinancialEventType? = type.getNullable("type") + /** Globally unique identifier. */ + @JsonProperty("token") @ExcludeMissing fun _token() = token + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -521,9 +524,6 @@ private constructor( */ @JsonProperty("result") @ExcludeMissing fun _result() = result - /** Globally unique identifier. */ - @JsonProperty("token") @ExcludeMissing fun _token() = token - @JsonProperty("type") @ExcludeMissing fun _type() = type @JsonAnyGetter @@ -534,10 +534,10 @@ private constructor( fun validate(): FinancialEvent = apply { if (!validated) { + token() amount() created() result() - token() type() validated = true } @@ -552,22 +552,28 @@ private constructor( class Builder { + private var token: JsonField = JsonMissing.of() private var amount: JsonField = JsonMissing.of() private var created: JsonField = JsonMissing.of() private var result: JsonField = JsonMissing.of() - private var token: JsonField = JsonMissing.of() private var type: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(financialEvent: FinancialEvent) = apply { + token = financialEvent.token amount = financialEvent.amount created = financialEvent.created result = financialEvent.result - token = financialEvent.token type = financialEvent.type additionalProperties = financialEvent.additionalProperties.toMutableMap() } + /** Globally unique identifier. */ + fun token(token: String) = token(JsonField.of(token)) + + /** Globally unique identifier. */ + fun token(token: JsonField) = apply { this.token = token } + /** * Amount of the financial event that has been settled in the currency's smallest unit * (e.g., cents). @@ -598,12 +604,6 @@ private constructor( */ fun result(result: JsonField) = apply { this.result = result } - /** Globally unique identifier. */ - fun token(token: String) = token(JsonField.of(token)) - - /** Globally unique identifier. */ - fun token(token: JsonField) = apply { this.token = token } - fun type(type: FinancialEventType) = type(JsonField.of(type)) fun type(type: JsonField) = apply { this.type = type } @@ -629,10 +629,10 @@ private constructor( fun build(): FinancialEvent = FinancialEvent( + token, amount, created, result, - token, type, additionalProperties.toImmutable(), ) @@ -1117,17 +1117,17 @@ private constructor( return true } - return /* spotless:off */ other is FinancialEvent && amount == other.amount && created == other.created && result == other.result && token == other.token && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is FinancialEvent && token == other.token && amount == other.amount && created == other.created && result == other.result && type == other.type && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(amount, created, result, token, type, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, amount, created, result, type, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "FinancialEvent{amount=$amount, created=$created, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}" + "FinancialEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, additionalProperties=$additionalProperties}" } class Result @@ -1267,15 +1267,15 @@ private constructor( return true } - return /* spotless:off */ other is Transfer && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && fromBalance == other.fromBalance && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && toBalance == other.toBalance && token == other.token && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Transfer && token == other.token && category == other.category && created == other.created && currency == other.currency && descriptor == other.descriptor && events == other.events && fromBalance == other.fromBalance && pendingAmount == other.pendingAmount && result == other.result && settledAmount == other.settledAmount && status == other.status && toBalance == other.toBalance && updated == other.updated && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(category, created, currency, descriptor, events, fromBalance, pendingAmount, result, settledAmount, status, toBalance, token, updated, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, category, created, currency, descriptor, events, fromBalance, pendingAmount, result, settledAmount, status, toBalance, updated, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "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}" + "Transfer{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, fromBalance=$fromBalance, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, toBalance=$toBalance, updated=$updated, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt index 79957f17..667ecab5 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ApplyResponse.kt @@ -32,24 +32,12 @@ class V2ApplyResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2ApplyResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2ApplyResponse: V2ApplyResponse) = apply { token = v2ApplyResponse.token - state = v2ApplyResponse.state - programLevel = v2ApplyResponse.programLevel - cardTokens = v2ApplyResponse.cardTokens - excludedCardTokens = v2ApplyResponse.excludedCardTokens accountTokens = v2ApplyResponse.accountTokens - type = v2ApplyResponse.type + cardTokens = v2ApplyResponse.cardTokens currentVersion = v2ApplyResponse.currentVersion draftVersion = v2ApplyResponse.draftVersion name = v2ApplyResponse.name + programLevel = v2ApplyResponse.programLevel + state = v2ApplyResponse.state + type = v2ApplyResponse.type + excludedCardTokens = v2ApplyResponse.excludedCardTokens additionalProperties = v2ApplyResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2ApplyResponse = V2ApplyResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2ApplyResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2ApplyResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2ApplyResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2ApplyResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt index ced0ea78..a1ea898a 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2CreateResponse.kt @@ -32,24 +32,12 @@ class V2CreateResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2CreateResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2CreateResponse: V2CreateResponse) = apply { token = v2CreateResponse.token - state = v2CreateResponse.state - programLevel = v2CreateResponse.programLevel - cardTokens = v2CreateResponse.cardTokens - excludedCardTokens = v2CreateResponse.excludedCardTokens accountTokens = v2CreateResponse.accountTokens - type = v2CreateResponse.type + cardTokens = v2CreateResponse.cardTokens currentVersion = v2CreateResponse.currentVersion draftVersion = v2CreateResponse.draftVersion name = v2CreateResponse.name + programLevel = v2CreateResponse.programLevel + state = v2CreateResponse.state + type = v2CreateResponse.type + excludedCardTokens = v2CreateResponse.excludedCardTokens additionalProperties = v2CreateResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2CreateResponse = V2CreateResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2CreateResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2CreateResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2CreateResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2CreateResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt index 96e7bbda..4b976b8f 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2DraftResponse.kt @@ -32,24 +32,12 @@ class V2DraftResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2DraftResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2DraftResponse: V2DraftResponse) = apply { token = v2DraftResponse.token - state = v2DraftResponse.state - programLevel = v2DraftResponse.programLevel - cardTokens = v2DraftResponse.cardTokens - excludedCardTokens = v2DraftResponse.excludedCardTokens accountTokens = v2DraftResponse.accountTokens - type = v2DraftResponse.type + cardTokens = v2DraftResponse.cardTokens currentVersion = v2DraftResponse.currentVersion draftVersion = v2DraftResponse.draftVersion name = v2DraftResponse.name + programLevel = v2DraftResponse.programLevel + state = v2DraftResponse.state + type = v2DraftResponse.type + excludedCardTokens = v2DraftResponse.excludedCardTokens additionalProperties = v2DraftResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2DraftResponse = V2DraftResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2DraftResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2DraftResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2DraftResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2DraftResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt index 5a7b902c..9457a6b8 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2ListResponse.kt @@ -32,24 +32,12 @@ class V2ListResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2ListResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2ListResponse: V2ListResponse) = apply { token = v2ListResponse.token - state = v2ListResponse.state - programLevel = v2ListResponse.programLevel - cardTokens = v2ListResponse.cardTokens - excludedCardTokens = v2ListResponse.excludedCardTokens accountTokens = v2ListResponse.accountTokens - type = v2ListResponse.type + cardTokens = v2ListResponse.cardTokens currentVersion = v2ListResponse.currentVersion draftVersion = v2ListResponse.draftVersion name = v2ListResponse.name + programLevel = v2ListResponse.programLevel + state = v2ListResponse.state + type = v2ListResponse.type + excludedCardTokens = v2ListResponse.excludedCardTokens additionalProperties = v2ListResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2ListResponse = V2ListResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2ListResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2ListResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2ListResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2ListResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt index 743f526b..eccc72a0 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2PromoteResponse.kt @@ -32,24 +32,12 @@ class V2PromoteResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2PromoteResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2PromoteResponse: V2PromoteResponse) = apply { token = v2PromoteResponse.token - state = v2PromoteResponse.state - programLevel = v2PromoteResponse.programLevel - cardTokens = v2PromoteResponse.cardTokens - excludedCardTokens = v2PromoteResponse.excludedCardTokens accountTokens = v2PromoteResponse.accountTokens - type = v2PromoteResponse.type + cardTokens = v2PromoteResponse.cardTokens currentVersion = v2PromoteResponse.currentVersion draftVersion = v2PromoteResponse.draftVersion name = v2PromoteResponse.name + programLevel = v2PromoteResponse.programLevel + state = v2PromoteResponse.state + type = v2PromoteResponse.type + excludedCardTokens = v2PromoteResponse.excludedCardTokens additionalProperties = v2PromoteResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2PromoteResponse = V2PromoteResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2PromoteResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2PromoteResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2PromoteResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2PromoteResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt index e13f9fbc..850bd81a 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2RetrieveResponse.kt @@ -32,24 +32,12 @@ class V2RetrieveResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2RetrieveResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2RetrieveResponse: V2RetrieveResponse) = apply { token = v2RetrieveResponse.token - state = v2RetrieveResponse.state - programLevel = v2RetrieveResponse.programLevel - cardTokens = v2RetrieveResponse.cardTokens - excludedCardTokens = v2RetrieveResponse.excludedCardTokens accountTokens = v2RetrieveResponse.accountTokens - type = v2RetrieveResponse.type + cardTokens = v2RetrieveResponse.cardTokens currentVersion = v2RetrieveResponse.currentVersion draftVersion = v2RetrieveResponse.draftVersion name = v2RetrieveResponse.name + programLevel = v2RetrieveResponse.programLevel + state = v2RetrieveResponse.state + type = v2RetrieveResponse.type + excludedCardTokens = v2RetrieveResponse.excludedCardTokens additionalProperties = v2RetrieveResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2RetrieveResponse = V2RetrieveResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2RetrieveResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2RetrieveResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2RetrieveResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2RetrieveResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt index da9e7e8e..06355074 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/V2UpdateResponse.kt @@ -32,24 +32,12 @@ class V2UpdateResponse @JsonCreator private constructor( @JsonProperty("token") @ExcludeMissing private val token: JsonField = JsonMissing.of(), - @JsonProperty("state") - @ExcludeMissing - private val state: JsonField = JsonMissing.of(), - @JsonProperty("program_level") - @ExcludeMissing - private val programLevel: JsonField = JsonMissing.of(), - @JsonProperty("card_tokens") - @ExcludeMissing - private val cardTokens: JsonField> = JsonMissing.of(), - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonProperty("account_tokens") @ExcludeMissing private val accountTokens: JsonField> = JsonMissing.of(), - @JsonProperty("type") + @JsonProperty("card_tokens") @ExcludeMissing - private val type: JsonField = JsonMissing.of(), + private val cardTokens: JsonField> = JsonMissing.of(), @JsonProperty("current_version") @ExcludeMissing private val currentVersion: JsonField = JsonMissing.of(), @@ -57,29 +45,29 @@ private constructor( @ExcludeMissing private val draftVersion: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing private val name: JsonField = JsonMissing.of(), + @JsonProperty("program_level") + @ExcludeMissing + private val programLevel: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + private val state: JsonField = JsonMissing.of(), + @JsonProperty("type") + @ExcludeMissing + private val type: JsonField = JsonMissing.of(), + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + private val excludedCardTokens: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { /** Auth Rule Token */ fun token(): String = token.getRequired("token") - /** The state of the Auth Rule */ - fun state(): AuthRuleState = state.getRequired("state") - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(): Boolean = programLevel.getRequired("program_level") - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(): List = cardTokens.getRequired("card_tokens") - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(): List = accountTokens.getRequired("account_tokens") - /** The type of Auth Rule */ - fun type(): AuthRuleType = type.getRequired("type") + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(): List = cardTokens.getRequired("card_tokens") fun currentVersion(): CurrentVersion? = currentVersion.getNullable("current_version") @@ -88,28 +76,26 @@ private constructor( /** Auth Rule Name */ fun name(): String? = name.getNullable("name") - /** Auth Rule Token */ - @JsonProperty("token") @ExcludeMissing fun _token() = token + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(): Boolean = programLevel.getRequired("program_level") /** The state of the Auth Rule */ - @JsonProperty("state") @ExcludeMissing fun _state() = state - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + fun state(): AuthRuleState = state.getRequired("state") - /** Card tokens to which the Auth Rule applies. */ - @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens + /** The type of Auth Rule */ + fun type(): AuthRuleType = type.getRequired("type") /** Card tokens to which the Auth Rule does not apply. */ - @JsonProperty("excluded_card_tokens") - @ExcludeMissing - fun _excludedCardTokens() = excludedCardTokens + fun excludedCardTokens(): List? = excludedCardTokens.getNullable("excluded_card_tokens") + + /** Auth Rule Token */ + @JsonProperty("token") @ExcludeMissing fun _token() = token /** Account tokens to which the Auth Rule applies. */ @JsonProperty("account_tokens") @ExcludeMissing fun _accountTokens() = accountTokens - /** The type of Auth Rule */ - @JsonProperty("type") @ExcludeMissing fun _type() = type + /** Card tokens to which the Auth Rule applies. */ + @JsonProperty("card_tokens") @ExcludeMissing fun _cardTokens() = cardTokens @JsonProperty("current_version") @ExcludeMissing fun _currentVersion() = currentVersion @@ -118,6 +104,20 @@ private constructor( /** Auth Rule Name */ @JsonProperty("name") @ExcludeMissing fun _name() = name + /** Whether the Auth Rule applies to all authorizations on the card program. */ + @JsonProperty("program_level") @ExcludeMissing fun _programLevel() = programLevel + + /** The state of the Auth Rule */ + @JsonProperty("state") @ExcludeMissing fun _state() = state + + /** The type of Auth Rule */ + @JsonProperty("type") @ExcludeMissing fun _type() = type + + /** Card tokens to which the Auth Rule does not apply. */ + @JsonProperty("excluded_card_tokens") + @ExcludeMissing + fun _excludedCardTokens() = excludedCardTokens + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -127,15 +127,15 @@ private constructor( fun validate(): V2UpdateResponse = apply { if (!validated) { token() - state() - programLevel() - cardTokens() - excludedCardTokens() accountTokens() - type() + cardTokens() currentVersion()?.validate() draftVersion()?.validate() name() + programLevel() + state() + type() + excludedCardTokens() validated = true } } @@ -150,28 +150,28 @@ private constructor( class Builder { private var token: JsonField = JsonMissing.of() - private var state: JsonField = JsonMissing.of() - private var programLevel: JsonField = JsonMissing.of() - private var cardTokens: JsonField> = JsonMissing.of() - private var excludedCardTokens: JsonField> = JsonMissing.of() private var accountTokens: JsonField> = JsonMissing.of() - private var type: JsonField = JsonMissing.of() + private var cardTokens: JsonField> = JsonMissing.of() private var currentVersion: JsonField = JsonMissing.of() private var draftVersion: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() + private var programLevel: JsonField = JsonMissing.of() + private var state: JsonField = JsonMissing.of() + private var type: JsonField = JsonMissing.of() + private var excludedCardTokens: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(v2UpdateResponse: V2UpdateResponse) = apply { token = v2UpdateResponse.token - state = v2UpdateResponse.state - programLevel = v2UpdateResponse.programLevel - cardTokens = v2UpdateResponse.cardTokens - excludedCardTokens = v2UpdateResponse.excludedCardTokens accountTokens = v2UpdateResponse.accountTokens - type = v2UpdateResponse.type + cardTokens = v2UpdateResponse.cardTokens currentVersion = v2UpdateResponse.currentVersion draftVersion = v2UpdateResponse.draftVersion name = v2UpdateResponse.name + programLevel = v2UpdateResponse.programLevel + state = v2UpdateResponse.state + type = v2UpdateResponse.type + excludedCardTokens = v2UpdateResponse.excludedCardTokens additionalProperties = v2UpdateResponse.additionalProperties.toMutableMap() } @@ -181,35 +181,6 @@ private constructor( /** Auth Rule Token */ fun token(token: JsonField) = apply { this.token = token } - /** The state of the Auth Rule */ - fun state(state: AuthRuleState) = state(JsonField.of(state)) - - /** The state of the Auth Rule */ - fun state(state: JsonField) = apply { this.state = state } - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) - - /** Whether the Auth Rule applies to all authorizations on the card program. */ - fun programLevel(programLevel: JsonField) = apply { - this.programLevel = programLevel - } - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - - /** Card tokens to which the Auth Rule applies. */ - fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: List) = - excludedCardTokens(JsonField.of(excludedCardTokens)) - - /** Card tokens to which the Auth Rule does not apply. */ - fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { - this.excludedCardTokens = excludedCardTokens - } - /** Account tokens to which the Auth Rule applies. */ fun accountTokens(accountTokens: List) = accountTokens(JsonField.of(accountTokens)) @@ -218,11 +189,11 @@ private constructor( this.accountTokens = accountTokens } - /** The type of Auth Rule */ - fun type(type: AuthRuleType) = type(JsonField.of(type)) + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: List) = cardTokens(JsonField.of(cardTokens)) - /** The type of Auth Rule */ - fun type(type: JsonField) = apply { this.type = type } + /** Card tokens to which the Auth Rule applies. */ + fun cardTokens(cardTokens: JsonField>) = apply { this.cardTokens = cardTokens } fun currentVersion(currentVersion: CurrentVersion) = currentVersion(JsonField.of(currentVersion)) @@ -243,6 +214,35 @@ private constructor( /** Auth Rule Name */ fun name(name: JsonField) = apply { this.name = name } + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: Boolean) = programLevel(JsonField.of(programLevel)) + + /** Whether the Auth Rule applies to all authorizations on the card program. */ + fun programLevel(programLevel: JsonField) = apply { + this.programLevel = programLevel + } + + /** The state of the Auth Rule */ + fun state(state: AuthRuleState) = state(JsonField.of(state)) + + /** The state of the Auth Rule */ + fun state(state: JsonField) = apply { this.state = state } + + /** The type of Auth Rule */ + fun type(type: AuthRuleType) = type(JsonField.of(type)) + + /** The type of Auth Rule */ + fun type(type: JsonField) = apply { this.type = type } + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: List) = + excludedCardTokens(JsonField.of(excludedCardTokens)) + + /** Card tokens to which the Auth Rule does not apply. */ + fun excludedCardTokens(excludedCardTokens: JsonField>) = apply { + this.excludedCardTokens = excludedCardTokens + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -265,15 +265,15 @@ private constructor( fun build(): V2UpdateResponse = V2UpdateResponse( token, - state, - programLevel, - cardTokens.map { it.toImmutable() }, - excludedCardTokens.map { it.toImmutable() }, accountTokens.map { it.toImmutable() }, - type, + cardTokens.map { it.toImmutable() }, currentVersion, draftVersion, name, + programLevel, + state, + type, + excludedCardTokens.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -2341,15 +2341,15 @@ private constructor( return true } - return /* spotless:off */ other is V2UpdateResponse && token == other.token && state == other.state && programLevel == other.programLevel && cardTokens == other.cardTokens && excludedCardTokens == other.excludedCardTokens && accountTokens == other.accountTokens && type == other.type && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is V2UpdateResponse && token == other.token && accountTokens == other.accountTokens && cardTokens == other.cardTokens && currentVersion == other.currentVersion && draftVersion == other.draftVersion && name == other.name && programLevel == other.programLevel && state == other.state && type == other.type && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(token, state, programLevel, cardTokens, excludedCardTokens, accountTokens, type, currentVersion, draftVersion, name, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(token, accountTokens, cardTokens, currentVersion, draftVersion, name, programLevel, state, type, excludedCardTokens, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "V2UpdateResponse{token=$token, state=$state, programLevel=$programLevel, cardTokens=$cardTokens, excludedCardTokens=$excludedCardTokens, accountTokens=$accountTokens, type=$type, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, additionalProperties=$additionalProperties}" + "V2UpdateResponse{token=$token, accountTokens=$accountTokens, cardTokens=$cardTokens, currentVersion=$currentVersion, draftVersion=$draftVersion, name=$name, programLevel=$programLevel, state=$state, type=$type, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}" } diff --git a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt index 08cf62e3..66010558 100644 --- a/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt +++ b/lithic-kotlin-core/src/main/kotlin/com/lithic/api/models/VelocityLimitParams.kt @@ -31,13 +31,13 @@ import java.util.Objects class VelocityLimitParams @JsonCreator private constructor( - @JsonProperty("scope") @ExcludeMissing private val scope: JsonField = JsonMissing.of(), - @JsonProperty("period") - @ExcludeMissing - private val period: JsonField = JsonMissing.of(), @JsonProperty("filters") @ExcludeMissing private val filters: JsonField = JsonMissing.of(), + @JsonProperty("period") + @ExcludeMissing + private val period: JsonField = JsonMissing.of(), + @JsonProperty("scope") @ExcludeMissing private val scope: JsonField = JsonMissing.of(), @JsonProperty("limit_amount") @ExcludeMissing private val limitAmount: JsonField = JsonMissing.of(), @@ -47,7 +47,7 @@ private constructor( @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - fun scope(): Scope = scope.getRequired("scope") + fun filters(): Filters = filters.getRequired("filters") /** * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum @@ -55,7 +55,7 @@ private constructor( */ fun period(): Period = period.getRequired("period") - fun filters(): Filters = filters.getRequired("filters") + fun scope(): Scope = scope.getRequired("scope") /** * The maximum amount of spend velocity allowed in the period in minor units (the smallest unit @@ -71,7 +71,7 @@ private constructor( */ fun limitCount(): Long? = limitCount.getNullable("limit_count") - @JsonProperty("scope") @ExcludeMissing fun _scope() = scope + @JsonProperty("filters") @ExcludeMissing fun _filters() = filters /** * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum @@ -79,7 +79,7 @@ private constructor( */ @JsonProperty("period") @ExcludeMissing fun _period() = period - @JsonProperty("filters") @ExcludeMissing fun _filters() = filters + @JsonProperty("scope") @ExcludeMissing fun _scope() = scope /** * The maximum amount of spend velocity allowed in the period in minor units (the smallest unit @@ -103,9 +103,9 @@ private constructor( fun validate(): VelocityLimitParams = apply { if (!validated) { - scope() - period() filters().validate() + period() + scope() limitAmount() limitCount() validated = true @@ -121,25 +121,25 @@ private constructor( class Builder { - private var scope: JsonField = JsonMissing.of() - private var period: JsonField = JsonMissing.of() private var filters: JsonField = JsonMissing.of() + private var period: JsonField = JsonMissing.of() + private var scope: JsonField = JsonMissing.of() private var limitAmount: JsonField = JsonMissing.of() private var limitCount: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(velocityLimitParams: VelocityLimitParams) = apply { - scope = velocityLimitParams.scope - period = velocityLimitParams.period filters = velocityLimitParams.filters + period = velocityLimitParams.period + scope = velocityLimitParams.scope limitAmount = velocityLimitParams.limitAmount limitCount = velocityLimitParams.limitCount additionalProperties = velocityLimitParams.additionalProperties.toMutableMap() } - fun scope(scope: Scope) = scope(JsonField.of(scope)) + fun filters(filters: Filters) = filters(JsonField.of(filters)) - fun scope(scope: JsonField) = apply { this.scope = scope } + fun filters(filters: JsonField) = apply { this.filters = filters } /** * The size of the trailing window to calculate Spend Velocity over in seconds. The minimum @@ -153,9 +153,9 @@ private constructor( */ fun period(period: JsonField) = apply { this.period = period } - fun filters(filters: Filters) = filters(JsonField.of(filters)) + fun scope(scope: Scope) = scope(JsonField.of(scope)) - fun filters(filters: JsonField) = apply { this.filters = filters } + fun scope(scope: JsonField) = apply { this.scope = scope } /** * The maximum amount of spend velocity allowed in the period in minor units (the smallest @@ -208,9 +208,9 @@ private constructor( fun build(): VelocityLimitParams = VelocityLimitParams( - scope, - period, filters, + period, + scope, limitAmount, limitCount, additionalProperties.toImmutable(), @@ -221,22 +221,16 @@ private constructor( class Filters @JsonCreator private constructor( - @JsonProperty("include_mccs") - @ExcludeMissing - private val includeMccs: JsonField> = JsonMissing.of(), @JsonProperty("include_countries") @ExcludeMissing private val includeCountries: JsonField> = JsonMissing.of(), + @JsonProperty("include_mccs") + @ExcludeMissing + private val includeMccs: JsonField> = JsonMissing.of(), @JsonAnySetter private val additionalProperties: Map = immutableEmptyMap(), ) { - /** - * Merchant Category Codes to include in the velocity calculation. Transactions not matching - * this MCC will not be included in the calculated velocity. - */ - fun includeMccs(): List? = includeMccs.getNullable("include_mccs") - /** * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions not * matching any of the provided will not be included in the calculated velocity. @@ -247,7 +241,7 @@ private constructor( * Merchant Category Codes to include in the velocity calculation. Transactions not matching * this MCC will not be included in the calculated velocity. */ - @JsonProperty("include_mccs") @ExcludeMissing fun _includeMccs() = includeMccs + fun includeMccs(): List? = includeMccs.getNullable("include_mccs") /** * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions not @@ -257,6 +251,12 @@ private constructor( @ExcludeMissing fun _includeCountries() = includeCountries + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not matching + * this MCC will not be included in the calculated velocity. + */ + @JsonProperty("include_mccs") @ExcludeMissing fun _includeMccs() = includeMccs + @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties @@ -265,8 +265,8 @@ private constructor( fun validate(): Filters = apply { if (!validated) { - includeMccs() includeCountries() + includeMccs() validated = true } } @@ -280,30 +280,16 @@ private constructor( class Builder { - private var includeMccs: JsonField> = JsonMissing.of() private var includeCountries: JsonField> = JsonMissing.of() + private var includeMccs: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(filters: Filters) = apply { - includeMccs = filters.includeMccs includeCountries = filters.includeCountries + includeMccs = filters.includeMccs additionalProperties = filters.additionalProperties.toMutableMap() } - /** - * Merchant Category Codes to include in the velocity calculation. Transactions not - * matching this MCC will not be included in the calculated velocity. - */ - fun includeMccs(includeMccs: List) = includeMccs(JsonField.of(includeMccs)) - - /** - * Merchant Category Codes to include in the velocity calculation. Transactions not - * matching this MCC will not be included in the calculated velocity. - */ - fun includeMccs(includeMccs: JsonField>) = apply { - this.includeMccs = includeMccs - } - /** * ISO-3166-1 alpha-3 Country Codes to include in the velocity calculation. Transactions * not matching any of the provided will not be included in the calculated velocity. @@ -319,6 +305,20 @@ private constructor( this.includeCountries = includeCountries } + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not + * matching this MCC will not be included in the calculated velocity. + */ + fun includeMccs(includeMccs: List) = includeMccs(JsonField.of(includeMccs)) + + /** + * Merchant Category Codes to include in the velocity calculation. Transactions not + * matching this MCC will not be included in the calculated velocity. + */ + fun includeMccs(includeMccs: JsonField>) = apply { + this.includeMccs = includeMccs + } + fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -340,8 +340,8 @@ private constructor( fun build(): Filters = Filters( - includeMccs.map { it.toImmutable() }, includeCountries.map { it.toImmutable() }, + includeMccs.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } @@ -351,17 +351,17 @@ private constructor( return true } - return /* spotless:off */ other is Filters && includeMccs == other.includeMccs && includeCountries == other.includeCountries && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is Filters && includeCountries == other.includeCountries && includeMccs == other.includeMccs && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(includeMccs, includeCountries, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(includeCountries, includeMccs, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "Filters{includeMccs=$includeMccs, includeCountries=$includeCountries, additionalProperties=$additionalProperties}" + "Filters{includeCountries=$includeCountries, includeMccs=$includeMccs, additionalProperties=$additionalProperties}" } /** @@ -578,15 +578,15 @@ private constructor( return true } - return /* spotless:off */ other is VelocityLimitParams && scope == other.scope && period == other.period && filters == other.filters && limitAmount == other.limitAmount && limitCount == other.limitCount && additionalProperties == other.additionalProperties /* spotless:on */ + return /* spotless:off */ other is VelocityLimitParams && filters == other.filters && period == other.period && scope == other.scope && limitAmount == other.limitAmount && limitCount == other.limitCount && additionalProperties == other.additionalProperties /* spotless:on */ } /* spotless:off */ - private val hashCode: Int by lazy { Objects.hash(scope, period, filters, limitAmount, limitCount, additionalProperties) } + private val hashCode: Int by lazy { Objects.hash(filters, period, scope, limitAmount, limitCount, additionalProperties) } /* spotless:on */ override fun hashCode(): Int = hashCode override fun toString() = - "VelocityLimitParams{scope=$scope, period=$period, filters=$filters, limitAmount=$limitAmount, limitCount=$limitCount, additionalProperties=$additionalProperties}" + "VelocityLimitParams{filters=$filters, period=$period, scope=$scope, limitAmount=$limitAmount, limitCount=$limitCount, additionalProperties=$additionalProperties}" }