com.lithic.api.models.VelocityLimitParamsPeriodWindow.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.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 VelocityLimitParamsPeriodWindow
@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 VelocityLimitParamsPeriodWindow && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val DAY = VelocityLimitParamsPeriodWindow(JsonField.of("DAY"))
val MONTH = VelocityLimitParamsPeriodWindow(JsonField.of("MONTH"))
fun of(value: String) = VelocityLimitParamsPeriodWindow(JsonField.of(value))
}
enum class Known {
DAY,
MONTH,
}
enum class Value {
DAY,
MONTH,
_UNKNOWN,
}
fun value(): Value =
when (this) {
DAY -> Value.DAY
MONTH -> Value.MONTH
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
DAY -> Known.DAY
MONTH -> Known.MONTH
else ->
throw LithicInvalidDataException("Unknown VelocityLimitParamsPeriodWindow: $value")
}
fun asString(): String = _value().asStringOrThrow()
}