/**
 *
 * Please note:
 * This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * Do not edit this file manually.
 *
 */

@file:Suppress(
    "ArrayInDataClass",
    "EnumEntryName",
    "RemoveRedundantQualifierName",
    "UnusedImport",
)

package dev.mokksy.aimocks.openai.model

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

/**
 * **o-series models only**
 * Constrains effort on reasoning for
 * [reasoning models](https://platform.openai.com/docs/guides/reasoning).
 * Currently supported values are `low`, `medium`, and `high`.
 * Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response.
 *
 * Values: LOW,MEDIUM,HIGH
 */
@Serializable
public enum class ReasoningEffort(
    public val value: kotlin.String,
) {
    @SerialName(value = "low")
    LOW("low"),

    @SerialName(value = "medium")
    MEDIUM("medium"),

    @SerialName(value = "high")
    HIGH("high"),
    ;

    /**
     * Override [toString()] to avoid using the enum variable name as the value, and instead use
     * the actual value defined in the API spec file.
     *
     * This solves a problem when the variable name and its value are different, and ensures that
     * the client sends the correct enum values to the server always.
     */
    override fun toString(): kotlin.String = value

    public companion object {
        /**
         * Converts the provided [data] to a [String] on success, null otherwise.
         */
        @JvmStatic
        public fun encode(data: kotlin.Any?): kotlin.String? =
            if (data is ReasoningEffort) "$data" else null

        /**
         * Returns a valid [ReasoningEffort] for [data], null otherwise.
         */
        @JvmStatic
        public fun decode(data: kotlin.Any?): ReasoningEffort? =
            data?.let {
                val normalizedData = "$it".lowercase()
                entries.firstOrNull { value ->
                    it == value || normalizedData == "$value".lowercase()
                }
            }
    }
}
