com.lithic.api.models.AccountHolderSimulateEnrollmentDocumentReviewParams.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.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.toUnmodifiable
import com.lithic.api.errors.LithicInvalidDataException
import com.lithic.api.models.*
import java.util.Objects
class AccountHolderSimulateEnrollmentDocumentReviewParams
constructor(
private val documentUploadToken: String?,
private val status: Status?,
private val statusReasons: List?,
private val additionalQueryParams: Map>,
private val additionalHeaders: Map>,
private val additionalBodyProperties: Map,
) {
fun documentUploadToken(): String? = documentUploadToken
fun status(): Status? = status
fun statusReasons(): List? = statusReasons
internal fun getBody(): AccountHolderSimulateEnrollmentDocumentReviewBody {
return AccountHolderSimulateEnrollmentDocumentReviewBody(
documentUploadToken,
status,
statusReasons,
additionalBodyProperties,
)
}
internal fun getQueryParams(): Map> = additionalQueryParams
internal fun getHeaders(): Map> = additionalHeaders
@JsonDeserialize(builder = AccountHolderSimulateEnrollmentDocumentReviewBody.Builder::class)
@NoAutoDetect
class AccountHolderSimulateEnrollmentDocumentReviewBody
internal constructor(
private val documentUploadToken: String?,
private val status: Status?,
private val statusReasons: List?,
private val additionalProperties: Map,
) {
private var hashCode: Int = 0
/** The account holder document upload which to perform the simulation upon. */
@JsonProperty("document_upload_token")
fun documentUploadToken(): String? = documentUploadToken
/** An account holder document's upload status for use within the simulation. */
@JsonProperty("status") fun status(): Status? = status
/**
* Status reason that will be associated with the simulated account holder status. Only
* required for a `REJECTED` status.
*/
@JsonProperty("status_reasons") fun statusReasons(): List? = statusReasons
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AccountHolderSimulateEnrollmentDocumentReviewBody &&
this.documentUploadToken == other.documentUploadToken &&
this.status == other.status &&
this.statusReasons == other.statusReasons &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
documentUploadToken,
status,
statusReasons,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"AccountHolderSimulateEnrollmentDocumentReviewBody{documentUploadToken=$documentUploadToken, status=$status, statusReasons=$statusReasons, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var documentUploadToken: String? = null
private var status: Status? = null
private var statusReasons: List? = null
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(
accountHolderSimulateEnrollmentDocumentReviewBody:
AccountHolderSimulateEnrollmentDocumentReviewBody
) = apply {
this.documentUploadToken =
accountHolderSimulateEnrollmentDocumentReviewBody.documentUploadToken
this.status = accountHolderSimulateEnrollmentDocumentReviewBody.status
this.statusReasons = accountHolderSimulateEnrollmentDocumentReviewBody.statusReasons
additionalProperties(
accountHolderSimulateEnrollmentDocumentReviewBody.additionalProperties
)
}
/** The account holder document upload which to perform the simulation upon. */
@JsonProperty("document_upload_token")
fun documentUploadToken(documentUploadToken: String) = apply {
this.documentUploadToken = documentUploadToken
}
/** An account holder document's upload status for use within the simulation. */
@JsonProperty("status") fun status(status: Status) = apply { this.status = status }
/**
* Status reason that will be associated with the simulated account holder status. Only
* required for a `REJECTED` status.
*/
@JsonProperty("status_reasons")
fun statusReasons(statusReasons: List) = 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(): AccountHolderSimulateEnrollmentDocumentReviewBody =
AccountHolderSimulateEnrollmentDocumentReviewBody(
documentUploadToken,
status,
statusReasons?.toUnmodifiable(),
additionalProperties.toUnmodifiable(),
)
}
}
fun _additionalQueryParams(): Map> = additionalQueryParams
fun _additionalHeaders(): Map> = additionalHeaders
fun _additionalBodyProperties(): Map = additionalBodyProperties
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is AccountHolderSimulateEnrollmentDocumentReviewParams &&
this.documentUploadToken == other.documentUploadToken &&
this.status == other.status &&
this.statusReasons == other.statusReasons &&
this.additionalQueryParams == other.additionalQueryParams &&
this.additionalHeaders == other.additionalHeaders &&
this.additionalBodyProperties == other.additionalBodyProperties
}
override fun hashCode(): Int {
return Objects.hash(
documentUploadToken,
status,
statusReasons,
additionalQueryParams,
additionalHeaders,
additionalBodyProperties,
)
}
override fun toString() =
"AccountHolderSimulateEnrollmentDocumentReviewParams{documentUploadToken=$documentUploadToken, status=$status, statusReasons=$statusReasons, additionalQueryParams=$additionalQueryParams, additionalHeaders=$additionalHeaders, additionalBodyProperties=$additionalBodyProperties}"
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
@NoAutoDetect
class Builder {
private var documentUploadToken: String? = null
private var status: Status? = null
private var statusReasons: MutableList = mutableListOf()
private var additionalQueryParams: MutableMap> = mutableMapOf()
private var additionalHeaders: MutableMap> = mutableMapOf()
private var additionalBodyProperties: MutableMap = mutableMapOf()
internal fun from(
accountHolderSimulateEnrollmentDocumentReviewParams:
AccountHolderSimulateEnrollmentDocumentReviewParams
) = apply {
this.documentUploadToken =
accountHolderSimulateEnrollmentDocumentReviewParams.documentUploadToken
this.status = accountHolderSimulateEnrollmentDocumentReviewParams.status
this.statusReasons(
accountHolderSimulateEnrollmentDocumentReviewParams.statusReasons ?: listOf()
)
additionalQueryParams(
accountHolderSimulateEnrollmentDocumentReviewParams.additionalQueryParams
)
additionalHeaders(accountHolderSimulateEnrollmentDocumentReviewParams.additionalHeaders)
additionalBodyProperties(
accountHolderSimulateEnrollmentDocumentReviewParams.additionalBodyProperties
)
}
/** The account holder document upload which to perform the simulation upon. */
fun documentUploadToken(documentUploadToken: String) = apply {
this.documentUploadToken = documentUploadToken
}
/** An account holder document's upload status for use within the simulation. */
fun status(status: Status) = apply { this.status = status }
/**
* Status reason that will be associated with the simulated account holder status. Only
* required for a `REJECTED` status.
*/
fun statusReasons(statusReasons: List) = apply {
this.statusReasons.clear()
this.statusReasons.addAll(statusReasons)
}
/**
* Status reason that will be associated with the simulated account holder status. Only
* required for a `REJECTED` status.
*/
fun addStatusReason(statusReason: StatusReason) = apply {
this.statusReasons.add(statusReason)
}
fun additionalQueryParams(additionalQueryParams: Map>) = apply {
this.additionalQueryParams.clear()
putAllQueryParams(additionalQueryParams)
}
fun putQueryParam(name: String, value: String) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.add(value)
}
fun putQueryParams(name: String, values: Iterable) = apply {
this.additionalQueryParams.getOrPut(name) { mutableListOf() }.addAll(values)
}
fun putAllQueryParams(additionalQueryParams: Map>) = apply {
additionalQueryParams.forEach(this::putQueryParams)
}
fun removeQueryParam(name: String) = apply {
this.additionalQueryParams.put(name, mutableListOf())
}
fun additionalHeaders(additionalHeaders: Map>) = apply {
this.additionalHeaders.clear()
putAllHeaders(additionalHeaders)
}
fun putHeader(name: String, value: String) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.add(value)
}
fun putHeaders(name: String, values: Iterable) = apply {
this.additionalHeaders.getOrPut(name) { mutableListOf() }.addAll(values)
}
fun putAllHeaders(additionalHeaders: Map>) = apply {
additionalHeaders.forEach(this::putHeaders)
}
fun removeHeader(name: String) = apply { this.additionalHeaders.put(name, mutableListOf()) }
fun additionalBodyProperties(additionalBodyProperties: Map) = apply {
this.additionalBodyProperties.clear()
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun putAdditionalBodyProperty(key: String, value: JsonValue) = apply {
this.additionalBodyProperties.put(key, value)
}
fun putAllAdditionalBodyProperties(additionalBodyProperties: Map) =
apply {
this.additionalBodyProperties.putAll(additionalBodyProperties)
}
fun build(): AccountHolderSimulateEnrollmentDocumentReviewParams =
AccountHolderSimulateEnrollmentDocumentReviewParams(
documentUploadToken,
status,
if (statusReasons.size == 0) null else statusReasons.toUnmodifiable(),
additionalQueryParams.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalHeaders.mapValues { it.value.toUnmodifiable() }.toUnmodifiable(),
additionalBodyProperties.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 UPLOADED = Status(JsonField.of("UPLOADED"))
val ACCEPTED = Status(JsonField.of("ACCEPTED"))
val REJECTED = Status(JsonField.of("REJECTED"))
fun of(value: String) = Status(JsonField.of(value))
}
enum class Known {
UPLOADED,
ACCEPTED,
REJECTED,
}
enum class Value {
UPLOADED,
ACCEPTED,
REJECTED,
_UNKNOWN,
}
fun value(): Value =
when (this) {
UPLOADED -> Value.UPLOADED
ACCEPTED -> Value.ACCEPTED
REJECTED -> Value.REJECTED
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
UPLOADED -> Known.UPLOADED
ACCEPTED -> Known.ACCEPTED
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 DOCUMENT_MISSING_REQUIRED_DATA =
StatusReason(JsonField.of("DOCUMENT_MISSING_REQUIRED_DATA"))
val DOCUMENT_UPLOAD_TOO_BLURRY =
StatusReason(JsonField.of("DOCUMENT_UPLOAD_TOO_BLURRY"))
val INVALID_DOCUMENT_TYPE = StatusReason(JsonField.of("INVALID_DOCUMENT_TYPE"))
fun of(value: String) = StatusReason(JsonField.of(value))
}
enum class Known {
DOCUMENT_MISSING_REQUIRED_DATA,
DOCUMENT_UPLOAD_TOO_BLURRY,
INVALID_DOCUMENT_TYPE,
}
enum class Value {
DOCUMENT_MISSING_REQUIRED_DATA,
DOCUMENT_UPLOAD_TOO_BLURRY,
INVALID_DOCUMENT_TYPE,
_UNKNOWN,
}
fun value(): Value =
when (this) {
DOCUMENT_MISSING_REQUIRED_DATA -> Value.DOCUMENT_MISSING_REQUIRED_DATA
DOCUMENT_UPLOAD_TOO_BLURRY -> Value.DOCUMENT_UPLOAD_TOO_BLURRY
INVALID_DOCUMENT_TYPE -> Value.INVALID_DOCUMENT_TYPE
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
DOCUMENT_MISSING_REQUIRED_DATA -> Known.DOCUMENT_MISSING_REQUIRED_DATA
DOCUMENT_UPLOAD_TOO_BLURRY -> Known.DOCUMENT_UPLOAD_TOO_BLURRY
INVALID_DOCUMENT_TYPE -> Known.INVALID_DOCUMENT_TYPE
else -> throw LithicInvalidDataException("Unknown StatusReason: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}