diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 145ecf69a..b5b696492 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.510.0" + ".": "0.511.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 0be591b72..2dd3ad7c7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 241 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-76519f799070d5e184aa17c924a502d5767ba63eed88e48255145e1c36a19b7f.yml -openapi_spec_hash: 4bac99d90df83788bc79092b880d9ac6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-ff1d99efd9eeb980f386d87e7d4c422890073b2dd12759044b444227f76dbe96.yml +openapi_spec_hash: 1b8389213a95f495dcc6d381451e5c4c config_hash: d48e9f65bcf642f92610034d6c43f07a diff --git a/CHANGELOG.md b/CHANGELOG.md index e2603e777..cc3e6a2b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.511.0 (2026-04-11) + +Full Changelog: [v0.510.0...v0.511.0](https://github.com/Increase/increase-java/compare/v0.510.0...v0.511.0) + +### Features + +* **api:** api update ([f7888e9](https://github.com/Increase/increase-java/commit/f7888e95b04b2ac8f43aaa6d8fec358c69869a85)) + ## 0.510.0 (2026-04-11) Full Changelog: [v0.509.0...v0.510.0](https://github.com/Increase/increase-java/compare/v0.509.0...v0.510.0) diff --git a/README.md b/README.md index 61129141b..d1051f07c 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.510.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.510.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.510.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.511.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.511.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.511.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.510.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.511.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.510.0") +implementation("com.increase.api:increase-java:0.511.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.510.0") com.increase.api increase-java - 0.510.0 + 0.511.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 07d79572c..89e6d32f1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.510.0" // x-release-please-version + version = "0.511.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityUpdateParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityUpdateParams.kt index 5aecf3f7c..7b1a39a96 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityUpdateParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/entities/EntityUpdateParams.kt @@ -16,6 +16,7 @@ import com.increase.api.core.checkRequired import com.increase.api.core.http.Headers import com.increase.api.core.http.QueryParams import com.increase.api.errors.IncreaseInvalidDataException +import java.time.LocalDate import java.time.OffsetDateTime import java.util.Collections import java.util.Objects @@ -2561,6 +2562,8 @@ private constructor( @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val address: JsonField
, + private val confirmedNoUsTaxId: JsonField, + private val identification: JsonField, private val name: JsonField, private val additionalProperties: MutableMap, ) { @@ -2568,8 +2571,14 @@ private constructor( @JsonCreator private constructor( @JsonProperty("address") @ExcludeMissing address: JsonField
= JsonMissing.of(), + @JsonProperty("confirmed_no_us_tax_id") + @ExcludeMissing + confirmedNoUsTaxId: JsonField = JsonMissing.of(), + @JsonProperty("identification") + @ExcludeMissing + identification: JsonField = JsonMissing.of(), @JsonProperty("name") @ExcludeMissing name: JsonField = JsonMissing.of(), - ) : this(address, name, mutableMapOf()) + ) : this(address, confirmedNoUsTaxId, identification, name, mutableMapOf()) /** * The entity's physical address. Mail receiving locations like PO Boxes and PMB's are @@ -2580,6 +2589,26 @@ private constructor( */ fun address(): Optional
= address.getOptional("address") + /** + * The identification method for an individual can only be a passport, driver's license, or + * other document if you've confirmed the individual does not have a US tax id (either a + * Social Security Number or Individual Taxpayer Identification Number). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun confirmedNoUsTaxId(): Optional = + confirmedNoUsTaxId.getOptional("confirmed_no_us_tax_id") + + /** + * A means of verifying the person's identity. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun identification(): Optional = + identification.getOptional("identification") + /** * The legal name of the natural person. * @@ -2595,6 +2624,26 @@ private constructor( */ @JsonProperty("address") @ExcludeMissing fun _address(): JsonField
= address + /** + * Returns the raw JSON value of [confirmedNoUsTaxId]. + * + * Unlike [confirmedNoUsTaxId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("confirmed_no_us_tax_id") + @ExcludeMissing + fun _confirmedNoUsTaxId(): JsonField = confirmedNoUsTaxId + + /** + * Returns the raw JSON value of [identification]. + * + * Unlike [identification], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("identification") + @ExcludeMissing + fun _identification(): JsonField = identification + /** * Returns the raw JSON value of [name]. * @@ -2624,12 +2673,16 @@ private constructor( class Builder internal constructor() { private var address: JsonField
= JsonMissing.of() + private var confirmedNoUsTaxId: JsonField = JsonMissing.of() + private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(naturalPerson: NaturalPerson) = apply { address = naturalPerson.address + confirmedNoUsTaxId = naturalPerson.confirmedNoUsTaxId + identification = naturalPerson.identification name = naturalPerson.name additionalProperties = naturalPerson.additionalProperties.toMutableMap() } @@ -2649,6 +2702,40 @@ private constructor( */ fun address(address: JsonField
) = apply { this.address = address } + /** + * The identification method for an individual can only be a passport, driver's license, + * or other document if you've confirmed the individual does not have a US tax id + * (either a Social Security Number or Individual Taxpayer Identification Number). + */ + fun confirmedNoUsTaxId(confirmedNoUsTaxId: Boolean) = + confirmedNoUsTaxId(JsonField.of(confirmedNoUsTaxId)) + + /** + * Sets [Builder.confirmedNoUsTaxId] to an arbitrary JSON value. + * + * You should usually call [Builder.confirmedNoUsTaxId] with a well-typed [Boolean] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun confirmedNoUsTaxId(confirmedNoUsTaxId: JsonField) = apply { + this.confirmedNoUsTaxId = confirmedNoUsTaxId + } + + /** A means of verifying the person's identity. */ + fun identification(identification: Identification) = + identification(JsonField.of(identification)) + + /** + * Sets [Builder.identification] to an arbitrary JSON value. + * + * You should usually call [Builder.identification] with a well-typed [Identification] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun identification(identification: JsonField) = apply { + this.identification = identification + } + /** The legal name of the natural person. */ fun name(name: String) = name(JsonField.of(name)) @@ -2686,7 +2773,13 @@ private constructor( * Further updates to this [Builder] will not mutate the returned instance. */ fun build(): NaturalPerson = - NaturalPerson(address, name, additionalProperties.toMutableMap()) + NaturalPerson( + address, + confirmedNoUsTaxId, + identification, + name, + additionalProperties.toMutableMap(), + ) } private var validated: Boolean = false @@ -2697,6 +2790,8 @@ private constructor( } address().ifPresent { it.validate() } + confirmedNoUsTaxId() + identification().ifPresent { it.validate() } name() validated = true } @@ -2718,6 +2813,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (address.asKnown().getOrNull()?.validity() ?: 0) + + (if (confirmedNoUsTaxId.asKnown().isPresent) 1 else 0) + + (identification.asKnown().getOrNull()?.validity() ?: 0) + (if (name.asKnown().isPresent) 1 else 0) /** @@ -3078,23 +3175,1470 @@ private constructor( "Address{city=$city, country=$country, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } - override fun equals(other: Any?): Boolean { - if (this === other) { - return true + /** A means of verifying the person's identity. */ + class Identification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val method: JsonField, + private val number: JsonField, + private val driversLicense: JsonField, + private val other: JsonField, + private val passport: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("method") + @ExcludeMissing + method: JsonField = JsonMissing.of(), + @JsonProperty("number") + @ExcludeMissing + number: JsonField = JsonMissing.of(), + @JsonProperty("drivers_license") + @ExcludeMissing + driversLicense: JsonField = JsonMissing.of(), + @JsonProperty("other") @ExcludeMissing other: JsonField = JsonMissing.of(), + @JsonProperty("passport") + @ExcludeMissing + passport: JsonField = JsonMissing.of(), + ) : this(method, number, driversLicense, other, passport, mutableMapOf()) + + /** + * A method that can be used to verify the individual's identity. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun method(): Method = method.getRequired("method") + + /** + * An identification number that can be used to verify the individual's identity, such + * as a social security number. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun number(): String = number.getRequired("number") + + /** + * Information about the United States driver's license used for identification. + * Required if `method` is equal to `drivers_license`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun driversLicense(): Optional = + driversLicense.getOptional("drivers_license") + + /** + * Information about the identification document provided. Required if `method` is equal + * to `other`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun other(): Optional = other.getOptional("other") + + /** + * Information about the passport used for identification. Required if `method` is equal + * to `passport`. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun passport(): Optional = passport.getOptional("passport") + + /** + * Returns the raw JSON value of [method]. + * + * Unlike [method], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("method") @ExcludeMissing fun _method(): JsonField = method + + /** + * Returns the raw JSON value of [number]. + * + * Unlike [number], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("number") @ExcludeMissing fun _number(): JsonField = number + + /** + * Returns the raw JSON value of [driversLicense]. + * + * Unlike [driversLicense], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("drivers_license") + @ExcludeMissing + fun _driversLicense(): JsonField = driversLicense + + /** + * Returns the raw JSON value of [other]. + * + * Unlike [other], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("other") @ExcludeMissing fun _other(): JsonField = other + + /** + * Returns the raw JSON value of [passport]. + * + * Unlike [passport], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("passport") + @ExcludeMissing + fun _passport(): JsonField = passport + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) } - return other is NaturalPerson && - address == other.address && - name == other.name && - additionalProperties == other.additionalProperties - } + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - private val hashCode: Int by lazy { Objects.hash(address, name, additionalProperties) } + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Identification]. + * + * The following fields are required: + * ```java + * .method() + * .number() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Identification]. */ + class Builder internal constructor() { + + private var method: JsonField? = null + private var number: JsonField? = null + private var driversLicense: JsonField = JsonMissing.of() + private var other: JsonField = JsonMissing.of() + private var passport: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(identification: Identification) = apply { + method = identification.method + number = identification.number + driversLicense = identification.driversLicense + other = identification.other + passport = identification.passport + additionalProperties = identification.additionalProperties.toMutableMap() + } + + /** A method that can be used to verify the individual's identity. */ + fun method(method: Method) = method(JsonField.of(method)) + + /** + * Sets [Builder.method] to an arbitrary JSON value. + * + * You should usually call [Builder.method] with a well-typed [Method] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun method(method: JsonField) = apply { this.method = method } + + /** + * An identification number that can be used to verify the individual's identity, + * such as a social security number. + */ + fun number(number: String) = number(JsonField.of(number)) + + /** + * Sets [Builder.number] to an arbitrary JSON value. + * + * You should usually call [Builder.number] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun number(number: JsonField) = apply { this.number = number } + + /** + * Information about the United States driver's license used for identification. + * Required if `method` is equal to `drivers_license`. + */ + fun driversLicense(driversLicense: DriversLicense) = + driversLicense(JsonField.of(driversLicense)) + + /** + * Sets [Builder.driversLicense] to an arbitrary JSON value. + * + * You should usually call [Builder.driversLicense] with a well-typed + * [DriversLicense] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun driversLicense(driversLicense: JsonField) = apply { + this.driversLicense = driversLicense + } + + /** + * Information about the identification document provided. Required if `method` is + * equal to `other`. + */ + fun other(other: Other) = other(JsonField.of(other)) + + /** + * Sets [Builder.other] to an arbitrary JSON value. + * + * You should usually call [Builder.other] with a well-typed [Other] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun other(other: JsonField) = apply { this.other = other } + + /** + * Information about the passport used for identification. Required if `method` is + * equal to `passport`. + */ + fun passport(passport: Passport) = passport(JsonField.of(passport)) + + /** + * Sets [Builder.passport] to an arbitrary JSON value. + * + * You should usually call [Builder.passport] with a well-typed [Passport] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun passport(passport: JsonField) = apply { this.passport = passport } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Identification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .method() + * .number() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Identification = + Identification( + checkRequired("method", method), + checkRequired("number", number), + driversLicense, + other, + passport, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Identification = apply { + if (validated) { + return@apply + } + + method().validate() + number() + driversLicense().ifPresent { it.validate() } + other().ifPresent { it.validate() } + passport().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (method.asKnown().getOrNull()?.validity() ?: 0) + + (if (number.asKnown().isPresent) 1 else 0) + + (driversLicense.asKnown().getOrNull()?.validity() ?: 0) + + (other.asKnown().getOrNull()?.validity() ?: 0) + + (passport.asKnown().getOrNull()?.validity() ?: 0) + + /** A method that can be used to verify the individual's identity. */ + class Method @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** A social security number. */ + @JvmField val SOCIAL_SECURITY_NUMBER = of("social_security_number") + + /** An individual taxpayer identification number (ITIN). */ + @JvmField + val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = + of("individual_taxpayer_identification_number") + + /** A passport number. */ + @JvmField val PASSPORT = of("passport") + + /** A driver's license number. */ + @JvmField val DRIVERS_LICENSE = of("drivers_license") + + /** Another identifying document. */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = Method(JsonField.of(value)) + } + + /** An enum containing [Method]'s known values. */ + enum class Known { + /** A social security number. */ + SOCIAL_SECURITY_NUMBER, + /** An individual taxpayer identification number (ITIN). */ + INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, + /** A passport number. */ + PASSPORT, + /** A driver's license number. */ + DRIVERS_LICENSE, + /** Another identifying document. */ + OTHER, + } + + /** + * An enum containing [Method]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Method] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** A social security number. */ + SOCIAL_SECURITY_NUMBER, + /** An individual taxpayer identification number (ITIN). */ + INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, + /** A passport number. */ + PASSPORT, + /** A driver's license number. */ + DRIVERS_LICENSE, + /** Another identifying document. */ + OTHER, + /** + * An enum member indicating that [Method] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + SOCIAL_SECURITY_NUMBER -> Value.SOCIAL_SECURITY_NUMBER + INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER -> + Value.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER + PASSPORT -> Value.PASSPORT + DRIVERS_LICENSE -> Value.DRIVERS_LICENSE + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + SOCIAL_SECURITY_NUMBER -> Known.SOCIAL_SECURITY_NUMBER + INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER -> + Known.INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER + PASSPORT -> Known.PASSPORT + DRIVERS_LICENSE -> Known.DRIVERS_LICENSE + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Method: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Method = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Method && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Information about the United States driver's license used for identification. + * Required if `method` is equal to `drivers_license`. + */ + class DriversLicense + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val expirationDate: JsonField, + private val fileId: JsonField, + private val state: JsonField, + private val backFileId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("expiration_date") + @ExcludeMissing + expirationDate: JsonField = JsonMissing.of(), + @JsonProperty("file_id") + @ExcludeMissing + fileId: JsonField = JsonMissing.of(), + @JsonProperty("state") + @ExcludeMissing + state: JsonField = JsonMissing.of(), + @JsonProperty("back_file_id") + @ExcludeMissing + backFileId: JsonField = JsonMissing.of(), + ) : this(expirationDate, fileId, state, backFileId, mutableMapOf()) + + /** + * The driver's license's expiration date in YYYY-MM-DD format. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun expirationDate(): LocalDate = expirationDate.getRequired("expiration_date") + + /** + * The identifier of the File containing the front of the driver's license. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun fileId(): String = fileId.getRequired("file_id") + + /** + * The state that issued the provided driver's license. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun state(): String = state.getRequired("state") + + /** + * The identifier of the File containing the back of the driver's license. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun backFileId(): Optional = backFileId.getOptional("back_file_id") + + /** + * Returns the raw JSON value of [expirationDate]. + * + * Unlike [expirationDate], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("expiration_date") + @ExcludeMissing + fun _expirationDate(): JsonField = expirationDate + + /** + * Returns the raw JSON value of [fileId]. + * + * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId + + /** + * Returns the raw JSON value of [state]. + * + * Unlike [state], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("state") @ExcludeMissing fun _state(): JsonField = state + + /** + * Returns the raw JSON value of [backFileId]. + * + * Unlike [backFileId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("back_file_id") + @ExcludeMissing + fun _backFileId(): JsonField = backFileId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DriversLicense]. + * + * The following fields are required: + * ```java + * .expirationDate() + * .fileId() + * .state() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DriversLicense]. */ + class Builder internal constructor() { + + private var expirationDate: JsonField? = null + private var fileId: JsonField? = null + private var state: JsonField? = null + private var backFileId: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(driversLicense: DriversLicense) = apply { + expirationDate = driversLicense.expirationDate + fileId = driversLicense.fileId + state = driversLicense.state + backFileId = driversLicense.backFileId + additionalProperties = driversLicense.additionalProperties.toMutableMap() + } + + /** The driver's license's expiration date in YYYY-MM-DD format. */ + fun expirationDate(expirationDate: LocalDate) = + expirationDate(JsonField.of(expirationDate)) + + /** + * Sets [Builder.expirationDate] to an arbitrary JSON value. + * + * You should usually call [Builder.expirationDate] with a well-typed + * [LocalDate] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun expirationDate(expirationDate: JsonField) = apply { + this.expirationDate = expirationDate + } + + /** The identifier of the File containing the front of the driver's license. */ + fun fileId(fileId: String) = fileId(JsonField.of(fileId)) + + /** + * Sets [Builder.fileId] to an arbitrary JSON value. + * + * You should usually call [Builder.fileId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun fileId(fileId: JsonField) = apply { this.fileId = fileId } + + /** The state that issued the provided driver's license. */ + fun state(state: String) = state(JsonField.of(state)) + + /** + * Sets [Builder.state] to an arbitrary JSON value. + * + * You should usually call [Builder.state] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun state(state: JsonField) = apply { this.state = state } + + /** The identifier of the File containing the back of the driver's license. */ + fun backFileId(backFileId: String) = backFileId(JsonField.of(backFileId)) + + /** + * Sets [Builder.backFileId] to an arbitrary JSON value. + * + * You should usually call [Builder.backFileId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun backFileId(backFileId: JsonField) = apply { + this.backFileId = backFileId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [DriversLicense]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .expirationDate() + * .fileId() + * .state() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DriversLicense = + DriversLicense( + checkRequired("expirationDate", expirationDate), + checkRequired("fileId", fileId), + checkRequired("state", state), + backFileId, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DriversLicense = apply { + if (validated) { + return@apply + } + + expirationDate() + fileId() + state() + backFileId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (expirationDate.asKnown().isPresent) 1 else 0) + + (if (fileId.asKnown().isPresent) 1 else 0) + + (if (state.asKnown().isPresent) 1 else 0) + + (if (backFileId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DriversLicense && + expirationDate == other.expirationDate && + fileId == other.fileId && + state == other.state && + backFileId == other.backFileId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(expirationDate, fileId, state, backFileId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DriversLicense{expirationDate=$expirationDate, fileId=$fileId, state=$state, backFileId=$backFileId, additionalProperties=$additionalProperties}" + } + + /** + * Information about the identification document provided. Required if `method` is equal + * to `other`. + */ + class Other + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val country: JsonField, + private val description: JsonField, + private val fileId: JsonField, + private val backFileId: JsonField, + private val expirationDate: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("country") + @ExcludeMissing + country: JsonField = JsonMissing.of(), + @JsonProperty("description") + @ExcludeMissing + description: JsonField = JsonMissing.of(), + @JsonProperty("file_id") + @ExcludeMissing + fileId: JsonField = JsonMissing.of(), + @JsonProperty("back_file_id") + @ExcludeMissing + backFileId: JsonField = JsonMissing.of(), + @JsonProperty("expiration_date") + @ExcludeMissing + expirationDate: JsonField = JsonMissing.of(), + ) : this(country, description, fileId, backFileId, expirationDate, mutableMapOf()) + + /** + * The two-character ISO 3166-1 code representing the country that issued the + * document (e.g., `US`). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun country(): String = country.getRequired("country") + + /** + * A description of the document submitted. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun description(): String = description.getRequired("description") + + /** + * The identifier of the File containing the front of the document. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun fileId(): String = fileId.getRequired("file_id") + + /** + * The identifier of the File containing the back of the document. Not every + * document has a reverse side. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun backFileId(): Optional = backFileId.getOptional("back_file_id") + + /** + * The document's expiration date in YYYY-MM-DD format. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun expirationDate(): Optional = + expirationDate.getOptional("expiration_date") + + /** + * Returns the raw JSON value of [country]. + * + * Unlike [country], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("country") @ExcludeMissing fun _country(): JsonField = country + + /** + * Returns the raw JSON value of [description]. + * + * Unlike [description], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("description") + @ExcludeMissing + fun _description(): JsonField = description + + /** + * Returns the raw JSON value of [fileId]. + * + * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId + + /** + * Returns the raw JSON value of [backFileId]. + * + * Unlike [backFileId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("back_file_id") + @ExcludeMissing + fun _backFileId(): JsonField = backFileId + + /** + * Returns the raw JSON value of [expirationDate]. + * + * Unlike [expirationDate], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("expiration_date") + @ExcludeMissing + fun _expirationDate(): JsonField = expirationDate + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Other]. + * + * The following fields are required: + * ```java + * .country() + * .description() + * .fileId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Other]. */ + class Builder internal constructor() { + + private var country: JsonField? = null + private var description: JsonField? = null + private var fileId: JsonField? = null + private var backFileId: JsonField = JsonMissing.of() + private var expirationDate: JsonField = JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(other: Other) = apply { + country = other.country + description = other.description + fileId = other.fileId + backFileId = other.backFileId + expirationDate = other.expirationDate + additionalProperties = other.additionalProperties.toMutableMap() + } + + /** + * The two-character ISO 3166-1 code representing the country that issued the + * document (e.g., `US`). + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * Sets [Builder.country] to an arbitrary JSON value. + * + * You should usually call [Builder.country] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun country(country: JsonField) = apply { this.country = country } + + /** A description of the document submitted. */ + fun description(description: String) = description(JsonField.of(description)) + + /** + * Sets [Builder.description] to an arbitrary JSON value. + * + * You should usually call [Builder.description] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun description(description: JsonField) = apply { + this.description = description + } + + /** The identifier of the File containing the front of the document. */ + fun fileId(fileId: String) = fileId(JsonField.of(fileId)) + + /** + * Sets [Builder.fileId] to an arbitrary JSON value. + * + * You should usually call [Builder.fileId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun fileId(fileId: JsonField) = apply { this.fileId = fileId } + + /** + * The identifier of the File containing the back of the document. Not every + * document has a reverse side. + */ + fun backFileId(backFileId: String) = backFileId(JsonField.of(backFileId)) + + /** + * Sets [Builder.backFileId] to an arbitrary JSON value. + * + * You should usually call [Builder.backFileId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun backFileId(backFileId: JsonField) = apply { + this.backFileId = backFileId + } + + /** The document's expiration date in YYYY-MM-DD format. */ + fun expirationDate(expirationDate: LocalDate) = + expirationDate(JsonField.of(expirationDate)) + + /** + * Sets [Builder.expirationDate] to an arbitrary JSON value. + * + * You should usually call [Builder.expirationDate] with a well-typed + * [LocalDate] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun expirationDate(expirationDate: JsonField) = apply { + this.expirationDate = expirationDate + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Other]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .country() + * .description() + * .fileId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Other = + Other( + checkRequired("country", country), + checkRequired("description", description), + checkRequired("fileId", fileId), + backFileId, + expirationDate, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Other = apply { + if (validated) { + return@apply + } + + country() + description() + fileId() + backFileId() + expirationDate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (country.asKnown().isPresent) 1 else 0) + + (if (description.asKnown().isPresent) 1 else 0) + + (if (fileId.asKnown().isPresent) 1 else 0) + + (if (backFileId.asKnown().isPresent) 1 else 0) + + (if (expirationDate.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Other && + country == other.country && + description == other.description && + fileId == other.fileId && + backFileId == other.backFileId && + expirationDate == other.expirationDate && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + country, + description, + fileId, + backFileId, + expirationDate, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Other{country=$country, description=$description, fileId=$fileId, backFileId=$backFileId, expirationDate=$expirationDate, additionalProperties=$additionalProperties}" + } + + /** + * Information about the passport used for identification. Required if `method` is equal + * to `passport`. + */ + class Passport + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val country: JsonField, + private val expirationDate: JsonField, + private val fileId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("country") + @ExcludeMissing + country: JsonField = JsonMissing.of(), + @JsonProperty("expiration_date") + @ExcludeMissing + expirationDate: JsonField = JsonMissing.of(), + @JsonProperty("file_id") + @ExcludeMissing + fileId: JsonField = JsonMissing.of(), + ) : this(country, expirationDate, fileId, mutableMapOf()) + + /** + * The two-character ISO 3166-1 code representing the country that issued the + * document (e.g., `US`). + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun country(): String = country.getRequired("country") + + /** + * The passport's expiration date in YYYY-MM-DD format. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun expirationDate(): LocalDate = expirationDate.getRequired("expiration_date") + + /** + * The identifier of the File containing the passport. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun fileId(): String = fileId.getRequired("file_id") + + /** + * Returns the raw JSON value of [country]. + * + * Unlike [country], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("country") @ExcludeMissing fun _country(): JsonField = country + + /** + * Returns the raw JSON value of [expirationDate]. + * + * Unlike [expirationDate], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("expiration_date") + @ExcludeMissing + fun _expirationDate(): JsonField = expirationDate + + /** + * Returns the raw JSON value of [fileId]. + * + * Unlike [fileId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("file_id") @ExcludeMissing fun _fileId(): JsonField = fileId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Passport]. + * + * The following fields are required: + * ```java + * .country() + * .expirationDate() + * .fileId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Passport]. */ + class Builder internal constructor() { + + private var country: JsonField? = null + private var expirationDate: JsonField? = null + private var fileId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(passport: Passport) = apply { + country = passport.country + expirationDate = passport.expirationDate + fileId = passport.fileId + additionalProperties = passport.additionalProperties.toMutableMap() + } + + /** + * The two-character ISO 3166-1 code representing the country that issued the + * document (e.g., `US`). + */ + fun country(country: String) = country(JsonField.of(country)) + + /** + * Sets [Builder.country] to an arbitrary JSON value. + * + * You should usually call [Builder.country] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun country(country: JsonField) = apply { this.country = country } + + /** The passport's expiration date in YYYY-MM-DD format. */ + fun expirationDate(expirationDate: LocalDate) = + expirationDate(JsonField.of(expirationDate)) + + /** + * Sets [Builder.expirationDate] to an arbitrary JSON value. + * + * You should usually call [Builder.expirationDate] with a well-typed + * [LocalDate] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun expirationDate(expirationDate: JsonField) = apply { + this.expirationDate = expirationDate + } + + /** The identifier of the File containing the passport. */ + fun fileId(fileId: String) = fileId(JsonField.of(fileId)) + + /** + * Sets [Builder.fileId] to an arbitrary JSON value. + * + * You should usually call [Builder.fileId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun fileId(fileId: JsonField) = apply { this.fileId = fileId } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Passport]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .country() + * .expirationDate() + * .fileId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Passport = + Passport( + checkRequired("country", country), + checkRequired("expirationDate", expirationDate), + checkRequired("fileId", fileId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Passport = apply { + if (validated) { + return@apply + } + + country() + expirationDate() + fileId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (country.asKnown().isPresent) 1 else 0) + + (if (expirationDate.asKnown().isPresent) 1 else 0) + + (if (fileId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Passport && + country == other.country && + expirationDate == other.expirationDate && + fileId == other.fileId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(country, expirationDate, fileId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Passport{country=$country, expirationDate=$expirationDate, fileId=$fileId, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Identification && + method == other.method && + number == other.number && + driversLicense == other.driversLicense && + this.other == other.other && + passport == other.passport && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(method, number, driversLicense, other, passport, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Identification{method=$method, number=$number, driversLicense=$driversLicense, other=$other, passport=$passport, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NaturalPerson && + address == other.address && + confirmedNoUsTaxId == other.confirmedNoUsTaxId && + identification == other.identification && + name == other.name && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(address, confirmedNoUsTaxId, identification, name, additionalProperties) + } override fun hashCode(): Int = hashCode override fun toString() = - "NaturalPerson{address=$address, name=$name, additionalProperties=$additionalProperties}" + "NaturalPerson{address=$address, confirmedNoUsTaxId=$confirmedNoUsTaxId, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityUpdateParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityUpdateParamsTest.kt index 3d9d3ec2f..ebf80c63a 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityUpdateParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/entities/EntityUpdateParamsTest.kt @@ -2,6 +2,7 @@ package com.increase.api.models.entities +import java.time.LocalDate import java.time.OffsetDateTime import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test @@ -66,6 +67,41 @@ internal class EntityUpdateParamsTest { .zip("x") .build() ) + .confirmedNoUsTaxId(true) + .identification( + EntityUpdateParams.NaturalPerson.Identification.builder() + .method( + EntityUpdateParams.NaturalPerson.Identification.Method + .SOCIAL_SECURITY_NUMBER + ) + .number("xxxx") + .driversLicense( + EntityUpdateParams.NaturalPerson.Identification.DriversLicense + .builder() + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .state("x") + .backFileId("back_file_id") + .build() + ) + .other( + EntityUpdateParams.NaturalPerson.Identification.Other.builder() + .country("x") + .description("x") + .fileId("file_id") + .backFileId("back_file_id") + .expirationDate(LocalDate.parse("2019-12-27")) + .build() + ) + .passport( + EntityUpdateParams.NaturalPerson.Identification.Passport.builder() + .country("x") + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .build() + ) + .build() + ) .name("x") .build() ) @@ -166,6 +202,42 @@ internal class EntityUpdateParamsTest { .zip("x") .build() ) + .confirmedNoUsTaxId(true) + .identification( + EntityUpdateParams.NaturalPerson.Identification.builder() + .method( + EntityUpdateParams.NaturalPerson.Identification.Method + .SOCIAL_SECURITY_NUMBER + ) + .number("xxxx") + .driversLicense( + EntityUpdateParams.NaturalPerson.Identification.DriversLicense + .builder() + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .state("x") + .backFileId("back_file_id") + .build() + ) + .other( + EntityUpdateParams.NaturalPerson.Identification.Other.builder() + .country("x") + .description("x") + .fileId("file_id") + .backFileId("back_file_id") + .expirationDate(LocalDate.parse("2019-12-27")) + .build() + ) + .passport( + EntityUpdateParams.NaturalPerson.Identification.Passport + .builder() + .country("x") + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .build() + ) + .build() + ) .name("x") .build() ) @@ -257,6 +329,41 @@ internal class EntityUpdateParamsTest { .zip("x") .build() ) + .confirmedNoUsTaxId(true) + .identification( + EntityUpdateParams.NaturalPerson.Identification.builder() + .method( + EntityUpdateParams.NaturalPerson.Identification.Method + .SOCIAL_SECURITY_NUMBER + ) + .number("xxxx") + .driversLicense( + EntityUpdateParams.NaturalPerson.Identification.DriversLicense + .builder() + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .state("x") + .backFileId("back_file_id") + .build() + ) + .other( + EntityUpdateParams.NaturalPerson.Identification.Other.builder() + .country("x") + .description("x") + .fileId("file_id") + .backFileId("back_file_id") + .expirationDate(LocalDate.parse("2019-12-27")) + .build() + ) + .passport( + EntityUpdateParams.NaturalPerson.Identification.Passport.builder() + .country("x") + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .build() + ) + .build() + ) .name("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt index ab68235ff..2dc6a5b0e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/EntityServiceAsyncTest.kt @@ -552,6 +552,44 @@ internal class EntityServiceAsyncTest { .zip("x") .build() ) + .confirmedNoUsTaxId(true) + .identification( + EntityUpdateParams.NaturalPerson.Identification.builder() + .method( + EntityUpdateParams.NaturalPerson.Identification.Method + .SOCIAL_SECURITY_NUMBER + ) + .number("xxxx") + .driversLicense( + EntityUpdateParams.NaturalPerson.Identification + .DriversLicense + .builder() + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .state("x") + .backFileId("back_file_id") + .build() + ) + .other( + EntityUpdateParams.NaturalPerson.Identification.Other + .builder() + .country("x") + .description("x") + .fileId("file_id") + .backFileId("back_file_id") + .expirationDate(LocalDate.parse("2019-12-27")) + .build() + ) + .passport( + EntityUpdateParams.NaturalPerson.Identification.Passport + .builder() + .country("x") + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .build() + ) + .build() + ) .name("x") .build() ) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt index 5eadb5c4d..5ab6448d5 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/EntityServiceTest.kt @@ -550,6 +550,44 @@ internal class EntityServiceTest { .zip("x") .build() ) + .confirmedNoUsTaxId(true) + .identification( + EntityUpdateParams.NaturalPerson.Identification.builder() + .method( + EntityUpdateParams.NaturalPerson.Identification.Method + .SOCIAL_SECURITY_NUMBER + ) + .number("xxxx") + .driversLicense( + EntityUpdateParams.NaturalPerson.Identification + .DriversLicense + .builder() + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .state("x") + .backFileId("back_file_id") + .build() + ) + .other( + EntityUpdateParams.NaturalPerson.Identification.Other + .builder() + .country("x") + .description("x") + .fileId("file_id") + .backFileId("back_file_id") + .expirationDate(LocalDate.parse("2019-12-27")) + .build() + ) + .passport( + EntityUpdateParams.NaturalPerson.Identification.Passport + .builder() + .country("x") + .expirationDate(LocalDate.parse("2019-12-27")) + .fileId("file_id") + .build() + ) + .build() + ) .name("x") .build() )