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

com.lithic.api.models.ChallengeResult.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.JsonCreator
import com.lithic.api.core.Enum
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonValue
import com.lithic.api.errors.LithicInvalidDataException

class ChallengeResult
@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 ChallengeResult && this.value == other.value /* spotless:on */
    }

    override fun hashCode() = value.hashCode()

    override fun toString() = value.toString()

    companion object {

        val APPROVE = ChallengeResult(JsonField.of("APPROVE"))

        val DECLINE_BY_CUSTOMER = ChallengeResult(JsonField.of("DECLINE_BY_CUSTOMER"))

        fun of(value: String) = ChallengeResult(JsonField.of(value))
    }

    enum class Known {
        APPROVE,
        DECLINE_BY_CUSTOMER,
    }

    enum class Value {
        APPROVE,
        DECLINE_BY_CUSTOMER,
        _UNKNOWN,
    }

    fun value(): Value =
        when (this) {
            APPROVE -> Value.APPROVE
            DECLINE_BY_CUSTOMER -> Value.DECLINE_BY_CUSTOMER
            else -> Value._UNKNOWN
        }

    fun known(): Known =
        when (this) {
            APPROVE -> Known.APPROVE
            DECLINE_BY_CUSTOMER -> Known.DECLINE_BY_CUSTOMER
            else -> throw LithicInvalidDataException("Unknown ChallengeResult: $value")
        }

    fun asString(): String = _value().asStringOrThrow()
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy