com.lithic.api.models.AccountHolderUploadDocumentParams.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lithic-kotlin-core Show documentation
Show all versions of lithic-kotlin-core Show documentation
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.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.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.http.Headers
import com.lithic.api.core.http.QueryParams
import com.lithic.api.core.toImmutable
import com.lithic.api.errors.LithicInvalidDataException
import com.lithic.api.models.*
import java.util.Objects
class AccountHolderUploadDocumentParams
constructor(
private val accountHolderToken: String,
private val documentType: DocumentType,
private val entityToken: String,
private val additionalHeaders: Headers,
private val additionalQueryParams: QueryParams,
private val additionalBodyProperties: Map,
) {
fun accountHolderToken(): String = accountHolderToken
fun documentType(): DocumentType = documentType
fun entityToken(): String = entityToken
internal fun getBody(): AccountHolderUploadDocumentBody {
return AccountHolderUploadDocumentBody(
documentType,
entityToken,
additionalBodyProperties,
)
}
internal fun getHeaders(): Headers = additionalHeaders
internal fun getQueryParams(): QueryParams = additionalQueryParams
fun getPathParam(index: Int): String {
return when (index) {
0 -> accountHolderToken
else -> ""
}
}
@JsonDeserialize(builder = AccountHolderUploadDocumentBody.Builder::class)
@NoAutoDetect
class AccountHolderUploadDocumentBody
internal constructor(
private val documentType: DocumentType?,
private val entityToken: String?,
private val additionalProperties: Map,
) {
/** The type of document to upload */
@JsonProperty("document_type") fun documentType(): DocumentType? = documentType
/** Globally unique identifier for the entity. */
@JsonProperty("entity_token") fun entityToken(): String? = entityToken
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var documentType: DocumentType? = null
private var entityToken: String? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(accountHolderUploadDocumentBody: AccountHolderUploadDocumentBody) =
apply {
this.documentType = accountHolderUploadDocumentBody.documentType
this.entityToken = accountHolderUploadDocumentBody.entityToken
additionalProperties(accountHolderUploadDocumentBody.additionalProperties)
}
/** The type of document to upload */
@JsonProperty("document_type")
fun documentType(documentType: DocumentType) = apply {
this.documentType = documentType
}
/** Globally unique identifier for the entity. */
@JsonProperty("entity_token")
fun entityToken(entityToken: String) = 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(): AccountHolderUploadDocumentBody =
AccountHolderUploadDocumentBody(
checkNotNull(documentType) { "`documentType` is required but was not set" },
checkNotNull(entityToken) { "`entityToken` is required but was not set" },
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AccountHolderUploadDocumentBody && this.documentType == other.documentType && this.entityToken == other.entityToken && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(documentType, entityToken, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"AccountHolderUploadDocumentBody{documentType=$documentType, entityToken=$entityToken, additionalProperties=$additionalProperties}"
}
fun _additionalHeaders(): Headers = additionalHeaders
fun _additionalQueryParams(): QueryParams = additionalQueryParams
fun _additionalBodyProperties(): Map = additionalBodyProperties
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is AccountHolderUploadDocumentParams && this.accountHolderToken == other.accountHolderToken && this.documentType == other.documentType && this.entityToken == other.entityToken && this.additionalHeaders == other.additionalHeaders && this.additionalQueryParams == other.additionalQueryParams && this.additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
}
override fun hashCode(): Int {
return /* spotless:off */ Objects.hash(accountHolderToken, documentType, entityToken, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
}
override fun toString() =
"AccountHolderUploadDocumentParams{accountHolderToken=$accountHolderToken, documentType=$documentType, entityToken=$entityToken, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
@NoAutoDetect
class Builder {
private var accountHolderToken: String? = null
private var documentType: DocumentType? = null
private var entityToken: String? = null
private var additionalHeaders: Headers.Builder = Headers.builder()
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
private var additionalBodyProperties: MutableMap = mutableMapOf()
internal fun from(accountHolderUploadDocumentParams: AccountHolderUploadDocumentParams) =
apply {
this.accountHolderToken = accountHolderUploadDocumentParams.accountHolderToken
this.documentType = accountHolderUploadDocumentParams.documentType
this.entityToken = accountHolderUploadDocumentParams.entityToken
additionalHeaders(accountHolderUploadDocumentParams.additionalHeaders)
additionalQueryParams(accountHolderUploadDocumentParams.additionalQueryParams)
additionalBodyProperties(accountHolderUploadDocumentParams.additionalBodyProperties)
}
fun accountHolderToken(accountHolderToken: String) = apply {
this.accountHolderToken = accountHolderToken
}
/** The type of document to upload */
fun documentType(documentType: DocumentType) = apply { this.documentType = documentType }
/** Globally unique identifier for the entity. */
fun entityToken(entityToken: String) = apply { this.entityToken = entityToken }
fun additionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
}
fun additionalHeaders(additionalHeaders: Map>) = apply {
this.additionalHeaders.clear()
putAllAdditionalHeaders(additionalHeaders)
}
fun putAdditionalHeader(name: String, value: String) = apply {
additionalHeaders.put(name, value)
}
fun putAdditionalHeaders(name: String, values: Iterable) = apply {
additionalHeaders.put(name, values)
}
fun putAllAdditionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.putAll(additionalHeaders)
}
fun putAllAdditionalHeaders(additionalHeaders: Map>) = apply {
this.additionalHeaders.putAll(additionalHeaders)
}
fun replaceAdditionalHeaders(name: String, value: String) = apply {
additionalHeaders.replace(name, value)
}
fun replaceAdditionalHeaders(name: String, values: Iterable) = apply {
additionalHeaders.replace(name, values)
}
fun replaceAllAdditionalHeaders(additionalHeaders: Headers) = apply {
this.additionalHeaders.replaceAll(additionalHeaders)
}
fun replaceAllAdditionalHeaders(additionalHeaders: Map>) = apply {
this.additionalHeaders.replaceAll(additionalHeaders)
}
fun removeAdditionalHeaders(name: String) = apply { additionalHeaders.remove(name) }
fun removeAllAdditionalHeaders(names: Set) = apply {
additionalHeaders.removeAll(names)
}
fun additionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.clear()
putAllAdditionalQueryParams(additionalQueryParams)
}
fun additionalQueryParams(additionalQueryParams: Map>) = apply {
this.additionalQueryParams.clear()
putAllAdditionalQueryParams(additionalQueryParams)
}
fun putAdditionalQueryParam(key: String, value: String) = apply {
additionalQueryParams.put(key, value)
}
fun putAdditionalQueryParams(key: String, values: Iterable) = apply {
additionalQueryParams.put(key, values)
}
fun putAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.putAll(additionalQueryParams)
}
fun putAllAdditionalQueryParams(additionalQueryParams: Map>) =
apply {
this.additionalQueryParams.putAll(additionalQueryParams)
}
fun replaceAdditionalQueryParams(key: String, value: String) = apply {
additionalQueryParams.replace(key, value)
}
fun replaceAdditionalQueryParams(key: String, values: Iterable) = apply {
additionalQueryParams.replace(key, values)
}
fun replaceAllAdditionalQueryParams(additionalQueryParams: QueryParams) = apply {
this.additionalQueryParams.replaceAll(additionalQueryParams)
}
fun replaceAllAdditionalQueryParams(additionalQueryParams: Map>) =
apply {
this.additionalQueryParams.replaceAll(additionalQueryParams)
}
fun removeAdditionalQueryParams(key: String) = apply { additionalQueryParams.remove(key) }
fun removeAllAdditionalQueryParams(keys: Set) = apply {
additionalQueryParams.removeAll(keys)
}
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
this.additionalBodyProperties.clear()
putAllAdditionalBodyProperties(additionalBodyProperties)
}
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
additionalBodyProperties.put(key, value)
}
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun removeAdditionalBodyProperty(key: String) = apply {
additionalBodyProperties.remove(key)
}
fun removeAllAdditionalBodyProperties(keys: Set) = apply {
keys.forEach(::removeAdditionalBodyProperty)
}
fun build(): AccountHolderUploadDocumentParams =
AccountHolderUploadDocumentParams(
checkNotNull(accountHolderToken) {
"`accountHolderToken` is required but was not set"
},
checkNotNull(documentType) { "`documentType` is required but was not set" },
checkNotNull(entityToken) { "`entityToken` is required but was not set" },
additionalHeaders.build(),
additionalQueryParams.build(),
additionalBodyProperties.toImmutable(),
)
}
class DocumentType
@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 DocumentType && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val EIN_LETTER = DocumentType(JsonField.of("EIN_LETTER"))
val TAX_RETURN = DocumentType(JsonField.of("TAX_RETURN"))
val OPERATING_AGREEMENT = DocumentType(JsonField.of("OPERATING_AGREEMENT"))
val CERTIFICATE_OF_FORMATION = DocumentType(JsonField.of("CERTIFICATE_OF_FORMATION"))
val DRIVERS_LICENSE = DocumentType(JsonField.of("DRIVERS_LICENSE"))
val PASSPORT = DocumentType(JsonField.of("PASSPORT"))
val PASSPORT_CARD = DocumentType(JsonField.of("PASSPORT_CARD"))
val CERTIFICATE_OF_GOOD_STANDING =
DocumentType(JsonField.of("CERTIFICATE_OF_GOOD_STANDING"))
val ARTICLES_OF_INCORPORATION = DocumentType(JsonField.of("ARTICLES_OF_INCORPORATION"))
val ARTICLES_OF_ORGANIZATION = DocumentType(JsonField.of("ARTICLES_OF_ORGANIZATION"))
val BYLAWS = DocumentType(JsonField.of("BYLAWS"))
val GOVERNMENT_BUSINESS_LICENSE =
DocumentType(JsonField.of("GOVERNMENT_BUSINESS_LICENSE"))
val PARTNERSHIP_AGREEMENT = DocumentType(JsonField.of("PARTNERSHIP_AGREEMENT"))
val SS4_FORM = DocumentType(JsonField.of("SS4_FORM"))
val BANK_STATEMENT = DocumentType(JsonField.of("BANK_STATEMENT"))
val UTILITY_BILL_STATEMENT = DocumentType(JsonField.of("UTILITY_BILL_STATEMENT"))
val SSN_CARD = DocumentType(JsonField.of("SSN_CARD"))
val ITIN_LETTER = DocumentType(JsonField.of("ITIN_LETTER"))
fun of(value: String) = DocumentType(JsonField.of(value))
}
enum class Known {
EIN_LETTER,
TAX_RETURN,
OPERATING_AGREEMENT,
CERTIFICATE_OF_FORMATION,
DRIVERS_LICENSE,
PASSPORT,
PASSPORT_CARD,
CERTIFICATE_OF_GOOD_STANDING,
ARTICLES_OF_INCORPORATION,
ARTICLES_OF_ORGANIZATION,
BYLAWS,
GOVERNMENT_BUSINESS_LICENSE,
PARTNERSHIP_AGREEMENT,
SS4_FORM,
BANK_STATEMENT,
UTILITY_BILL_STATEMENT,
SSN_CARD,
ITIN_LETTER,
}
enum class Value {
EIN_LETTER,
TAX_RETURN,
OPERATING_AGREEMENT,
CERTIFICATE_OF_FORMATION,
DRIVERS_LICENSE,
PASSPORT,
PASSPORT_CARD,
CERTIFICATE_OF_GOOD_STANDING,
ARTICLES_OF_INCORPORATION,
ARTICLES_OF_ORGANIZATION,
BYLAWS,
GOVERNMENT_BUSINESS_LICENSE,
PARTNERSHIP_AGREEMENT,
SS4_FORM,
BANK_STATEMENT,
UTILITY_BILL_STATEMENT,
SSN_CARD,
ITIN_LETTER,
_UNKNOWN,
}
fun value(): Value =
when (this) {
EIN_LETTER -> Value.EIN_LETTER
TAX_RETURN -> Value.TAX_RETURN
OPERATING_AGREEMENT -> Value.OPERATING_AGREEMENT
CERTIFICATE_OF_FORMATION -> Value.CERTIFICATE_OF_FORMATION
DRIVERS_LICENSE -> Value.DRIVERS_LICENSE
PASSPORT -> Value.PASSPORT
PASSPORT_CARD -> Value.PASSPORT_CARD
CERTIFICATE_OF_GOOD_STANDING -> Value.CERTIFICATE_OF_GOOD_STANDING
ARTICLES_OF_INCORPORATION -> Value.ARTICLES_OF_INCORPORATION
ARTICLES_OF_ORGANIZATION -> Value.ARTICLES_OF_ORGANIZATION
BYLAWS -> Value.BYLAWS
GOVERNMENT_BUSINESS_LICENSE -> Value.GOVERNMENT_BUSINESS_LICENSE
PARTNERSHIP_AGREEMENT -> Value.PARTNERSHIP_AGREEMENT
SS4_FORM -> Value.SS4_FORM
BANK_STATEMENT -> Value.BANK_STATEMENT
UTILITY_BILL_STATEMENT -> Value.UTILITY_BILL_STATEMENT
SSN_CARD -> Value.SSN_CARD
ITIN_LETTER -> Value.ITIN_LETTER
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
EIN_LETTER -> Known.EIN_LETTER
TAX_RETURN -> Known.TAX_RETURN
OPERATING_AGREEMENT -> Known.OPERATING_AGREEMENT
CERTIFICATE_OF_FORMATION -> Known.CERTIFICATE_OF_FORMATION
DRIVERS_LICENSE -> Known.DRIVERS_LICENSE
PASSPORT -> Known.PASSPORT
PASSPORT_CARD -> Known.PASSPORT_CARD
CERTIFICATE_OF_GOOD_STANDING -> Known.CERTIFICATE_OF_GOOD_STANDING
ARTICLES_OF_INCORPORATION -> Known.ARTICLES_OF_INCORPORATION
ARTICLES_OF_ORGANIZATION -> Known.ARTICLES_OF_ORGANIZATION
BYLAWS -> Known.BYLAWS
GOVERNMENT_BUSINESS_LICENSE -> Known.GOVERNMENT_BUSINESS_LICENSE
PARTNERSHIP_AGREEMENT -> Known.PARTNERSHIP_AGREEMENT
SS4_FORM -> Known.SS4_FORM
BANK_STATEMENT -> Known.BANK_STATEMENT
UTILITY_BILL_STATEMENT -> Known.UTILITY_BILL_STATEMENT
SSN_CARD -> Known.SSN_CARD
ITIN_LETTER -> Known.ITIN_LETTER
else -> throw LithicInvalidDataException("Unknown DocumentType: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy