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

com.lithic.api.models.AccountHolder.kt Maven / Gradle / Ivy

Go to download

The Lithic Developer API is designed to provide a predictable programmatic interface for accessing your Lithic account through an API and transaction webhooks. Note that your API key is a secret and should be treated as such. Don't share it with anyone, including us. We will never ask you for it.

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

package com.lithic.api.models

import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.lithic.api.core.Enum
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toUnmodifiable
import com.lithic.api.errors.LithicInvalidDataException
import java.time.OffsetDateTime
import java.util.Objects

@JsonDeserialize(builder = AccountHolder.Builder::class)
@NoAutoDetect
class AccountHolder
private constructor(
    private val accountToken: JsonField,
    private val beneficialOwnerEntities: JsonField>,
    private val beneficialOwnerIndividuals: JsonField>,
    private val businessAccountToken: JsonField,
    private val businessEntity: JsonField,
    private val controlPerson: JsonField,
    private val created: JsonField,
    private val email: JsonField,
    private val exemptionType: JsonField,
    private val externalId: JsonField,
    private val individual: JsonField,
    private val natureOfBusiness: JsonField,
    private val phoneNumber: JsonField,
    private val status: JsonField,
    private val statusReasons: JsonField>,
    private val token: JsonField,
    private val userType: JsonField,
    private val verificationApplication: JsonField,
    private val requiredDocuments: JsonField>,
    private val websiteUrl: JsonField,
    private val additionalProperties: Map,
) {

    private var validated: Boolean = false

    private var hashCode: Int = 0

    /** Globally unique identifier for the account. */
    fun accountToken(): String? = accountToken.getNullable("account_token")

    /**
     * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the
     * company.
     */
    fun beneficialOwnerEntities(): List? =
        beneficialOwnerEntities.getNullable("beneficial_owner_entities")

    /**
     * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in the
     * company.
     */
    fun beneficialOwnerIndividuals(): List? =
        beneficialOwnerIndividuals.getNullable("beneficial_owner_individuals")

    /**
     * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of
     * businesses. Pass the account_token of the enrolled business associated with the
     * AUTHORIZED_USER in this field.
     */
    fun businessAccountToken(): String? = businessAccountToken.getNullable("business_account_token")

    /**
     * Only present when user_type == "BUSINESS". Information about the business for which the
     * account is being opened and KYB is being run.
     */
    fun businessEntity(): BusinessEntity? = businessEntity.getNullable("business_entity")

    /**
     * Only present when user_type == "BUSINESS". An individual with significant responsibility for
     * managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer, Chief
     * Operating Officer, Managing Member, General Partner, President, Vice President, or
     * Treasurer). This can be an executive, or someone who will have program-wide access to the
     * cards that Lithic will provide. In some cases, this individual could also be a beneficial
     * owner listed above.
     */
    fun controlPerson(): AccountHolderIndividualResponse? =
        controlPerson.getNullable("control_person")

    /** Timestamp of when the account holder was created. */
    fun created(): OffsetDateTime? = created.getNullable("created")

    /**
     * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use
     * individual.phone_number when user_type == "INDIVIDUAL".
     * > Primary email of Account Holder.
     */
    fun email(): String? = email.getNullable("email")

    /** The type of KYC exemption for a KYC-Exempt Account Holder. */
    fun exemptionType(): ExemptionType? = exemptionType.getNullable("exemption_type")

    /**
     * Customer-provided token that indicates a relationship with an object outside of the Lithic
     * ecosystem.
     */
    fun externalId(): String? = externalId.getNullable("external_id")

    /**
     * Only present when user_type == "INDIVIDUAL". Information about the individual for which the
     * account is being opened and KYC is being run.
     */
    fun individual(): AccountHolderIndividualResponse? = individual.getNullable("individual")

    /** Only present when user_type == "BUSINESS". User-submitted description of the business. */
    fun natureOfBusiness(): String? = natureOfBusiness.getNullable("nature_of_business")

    /**
     * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use
     * individual.phone_number when user_type == "INDIVIDUAL".
     * > Primary phone of Account Holder, entered in E.164 format.
     */
    fun phoneNumber(): String? = phoneNumber.getNullable("phone_number")

    /**
     * 
     *
     * KYC and KYB evaluation states.
     *
     * Note:
     * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED`
     *   workflow.
     * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
     */
    fun status(): Status? = status.getNullable("status")

    /**
     *  Reason for the evaluation status.
     */
    fun statusReasons(): List? = statusReasons.getNullable("status_reasons")

    /** Globally unique identifier for the account holder. */
    fun token(): String = token.getRequired("token")

    /**
     * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
     * present. If the type is "BUSINESS" then the "business_entity", "control_person",
     * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and
     * "website_url" attributes will be present.
     */
    fun userType(): UserType? = userType.getNullable("user_type")

    /** Information about the most recent identity verification attempt */
    fun verificationApplication(): AccountHolderVerificationApplication? =
        verificationApplication.getNullable("verification_application")

    /**
     * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required for
     * the account holder to be approved.
     */
    fun requiredDocuments(): List? =
        requiredDocuments.getNullable("required_documents")

    /** Only present when user_type == "BUSINESS". Business's primary website. */
    fun websiteUrl(): String? = websiteUrl.getNullable("website_url")

    /** Globally unique identifier for the account. */
    @JsonProperty("account_token") @ExcludeMissing fun _accountToken() = accountToken

    /**
     * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in the
     * company.
     */
    @JsonProperty("beneficial_owner_entities")
    @ExcludeMissing
    fun _beneficialOwnerEntities() = beneficialOwnerEntities

    /**
     * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in the
     * company.
     */
    @JsonProperty("beneficial_owner_individuals")
    @ExcludeMissing
    fun _beneficialOwnerIndividuals() = beneficialOwnerIndividuals

    /**
     * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of
     * businesses. Pass the account_token of the enrolled business associated with the
     * AUTHORIZED_USER in this field.
     */
    @JsonProperty("business_account_token")
    @ExcludeMissing
    fun _businessAccountToken() = businessAccountToken

    /**
     * Only present when user_type == "BUSINESS". Information about the business for which the
     * account is being opened and KYB is being run.
     */
    @JsonProperty("business_entity") @ExcludeMissing fun _businessEntity() = businessEntity

    /**
     * Only present when user_type == "BUSINESS". An individual with significant responsibility for
     * managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer, Chief
     * Operating Officer, Managing Member, General Partner, President, Vice President, or
     * Treasurer). This can be an executive, or someone who will have program-wide access to the
     * cards that Lithic will provide. In some cases, this individual could also be a beneficial
     * owner listed above.
     */
    @JsonProperty("control_person") @ExcludeMissing fun _controlPerson() = controlPerson

    /** Timestamp of when the account holder was created. */
    @JsonProperty("created") @ExcludeMissing fun _created() = created

    /**
     * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use
     * individual.phone_number when user_type == "INDIVIDUAL".
     * > Primary email of Account Holder.
     */
    @JsonProperty("email") @ExcludeMissing fun _email() = email

    /** The type of KYC exemption for a KYC-Exempt Account Holder. */
    @JsonProperty("exemption_type") @ExcludeMissing fun _exemptionType() = exemptionType

    /**
     * Customer-provided token that indicates a relationship with an object outside of the Lithic
     * ecosystem.
     */
    @JsonProperty("external_id") @ExcludeMissing fun _externalId() = externalId

    /**
     * Only present when user_type == "INDIVIDUAL". Information about the individual for which the
     * account is being opened and KYC is being run.
     */
    @JsonProperty("individual") @ExcludeMissing fun _individual() = individual

    /** Only present when user_type == "BUSINESS". User-submitted description of the business. */
    @JsonProperty("nature_of_business") @ExcludeMissing fun _natureOfBusiness() = natureOfBusiness

    /**
     * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use
     * individual.phone_number when user_type == "INDIVIDUAL".
     * > Primary phone of Account Holder, entered in E.164 format.
     */
    @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber

    /**
     * 
     *
     * KYC and KYB evaluation states.
     *
     * Note:
     * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED`
     *   workflow.
     * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
     */
    @JsonProperty("status") @ExcludeMissing fun _status() = status

    /**
     *  Reason for the evaluation status.
     */
    @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons

    /** Globally unique identifier for the account holder. */
    @JsonProperty("token") @ExcludeMissing fun _token() = token

    /**
     * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will be
     * present. If the type is "BUSINESS" then the "business_entity", "control_person",
     * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and
     * "website_url" attributes will be present.
     */
    @JsonProperty("user_type") @ExcludeMissing fun _userType() = userType

    /** Information about the most recent identity verification attempt */
    @JsonProperty("verification_application")
    @ExcludeMissing
    fun _verificationApplication() = verificationApplication

    /**
     * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required for
     * the account holder to be approved.
     */
    @JsonProperty("required_documents") @ExcludeMissing fun _requiredDocuments() = requiredDocuments

    /** Only present when user_type == "BUSINESS". Business's primary website. */
    @JsonProperty("website_url") @ExcludeMissing fun _websiteUrl() = websiteUrl

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

    fun validate(): AccountHolder = apply {
        if (!validated) {
            accountToken()
            beneficialOwnerEntities()?.forEach { it.validate() }
            beneficialOwnerIndividuals()?.forEach { it.validate() }
            businessAccountToken()
            businessEntity()?.validate()
            controlPerson()?.validate()
            created()
            email()
            exemptionType()
            externalId()
            individual()?.validate()
            natureOfBusiness()
            phoneNumber()
            status()
            statusReasons()
            token()
            userType()
            verificationApplication()?.validate()
            requiredDocuments()?.forEach { it.validate() }
            websiteUrl()
            validated = true
        }
    }

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

    override fun equals(other: Any?): Boolean {
        if (this === other) {
            return true
        }

        return other is AccountHolder &&
            this.accountToken == other.accountToken &&
            this.beneficialOwnerEntities == other.beneficialOwnerEntities &&
            this.beneficialOwnerIndividuals == other.beneficialOwnerIndividuals &&
            this.businessAccountToken == other.businessAccountToken &&
            this.businessEntity == other.businessEntity &&
            this.controlPerson == other.controlPerson &&
            this.created == other.created &&
            this.email == other.email &&
            this.exemptionType == other.exemptionType &&
            this.externalId == other.externalId &&
            this.individual == other.individual &&
            this.natureOfBusiness == other.natureOfBusiness &&
            this.phoneNumber == other.phoneNumber &&
            this.status == other.status &&
            this.statusReasons == other.statusReasons &&
            this.token == other.token &&
            this.userType == other.userType &&
            this.verificationApplication == other.verificationApplication &&
            this.requiredDocuments == other.requiredDocuments &&
            this.websiteUrl == other.websiteUrl &&
            this.additionalProperties == other.additionalProperties
    }

    override fun hashCode(): Int {
        if (hashCode == 0) {
            hashCode =
                Objects.hash(
                    accountToken,
                    beneficialOwnerEntities,
                    beneficialOwnerIndividuals,
                    businessAccountToken,
                    businessEntity,
                    controlPerson,
                    created,
                    email,
                    exemptionType,
                    externalId,
                    individual,
                    natureOfBusiness,
                    phoneNumber,
                    status,
                    statusReasons,
                    token,
                    userType,
                    verificationApplication,
                    requiredDocuments,
                    websiteUrl,
                    additionalProperties,
                )
        }
        return hashCode
    }

    override fun toString() =
        "AccountHolder{accountToken=$accountToken, beneficialOwnerEntities=$beneficialOwnerEntities, beneficialOwnerIndividuals=$beneficialOwnerIndividuals, businessAccountToken=$businessAccountToken, businessEntity=$businessEntity, controlPerson=$controlPerson, created=$created, email=$email, exemptionType=$exemptionType, externalId=$externalId, individual=$individual, natureOfBusiness=$natureOfBusiness, phoneNumber=$phoneNumber, status=$status, statusReasons=$statusReasons, token=$token, userType=$userType, verificationApplication=$verificationApplication, requiredDocuments=$requiredDocuments, websiteUrl=$websiteUrl, additionalProperties=$additionalProperties}"

    companion object {

        fun builder() = Builder()
    }

    class Builder {

        private var accountToken: JsonField = JsonMissing.of()
        private var beneficialOwnerEntities: JsonField> = JsonMissing.of()
        private var beneficialOwnerIndividuals: JsonField> =
            JsonMissing.of()
        private var businessAccountToken: JsonField = JsonMissing.of()
        private var businessEntity: JsonField = JsonMissing.of()
        private var controlPerson: JsonField = JsonMissing.of()
        private var created: JsonField = JsonMissing.of()
        private var email: JsonField = JsonMissing.of()
        private var exemptionType: JsonField = JsonMissing.of()
        private var externalId: JsonField = JsonMissing.of()
        private var individual: JsonField = JsonMissing.of()
        private var natureOfBusiness: JsonField = JsonMissing.of()
        private var phoneNumber: JsonField = JsonMissing.of()
        private var status: JsonField = JsonMissing.of()
        private var statusReasons: JsonField> = JsonMissing.of()
        private var token: JsonField = JsonMissing.of()
        private var userType: JsonField = JsonMissing.of()
        private var verificationApplication: JsonField =
            JsonMissing.of()
        private var requiredDocuments: JsonField> = JsonMissing.of()
        private var websiteUrl: JsonField = JsonMissing.of()
        private var additionalProperties: MutableMap = mutableMapOf()

        internal fun from(accountHolder: AccountHolder) = apply {
            this.accountToken = accountHolder.accountToken
            this.beneficialOwnerEntities = accountHolder.beneficialOwnerEntities
            this.beneficialOwnerIndividuals = accountHolder.beneficialOwnerIndividuals
            this.businessAccountToken = accountHolder.businessAccountToken
            this.businessEntity = accountHolder.businessEntity
            this.controlPerson = accountHolder.controlPerson
            this.created = accountHolder.created
            this.email = accountHolder.email
            this.exemptionType = accountHolder.exemptionType
            this.externalId = accountHolder.externalId
            this.individual = accountHolder.individual
            this.natureOfBusiness = accountHolder.natureOfBusiness
            this.phoneNumber = accountHolder.phoneNumber
            this.status = accountHolder.status
            this.statusReasons = accountHolder.statusReasons
            this.token = accountHolder.token
            this.userType = accountHolder.userType
            this.verificationApplication = accountHolder.verificationApplication
            this.requiredDocuments = accountHolder.requiredDocuments
            this.websiteUrl = accountHolder.websiteUrl
            additionalProperties(accountHolder.additionalProperties)
        }

        /** Globally unique identifier for the account. */
        fun accountToken(accountToken: String) = accountToken(JsonField.of(accountToken))

        /** Globally unique identifier for the account. */
        @JsonProperty("account_token")
        @ExcludeMissing
        fun accountToken(accountToken: JsonField) = apply {
            this.accountToken = accountToken
        }

        /**
         * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in
         * the company.
         */
        fun beneficialOwnerEntities(beneficialOwnerEntities: List) =
            beneficialOwnerEntities(JsonField.of(beneficialOwnerEntities))

        /**
         * Only present when user_type == "BUSINESS". List of all entities with >25% ownership in
         * the company.
         */
        @JsonProperty("beneficial_owner_entities")
        @ExcludeMissing
        fun beneficialOwnerEntities(beneficialOwnerEntities: JsonField>) =
            apply {
                this.beneficialOwnerEntities = beneficialOwnerEntities
            }

        /**
         * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in
         * the company.
         */
        fun beneficialOwnerIndividuals(
            beneficialOwnerIndividuals: List
        ) = beneficialOwnerIndividuals(JsonField.of(beneficialOwnerIndividuals))

        /**
         * Only present when user_type == "BUSINESS". List of all individuals with >25% ownership in
         * the company.
         */
        @JsonProperty("beneficial_owner_individuals")
        @ExcludeMissing
        fun beneficialOwnerIndividuals(
            beneficialOwnerIndividuals: JsonField>
        ) = apply { this.beneficialOwnerIndividuals = beneficialOwnerIndividuals }

        /**
         * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of
         * businesses. Pass the account_token of the enrolled business associated with the
         * AUTHORIZED_USER in this field.
         */
        fun businessAccountToken(businessAccountToken: String) =
            businessAccountToken(JsonField.of(businessAccountToken))

        /**
         * Only applicable for customers using the KYC-Exempt workflow to enroll authorized users of
         * businesses. Pass the account_token of the enrolled business associated with the
         * AUTHORIZED_USER in this field.
         */
        @JsonProperty("business_account_token")
        @ExcludeMissing
        fun businessAccountToken(businessAccountToken: JsonField) = apply {
            this.businessAccountToken = businessAccountToken
        }

        /**
         * Only present when user_type == "BUSINESS". Information about the business for which the
         * account is being opened and KYB is being run.
         */
        fun businessEntity(businessEntity: BusinessEntity) =
            businessEntity(JsonField.of(businessEntity))

        /**
         * Only present when user_type == "BUSINESS". Information about the business for which the
         * account is being opened and KYB is being run.
         */
        @JsonProperty("business_entity")
        @ExcludeMissing
        fun businessEntity(businessEntity: JsonField) = apply {
            this.businessEntity = businessEntity
        }

        /**
         * Only present when user_type == "BUSINESS". An individual with significant responsibility
         * for managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer,
         * Chief Operating Officer, Managing Member, General Partner, President, Vice President, or
         * Treasurer). This can be an executive, or someone who will have program-wide access to the
         * cards that Lithic will provide. In some cases, this individual could also be a beneficial
         * owner listed above.
         */
        fun controlPerson(controlPerson: AccountHolderIndividualResponse) =
            controlPerson(JsonField.of(controlPerson))

        /**
         * Only present when user_type == "BUSINESS". An individual with significant responsibility
         * for managing the legal entity (e.g., a Chief Executive Officer, Chief Financial Officer,
         * Chief Operating Officer, Managing Member, General Partner, President, Vice President, or
         * Treasurer). This can be an executive, or someone who will have program-wide access to the
         * cards that Lithic will provide. In some cases, this individual could also be a beneficial
         * owner listed above.
         */
        @JsonProperty("control_person")
        @ExcludeMissing
        fun controlPerson(controlPerson: JsonField) = apply {
            this.controlPerson = controlPerson
        }

        /** Timestamp of when the account holder was created. */
        fun created(created: OffsetDateTime) = created(JsonField.of(created))

        /** Timestamp of when the account holder was created. */
        @JsonProperty("created")
        @ExcludeMissing
        fun created(created: JsonField) = apply { this.created = created }

        /**
         * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use
         * individual.phone_number when user_type == "INDIVIDUAL".
         * > Primary email of Account Holder.
         */
        fun email(email: String) = email(JsonField.of(email))

        /**
         * < Deprecated. Use control_person.email when user_type == "BUSINESS". Use
         * individual.phone_number when user_type == "INDIVIDUAL".
         * > Primary email of Account Holder.
         */
        @JsonProperty("email")
        @ExcludeMissing
        fun email(email: JsonField) = apply { this.email = email }

        /** The type of KYC exemption for a KYC-Exempt Account Holder. */
        fun exemptionType(exemptionType: ExemptionType) = exemptionType(JsonField.of(exemptionType))

        /** The type of KYC exemption for a KYC-Exempt Account Holder. */
        @JsonProperty("exemption_type")
        @ExcludeMissing
        fun exemptionType(exemptionType: JsonField) = apply {
            this.exemptionType = exemptionType
        }

        /**
         * Customer-provided token that indicates a relationship with an object outside of the
         * Lithic ecosystem.
         */
        fun externalId(externalId: String) = externalId(JsonField.of(externalId))

        /**
         * Customer-provided token that indicates a relationship with an object outside of the
         * Lithic ecosystem.
         */
        @JsonProperty("external_id")
        @ExcludeMissing
        fun externalId(externalId: JsonField) = apply { this.externalId = externalId }

        /**
         * Only present when user_type == "INDIVIDUAL". Information about the individual for which
         * the account is being opened and KYC is being run.
         */
        fun individual(individual: AccountHolderIndividualResponse) =
            individual(JsonField.of(individual))

        /**
         * Only present when user_type == "INDIVIDUAL". Information about the individual for which
         * the account is being opened and KYC is being run.
         */
        @JsonProperty("individual")
        @ExcludeMissing
        fun individual(individual: JsonField) = apply {
            this.individual = individual
        }

        /**
         * Only present when user_type == "BUSINESS". User-submitted description of the business.
         */
        fun natureOfBusiness(natureOfBusiness: String) =
            natureOfBusiness(JsonField.of(natureOfBusiness))

        /**
         * Only present when user_type == "BUSINESS". User-submitted description of the business.
         */
        @JsonProperty("nature_of_business")
        @ExcludeMissing
        fun natureOfBusiness(natureOfBusiness: JsonField) = apply {
            this.natureOfBusiness = natureOfBusiness
        }

        /**
         * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use
         * individual.phone_number when user_type == "INDIVIDUAL".
         * > Primary phone of Account Holder, entered in E.164 format.
         */
        fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber))

        /**
         * < Deprecated. Use control_person.phone_number when user_type == "BUSINESS". Use
         * individual.phone_number when user_type == "INDIVIDUAL".
         * > Primary phone of Account Holder, entered in E.164 format.
         */
        @JsonProperty("phone_number")
        @ExcludeMissing
        fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber }

        /**
         * 
         *
         * KYC and KYB evaluation states.
         *
         * Note:
         * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED`
         *   workflow.
         * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
         */
        fun status(status: Status) = status(JsonField.of(status))

        /**
         * 
         *
         * KYC and KYB evaluation states.
         *
         * Note:
         * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED`
         *   workflow.
         * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
         */
        @JsonProperty("status")
        @ExcludeMissing
        fun status(status: JsonField) = apply { this.status = status }

        /**
         *  Reason for the evaluation
         * status.
         */
        fun statusReasons(statusReasons: List) =
            statusReasons(JsonField.of(statusReasons))

        /**
         *  Reason for the evaluation
         * status.
         */
        @JsonProperty("status_reasons")
        @ExcludeMissing
        fun statusReasons(statusReasons: JsonField>) = apply {
            this.statusReasons = statusReasons
        }

        /** Globally unique identifier for the account holder. */
        fun token(token: String) = token(JsonField.of(token))

        /** Globally unique identifier for the account holder. */
        @JsonProperty("token")
        @ExcludeMissing
        fun token(token: JsonField) = apply { this.token = token }

        /**
         * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will
         * be present. If the type is "BUSINESS" then the "business_entity", "control_person",
         * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and
         * "website_url" attributes will be present.
         */
        fun userType(userType: UserType) = userType(JsonField.of(userType))

        /**
         * The type of Account Holder. If the type is "INDIVIDUAL", the "individual" attribute will
         * be present. If the type is "BUSINESS" then the "business_entity", "control_person",
         * "beneficial_owner_individuals", "beneficial_owner_entities", "nature_of_business", and
         * "website_url" attributes will be present.
         */
        @JsonProperty("user_type")
        @ExcludeMissing
        fun userType(userType: JsonField) = apply { this.userType = userType }

        /** Information about the most recent identity verification attempt */
        fun verificationApplication(verificationApplication: AccountHolderVerificationApplication) =
            verificationApplication(JsonField.of(verificationApplication))

        /** Information about the most recent identity verification attempt */
        @JsonProperty("verification_application")
        @ExcludeMissing
        fun verificationApplication(
            verificationApplication: JsonField
        ) = apply { this.verificationApplication = verificationApplication }

        /**
         * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required
         * for the account holder to be approved.
         */
        fun requiredDocuments(requiredDocuments: List) =
            requiredDocuments(JsonField.of(requiredDocuments))

        /**
         * Only present for "KYB_BASIC" and "KYC_ADVANCED" workflows. A list of documents required
         * for the account holder to be approved.
         */
        @JsonProperty("required_documents")
        @ExcludeMissing
        fun requiredDocuments(requiredDocuments: JsonField>) = apply {
            this.requiredDocuments = requiredDocuments
        }

        /** Only present when user_type == "BUSINESS". Business's primary website. */
        fun websiteUrl(websiteUrl: String) = websiteUrl(JsonField.of(websiteUrl))

        /** Only present when user_type == "BUSINESS". Business's primary website. */
        @JsonProperty("website_url")
        @ExcludeMissing
        fun websiteUrl(websiteUrl: JsonField) = apply { this.websiteUrl = websiteUrl }

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

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

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

        fun build(): AccountHolder =
            AccountHolder(
                accountToken,
                beneficialOwnerEntities.map { it.toUnmodifiable() },
                beneficialOwnerIndividuals.map { it.toUnmodifiable() },
                businessAccountToken,
                businessEntity,
                controlPerson,
                created,
                email,
                exemptionType,
                externalId,
                individual,
                natureOfBusiness,
                phoneNumber,
                status,
                statusReasons.map { it.toUnmodifiable() },
                token,
                userType,
                verificationApplication,
                requiredDocuments.map { it.toUnmodifiable() },
                websiteUrl,
                additionalProperties.toUnmodifiable(),
            )
    }

    @JsonDeserialize(builder = BusinessEntity.Builder::class)
    @NoAutoDetect
    class BusinessEntity
    private constructor(
        private val address: JsonField
, private val dbaBusinessName: JsonField, private val governmentId: JsonField, private val legalBusinessName: JsonField, private val parentCompany: JsonField, private val phoneNumbers: JsonField>, private val entityToken: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false private var hashCode: Int = 0 /** * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; * APO/FPO are acceptable. */ fun address(): Address = address.getRequired("address") /** * Any name that the business operates under that is not its legal business name (if * applicable). */ fun dbaBusinessName(): String? = dbaBusinessName.getNullable("dba_business_name") /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. */ fun governmentId(): String = governmentId.getRequired("government_id") /** Legal (formal) business name. */ fun legalBusinessName(): String = legalBusinessName.getRequired("legal_business_name") /** Parent company name (if applicable). */ fun parentCompany(): String? = parentCompany.getNullable("parent_company") /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(): List = phoneNumbers.getRequired("phone_numbers") /** Globally unique identifier for the entity. */ fun entityToken(): String? = entityToken.getNullable("entity_token") /** * Business's physical address - PO boxes, UPS drops, and FedEx drops are not acceptable; * APO/FPO are acceptable. */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** * Any name that the business operates under that is not its legal business name (if * applicable). */ @JsonProperty("dba_business_name") @ExcludeMissing fun _dbaBusinessName() = dbaBusinessName /** * Government-issued identification number. US Federal Employer Identification Numbers (EIN) * are currently supported, entered as full nine-digits, with or without hyphens. */ @JsonProperty("government_id") @ExcludeMissing fun _governmentId() = governmentId /** Legal (formal) business name. */ @JsonProperty("legal_business_name") @ExcludeMissing fun _legalBusinessName() = legalBusinessName /** Parent company name (if applicable). */ @JsonProperty("parent_company") @ExcludeMissing fun _parentCompany() = parentCompany /** One or more of the business's phone number(s), entered as a list in E.164 format. */ @JsonProperty("phone_numbers") @ExcludeMissing fun _phoneNumbers() = phoneNumbers /** Globally unique identifier for the entity. */ @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): BusinessEntity = apply { if (!validated) { address().validate() dbaBusinessName() governmentId() legalBusinessName() parentCompany() phoneNumbers() entityToken() validated = true } } fun toBuilder() = Builder().from(this) override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is BusinessEntity && this.address == other.address && this.dbaBusinessName == other.dbaBusinessName && this.governmentId == other.governmentId && this.legalBusinessName == other.legalBusinessName && this.parentCompany == other.parentCompany && this.phoneNumbers == other.phoneNumbers && this.entityToken == other.entityToken && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { hashCode = Objects.hash( address, dbaBusinessName, governmentId, legalBusinessName, parentCompany, phoneNumbers, entityToken, additionalProperties, ) } return hashCode } override fun toString() = "BusinessEntity{address=$address, dbaBusinessName=$dbaBusinessName, governmentId=$governmentId, legalBusinessName=$legalBusinessName, parentCompany=$parentCompany, phoneNumbers=$phoneNumbers, entityToken=$entityToken, additionalProperties=$additionalProperties}" companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dbaBusinessName: JsonField = JsonMissing.of() private var governmentId: JsonField = JsonMissing.of() private var legalBusinessName: JsonField = JsonMissing.of() private var parentCompany: JsonField = JsonMissing.of() private var phoneNumbers: JsonField> = JsonMissing.of() private var entityToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(businessEntity: BusinessEntity) = apply { this.address = businessEntity.address this.dbaBusinessName = businessEntity.dbaBusinessName this.governmentId = businessEntity.governmentId this.legalBusinessName = businessEntity.legalBusinessName this.parentCompany = businessEntity.parentCompany this.phoneNumbers = businessEntity.phoneNumbers this.entityToken = businessEntity.entityToken additionalProperties(businessEntity.additionalProperties) } /** * Business's physical address - PO boxes, UPS drops, and FedEx drops are not * acceptable; APO/FPO are acceptable. */ fun address(address: Address) = address(JsonField.of(address)) /** * Business's physical address - PO boxes, UPS drops, and FedEx drops are not * acceptable; APO/FPO are acceptable. */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** * Any name that the business operates under that is not its legal business name (if * applicable). */ fun dbaBusinessName(dbaBusinessName: String) = dbaBusinessName(JsonField.of(dbaBusinessName)) /** * Any name that the business operates under that is not its legal business name (if * applicable). */ @JsonProperty("dba_business_name") @ExcludeMissing fun dbaBusinessName(dbaBusinessName: JsonField) = apply { this.dbaBusinessName = dbaBusinessName } /** * Government-issued identification number. US Federal Employer Identification Numbers * (EIN) are currently supported, entered as full nine-digits, with or without hyphens. */ fun governmentId(governmentId: String) = governmentId(JsonField.of(governmentId)) /** * Government-issued identification number. US Federal Employer Identification Numbers * (EIN) are currently supported, entered as full nine-digits, with or without hyphens. */ @JsonProperty("government_id") @ExcludeMissing fun governmentId(governmentId: JsonField) = apply { this.governmentId = governmentId } /** Legal (formal) business name. */ fun legalBusinessName(legalBusinessName: String) = legalBusinessName(JsonField.of(legalBusinessName)) /** Legal (formal) business name. */ @JsonProperty("legal_business_name") @ExcludeMissing fun legalBusinessName(legalBusinessName: JsonField) = apply { this.legalBusinessName = legalBusinessName } /** Parent company name (if applicable). */ fun parentCompany(parentCompany: String) = parentCompany(JsonField.of(parentCompany)) /** Parent company name (if applicable). */ @JsonProperty("parent_company") @ExcludeMissing fun parentCompany(parentCompany: JsonField) = apply { this.parentCompany = parentCompany } /** One or more of the business's phone number(s), entered as a list in E.164 format. */ fun phoneNumbers(phoneNumbers: List) = phoneNumbers(JsonField.of(phoneNumbers)) /** One or more of the business's phone number(s), entered as a list in E.164 format. */ @JsonProperty("phone_numbers") @ExcludeMissing fun phoneNumbers(phoneNumbers: JsonField>) = apply { this.phoneNumbers = phoneNumbers } /** Globally unique identifier for the entity. */ fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) /** Globally unique identifier for the entity. */ @JsonProperty("entity_token") @ExcludeMissing fun entityToken(entityToken: JsonField) = apply { this.entityToken = entityToken } 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(): BusinessEntity = BusinessEntity( address, dbaBusinessName, governmentId, legalBusinessName, parentCompany, phoneNumbers.map { it.toUnmodifiable() }, entityToken, additionalProperties.toUnmodifiable(), ) } } /** * Information about an individual associated with an account holder. A subset of the * information provided via KYC. For example, we do not return the government id. */ @JsonDeserialize(builder = AccountHolderIndividualResponse.Builder::class) @NoAutoDetect class AccountHolderIndividualResponse private constructor( private val address: JsonField
, private val dob: JsonField, private val email: JsonField, private val firstName: JsonField, private val lastName: JsonField, private val phoneNumber: JsonField, private val entityToken: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false private var hashCode: Int = 0 /** Individual's current address */ fun address(): Address? = address.getNullable("address") /** Individual's date of birth, as an RFC 3339 date. */ fun dob(): String? = dob.getNullable("dob") /** Individual's email address. */ fun email(): String? = email.getNullable("email") /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(): String? = firstName.getNullable("first_name") /** Individual's last name, as it appears on government-issued identity documents. */ fun lastName(): String? = lastName.getNullable("last_name") /** Individual's phone number, entered in E.164 format. */ fun phoneNumber(): String? = phoneNumber.getNullable("phone_number") /** Globally unique identifier for the entity. */ fun entityToken(): String? = entityToken.getNullable("entity_token") /** Individual's current address */ @JsonProperty("address") @ExcludeMissing fun _address() = address /** Individual's date of birth, as an RFC 3339 date. */ @JsonProperty("dob") @ExcludeMissing fun _dob() = dob /** Individual's email address. */ @JsonProperty("email") @ExcludeMissing fun _email() = email /** Individual's first name, as it appears on government-issued identity documents. */ @JsonProperty("first_name") @ExcludeMissing fun _firstName() = firstName /** Individual's last name, as it appears on government-issued identity documents. */ @JsonProperty("last_name") @ExcludeMissing fun _lastName() = lastName /** Individual's phone number, entered in E.164 format. */ @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber /** Globally unique identifier for the entity. */ @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AccountHolderIndividualResponse = apply { if (!validated) { address()?.validate() dob() email() firstName() lastName() phoneNumber() entityToken() validated = true } } fun toBuilder() = Builder().from(this) override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is AccountHolderIndividualResponse && this.address == other.address && this.dob == other.dob && this.email == other.email && this.firstName == other.firstName && this.lastName == other.lastName && this.phoneNumber == other.phoneNumber && this.entityToken == other.entityToken && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { hashCode = Objects.hash( address, dob, email, firstName, lastName, phoneNumber, entityToken, additionalProperties, ) } return hashCode } override fun toString() = "AccountHolderIndividualResponse{address=$address, dob=$dob, email=$email, firstName=$firstName, lastName=$lastName, phoneNumber=$phoneNumber, entityToken=$entityToken, additionalProperties=$additionalProperties}" companion object { fun builder() = Builder() } class Builder { private var address: JsonField
= JsonMissing.of() private var dob: JsonField = JsonMissing.of() private var email: JsonField = JsonMissing.of() private var firstName: JsonField = JsonMissing.of() private var lastName: JsonField = JsonMissing.of() private var phoneNumber: JsonField = JsonMissing.of() private var entityToken: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(accountHolderIndividualResponse: AccountHolderIndividualResponse) = apply { this.address = accountHolderIndividualResponse.address this.dob = accountHolderIndividualResponse.dob this.email = accountHolderIndividualResponse.email this.firstName = accountHolderIndividualResponse.firstName this.lastName = accountHolderIndividualResponse.lastName this.phoneNumber = accountHolderIndividualResponse.phoneNumber this.entityToken = accountHolderIndividualResponse.entityToken additionalProperties(accountHolderIndividualResponse.additionalProperties) } /** Individual's current address */ fun address(address: Address) = address(JsonField.of(address)) /** Individual's current address */ @JsonProperty("address") @ExcludeMissing fun address(address: JsonField
) = apply { this.address = address } /** Individual's date of birth, as an RFC 3339 date. */ fun dob(dob: String) = dob(JsonField.of(dob)) /** Individual's date of birth, as an RFC 3339 date. */ @JsonProperty("dob") @ExcludeMissing fun dob(dob: JsonField) = apply { this.dob = dob } /** Individual's email address. */ fun email(email: String) = email(JsonField.of(email)) /** Individual's email address. */ @JsonProperty("email") @ExcludeMissing fun email(email: JsonField) = apply { this.email = email } /** Individual's first name, as it appears on government-issued identity documents. */ fun firstName(firstName: String) = firstName(JsonField.of(firstName)) /** Individual's first name, as it appears on government-issued identity documents. */ @JsonProperty("first_name") @ExcludeMissing fun firstName(firstName: JsonField) = apply { this.firstName = firstName } /** Individual's last name, as it appears on government-issued identity documents. */ fun lastName(lastName: String) = lastName(JsonField.of(lastName)) /** Individual's last name, as it appears on government-issued identity documents. */ @JsonProperty("last_name") @ExcludeMissing fun lastName(lastName: JsonField) = apply { this.lastName = lastName } /** Individual's phone number, entered in E.164 format. */ fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber)) /** Individual's phone number, entered in E.164 format. */ @JsonProperty("phone_number") @ExcludeMissing fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber } /** Globally unique identifier for the entity. */ fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) /** Globally unique identifier for the entity. */ @JsonProperty("entity_token") @ExcludeMissing fun entityToken(entityToken: JsonField) = apply { this.entityToken = entityToken } 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(): AccountHolderIndividualResponse = AccountHolderIndividualResponse( address, dob, email, firstName, lastName, phoneNumber, entityToken, additionalProperties.toUnmodifiable(), ) } } class ExemptionType @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is ExemptionType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val AUTHORIZED_USER = ExemptionType(JsonField.of("AUTHORIZED_USER")) val PREPAID_CARD_USER = ExemptionType(JsonField.of("PREPAID_CARD_USER")) fun of(value: String) = ExemptionType(JsonField.of(value)) } enum class Known { AUTHORIZED_USER, PREPAID_CARD_USER, } enum class Value { AUTHORIZED_USER, PREPAID_CARD_USER, _UNKNOWN, } fun value(): Value = when (this) { AUTHORIZED_USER -> Value.AUTHORIZED_USER PREPAID_CARD_USER -> Value.PREPAID_CARD_USER else -> Value._UNKNOWN } fun known(): Known = when (this) { AUTHORIZED_USER -> Known.AUTHORIZED_USER PREPAID_CARD_USER -> Known.PREPAID_CARD_USER else -> throw LithicInvalidDataException("Unknown ExemptionType: $value") } fun asString(): String = _value().asStringOrThrow() } @JsonDeserialize(builder = RequiredDocument.Builder::class) @NoAutoDetect class RequiredDocument private constructor( private val entityToken: JsonField, private val validDocuments: JsonField>, private val statusReasons: JsonField>, private val additionalProperties: Map, ) { private var validated: Boolean = false private var hashCode: Int = 0 /** Globally unique identifier for an entity. */ fun entityToken(): String = entityToken.getRequired("entity_token") /** * A list of valid documents that will satisfy the KYC requirements for the specified * entity. */ fun validDocuments(): List = validDocuments.getRequired("valid_documents") /** * rovides the status reasons that will be satisfied by providing one of the valid * documents. */ fun statusReasons(): List = statusReasons.getRequired("status_reasons") /** Globally unique identifier for an entity. */ @JsonProperty("entity_token") @ExcludeMissing fun _entityToken() = entityToken /** * A list of valid documents that will satisfy the KYC requirements for the specified * entity. */ @JsonProperty("valid_documents") @ExcludeMissing fun _validDocuments() = validDocuments /** * rovides the status reasons that will be satisfied by providing one of the valid * documents. */ @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): RequiredDocument = apply { if (!validated) { entityToken() validDocuments() statusReasons() validated = true } } fun toBuilder() = Builder().from(this) override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is RequiredDocument && this.entityToken == other.entityToken && this.validDocuments == other.validDocuments && this.statusReasons == other.statusReasons && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { hashCode = Objects.hash( entityToken, validDocuments, statusReasons, additionalProperties, ) } return hashCode } override fun toString() = "RequiredDocument{entityToken=$entityToken, validDocuments=$validDocuments, statusReasons=$statusReasons, additionalProperties=$additionalProperties}" companion object { fun builder() = Builder() } class Builder { private var entityToken: JsonField = JsonMissing.of() private var validDocuments: JsonField> = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from(requiredDocument: RequiredDocument) = apply { this.entityToken = requiredDocument.entityToken this.validDocuments = requiredDocument.validDocuments this.statusReasons = requiredDocument.statusReasons additionalProperties(requiredDocument.additionalProperties) } /** Globally unique identifier for an entity. */ fun entityToken(entityToken: String) = entityToken(JsonField.of(entityToken)) /** Globally unique identifier for an entity. */ @JsonProperty("entity_token") @ExcludeMissing fun entityToken(entityToken: JsonField) = apply { this.entityToken = entityToken } /** * A list of valid documents that will satisfy the KYC requirements for the specified * entity. */ fun validDocuments(validDocuments: List) = validDocuments(JsonField.of(validDocuments)) /** * A list of valid documents that will satisfy the KYC requirements for the specified * entity. */ @JsonProperty("valid_documents") @ExcludeMissing fun validDocuments(validDocuments: JsonField>) = apply { this.validDocuments = validDocuments } /** * rovides the status reasons that will be satisfied by providing one of the valid * documents. */ fun statusReasons(statusReasons: List) = statusReasons(JsonField.of(statusReasons)) /** * rovides the status reasons that will be satisfied by providing one of the valid * documents. */ @JsonProperty("status_reasons") @ExcludeMissing fun statusReasons(statusReasons: JsonField>) = apply { this.statusReasons = statusReasons } 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(): RequiredDocument = RequiredDocument( entityToken, validDocuments.map { it.toUnmodifiable() }, statusReasons.map { it.toUnmodifiable() }, additionalProperties.toUnmodifiable(), ) } } 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 other is Status && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ACCEPTED = Status(JsonField.of("ACCEPTED")) val PENDING_REVIEW = Status(JsonField.of("PENDING_REVIEW")) val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) val PENDING_RESUBMIT = Status(JsonField.of("PENDING_RESUBMIT")) val REJECTED = Status(JsonField.of("REJECTED")) fun of(value: String) = Status(JsonField.of(value)) } enum class Known { ACCEPTED, PENDING_REVIEW, PENDING_DOCUMENT, PENDING_RESUBMIT, REJECTED, } enum class Value { ACCEPTED, PENDING_REVIEW, PENDING_DOCUMENT, PENDING_RESUBMIT, REJECTED, _UNKNOWN, } fun value(): Value = when (this) { ACCEPTED -> Value.ACCEPTED PENDING_REVIEW -> Value.PENDING_REVIEW PENDING_DOCUMENT -> Value.PENDING_DOCUMENT PENDING_RESUBMIT -> Value.PENDING_RESUBMIT REJECTED -> Value.REJECTED else -> Value._UNKNOWN } fun known(): Known = when (this) { ACCEPTED -> Known.ACCEPTED PENDING_REVIEW -> Known.PENDING_REVIEW PENDING_DOCUMENT -> Known.PENDING_DOCUMENT PENDING_RESUBMIT -> Known.PENDING_RESUBMIT REJECTED -> Known.REJECTED else -> throw LithicInvalidDataException("Unknown Status: $value") } fun asString(): String = _value().asStringOrThrow() } class StatusReason @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is StatusReason && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ADDRESS_VERIFICATION_FAILURE = StatusReason(JsonField.of("ADDRESS_VERIFICATION_FAILURE")) val AGE_THRESHOLD_FAILURE = StatusReason(JsonField.of("AGE_THRESHOLD_FAILURE")) val COMPLETE_VERIFICATION_FAILURE = StatusReason(JsonField.of("COMPLETE_VERIFICATION_FAILURE")) val DOB_VERIFICATION_FAILURE = StatusReason(JsonField.of("DOB_VERIFICATION_FAILURE")) val ID_VERIFICATION_FAILURE = StatusReason(JsonField.of("ID_VERIFICATION_FAILURE")) val MAX_DOCUMENT_ATTEMPTS = StatusReason(JsonField.of("MAX_DOCUMENT_ATTEMPTS")) val MAX_RESUBMISSION_ATTEMPTS = StatusReason(JsonField.of("MAX_RESUBMISSION_ATTEMPTS")) val NAME_VERIFICATION_FAILURE = StatusReason(JsonField.of("NAME_VERIFICATION_FAILURE")) val OTHER_VERIFICATION_FAILURE = StatusReason(JsonField.of("OTHER_VERIFICATION_FAILURE")) val RISK_THRESHOLD_FAILURE = StatusReason(JsonField.of("RISK_THRESHOLD_FAILURE")) val WATCHLIST_ALERT_FAILURE = StatusReason(JsonField.of("WATCHLIST_ALERT_FAILURE")) fun of(value: String) = StatusReason(JsonField.of(value)) } enum class Known { ADDRESS_VERIFICATION_FAILURE, AGE_THRESHOLD_FAILURE, COMPLETE_VERIFICATION_FAILURE, DOB_VERIFICATION_FAILURE, ID_VERIFICATION_FAILURE, MAX_DOCUMENT_ATTEMPTS, MAX_RESUBMISSION_ATTEMPTS, NAME_VERIFICATION_FAILURE, OTHER_VERIFICATION_FAILURE, RISK_THRESHOLD_FAILURE, WATCHLIST_ALERT_FAILURE, } enum class Value { ADDRESS_VERIFICATION_FAILURE, AGE_THRESHOLD_FAILURE, COMPLETE_VERIFICATION_FAILURE, DOB_VERIFICATION_FAILURE, ID_VERIFICATION_FAILURE, MAX_DOCUMENT_ATTEMPTS, MAX_RESUBMISSION_ATTEMPTS, NAME_VERIFICATION_FAILURE, OTHER_VERIFICATION_FAILURE, RISK_THRESHOLD_FAILURE, WATCHLIST_ALERT_FAILURE, _UNKNOWN, } fun value(): Value = when (this) { ADDRESS_VERIFICATION_FAILURE -> Value.ADDRESS_VERIFICATION_FAILURE AGE_THRESHOLD_FAILURE -> Value.AGE_THRESHOLD_FAILURE COMPLETE_VERIFICATION_FAILURE -> Value.COMPLETE_VERIFICATION_FAILURE DOB_VERIFICATION_FAILURE -> Value.DOB_VERIFICATION_FAILURE ID_VERIFICATION_FAILURE -> Value.ID_VERIFICATION_FAILURE MAX_DOCUMENT_ATTEMPTS -> Value.MAX_DOCUMENT_ATTEMPTS MAX_RESUBMISSION_ATTEMPTS -> Value.MAX_RESUBMISSION_ATTEMPTS NAME_VERIFICATION_FAILURE -> Value.NAME_VERIFICATION_FAILURE OTHER_VERIFICATION_FAILURE -> Value.OTHER_VERIFICATION_FAILURE RISK_THRESHOLD_FAILURE -> Value.RISK_THRESHOLD_FAILURE WATCHLIST_ALERT_FAILURE -> Value.WATCHLIST_ALERT_FAILURE else -> Value._UNKNOWN } fun known(): Known = when (this) { ADDRESS_VERIFICATION_FAILURE -> Known.ADDRESS_VERIFICATION_FAILURE AGE_THRESHOLD_FAILURE -> Known.AGE_THRESHOLD_FAILURE COMPLETE_VERIFICATION_FAILURE -> Known.COMPLETE_VERIFICATION_FAILURE DOB_VERIFICATION_FAILURE -> Known.DOB_VERIFICATION_FAILURE ID_VERIFICATION_FAILURE -> Known.ID_VERIFICATION_FAILURE MAX_DOCUMENT_ATTEMPTS -> Known.MAX_DOCUMENT_ATTEMPTS MAX_RESUBMISSION_ATTEMPTS -> Known.MAX_RESUBMISSION_ATTEMPTS NAME_VERIFICATION_FAILURE -> Known.NAME_VERIFICATION_FAILURE OTHER_VERIFICATION_FAILURE -> Known.OTHER_VERIFICATION_FAILURE RISK_THRESHOLD_FAILURE -> Known.RISK_THRESHOLD_FAILURE WATCHLIST_ALERT_FAILURE -> Known.WATCHLIST_ALERT_FAILURE else -> throw LithicInvalidDataException("Unknown StatusReason: $value") } fun asString(): String = _value().asStringOrThrow() } class UserType @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is UserType && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val BUSINESS = UserType(JsonField.of("BUSINESS")) val INDIVIDUAL = UserType(JsonField.of("INDIVIDUAL")) fun of(value: String) = UserType(JsonField.of(value)) } enum class Known { BUSINESS, INDIVIDUAL, } enum class Value { BUSINESS, INDIVIDUAL, _UNKNOWN, } fun value(): Value = when (this) { BUSINESS -> Value.BUSINESS INDIVIDUAL -> Value.INDIVIDUAL else -> Value._UNKNOWN } fun known(): Known = when (this) { BUSINESS -> Known.BUSINESS INDIVIDUAL -> Known.INDIVIDUAL else -> throw LithicInvalidDataException("Unknown UserType: $value") } fun asString(): String = _value().asStringOrThrow() } /** Information about the most recent identity verification attempt */ @JsonDeserialize(builder = AccountHolderVerificationApplication.Builder::class) @NoAutoDetect class AccountHolderVerificationApplication private constructor( private val created: JsonField, private val status: JsonField, private val statusReasons: JsonField>, private val updated: JsonField, private val additionalProperties: Map, ) { private var validated: Boolean = false private var hashCode: Int = 0 /** Timestamp of when the application was created. */ fun created(): OffsetDateTime? = created.getNullable("created") /** * KYC and KYB evaluation states. * * Note: * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED` * workflow. * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. */ fun status(): Status? = status.getNullable("status") /** Reason for the evaluation status. */ fun statusReasons(): List? = statusReasons.getNullable("status_reasons") /** Timestamp of when the application was last updated. */ fun updated(): OffsetDateTime? = updated.getNullable("updated") /** Timestamp of when the application was created. */ @JsonProperty("created") @ExcludeMissing fun _created() = created /** * KYC and KYB evaluation states. * * Note: * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the `KYC_ADVANCED` * workflow. * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. */ @JsonProperty("status") @ExcludeMissing fun _status() = status /** Reason for the evaluation status. */ @JsonProperty("status_reasons") @ExcludeMissing fun _statusReasons() = statusReasons /** Timestamp of when the application was last updated. */ @JsonProperty("updated") @ExcludeMissing fun _updated() = updated @JsonAnyGetter @ExcludeMissing fun _additionalProperties(): Map = additionalProperties fun validate(): AccountHolderVerificationApplication = apply { if (!validated) { created() status() statusReasons() updated() validated = true } } fun toBuilder() = Builder().from(this) override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is AccountHolderVerificationApplication && this.created == other.created && this.status == other.status && this.statusReasons == other.statusReasons && this.updated == other.updated && this.additionalProperties == other.additionalProperties } override fun hashCode(): Int { if (hashCode == 0) { hashCode = Objects.hash( created, status, statusReasons, updated, additionalProperties, ) } return hashCode } override fun toString() = "AccountHolderVerificationApplication{created=$created, status=$status, statusReasons=$statusReasons, updated=$updated, additionalProperties=$additionalProperties}" companion object { fun builder() = Builder() } class Builder { private var created: JsonField = JsonMissing.of() private var status: JsonField = JsonMissing.of() private var statusReasons: JsonField> = JsonMissing.of() private var updated: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() internal fun from( accountHolderVerificationApplication: AccountHolderVerificationApplication ) = apply { this.created = accountHolderVerificationApplication.created this.status = accountHolderVerificationApplication.status this.statusReasons = accountHolderVerificationApplication.statusReasons this.updated = accountHolderVerificationApplication.updated additionalProperties(accountHolderVerificationApplication.additionalProperties) } /** Timestamp of when the application was created. */ fun created(created: OffsetDateTime) = created(JsonField.of(created)) /** Timestamp of when the application was created. */ @JsonProperty("created") @ExcludeMissing fun created(created: JsonField) = apply { this.created = created } /** * KYC and KYB evaluation states. * * Note: * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the * `KYC_ADVANCED` workflow. * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. */ fun status(status: Status) = status(JsonField.of(status)) /** * KYC and KYB evaluation states. * * Note: * - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the * `KYC_ADVANCED` workflow. * - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow. */ @JsonProperty("status") @ExcludeMissing fun status(status: JsonField) = apply { this.status = status } /** Reason for the evaluation status. */ fun statusReasons(statusReasons: List) = statusReasons(JsonField.of(statusReasons)) /** Reason for the evaluation status. */ @JsonProperty("status_reasons") @ExcludeMissing fun statusReasons(statusReasons: JsonField>) = apply { this.statusReasons = statusReasons } /** Timestamp of when the application was last updated. */ fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated)) /** Timestamp of when the application was last updated. */ @JsonProperty("updated") @ExcludeMissing fun updated(updated: JsonField) = apply { this.updated = updated } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() this.additionalProperties.putAll(additionalProperties) } @JsonAnySetter fun putAdditionalProperty(key: String, value: JsonValue) = apply { this.additionalProperties.put(key, value) } fun putAllAdditionalProperties(additionalProperties: Map) = apply { this.additionalProperties.putAll(additionalProperties) } fun build(): AccountHolderVerificationApplication = AccountHolderVerificationApplication( created, status, statusReasons.map { it.toUnmodifiable() }, updated, additionalProperties.toUnmodifiable(), ) } 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 other is Status && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ACCEPTED = Status(JsonField.of("ACCEPTED")) val PENDING_REVIEW = Status(JsonField.of("PENDING_REVIEW")) val PENDING_DOCUMENT = Status(JsonField.of("PENDING_DOCUMENT")) val PENDING_RESUBMIT = Status(JsonField.of("PENDING_RESUBMIT")) val REJECTED = Status(JsonField.of("REJECTED")) fun of(value: String) = Status(JsonField.of(value)) } enum class Known { ACCEPTED, PENDING_REVIEW, PENDING_DOCUMENT, PENDING_RESUBMIT, REJECTED, } enum class Value { ACCEPTED, PENDING_REVIEW, PENDING_DOCUMENT, PENDING_RESUBMIT, REJECTED, _UNKNOWN, } fun value(): Value = when (this) { ACCEPTED -> Value.ACCEPTED PENDING_REVIEW -> Value.PENDING_REVIEW PENDING_DOCUMENT -> Value.PENDING_DOCUMENT PENDING_RESUBMIT -> Value.PENDING_RESUBMIT REJECTED -> Value.REJECTED else -> Value._UNKNOWN } fun known(): Known = when (this) { ACCEPTED -> Known.ACCEPTED PENDING_REVIEW -> Known.PENDING_REVIEW PENDING_DOCUMENT -> Known.PENDING_DOCUMENT PENDING_RESUBMIT -> Known.PENDING_RESUBMIT REJECTED -> Known.REJECTED else -> throw LithicInvalidDataException("Unknown Status: $value") } fun asString(): String = _value().asStringOrThrow() } class StatusReason @JsonCreator private constructor( private val value: JsonField, ) : Enum { @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value override fun equals(other: Any?): Boolean { if (this === other) { return true } return other is StatusReason && this.value == other.value } override fun hashCode() = value.hashCode() override fun toString() = value.toString() companion object { val ADDRESS_VERIFICATION_FAILURE = StatusReason(JsonField.of("ADDRESS_VERIFICATION_FAILURE")) val AGE_THRESHOLD_FAILURE = StatusReason(JsonField.of("AGE_THRESHOLD_FAILURE")) val COMPLETE_VERIFICATION_FAILURE = StatusReason(JsonField.of("COMPLETE_VERIFICATION_FAILURE")) val DOB_VERIFICATION_FAILURE = StatusReason(JsonField.of("DOB_VERIFICATION_FAILURE")) val ID_VERIFICATION_FAILURE = StatusReason(JsonField.of("ID_VERIFICATION_FAILURE")) val MAX_DOCUMENT_ATTEMPTS = StatusReason(JsonField.of("MAX_DOCUMENT_ATTEMPTS")) val MAX_RESUBMISSION_ATTEMPTS = StatusReason(JsonField.of("MAX_RESUBMISSION_ATTEMPTS")) val NAME_VERIFICATION_FAILURE = StatusReason(JsonField.of("NAME_VERIFICATION_FAILURE")) val OTHER_VERIFICATION_FAILURE = StatusReason(JsonField.of("OTHER_VERIFICATION_FAILURE")) val RISK_THRESHOLD_FAILURE = StatusReason(JsonField.of("RISK_THRESHOLD_FAILURE")) val WATCHLIST_ALERT_FAILURE = StatusReason(JsonField.of("WATCHLIST_ALERT_FAILURE")) fun of(value: String) = StatusReason(JsonField.of(value)) } enum class Known { ADDRESS_VERIFICATION_FAILURE, AGE_THRESHOLD_FAILURE, COMPLETE_VERIFICATION_FAILURE, DOB_VERIFICATION_FAILURE, ID_VERIFICATION_FAILURE, MAX_DOCUMENT_ATTEMPTS, MAX_RESUBMISSION_ATTEMPTS, NAME_VERIFICATION_FAILURE, OTHER_VERIFICATION_FAILURE, RISK_THRESHOLD_FAILURE, WATCHLIST_ALERT_FAILURE, } enum class Value { ADDRESS_VERIFICATION_FAILURE, AGE_THRESHOLD_FAILURE, COMPLETE_VERIFICATION_FAILURE, DOB_VERIFICATION_FAILURE, ID_VERIFICATION_FAILURE, MAX_DOCUMENT_ATTEMPTS, MAX_RESUBMISSION_ATTEMPTS, NAME_VERIFICATION_FAILURE, OTHER_VERIFICATION_FAILURE, RISK_THRESHOLD_FAILURE, WATCHLIST_ALERT_FAILURE, _UNKNOWN, } fun value(): Value = when (this) { ADDRESS_VERIFICATION_FAILURE -> Value.ADDRESS_VERIFICATION_FAILURE AGE_THRESHOLD_FAILURE -> Value.AGE_THRESHOLD_FAILURE COMPLETE_VERIFICATION_FAILURE -> Value.COMPLETE_VERIFICATION_FAILURE DOB_VERIFICATION_FAILURE -> Value.DOB_VERIFICATION_FAILURE ID_VERIFICATION_FAILURE -> Value.ID_VERIFICATION_FAILURE MAX_DOCUMENT_ATTEMPTS -> Value.MAX_DOCUMENT_ATTEMPTS MAX_RESUBMISSION_ATTEMPTS -> Value.MAX_RESUBMISSION_ATTEMPTS NAME_VERIFICATION_FAILURE -> Value.NAME_VERIFICATION_FAILURE OTHER_VERIFICATION_FAILURE -> Value.OTHER_VERIFICATION_FAILURE RISK_THRESHOLD_FAILURE -> Value.RISK_THRESHOLD_FAILURE WATCHLIST_ALERT_FAILURE -> Value.WATCHLIST_ALERT_FAILURE else -> Value._UNKNOWN } fun known(): Known = when (this) { ADDRESS_VERIFICATION_FAILURE -> Known.ADDRESS_VERIFICATION_FAILURE AGE_THRESHOLD_FAILURE -> Known.AGE_THRESHOLD_FAILURE COMPLETE_VERIFICATION_FAILURE -> Known.COMPLETE_VERIFICATION_FAILURE DOB_VERIFICATION_FAILURE -> Known.DOB_VERIFICATION_FAILURE ID_VERIFICATION_FAILURE -> Known.ID_VERIFICATION_FAILURE MAX_DOCUMENT_ATTEMPTS -> Known.MAX_DOCUMENT_ATTEMPTS MAX_RESUBMISSION_ATTEMPTS -> Known.MAX_RESUBMISSION_ATTEMPTS NAME_VERIFICATION_FAILURE -> Known.NAME_VERIFICATION_FAILURE OTHER_VERIFICATION_FAILURE -> Known.OTHER_VERIFICATION_FAILURE RISK_THRESHOLD_FAILURE -> Known.RISK_THRESHOLD_FAILURE WATCHLIST_ALERT_FAILURE -> Known.WATCHLIST_ALERT_FAILURE else -> throw LithicInvalidDataException("Unknown StatusReason: $value") } fun asString(): String = _value().asStringOrThrow() } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy