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

com.lithic.api.models.AccountHolderUpdateResponse.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.

The 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.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toImmutable
import java.util.Objects

@JsonDeserialize(builder = AccountHolderUpdateResponse.Builder::class)
@NoAutoDetect
class AccountHolderUpdateResponse
private constructor(
    private val businessAccountToken: JsonField,
    private val email: JsonField,
    private val phoneNumber: JsonField,
    private val token: JsonField,
    private val additionalProperties: Map,
) {

    private var validated: Boolean = false

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

    /** The newly updated email for the account holder */
    fun email(): String? = email.getNullable("email")

    /** The newly updated phone_number for the account holder */
    fun phoneNumber(): String? = phoneNumber.getNullable("phone_number")

    /** The token for the account holder that was updated */
    fun token(): String? = token.getNullable("token")

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

    /** The newly updated email for the account holder */
    @JsonProperty("email") @ExcludeMissing fun _email() = email

    /** The newly updated phone_number for the account holder */
    @JsonProperty("phone_number") @ExcludeMissing fun _phoneNumber() = phoneNumber

    /** The token for the account holder that was updated */
    @JsonProperty("token") @ExcludeMissing fun _token() = token

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

    fun validate(): AccountHolderUpdateResponse = apply {
        if (!validated) {
            businessAccountToken()
            email()
            phoneNumber()
            token()
            validated = true
        }
    }

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

    companion object {

        fun builder() = Builder()
    }

    class Builder {

        private var businessAccountToken: JsonField = JsonMissing.of()
        private var email: JsonField = JsonMissing.of()
        private var phoneNumber: JsonField = JsonMissing.of()
        private var token: JsonField = JsonMissing.of()
        private var additionalProperties: MutableMap = mutableMapOf()

        internal fun from(accountHolderUpdateResponse: AccountHolderUpdateResponse) = apply {
            this.businessAccountToken = accountHolderUpdateResponse.businessAccountToken
            this.email = accountHolderUpdateResponse.email
            this.phoneNumber = accountHolderUpdateResponse.phoneNumber
            this.token = accountHolderUpdateResponse.token
            additionalProperties(accountHolderUpdateResponse.additionalProperties)
        }

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

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

        /** The newly updated email for the account holder */
        fun email(email: String) = email(JsonField.of(email))

        /** The newly updated email for the account holder */
        @JsonProperty("email")
        @ExcludeMissing
        fun email(email: JsonField) = apply { this.email = email }

        /** The newly updated phone_number for the account holder */
        fun phoneNumber(phoneNumber: String) = phoneNumber(JsonField.of(phoneNumber))

        /** The newly updated phone_number for the account holder */
        @JsonProperty("phone_number")
        @ExcludeMissing
        fun phoneNumber(phoneNumber: JsonField) = apply { this.phoneNumber = phoneNumber }

        /** The token for the account holder that was updated */
        fun token(token: String) = token(JsonField.of(token))

        /** The token for the account holder that was updated */
        @JsonProperty("token")
        @ExcludeMissing
        fun token(token: JsonField) = apply { this.token = token }

        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(): AccountHolderUpdateResponse =
            AccountHolderUpdateResponse(
                businessAccountToken,
                email,
                phoneNumber,
                token,
                additionalProperties.toImmutable(),
            )
    }

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

        return /* spotless:off */ other is AccountHolderUpdateResponse && this.businessAccountToken == other.businessAccountToken && this.email == other.email && this.phoneNumber == other.phoneNumber && this.token == other.token && this.additionalProperties == other.additionalProperties /* spotless:on */
    }

    private var hashCode: Int = 0

    override fun hashCode(): Int {
        if (hashCode == 0) {
            hashCode = /* spotless:off */ Objects.hash(businessAccountToken, email, phoneNumber, token, additionalProperties) /* spotless:on */
        }
        return hashCode
    }

    override fun toString() =
        "AccountHolderUpdateResponse{businessAccountToken=$businessAccountToken, email=$email, phoneNumber=$phoneNumber, token=$token, additionalProperties=$additionalProperties}"
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy