
#nullable enable

namespace Google.Gemini
{
    /// <summary>
    /// Optional. Controls the maximum depth of the model's internal reasoning process before it produces a response. The default value is model-dependent. Refer to the [Thinking levels guide](https://ai.google.dev/gemini-api/docs/thinking#thinking-levels) for more details. Recommended for Gemini 3 or later models. Use with earlier models results in an error.
    /// </summary>
    public enum ThinkingConfigThinkingLevel
    {
        /// <summary>
        /// High thinking level.
        /// </summary>
        High,
        /// <summary>
        /// Low thinking level.
        /// </summary>
        Low,
        /// <summary>
        /// Medium thinking level.
        /// </summary>
        Medium,
        /// <summary>
        /// Little to no thinking.
        /// </summary>
        Minimal,
        /// <summary>
        /// Default value.
        /// </summary>
        ThinkingLevelUnspecified,
    }

    /// <summary>
    /// Enum extensions to do fast conversions without the reflection.
    /// </summary>
    public static class ThinkingConfigThinkingLevelExtensions
    {
        /// <summary>
        /// Converts an enum to a string.
        /// </summary>
        public static string ToValueString(this ThinkingConfigThinkingLevel value)
        {
            return value switch
            {
                ThinkingConfigThinkingLevel.High => "HIGH",
                ThinkingConfigThinkingLevel.Low => "LOW",
                ThinkingConfigThinkingLevel.Medium => "MEDIUM",
                ThinkingConfigThinkingLevel.Minimal => "MINIMAL",
                ThinkingConfigThinkingLevel.ThinkingLevelUnspecified => "THINKING_LEVEL_UNSPECIFIED",
                _ => throw new global::System.ArgumentOutOfRangeException(nameof(value), value, null),
            };
        }
        /// <summary>
        /// Converts an string to a enum.
        /// </summary>
        public static ThinkingConfigThinkingLevel? ToEnum(string value)
        {
            return value switch
            {
                "HIGH" => ThinkingConfigThinkingLevel.High,
                "LOW" => ThinkingConfigThinkingLevel.Low,
                "MEDIUM" => ThinkingConfigThinkingLevel.Medium,
                "MINIMAL" => ThinkingConfigThinkingLevel.Minimal,
                "THINKING_LEVEL_UNSPECIFIED" => ThinkingConfigThinkingLevel.ThinkingLevelUnspecified,
                _ => null,
            };
        }
    }
}