com.lithic.api.models.RequiredDocument.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.
// 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.toUnmodifiable
import java.util.Objects
@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(),
)
}
}