All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.increase.api.models.Entity.kt Maven / Gradle / Ivy

There is a newer version: 0.142.0
Show newest version
// File generated from our OpenAPI spec by Stainless.

package com.increase.api.models

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.Enum
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonField
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toImmutable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects

/**
 * Entities are the legal entities that own accounts. They can be people, corporations,
 * partnerships, government authorities, or trusts.
 */
@JsonDeserialize(builder = Entity.Builder::class)
@NoAutoDetect
class Entity
private constructor(
    private val corporation: JsonField,
    private val createdAt: JsonField,
    private val description: JsonField,
    private val detailsConfirmedAt: JsonField,
    private val governmentAuthority: JsonField,
    private val id: JsonField,
    private val idempotencyKey: JsonField,
    private val joint: JsonField,
    private val naturalPerson: JsonField,
    private val status: JsonField,
    private val structure: JsonField,
    private val supplementalDocuments: JsonField>,
    private val thirdPartyVerification: JsonField,
    private val trust: JsonField,
    private val type: JsonField,
    private val additionalProperties: Map,
) {

    private var validated: Boolean = false

    /**
     * Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
     */
    fun corporation(): Corporation? = corporation.getNullable("corporation")

    /**
     * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was created.
     */
    fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")

    /** The entity's description for display purposes. */
    fun description(): String? = description.getNullable("description")

    /**
     * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
     * were most recently confirmed.
     */
    fun detailsConfirmedAt(): OffsetDateTime? =
        detailsConfirmedAt.getNullable("details_confirmed_at")

    /**
     * Details of the government authority entity. Will be present if `structure` is equal to
     * `government_authority`.
     */
    fun governmentAuthority(): GovernmentAuthority? =
        governmentAuthority.getNullable("government_authority")

    /** The entity's identifier. */
    fun id(): String = id.getRequired("id")

    /**
     * The idempotency key you chose for this object. This value is unique across Increase and is
     * used to ensure that a request is only processed once. Learn more about
     * [idempotency](https://increase.com/documentation/idempotency-keys).
     */
    fun idempotencyKey(): String? = idempotencyKey.getNullable("idempotency_key")

    /** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
    fun joint(): Joint? = joint.getNullable("joint")

    /**
     * Details of the natural person entity. Will be present if `structure` is equal to
     * `natural_person`.
     */
    fun naturalPerson(): NaturalPerson? = naturalPerson.getNullable("natural_person")

    /** The status of the entity. */
    fun status(): Status = status.getRequired("status")

    /** The entity's legal structure. */
    fun structure(): Structure = structure.getRequired("structure")

    /**
     * Additional documentation associated with the entity. This is limited to the first 10
     * documents for an entity. If an entity has more than 10 documents, use the GET
     * /entity_supplemental_documents list endpoint to retrieve them.
     */
    fun supplementalDocuments(): List =
        supplementalDocuments.getRequired("supplemental_documents")

    /**
     * A reference to data stored in a third-party verification service. Your integration may or may
     * not use this field.
     */
    fun thirdPartyVerification(): ThirdPartyVerification? =
        thirdPartyVerification.getNullable("third_party_verification")

    /** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
    fun trust(): Trust? = trust.getNullable("trust")

    /** A constant representing the object's type. For this resource it will always be `entity`. */
    fun type(): Type = type.getRequired("type")

    /**
     * Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
     */
    @JsonProperty("corporation") @ExcludeMissing fun _corporation() = corporation

    /**
     * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was created.
     */
    @JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt

    /** The entity's description for display purposes. */
    @JsonProperty("description") @ExcludeMissing fun _description() = description

    /**
     * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
     * were most recently confirmed.
     */
    @JsonProperty("details_confirmed_at")
    @ExcludeMissing
    fun _detailsConfirmedAt() = detailsConfirmedAt

    /**
     * Details of the government authority entity. Will be present if `structure` is equal to
     * `government_authority`.
     */
    @JsonProperty("government_authority")
    @ExcludeMissing
    fun _governmentAuthority() = governmentAuthority

    /** The entity's identifier. */
    @JsonProperty("id") @ExcludeMissing fun _id() = id

    /**
     * The idempotency key you chose for this object. This value is unique across Increase and is
     * used to ensure that a request is only processed once. Learn more about
     * [idempotency](https://increase.com/documentation/idempotency-keys).
     */
    @JsonProperty("idempotency_key") @ExcludeMissing fun _idempotencyKey() = idempotencyKey

    /** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
    @JsonProperty("joint") @ExcludeMissing fun _joint() = joint

    /**
     * Details of the natural person entity. Will be present if `structure` is equal to
     * `natural_person`.
     */
    @JsonProperty("natural_person") @ExcludeMissing fun _naturalPerson() = naturalPerson

    /** The status of the entity. */
    @JsonProperty("status") @ExcludeMissing fun _status() = status

    /** The entity's legal structure. */
    @JsonProperty("structure") @ExcludeMissing fun _structure() = structure

    /**
     * Additional documentation associated with the entity. This is limited to the first 10
     * documents for an entity. If an entity has more than 10 documents, use the GET
     * /entity_supplemental_documents list endpoint to retrieve them.
     */
    @JsonProperty("supplemental_documents")
    @ExcludeMissing
    fun _supplementalDocuments() = supplementalDocuments

    /**
     * A reference to data stored in a third-party verification service. Your integration may or may
     * not use this field.
     */
    @JsonProperty("third_party_verification")
    @ExcludeMissing
    fun _thirdPartyVerification() = thirdPartyVerification

    /** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
    @JsonProperty("trust") @ExcludeMissing fun _trust() = trust

    /** A constant representing the object's type. For this resource it will always be `entity`. */
    @JsonProperty("type") @ExcludeMissing fun _type() = type

    @JsonAnyGetter
    @ExcludeMissing
    fun _additionalProperties(): Map = additionalProperties

    fun validate(): Entity = apply {
        if (!validated) {
            corporation()?.validate()
            createdAt()
            description()
            detailsConfirmedAt()
            governmentAuthority()?.validate()
            id()
            idempotencyKey()
            joint()?.validate()
            naturalPerson()?.validate()
            status()
            structure()
            supplementalDocuments().forEach { it.validate() }
            thirdPartyVerification()?.validate()
            trust()?.validate()
            type()
            validated = true
        }
    }

    fun toBuilder() = Builder().from(this)

    companion object {

        fun builder() = Builder()
    }

    class Builder {

        private var corporation: JsonField = JsonMissing.of()
        private var createdAt: JsonField = JsonMissing.of()
        private var description: JsonField = JsonMissing.of()
        private var detailsConfirmedAt: JsonField = JsonMissing.of()
        private var governmentAuthority: JsonField = JsonMissing.of()
        private var id: JsonField = JsonMissing.of()
        private var idempotencyKey: JsonField = JsonMissing.of()
        private var joint: JsonField = JsonMissing.of()
        private var naturalPerson: JsonField = JsonMissing.of()
        private var status: JsonField = JsonMissing.of()
        private var structure: JsonField = JsonMissing.of()
        private var supplementalDocuments: JsonField> =
            JsonMissing.of()
        private var thirdPartyVerification: JsonField = JsonMissing.of()
        private var trust: JsonField = JsonMissing.of()
        private var type: JsonField = JsonMissing.of()
        private var additionalProperties: MutableMap = mutableMapOf()

        internal fun from(entity: Entity) = apply {
            this.corporation = entity.corporation
            this.createdAt = entity.createdAt
            this.description = entity.description
            this.detailsConfirmedAt = entity.detailsConfirmedAt
            this.governmentAuthority = entity.governmentAuthority
            this.id = entity.id
            this.idempotencyKey = entity.idempotencyKey
            this.joint = entity.joint
            this.naturalPerson = entity.naturalPerson
            this.status = entity.status
            this.structure = entity.structure
            this.supplementalDocuments = entity.supplementalDocuments
            this.thirdPartyVerification = entity.thirdPartyVerification
            this.trust = entity.trust
            this.type = entity.type
            additionalProperties(entity.additionalProperties)
        }

        /**
         * Details of the corporation entity. Will be present if `structure` is equal to
         * `corporation`.
         */
        fun corporation(corporation: Corporation) = corporation(JsonField.of(corporation))

        /**
         * Details of the corporation entity. Will be present if `structure` is equal to
         * `corporation`.
         */
        @JsonProperty("corporation")
        @ExcludeMissing
        fun corporation(corporation: JsonField) = apply {
            this.corporation = corporation
        }

        /**
         * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was
         * created.
         */
        fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))

        /**
         * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity was
         * created.
         */
        @JsonProperty("created_at")
        @ExcludeMissing
        fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }

        /** The entity's description for display purposes. */
        fun description(description: String) = description(JsonField.of(description))

        /** The entity's description for display purposes. */
        @JsonProperty("description")
        @ExcludeMissing
        fun description(description: JsonField) = apply { this.description = description }

        /**
         * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
         * were most recently confirmed.
         */
        fun detailsConfirmedAt(detailsConfirmedAt: OffsetDateTime) =
            detailsConfirmedAt(JsonField.of(detailsConfirmedAt))

        /**
         * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Entity's details
         * were most recently confirmed.
         */
        @JsonProperty("details_confirmed_at")
        @ExcludeMissing
        fun detailsConfirmedAt(detailsConfirmedAt: JsonField) = apply {
            this.detailsConfirmedAt = detailsConfirmedAt
        }

        /**
         * Details of the government authority entity. Will be present if `structure` is equal to
         * `government_authority`.
         */
        fun governmentAuthority(governmentAuthority: GovernmentAuthority) =
            governmentAuthority(JsonField.of(governmentAuthority))

        /**
         * Details of the government authority entity. Will be present if `structure` is equal to
         * `government_authority`.
         */
        @JsonProperty("government_authority")
        @ExcludeMissing
        fun governmentAuthority(governmentAuthority: JsonField) = apply {
            this.governmentAuthority = governmentAuthority
        }

        /** The entity's identifier. */
        fun id(id: String) = id(JsonField.of(id))

        /** The entity's identifier. */
        @JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }

        /**
         * The idempotency key you chose for this object. This value is unique across Increase and
         * is used to ensure that a request is only processed once. Learn more about
         * [idempotency](https://increase.com/documentation/idempotency-keys).
         */
        fun idempotencyKey(idempotencyKey: String) = idempotencyKey(JsonField.of(idempotencyKey))

        /**
         * The idempotency key you chose for this object. This value is unique across Increase and
         * is used to ensure that a request is only processed once. Learn more about
         * [idempotency](https://increase.com/documentation/idempotency-keys).
         */
        @JsonProperty("idempotency_key")
        @ExcludeMissing
        fun idempotencyKey(idempotencyKey: JsonField) = apply {
            this.idempotencyKey = idempotencyKey
        }

        /** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
        fun joint(joint: Joint) = joint(JsonField.of(joint))

        /** Details of the joint entity. Will be present if `structure` is equal to `joint`. */
        @JsonProperty("joint")
        @ExcludeMissing
        fun joint(joint: JsonField) = apply { this.joint = joint }

        /**
         * Details of the natural person entity. Will be present if `structure` is equal to
         * `natural_person`.
         */
        fun naturalPerson(naturalPerson: NaturalPerson) = naturalPerson(JsonField.of(naturalPerson))

        /**
         * Details of the natural person entity. Will be present if `structure` is equal to
         * `natural_person`.
         */
        @JsonProperty("natural_person")
        @ExcludeMissing
        fun naturalPerson(naturalPerson: JsonField) = apply {
            this.naturalPerson = naturalPerson
        }

        /** The status of the entity. */
        fun status(status: Status) = status(JsonField.of(status))

        /** The status of the entity. */
        @JsonProperty("status")
        @ExcludeMissing
        fun status(status: JsonField) = apply { this.status = status }

        /** The entity's legal structure. */
        fun structure(structure: Structure) = structure(JsonField.of(structure))

        /** The entity's legal structure. */
        @JsonProperty("structure")
        @ExcludeMissing
        fun structure(structure: JsonField) = apply { this.structure = structure }

        /**
         * Additional documentation associated with the entity. This is limited to the first 10
         * documents for an entity. If an entity has more than 10 documents, use the GET
         * /entity_supplemental_documents list endpoint to retrieve them.
         */
        fun supplementalDocuments(supplementalDocuments: List) =
            supplementalDocuments(JsonField.of(supplementalDocuments))

        /**
         * Additional documentation associated with the entity. This is limited to the first 10
         * documents for an entity. If an entity has more than 10 documents, use the GET
         * /entity_supplemental_documents list endpoint to retrieve them.
         */
        @JsonProperty("supplemental_documents")
        @ExcludeMissing
        fun supplementalDocuments(
            supplementalDocuments: JsonField>
        ) = apply { this.supplementalDocuments = supplementalDocuments }

        /**
         * A reference to data stored in a third-party verification service. Your integration may or
         * may not use this field.
         */
        fun thirdPartyVerification(thirdPartyVerification: ThirdPartyVerification) =
            thirdPartyVerification(JsonField.of(thirdPartyVerification))

        /**
         * A reference to data stored in a third-party verification service. Your integration may or
         * may not use this field.
         */
        @JsonProperty("third_party_verification")
        @ExcludeMissing
        fun thirdPartyVerification(thirdPartyVerification: JsonField) =
            apply {
                this.thirdPartyVerification = thirdPartyVerification
            }

        /** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
        fun trust(trust: Trust) = trust(JsonField.of(trust))

        /** Details of the trust entity. Will be present if `structure` is equal to `trust`. */
        @JsonProperty("trust")
        @ExcludeMissing
        fun trust(trust: JsonField) = apply { this.trust = trust }

        /**
         * A constant representing the object's type. For this resource it will always be `entity`.
         */
        fun type(type: Type) = type(JsonField.of(type))

        /**
         * A constant representing the object's type. For this resource it will always be `entity`.
         */
        @JsonProperty("type")
        @ExcludeMissing
        fun type(type: JsonField) = apply { this.type = type }

        fun additionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.clear()
            this.additionalProperties.putAll(additionalProperties)
        }

        @JsonAnySetter
        fun putAdditionalProperty(key: String, value: JsonValue) = apply {
            this.additionalProperties.put(key, value)
        }

        fun putAllAdditionalProperties(additionalProperties: Map) = apply {
            this.additionalProperties.putAll(additionalProperties)
        }

        fun build(): Entity =
            Entity(
                corporation,
                createdAt,
                description,
                detailsConfirmedAt,
                governmentAuthority,
                id,
                idempotencyKey,
                joint,
                naturalPerson,
                status,
                structure,
                supplementalDocuments.map { it.toImmutable() },
                thirdPartyVerification,
                trust,
                type,
                additionalProperties.toImmutable(),
            )
    }

    /**
     * Details of the corporation entity. Will be present if `structure` is equal to `corporation`.
     */
    @JsonDeserialize(builder = Corporation.Builder::class)
    @NoAutoDetect
    class Corporation
    private constructor(
        private val address: JsonField
, private val beneficialOwners: JsonField>, private val incorporationState: JsonField, private val industryCode: JsonField, private val name: JsonField, private val taxIdentifier: JsonField, private val website: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The corporation's address. */ fun address(): Address = address.getRequired("address") /** * The identifying details of anyone controlling or owning 25% or more of the corporation. */ fun beneficialOwners(): List = beneficialOwners.getRequired("beneficial_owners") /** * The two-letter United States Postal Service (USPS) abbreviation for the corporation's * state of incorporation. */ fun incorporationState(): String? = incorporationState.getNullable("incorporation_state") /** * The numeric North American Industry Classification System (NAICS) code submitted for the * corporation. */ fun industryCode(): String? = industryCode.getNullable("industry_code") /** The legal name of the corporation. */ fun name(): String = name.getRequired("name") /** The Employer Identification Number (EIN) for the corporation. */ fun taxIdentifier(): String? = taxIdentifier.getNullable("tax_identifier") /** The website of the corporation. */ fun website(): String? = website.getNullable("website") /** The corporation's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** * The identifying details of anyone controlling or owning 25% or more of the corporation. */ @JsonProperty("beneficial_owners") @ExcludeMissing fun _beneficialOwners() = beneficialOwners /** * The two-letter United States Postal Service (USPS) abbreviation for the corporation's * state of incorporation. */ @JsonProperty("incorporation_state") @ExcludeMissing fun _incorporationState() = incorporationState /** * The numeric North American Industry Classification System (NAICS) code submitted for the * corporation. */ @JsonProperty("industry_code") @ExcludeMissing fun _industryCode() = industryCode /** The legal name of the corporation. */ @JsonProperty("name") @ExcludeMissing fun _name() = name /** The Employer Identification Number (EIN) for the corporation. */ @JsonProperty("tax_identifier") @ExcludeMissing fun _taxIdentifier() = taxIdentifier /** The website of the corporation. */ @JsonProperty("website") @ExcludeMissing fun _website() = website @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Corporation = apply { if (!validated) { address().validate() beneficialOwners().forEach { it.validate() } incorporationState() industryCode() name() taxIdentifier() website() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var beneficialOwners: JsonField> = JsonMissing.of() private var incorporationState: JsonField = JsonMissing.of() private var industryCode: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var taxIdentifier: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(corporation: Corporation) = apply { this.address = corporation.address this.beneficialOwners = corporation.beneficialOwners this.incorporationState = corporation.incorporationState this.industryCode = corporation.industryCode this.name = corporation.name this.taxIdentifier = corporation.taxIdentifier this.website = corporation.website additionalProperties(corporation.additionalProperties) } /** The corporation's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The corporation's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** * The identifying details of anyone controlling or owning 25% or more of the * corporation. */ fun beneficialOwners(beneficialOwners: List) = beneficialOwners(JsonField.of(beneficialOwners)) /** * The identifying details of anyone controlling or owning 25% or more of the * corporation. */ @JsonProperty("beneficial_owners") @ExcludeMissing fun beneficialOwners(beneficialOwners: JsonField>) = apply { this.beneficialOwners = beneficialOwners } /** * The two-letter United States Postal Service (USPS) abbreviation for the corporation's * state of incorporation. */ fun incorporationState(incorporationState: String) = incorporationState(JsonField.of(incorporationState)) /** * The two-letter United States Postal Service (USPS) abbreviation for the corporation's * state of incorporation. */ @JsonProperty("incorporation_state") @ExcludeMissing fun incorporationState(incorporationState: JsonField) = apply { this.incorporationState = incorporationState } /** * The numeric North American Industry Classification System (NAICS) code submitted for * the corporation. */ fun industryCode(industryCode: String) = industryCode(JsonField.of(industryCode)) /** * The numeric North American Industry Classification System (NAICS) code submitted for * the corporation. */ @JsonProperty("industry_code") @ExcludeMissing fun industryCode(industryCode: JsonField) = apply { this.industryCode = industryCode } /** The legal name of the corporation. */ fun name(name: String) = name(JsonField.of(name)) /** The legal name of the corporation. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The Employer Identification Number (EIN) for the corporation. */ fun taxIdentifier(taxIdentifier: String) = taxIdentifier(JsonField.of(taxIdentifier)) /** The Employer Identification Number (EIN) for the corporation. */ @JsonProperty("tax_identifier") @ExcludeMissing fun taxIdentifier(taxIdentifier: JsonField) = apply { this.taxIdentifier = taxIdentifier } /** The website of the corporation. */ fun website(website: String) = website(JsonField.of(website)) /** The website of the corporation. */ @JsonProperty("website") @ExcludeMissing fun website(website: JsonField) = apply { this.website = website } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Corporation = Corporation( address, beneficialOwners.map { it.toImmutable() }, incorporationState, industryCode, name, taxIdentifier, website, additionalProperties.toImmutable(), ) } /** The corporation's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = BeneficialOwner.Builder::class) @NoAutoDetect class BeneficialOwner private constructor( private val beneficialOwnerId: JsonField, private val companyTitle: JsonField, private val individual: JsonField, private val prong: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The identifier of this beneficial owner. */ fun beneficialOwnerId(): String = beneficialOwnerId.getRequired("beneficial_owner_id") /** This person's role or title within the entity. */ fun companyTitle(): String? = companyTitle.getNullable("company_title") /** Personal details for the beneficial owner. */ fun individual(): Individual = individual.getRequired("individual") /** Why this person is considered a beneficial owner of the entity. */ fun prong(): Prong = prong.getRequired("prong") /** The identifier of this beneficial owner. */ @JsonProperty("beneficial_owner_id") @ExcludeMissing fun _beneficialOwnerId() = beneficialOwnerId /** This person's role or title within the entity. */ @JsonProperty("company_title") @ExcludeMissing fun _companyTitle() = companyTitle /** Personal details for the beneficial owner. */ @JsonProperty("individual") @ExcludeMissing fun _individual() = individual /** Why this person is considered a beneficial owner of the entity. */ @JsonProperty("prong") @ExcludeMissing fun _prong() = prong @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): BeneficialOwner = apply { if (!validated) { beneficialOwnerId() companyTitle() individual().validate() prong() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var beneficialOwnerId: JsonField = JsonMissing.of() private var companyTitle: JsonField = JsonMissing.of() private var individual: JsonField = JsonMissing.of() private var prong: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(beneficialOwner: BeneficialOwner) = apply { this.beneficialOwnerId = beneficialOwner.beneficialOwnerId this.companyTitle = beneficialOwner.companyTitle this.individual = beneficialOwner.individual this.prong = beneficialOwner.prong additionalProperties(beneficialOwner.additionalProperties) } /** The identifier of this beneficial owner. */ fun beneficialOwnerId(beneficialOwnerId: String) = beneficialOwnerId(JsonField.of(beneficialOwnerId)) /** The identifier of this beneficial owner. */ @JsonProperty("beneficial_owner_id") @ExcludeMissing fun beneficialOwnerId(beneficialOwnerId: JsonField) = apply { this.beneficialOwnerId = beneficialOwnerId } /** This person's role or title within the entity. */ fun companyTitle(companyTitle: String) = companyTitle(JsonField.of(companyTitle)) /** This person's role or title within the entity. */ @JsonProperty("company_title") @ExcludeMissing fun companyTitle(companyTitle: JsonField) = apply { this.companyTitle = companyTitle } /** Personal details for the beneficial owner. */ fun individual(individual: Individual) = individual(JsonField.of(individual)) /** Personal details for the beneficial owner. */ @JsonProperty("individual") @ExcludeMissing fun individual(individual: JsonField) = apply { this.individual = individual } /** Why this person is considered a beneficial owner of the entity. */ fun prong(prong: Prong) = prong(JsonField.of(prong)) /** Why this person is considered a beneficial owner of the entity. */ @JsonProperty("prong") @ExcludeMissing fun prong(prong: JsonField) = apply { this.prong = prong } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): BeneficialOwner = BeneficialOwner( beneficialOwnerId, companyTitle, individual, prong, additionalProperties.toImmutable(), ) } /** Personal details for the beneficial owner. */ @JsonDeserialize(builder = Individual.Builder::class) @NoAutoDetect class Individual private constructor( private val address: JsonField
, private val dateOfBirth: JsonField, private val identification: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The person's address. */ fun address(): Address = address.getRequired("address") /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth") /** A means of verifying the person's identity. */ fun identification(): Identification = identification.getRequired("identification") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun _identification() = identification /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Individual = apply { if (!validated) { address().validate() dateOfBirth() identification().validate() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(individual: Individual) = apply { this.address = individual.address this.dateOfBirth = individual.dateOfBirth this.identification = individual.identification this.name = individual.name additionalProperties(individual.additionalProperties) } /** The person's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth)) /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun dateOfBirth(dateOfBirth: JsonField) = apply { this.dateOfBirth = dateOfBirth } /** A means of verifying the person's identity. */ fun identification(identification: Identification) = identification(JsonField.of(identification)) /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun identification(identification: JsonField) = apply { this.identification = identification } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Individual = Individual( address, dateOfBirth, identification, name, additionalProperties.toImmutable(), ) } /** The person's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the * state of the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the * state of the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } /** A means of verifying the person's identity. */ @JsonDeserialize(builder = Identification.Builder::class) @NoAutoDetect class Identification private constructor( private val method: JsonField, private val numberLast4: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** A method that can be used to verify the individual's identity. */ fun method(): Method = method.getRequired("method") /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(): String = numberLast4.getRequired("number_last4") /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun _method() = method /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4 @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Identification = apply { if (!validated) { method() numberLast4() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var method: JsonField = JsonMissing.of() private var numberLast4: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(identification: Identification) = apply { this.method = identification.method this.numberLast4 = identification.numberLast4 additionalProperties(identification.additionalProperties) } /** A method that can be used to verify the individual's identity. */ fun method(method: Method) = method(JsonField.of(method)) /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** * The last 4 digits of the identification number that can be used to verify * the individual's identity. */ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4)) /** * The last 4 digits of the identification number that can be used to verify * the individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun numberLast4(numberLast4: JsonField) = apply { this.numberLast4 = numberLast4 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Identification = Identification( method, numberLast4, additionalProperties.toImmutable(), ) } class Method @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Method && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val SOCIAL_SECURITY_NUMBER = Method(JsonField.of("social_security_number")) val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = Method(JsonField.of("individual_taxpayer_identification_number")) val PASSPORT = Method(JsonField.of("passport")) val DRIVERS_LICENSE = Method(JsonField.of("drivers_license")) val OTHER = Method(JsonField.of("other")) fun of(value: String) = Method(JsonField.of(value)) } enum class Known { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, } enum class Value { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, _UNKNOWN, } 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 } 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") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Identification && this.method == other.method && this.numberLast4 == other.numberLast4 && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(method, numberLast4, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Individual && this.address == other.address && this.dateOfBirth == other.dateOfBirth && this.identification == other.identification && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, dateOfBirth, identification, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } class Prong @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Prong && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val OWNERSHIP = Prong(JsonField.of("ownership")) val CONTROL = Prong(JsonField.of("control")) fun of(value: String) = Prong(JsonField.of(value)) } enum class Known { OWNERSHIP, CONTROL, } enum class Value { OWNERSHIP, CONTROL, _UNKNOWN, } fun value(): Value = when (this) { OWNERSHIP -> Value.OWNERSHIP CONTROL -> Value.CONTROL else -> Value._UNKNOWN } fun known(): Known = when (this) { OWNERSHIP -> Known.OWNERSHIP CONTROL -> Known.CONTROL else -> throw IncreaseInvalidDataException("Unknown Prong: $value") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is BeneficialOwner && this.beneficialOwnerId == other.beneficialOwnerId && this.companyTitle == other.companyTitle && this.individual == other.individual && this.prong == other.prong && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(beneficialOwnerId, companyTitle, individual, prong, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "BeneficialOwner{beneficialOwnerId=$beneficialOwnerId, companyTitle=$companyTitle, individual=$individual, prong=$prong, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Corporation && this.address == other.address && this.beneficialOwners == other.beneficialOwners && this.incorporationState == other.incorporationState && this.industryCode == other.industryCode && this.name == other.name && this.taxIdentifier == other.taxIdentifier && this.website == other.website && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, beneficialOwners, incorporationState, industryCode, name, taxIdentifier, website, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Corporation{address=$address, beneficialOwners=$beneficialOwners, incorporationState=$incorporationState, industryCode=$industryCode, name=$name, taxIdentifier=$taxIdentifier, website=$website, additionalProperties=$additionalProperties}" } /** * Details of the government authority entity. Will be present if `structure` is equal to * `government_authority`. */ @JsonDeserialize(builder = GovernmentAuthority.Builder::class) @NoAutoDetect class GovernmentAuthority private constructor( private val address: JsonField
, private val authorizedPersons: JsonField>, private val category: JsonField, private val name: JsonField, private val taxIdentifier: JsonField, private val website: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The government authority's address. */ fun address(): Address = address.getRequired("address") /** The identifying details of authorized persons of the government authority. */ fun authorizedPersons(): List = authorizedPersons.getRequired("authorized_persons") /** The category of the government authority. */ fun category(): Category = category.getRequired("category") /** The government authority's name. */ fun name(): String = name.getRequired("name") /** The Employer Identification Number (EIN) of the government authority. */ fun taxIdentifier(): String? = taxIdentifier.getNullable("tax_identifier") /** The government authority's website. */ fun website(): String? = website.getNullable("website") /** The government authority's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The identifying details of authorized persons of the government authority. */ @JsonProperty("authorized_persons") @ExcludeMissing fun _authorizedPersons() = authorizedPersons /** The category of the government authority. */ @JsonProperty("category") @ExcludeMissing fun _category() = category /** The government authority's name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name /** The Employer Identification Number (EIN) of the government authority. */ @JsonProperty("tax_identifier") @ExcludeMissing fun _taxIdentifier() = taxIdentifier /** The government authority's website. */ @JsonProperty("website") @ExcludeMissing fun _website() = website @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): GovernmentAuthority = apply { if (!validated) { address().validate() authorizedPersons().forEach { it.validate() } category() name() taxIdentifier() website() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var authorizedPersons: JsonField> = JsonMissing.of() private var category: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var taxIdentifier: JsonField = JsonMissing.of() private var website: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(governmentAuthority: GovernmentAuthority) = apply { this.address = governmentAuthority.address this.authorizedPersons = governmentAuthority.authorizedPersons this.category = governmentAuthority.category this.name = governmentAuthority.name this.taxIdentifier = governmentAuthority.taxIdentifier this.website = governmentAuthority.website additionalProperties(governmentAuthority.additionalProperties) } /** The government authority's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The government authority's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The identifying details of authorized persons of the government authority. */ fun authorizedPersons(authorizedPersons: List) = authorizedPersons(JsonField.of(authorizedPersons)) /** The identifying details of authorized persons of the government authority. */ @JsonProperty("authorized_persons") @ExcludeMissing fun authorizedPersons(authorizedPersons: JsonField>) = apply { this.authorizedPersons = authorizedPersons } /** The category of the government authority. */ fun category(category: Category) = category(JsonField.of(category)) /** The category of the government authority. */ @JsonProperty("category") @ExcludeMissing fun category(category: JsonField) = apply { this.category = category } /** The government authority's name. */ fun name(name: String) = name(JsonField.of(name)) /** The government authority's name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The Employer Identification Number (EIN) of the government authority. */ fun taxIdentifier(taxIdentifier: String) = taxIdentifier(JsonField.of(taxIdentifier)) /** The Employer Identification Number (EIN) of the government authority. */ @JsonProperty("tax_identifier") @ExcludeMissing fun taxIdentifier(taxIdentifier: JsonField) = apply { this.taxIdentifier = taxIdentifier } /** The government authority's website. */ fun website(website: String) = website(JsonField.of(website)) /** The government authority's website. */ @JsonProperty("website") @ExcludeMissing fun website(website: JsonField) = apply { this.website = website } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): GovernmentAuthority = GovernmentAuthority( address, authorizedPersons.map { it.toImmutable() }, category, name, taxIdentifier, website, additionalProperties.toImmutable(), ) } /** The government authority's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = AuthorizedPerson.Builder::class) @NoAutoDetect class AuthorizedPerson private constructor( private val authorizedPersonId: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The identifier of this authorized person. */ fun authorizedPersonId(): String = authorizedPersonId.getRequired("authorized_person_id") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The identifier of this authorized person. */ @JsonProperty("authorized_person_id") @ExcludeMissing fun _authorizedPersonId() = authorizedPersonId /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AuthorizedPerson = apply { if (!validated) { authorizedPersonId() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var authorizedPersonId: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(authorizedPerson: AuthorizedPerson) = apply { this.authorizedPersonId = authorizedPerson.authorizedPersonId this.name = authorizedPerson.name additionalProperties(authorizedPerson.additionalProperties) } /** The identifier of this authorized person. */ fun authorizedPersonId(authorizedPersonId: String) = authorizedPersonId(JsonField.of(authorizedPersonId)) /** The identifier of this authorized person. */ @JsonProperty("authorized_person_id") @ExcludeMissing fun authorizedPersonId(authorizedPersonId: JsonField) = apply { this.authorizedPersonId = authorizedPersonId } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): AuthorizedPerson = AuthorizedPerson( authorizedPersonId, name, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is AuthorizedPerson && this.authorizedPersonId == other.authorizedPersonId && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(authorizedPersonId, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "AuthorizedPerson{authorizedPersonId=$authorizedPersonId, name=$name, additionalProperties=$additionalProperties}" } class Category @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Category && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val MUNICIPALITY = Category(JsonField.of("municipality")) fun of(value: String) = Category(JsonField.of(value)) } enum class Known { MUNICIPALITY, } enum class Value { MUNICIPALITY, _UNKNOWN, } fun value(): Value = when (this) { MUNICIPALITY -> Value.MUNICIPALITY else -> Value._UNKNOWN } fun known(): Known = when (this) { MUNICIPALITY -> Known.MUNICIPALITY else -> throw IncreaseInvalidDataException("Unknown Category: $value") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is GovernmentAuthority && this.address == other.address && this.authorizedPersons == other.authorizedPersons && this.category == other.category && this.name == other.name && this.taxIdentifier == other.taxIdentifier && this.website == other.website && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, authorizedPersons, category, name, taxIdentifier, website, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "GovernmentAuthority{address=$address, authorizedPersons=$authorizedPersons, category=$category, name=$name, taxIdentifier=$taxIdentifier, website=$website, additionalProperties=$additionalProperties}" } /** Details of the joint entity. Will be present if `structure` is equal to `joint`. */ @JsonDeserialize(builder = Joint.Builder::class) @NoAutoDetect class Joint private constructor( private val individuals: JsonField>, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The two individuals that share control of the entity. */ fun individuals(): List = individuals.getRequired("individuals") /** The entity's name. */ fun name(): String = name.getRequired("name") /** The two individuals that share control of the entity. */ @JsonProperty("individuals") @ExcludeMissing fun _individuals() = individuals /** The entity's name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Joint = apply { if (!validated) { individuals().forEach { it.validate() } name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var individuals: JsonField> = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(joint: Joint) = apply { this.individuals = joint.individuals this.name = joint.name additionalProperties(joint.additionalProperties) } /** The two individuals that share control of the entity. */ fun individuals(individuals: List) = individuals(JsonField.of(individuals)) /** The two individuals that share control of the entity. */ @JsonProperty("individuals") @ExcludeMissing fun individuals(individuals: JsonField>) = apply { this.individuals = individuals } /** The entity's name. */ fun name(name: String) = name(JsonField.of(name)) /** The entity's name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Joint = Joint( individuals.map { it.toImmutable() }, name, additionalProperties.toImmutable(), ) } @JsonDeserialize(builder = Individual.Builder::class) @NoAutoDetect class Individual private constructor( private val address: JsonField
, private val dateOfBirth: JsonField, private val identification: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The person's address. */ fun address(): Address = address.getRequired("address") /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth") /** A means of verifying the person's identity. */ fun identification(): Identification = identification.getRequired("identification") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun _identification() = identification /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Individual = apply { if (!validated) { address().validate() dateOfBirth() identification().validate() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(individual: Individual) = apply { this.address = individual.address this.dateOfBirth = individual.dateOfBirth this.identification = individual.identification this.name = individual.name additionalProperties(individual.additionalProperties) } /** The person's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth)) /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun dateOfBirth(dateOfBirth: JsonField) = apply { this.dateOfBirth = dateOfBirth } /** A means of verifying the person's identity. */ fun identification(identification: Identification) = identification(JsonField.of(identification)) /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun identification(identification: JsonField) = apply { this.identification = identification } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Individual = Individual( address, dateOfBirth, identification, name, additionalProperties.toImmutable(), ) } /** The person's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } /** A means of verifying the person's identity. */ @JsonDeserialize(builder = Identification.Builder::class) @NoAutoDetect class Identification private constructor( private val method: JsonField, private val numberLast4: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** A method that can be used to verify the individual's identity. */ fun method(): Method = method.getRequired("method") /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(): String = numberLast4.getRequired("number_last4") /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun _method() = method /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4 @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Identification = apply { if (!validated) { method() numberLast4() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var method: JsonField = JsonMissing.of() private var numberLast4: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(identification: Identification) = apply { this.method = identification.method this.numberLast4 = identification.numberLast4 additionalProperties(identification.additionalProperties) } /** A method that can be used to verify the individual's identity. */ fun method(method: Method) = method(JsonField.of(method)) /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4)) /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun numberLast4(numberLast4: JsonField) = apply { this.numberLast4 = numberLast4 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Identification = Identification( method, numberLast4, additionalProperties.toImmutable(), ) } class Method @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Method && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val SOCIAL_SECURITY_NUMBER = Method(JsonField.of("social_security_number")) val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = Method(JsonField.of("individual_taxpayer_identification_number")) val PASSPORT = Method(JsonField.of("passport")) val DRIVERS_LICENSE = Method(JsonField.of("drivers_license")) val OTHER = Method(JsonField.of("other")) fun of(value: String) = Method(JsonField.of(value)) } enum class Known { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, } enum class Value { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, _UNKNOWN, } 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 } 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") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Identification && this.method == other.method && this.numberLast4 == other.numberLast4 && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(method, numberLast4, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Individual && this.address == other.address && this.dateOfBirth == other.dateOfBirth && this.identification == other.identification && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, dateOfBirth, identification, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Joint && this.individuals == other.individuals && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(individuals, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Joint{individuals=$individuals, name=$name, additionalProperties=$additionalProperties}" } /** * Details of the natural person entity. Will be present if `structure` is equal to * `natural_person`. */ @JsonDeserialize(builder = NaturalPerson.Builder::class) @NoAutoDetect class NaturalPerson private constructor( private val address: JsonField
, private val dateOfBirth: JsonField, private val identification: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The person's address. */ fun address(): Address = address.getRequired("address") /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth") /** A means of verifying the person's identity. */ fun identification(): Identification = identification.getRequired("identification") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun _identification() = identification /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): NaturalPerson = apply { if (!validated) { address().validate() dateOfBirth() identification().validate() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(naturalPerson: NaturalPerson) = apply { this.address = naturalPerson.address this.dateOfBirth = naturalPerson.dateOfBirth this.identification = naturalPerson.identification this.name = naturalPerson.name additionalProperties(naturalPerson.additionalProperties) } /** The person's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth)) /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun dateOfBirth(dateOfBirth: JsonField) = apply { this.dateOfBirth = dateOfBirth } /** A means of verifying the person's identity. */ fun identification(identification: Identification) = identification(JsonField.of(identification)) /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun identification(identification: JsonField) = apply { this.identification = identification } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): NaturalPerson = NaturalPerson( address, dateOfBirth, identification, name, additionalProperties.toImmutable(), ) } /** The person's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } /** A means of verifying the person's identity. */ @JsonDeserialize(builder = Identification.Builder::class) @NoAutoDetect class Identification private constructor( private val method: JsonField, private val numberLast4: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** A method that can be used to verify the individual's identity. */ fun method(): Method = method.getRequired("method") /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(): String = numberLast4.getRequired("number_last4") /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun _method() = method /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4 @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Identification = apply { if (!validated) { method() numberLast4() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var method: JsonField = JsonMissing.of() private var numberLast4: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(identification: Identification) = apply { this.method = identification.method this.numberLast4 = identification.numberLast4 additionalProperties(identification.additionalProperties) } /** A method that can be used to verify the individual's identity. */ fun method(method: Method) = method(JsonField.of(method)) /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4)) /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun numberLast4(numberLast4: JsonField) = apply { this.numberLast4 = numberLast4 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Identification = Identification( method, numberLast4, additionalProperties.toImmutable(), ) } class Method @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Method && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val SOCIAL_SECURITY_NUMBER = Method(JsonField.of("social_security_number")) val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = Method(JsonField.of("individual_taxpayer_identification_number")) val PASSPORT = Method(JsonField.of("passport")) val DRIVERS_LICENSE = Method(JsonField.of("drivers_license")) val OTHER = Method(JsonField.of("other")) fun of(value: String) = Method(JsonField.of(value)) } enum class Known { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, } enum class Value { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, _UNKNOWN, } 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 } 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") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Identification && this.method == other.method && this.numberLast4 == other.numberLast4 && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(method, numberLast4, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is NaturalPerson && this.address == other.address && this.dateOfBirth == other.dateOfBirth && this.identification == other.identification && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, dateOfBirth, identification, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "NaturalPerson{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } class Status @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Status && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ACTIVE = Status(JsonField.of("active")) val ARCHIVED = Status(JsonField.of("archived")) val DISABLED = Status(JsonField.of("disabled")) fun of(value: String) = Status(JsonField.of(value)) } enum class Known { ACTIVE, ARCHIVED, DISABLED, } enum class Value { ACTIVE, ARCHIVED, DISABLED, _UNKNOWN, } fun value(): Value = when (this) { ACTIVE -> Value.ACTIVE ARCHIVED -> Value.ARCHIVED DISABLED -> Value.DISABLED else -> Value._UNKNOWN } fun known(): Known = when (this) { ACTIVE -> Known.ACTIVE ARCHIVED -> Known.ARCHIVED DISABLED -> Known.DISABLED else -> throw IncreaseInvalidDataException("Unknown Status: $value") } fun asString(): String = _value().asStringOrThrow() } class Structure @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Structure && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val CORPORATION = Structure(JsonField.of("corporation")) val NATURAL_PERSON = Structure(JsonField.of("natural_person")) val JOINT = Structure(JsonField.of("joint")) val TRUST = Structure(JsonField.of("trust")) val GOVERNMENT_AUTHORITY = Structure(JsonField.of("government_authority")) fun of(value: String) = Structure(JsonField.of(value)) } enum class Known { CORPORATION, NATURAL_PERSON, JOINT, TRUST, GOVERNMENT_AUTHORITY, } enum class Value { CORPORATION, NATURAL_PERSON, JOINT, TRUST, GOVERNMENT_AUTHORITY, _UNKNOWN, } fun value(): Value = when (this) { CORPORATION -> Value.CORPORATION NATURAL_PERSON -> Value.NATURAL_PERSON JOINT -> Value.JOINT TRUST -> Value.TRUST GOVERNMENT_AUTHORITY -> Value.GOVERNMENT_AUTHORITY else -> Value._UNKNOWN } fun known(): Known = when (this) { CORPORATION -> Known.CORPORATION NATURAL_PERSON -> Known.NATURAL_PERSON JOINT -> Known.JOINT TRUST -> Known.TRUST GOVERNMENT_AUTHORITY -> Known.GOVERNMENT_AUTHORITY else -> throw IncreaseInvalidDataException("Unknown Structure: $value") } fun asString(): String = _value().asStringOrThrow() } /** * A reference to data stored in a third-party verification service. Your integration may or may * not use this field. */ @JsonDeserialize(builder = ThirdPartyVerification.Builder::class) @NoAutoDetect class ThirdPartyVerification private constructor( private val reference: JsonField, private val vendor: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The reference identifier for the third party verification. */ fun reference(): String = reference.getRequired("reference") /** The vendor that was used to perform the verification. */ fun vendor(): Vendor = vendor.getRequired("vendor") /** The reference identifier for the third party verification. */ @JsonProperty("reference") @ExcludeMissing fun _reference() = reference /** The vendor that was used to perform the verification. */ @JsonProperty("vendor") @ExcludeMissing fun _vendor() = vendor @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): ThirdPartyVerification = apply { if (!validated) { reference() vendor() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var reference: JsonField = JsonMissing.of() private var vendor: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(thirdPartyVerification: ThirdPartyVerification) = apply { this.reference = thirdPartyVerification.reference this.vendor = thirdPartyVerification.vendor additionalProperties(thirdPartyVerification.additionalProperties) } /** The reference identifier for the third party verification. */ fun reference(reference: String) = reference(JsonField.of(reference)) /** The reference identifier for the third party verification. */ @JsonProperty("reference") @ExcludeMissing fun reference(reference: JsonField) = apply { this.reference = reference } /** The vendor that was used to perform the verification. */ fun vendor(vendor: Vendor) = vendor(JsonField.of(vendor)) /** The vendor that was used to perform the verification. */ @JsonProperty("vendor") @ExcludeMissing fun vendor(vendor: JsonField) = apply { this.vendor = vendor } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): ThirdPartyVerification = ThirdPartyVerification( reference, vendor, additionalProperties.toImmutable(), ) } class Vendor @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Vendor && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ALLOY = Vendor(JsonField.of("alloy")) val MIDDESK = Vendor(JsonField.of("middesk")) fun of(value: String) = Vendor(JsonField.of(value)) } enum class Known { ALLOY, MIDDESK, } enum class Value { ALLOY, MIDDESK, _UNKNOWN, } fun value(): Value = when (this) { ALLOY -> Value.ALLOY MIDDESK -> Value.MIDDESK else -> Value._UNKNOWN } fun known(): Known = when (this) { ALLOY -> Known.ALLOY MIDDESK -> Known.MIDDESK else -> throw IncreaseInvalidDataException("Unknown Vendor: $value") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is ThirdPartyVerification && this.reference == other.reference && this.vendor == other.vendor && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(reference, vendor, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "ThirdPartyVerification{reference=$reference, vendor=$vendor, additionalProperties=$additionalProperties}" } /** Details of the trust entity. Will be present if `structure` is equal to `trust`. */ @JsonDeserialize(builder = Trust.Builder::class) @NoAutoDetect class Trust private constructor( private val address: JsonField
, private val category: JsonField, private val formationDocumentFileId: JsonField, private val formationState: JsonField, private val grantor: JsonField, private val name: JsonField, private val taxIdentifier: JsonField, private val trustees: JsonField>, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The trust's address. */ fun address(): Address = address.getRequired("address") /** Whether the trust is `revocable` or `irrevocable`. */ fun category(): Category = category.getRequired("category") /** The ID for the File containing the formation document of the trust. */ fun formationDocumentFileId(): String? = formationDocumentFileId.getNullable("formation_document_file_id") /** * The two-letter United States Postal Service (USPS) abbreviation for the state in which * the trust was formed. */ fun formationState(): String? = formationState.getNullable("formation_state") /** The grantor of the trust. Will be present if the `category` is `revocable`. */ fun grantor(): Grantor? = grantor.getNullable("grantor") /** The trust's name. */ fun name(): String = name.getRequired("name") /** The Employer Identification Number (EIN) of the trust itself. */ fun taxIdentifier(): String? = taxIdentifier.getNullable("tax_identifier") /** The trustees of the trust. */ fun trustees(): List = trustees.getRequired("trustees") /** The trust's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** Whether the trust is `revocable` or `irrevocable`. */ @JsonProperty("category") @ExcludeMissing fun _category() = category /** The ID for the File containing the formation document of the trust. */ @JsonProperty("formation_document_file_id") @ExcludeMissing fun _formationDocumentFileId() = formationDocumentFileId /** * The two-letter United States Postal Service (USPS) abbreviation for the state in which * the trust was formed. */ @JsonProperty("formation_state") @ExcludeMissing fun _formationState() = formationState /** The grantor of the trust. Will be present if the `category` is `revocable`. */ @JsonProperty("grantor") @ExcludeMissing fun _grantor() = grantor /** The trust's name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name /** The Employer Identification Number (EIN) of the trust itself. */ @JsonProperty("tax_identifier") @ExcludeMissing fun _taxIdentifier() = taxIdentifier /** The trustees of the trust. */ @JsonProperty("trustees") @ExcludeMissing fun _trustees() = trustees @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Trust = apply { if (!validated) { address().validate() category() formationDocumentFileId() formationState() grantor()?.validate() name() taxIdentifier() trustees().forEach { it.validate() } validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var category: JsonField = JsonMissing.of() private var formationDocumentFileId: JsonField = JsonMissing.of() private var formationState: JsonField = JsonMissing.of() private var grantor: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var taxIdentifier: JsonField = JsonMissing.of() private var trustees: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(trust: Trust) = apply { this.address = trust.address this.category = trust.category this.formationDocumentFileId = trust.formationDocumentFileId this.formationState = trust.formationState this.grantor = trust.grantor this.name = trust.name this.taxIdentifier = trust.taxIdentifier this.trustees = trust.trustees additionalProperties(trust.additionalProperties) } /** The trust's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The trust's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** Whether the trust is `revocable` or `irrevocable`. */ fun category(category: Category) = category(JsonField.of(category)) /** Whether the trust is `revocable` or `irrevocable`. */ @JsonProperty("category") @ExcludeMissing fun category(category: JsonField) = apply { this.category = category } /** The ID for the File containing the formation document of the trust. */ fun formationDocumentFileId(formationDocumentFileId: String) = formationDocumentFileId(JsonField.of(formationDocumentFileId)) /** The ID for the File containing the formation document of the trust. */ @JsonProperty("formation_document_file_id") @ExcludeMissing fun formationDocumentFileId(formationDocumentFileId: JsonField) = apply { this.formationDocumentFileId = formationDocumentFileId } /** * The two-letter United States Postal Service (USPS) abbreviation for the state in * which the trust was formed. */ fun formationState(formationState: String) = formationState(JsonField.of(formationState)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state in * which the trust was formed. */ @JsonProperty("formation_state") @ExcludeMissing fun formationState(formationState: JsonField) = apply { this.formationState = formationState } /** The grantor of the trust. Will be present if the `category` is `revocable`. */ fun grantor(grantor: Grantor) = grantor(JsonField.of(grantor)) /** The grantor of the trust. Will be present if the `category` is `revocable`. */ @JsonProperty("grantor") @ExcludeMissing fun grantor(grantor: JsonField) = apply { this.grantor = grantor } /** The trust's name. */ fun name(name: String) = name(JsonField.of(name)) /** The trust's name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } /** The Employer Identification Number (EIN) of the trust itself. */ fun taxIdentifier(taxIdentifier: String) = taxIdentifier(JsonField.of(taxIdentifier)) /** The Employer Identification Number (EIN) of the trust itself. */ @JsonProperty("tax_identifier") @ExcludeMissing fun taxIdentifier(taxIdentifier: JsonField) = apply { this.taxIdentifier = taxIdentifier } /** The trustees of the trust. */ fun trustees(trustees: List) = trustees(JsonField.of(trustees)) /** The trustees of the trust. */ @JsonProperty("trustees") @ExcludeMissing fun trustees(trustees: JsonField>) = apply { this.trustees = trustees } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Trust = Trust( address, category, formationDocumentFileId, formationState, grantor, name, taxIdentifier, trustees.map { it.toImmutable() }, additionalProperties.toImmutable(), ) } /** The trust's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of the * address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } class Category @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Category && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val REVOCABLE = Category(JsonField.of("revocable")) val IRREVOCABLE = Category(JsonField.of("irrevocable")) fun of(value: String) = Category(JsonField.of(value)) } enum class Known { REVOCABLE, IRREVOCABLE, } enum class Value { REVOCABLE, IRREVOCABLE, _UNKNOWN, } fun value(): Value = when (this) { REVOCABLE -> Value.REVOCABLE IRREVOCABLE -> Value.IRREVOCABLE else -> Value._UNKNOWN } fun known(): Known = when (this) { REVOCABLE -> Known.REVOCABLE IRREVOCABLE -> Known.IRREVOCABLE else -> throw IncreaseInvalidDataException("Unknown Category: $value") } fun asString(): String = _value().asStringOrThrow() } /** The grantor of the trust. Will be present if the `category` is `revocable`. */ @JsonDeserialize(builder = Grantor.Builder::class) @NoAutoDetect class Grantor private constructor( private val address: JsonField
, private val dateOfBirth: JsonField, private val identification: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The person's address. */ fun address(): Address = address.getRequired("address") /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth") /** A means of verifying the person's identity. */ fun identification(): Identification = identification.getRequired("identification") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun _identification() = identification /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Grantor = apply { if (!validated) { address().validate() dateOfBirth() identification().validate() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(grantor: Grantor) = apply { this.address = grantor.address this.dateOfBirth = grantor.dateOfBirth this.identification = grantor.identification this.name = grantor.name additionalProperties(grantor.additionalProperties) } /** The person's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth)) /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun dateOfBirth(dateOfBirth: JsonField) = apply { this.dateOfBirth = dateOfBirth } /** A means of verifying the person's identity. */ fun identification(identification: Identification) = identification(JsonField.of(identification)) /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun identification(identification: JsonField) = apply { this.identification = identification } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Grantor = Grantor( address, dateOfBirth, identification, name, additionalProperties.toImmutable(), ) } /** The person's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state of * the address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } /** A means of verifying the person's identity. */ @JsonDeserialize(builder = Identification.Builder::class) @NoAutoDetect class Identification private constructor( private val method: JsonField, private val numberLast4: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** A method that can be used to verify the individual's identity. */ fun method(): Method = method.getRequired("method") /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(): String = numberLast4.getRequired("number_last4") /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun _method() = method /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4 @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Identification = apply { if (!validated) { method() numberLast4() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var method: JsonField = JsonMissing.of() private var numberLast4: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(identification: Identification) = apply { this.method = identification.method this.numberLast4 = identification.numberLast4 additionalProperties(identification.additionalProperties) } /** A method that can be used to verify the individual's identity. */ fun method(method: Method) = method(JsonField.of(method)) /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4)) /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun numberLast4(numberLast4: JsonField) = apply { this.numberLast4 = numberLast4 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Identification = Identification( method, numberLast4, additionalProperties.toImmutable(), ) } class Method @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Method && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val SOCIAL_SECURITY_NUMBER = Method(JsonField.of("social_security_number")) val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = Method(JsonField.of("individual_taxpayer_identification_number")) val PASSPORT = Method(JsonField.of("passport")) val DRIVERS_LICENSE = Method(JsonField.of("drivers_license")) val OTHER = Method(JsonField.of("other")) fun of(value: String) = Method(JsonField.of(value)) } enum class Known { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, } enum class Value { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, _UNKNOWN, } 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 } 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") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Identification && this.method == other.method && this.numberLast4 == other.numberLast4 && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(method, numberLast4, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Grantor && this.address == other.address && this.dateOfBirth == other.dateOfBirth && this.identification == other.identification && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, dateOfBirth, identification, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Grantor{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } @JsonDeserialize(builder = Trustee.Builder::class) @NoAutoDetect class Trustee private constructor( private val individual: JsonField, private val structure: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** * The individual trustee of the trust. Will be present if the trustee's `structure` is * equal to `individual`. */ fun individual(): Individual? = individual.getNullable("individual") /** The structure of the trustee. Will always be equal to `individual`. */ fun structure(): Structure = structure.getRequired("structure") /** * The individual trustee of the trust. Will be present if the trustee's `structure` is * equal to `individual`. */ @JsonProperty("individual") @ExcludeMissing fun _individual() = individual /** The structure of the trustee. Will always be equal to `individual`. */ @JsonProperty("structure") @ExcludeMissing fun _structure() = structure @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Trustee = apply { if (!validated) { individual()?.validate() structure() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var individual: JsonField = JsonMissing.of() private var structure: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(trustee: Trustee) = apply { this.individual = trustee.individual this.structure = trustee.structure additionalProperties(trustee.additionalProperties) } /** * The individual trustee of the trust. Will be present if the trustee's `structure` * is equal to `individual`. */ fun individual(individual: Individual) = individual(JsonField.of(individual)) /** * The individual trustee of the trust. Will be present if the trustee's `structure` * is equal to `individual`. */ @JsonProperty("individual") @ExcludeMissing fun individual(individual: JsonField) = apply { this.individual = individual } /** The structure of the trustee. Will always be equal to `individual`. */ fun structure(structure: Structure) = structure(JsonField.of(structure)) /** The structure of the trustee. Will always be equal to `individual`. */ @JsonProperty("structure") @ExcludeMissing fun structure(structure: JsonField) = apply { this.structure = structure } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Trustee = Trustee( individual, structure, additionalProperties.toImmutable(), ) } /** * The individual trustee of the trust. Will be present if the trustee's `structure` is * equal to `individual`. */ @JsonDeserialize(builder = Individual.Builder::class) @NoAutoDetect class Individual private constructor( private val address: JsonField
, private val dateOfBirth: JsonField, private val identification: JsonField, private val name: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The person's address. */ fun address(): Address = address.getRequired("address") /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(): LocalDate = dateOfBirth.getRequired("date_of_birth") /** A means of verifying the person's identity. */ fun identification(): Identification = identification.getRequired("identification") /** The person's legal name. */ fun name(): String = name.getRequired("name") /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun _dateOfBirth() = dateOfBirth /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun _identification() = identification /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun _name() = name @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Individual = apply { if (!validated) { address().validate() dateOfBirth() identification().validate() name() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dateOfBirth: JsonField = JsonMissing.of() private var identification: JsonField = JsonMissing.of() private var name: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(individual: Individual) = apply { this.address = individual.address this.dateOfBirth = individual.dateOfBirth this.identification = individual.identification this.name = individual.name additionalProperties(individual.additionalProperties) } /** The person's address. */ fun address(address: Address) = address(JsonField.of(address)) /** The person's address. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** The person's date of birth in YYYY-MM-DD format. */ fun dateOfBirth(dateOfBirth: LocalDate) = dateOfBirth(JsonField.of(dateOfBirth)) /** The person's date of birth in YYYY-MM-DD format. */ @JsonProperty("date_of_birth") @ExcludeMissing fun dateOfBirth(dateOfBirth: JsonField) = apply { this.dateOfBirth = dateOfBirth } /** A means of verifying the person's identity. */ fun identification(identification: Identification) = identification(JsonField.of(identification)) /** A means of verifying the person's identity. */ @JsonProperty("identification") @ExcludeMissing fun identification(identification: JsonField) = apply { this.identification = identification } /** The person's legal name. */ fun name(name: String) = name(JsonField.of(name)) /** The person's legal name. */ @JsonProperty("name") @ExcludeMissing fun name(name: JsonField) = apply { this.name = name } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Individual = Individual( address, dateOfBirth, identification, name, additionalProperties.toImmutable(), ) } /** The person's address. */ @JsonDeserialize(builder = Address.Builder::class) @NoAutoDetect class Address private constructor( private val city: JsonField, private val line1: JsonField, private val line2: JsonField, private val state: JsonField, private val zip: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** The city of the address. */ fun city(): String = city.getRequired("city") /** The first line of the address. */ fun line1(): String = line1.getRequired("line1") /** The second line of the address. */ fun line2(): String? = line2.getNullable("line2") /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ fun state(): String = state.getRequired("state") /** The ZIP code of the address. */ fun zip(): String = zip.getRequired("zip") /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun _city() = city /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun _line1() = line1 /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun _line2() = line2 /** * The two-letter United States Postal Service (USPS) abbreviation for the state * of the address. */ @JsonProperty("state") @ExcludeMissing fun _state() = state /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun _zip() = zip @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Address = apply { if (!validated) { city() line1() line2() state() zip() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var city: JsonField = JsonMissing.of() private var line1: JsonField = JsonMissing.of() private var line2: JsonField = JsonMissing.of() private var state: JsonField = JsonMissing.of() private var zip: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(address: Address) = apply { this.city = address.city this.line1 = address.line1 this.line2 = address.line2 this.state = address.state this.zip = address.zip additionalProperties(address.additionalProperties) } /** The city of the address. */ fun city(city: String) = city(JsonField.of(city)) /** The city of the address. */ @JsonProperty("city") @ExcludeMissing fun city(city: JsonField) = apply { this.city = city } /** The first line of the address. */ fun line1(line1: String) = line1(JsonField.of(line1)) /** The first line of the address. */ @JsonProperty("line1") @ExcludeMissing fun line1(line1: JsonField) = apply { this.line1 = line1 } /** The second line of the address. */ fun line2(line2: String) = line2(JsonField.of(line2)) /** The second line of the address. */ @JsonProperty("line2") @ExcludeMissing fun line2(line2: JsonField) = apply { this.line2 = line2 } /** * The two-letter United States Postal Service (USPS) abbreviation for the * state of the address. */ fun state(state: String) = state(JsonField.of(state)) /** * The two-letter United States Postal Service (USPS) abbreviation for the * state of the address. */ @JsonProperty("state") @ExcludeMissing fun state(state: JsonField) = apply { this.state = state } /** The ZIP code of the address. */ fun zip(zip: String) = zip(JsonField.of(zip)) /** The ZIP code of the address. */ @JsonProperty("zip") @ExcludeMissing fun zip(zip: JsonField) = apply { this.zip = zip } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Address = Address( city, line1, line2, state, zip, additionalProperties.toImmutable(), ) } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Address && this.city == other.city && this.line1 == other.line1 && this.line2 == other.line2 && this.state == other.state && this.zip == other.zip && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(city, line1, line2, state, zip, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Address{city=$city, line1=$line1, line2=$line2, state=$state, zip=$zip, additionalProperties=$additionalProperties}" } /** A means of verifying the person's identity. */ @JsonDeserialize(builder = Identification.Builder::class) @NoAutoDetect class Identification private constructor( private val method: JsonField, private val numberLast4: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false /** A method that can be used to verify the individual's identity. */ fun method(): Method = method.getRequired("method") /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ fun numberLast4(): String = numberLast4.getRequired("number_last4") /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun _method() = method /** * The last 4 digits of the identification number that can be used to verify the * individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun _numberLast4() = numberLast4 @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): Identification = apply { if (!validated) { method() numberLast4() validated = true } } fun toBuilder() = Builder().from(this) companion object { fun builder() = Builder() } class Builder { private var method: JsonField = JsonMissing.of() private var numberLast4: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(identification: Identification) = apply { this.method = identification.method this.numberLast4 = identification.numberLast4 additionalProperties(identification.additionalProperties) } /** A method that can be used to verify the individual's identity. */ fun method(method: Method) = method(JsonField.of(method)) /** A method that can be used to verify the individual's identity. */ @JsonProperty("method") @ExcludeMissing fun method(method: JsonField) = apply { this.method = method } /** * The last 4 digits of the identification number that can be used to verify * the individual's identity. */ fun numberLast4(numberLast4: String) = numberLast4(JsonField.of(numberLast4)) /** * The last 4 digits of the identification number that can be used to verify * the individual's identity. */ @JsonProperty("number_last4") @ExcludeMissing fun numberLast4(numberLast4: JsonField) = apply { this.numberLast4 = numberLast4 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties( additionalProperties: Map ) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): Identification = Identification( method, numberLast4, additionalProperties.toImmutable(), ) } class Method @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Method && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val SOCIAL_SECURITY_NUMBER = Method(JsonField.of("social_security_number")) val INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER = Method(JsonField.of("individual_taxpayer_identification_number")) val PASSPORT = Method(JsonField.of("passport")) val DRIVERS_LICENSE = Method(JsonField.of("drivers_license")) val OTHER = Method(JsonField.of("other")) fun of(value: String) = Method(JsonField.of(value)) } enum class Known { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, } enum class Value { SOCIAL_SECURITY_NUMBER, INDIVIDUAL_TAXPAYER_IDENTIFICATION_NUMBER, PASSPORT, DRIVERS_LICENSE, OTHER, _UNKNOWN, } 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 } 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") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Identification && this.method == other.method && this.numberLast4 == other.numberLast4 && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(method, numberLast4, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Identification{method=$method, numberLast4=$numberLast4, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Individual && this.address == other.address && this.dateOfBirth == other.dateOfBirth && this.identification == other.identification && this.name == other.name && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, dateOfBirth, identification, name, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Individual{address=$address, dateOfBirth=$dateOfBirth, identification=$identification, name=$name, additionalProperties=$additionalProperties}" } class Structure @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Structure && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val INDIVIDUAL = Structure(JsonField.of("individual")) fun of(value: String) = Structure(JsonField.of(value)) } enum class Known { INDIVIDUAL, } enum class Value { INDIVIDUAL, _UNKNOWN, } fun value(): Value = when (this) { INDIVIDUAL -> Value.INDIVIDUAL else -> Value._UNKNOWN } fun known(): Known = when (this) { INDIVIDUAL -> Known.INDIVIDUAL else -> throw IncreaseInvalidDataException("Unknown Structure: $value") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Trustee && this.individual == other.individual && this.structure == other.structure && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(individual, structure, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Trustee{individual=$individual, structure=$structure, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Trust && this.address == other.address && this.category == other.category && this.formationDocumentFileId == other.formationDocumentFileId && this.formationState == other.formationState && this.grantor == other.grantor && this.name == other.name && this.taxIdentifier == other.taxIdentifier && this.trustees == other.trustees && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(address, category, formationDocumentFileId, formationState, grantor, name, taxIdentifier, trustees, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Trust{address=$address, category=$category, formationDocumentFileId=$formationDocumentFileId, formationState=$formationState, grantor=$grantor, name=$name, taxIdentifier=$taxIdentifier, trustees=$trustees, additionalProperties=$additionalProperties}" } class Type @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */ } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ENTITY = Type(JsonField.of("entity")) fun of(value: String) = Type(JsonField.of(value)) } enum class Known { ENTITY, } enum class Value { ENTITY, _UNKNOWN, } fun value(): Value = when (this) { ENTITY -> Value.ENTITY else -> Value._UNKNOWN } fun known(): Known = when (this) { ENTITY -> Known.ENTITY else -> throw IncreaseInvalidDataException("Unknown Type: $value") } fun asString(): String = _value().asStringOrThrow() } override fun equals(other: Any?): Boolean { if (this === other) { return true } return /* spotless:off */ other is Entity && this.corporation == other.corporation && this.createdAt == other.createdAt && this.description == other.description && this.detailsConfirmedAt == other.detailsConfirmedAt && this.governmentAuthority == other.governmentAuthority && this.id == other.id && this.idempotencyKey == other.idempotencyKey && this.joint == other.joint && this.naturalPerson == other.naturalPerson && this.status == other.status && this.structure == other.structure && this.supplementalDocuments == other.supplementalDocuments && this.thirdPartyVerification == other.thirdPartyVerification && this.trust == other.trust && this.type == other.type && this.additionalProperties == other.additionalProperties /* spotless:on */ } private var hashCode: Int = 0 override fun hashCode(): Int { if (hashCode == 0) { hashCode = /* spotless:off */ Objects.hash(corporation, createdAt, description, detailsConfirmedAt, governmentAuthority, id, idempotencyKey, joint, naturalPerson, status, structure, supplementalDocuments, thirdPartyVerification, trust, type, additionalProperties) /* spotless:on */ } return hashCode } override fun toString() = "Entity{corporation=$corporation, createdAt=$createdAt, description=$description, detailsConfirmedAt=$detailsConfirmedAt, governmentAuthority=$governmentAuthority, id=$id, idempotencyKey=$idempotencyKey, joint=$joint, naturalPerson=$naturalPerson, status=$status, structure=$structure, supplementalDocuments=$supplementalDocuments, thirdPartyVerification=$thirdPartyVerification, trust=$trust, type=$type, additionalProperties=$additionalProperties}" }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy