// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Realtime
{
    internal static partial class ConversationToolChoiceKindExtensions
    {
        public static string ToSerialString(this ConversationToolChoiceKind value) => value switch
        {
            ConversationToolChoiceKind.Auto => "auto",
            ConversationToolChoiceKind.None => "none",
            ConversationToolChoiceKind.Required => "required",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConversationToolChoiceKind value.")
        };

        public static ConversationToolChoiceKind ToConversationToolChoiceKind(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "auto"))
            {
                return ConversationToolChoiceKind.Auto;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "none"))
            {
                return ConversationToolChoiceKind.None;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "required"))
            {
                return ConversationToolChoiceKind.Required;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConversationToolChoiceKind value.");
        }
    }
}
