// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.RealtimeConversation
{
    internal static partial class ConversationTurnDetectionKindExtensions
    {
        public static string ToSerialString(this ConversationTurnDetectionKind value) => value switch
        {
            ConversationTurnDetectionKind.ServerVoiceActivityDetection => "server_vad",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConversationTurnDetectionKind value.")
        };

        public static ConversationTurnDetectionKind ToConversationTurnDetectionKind(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "server_vad"))
            {
                return ConversationTurnDetectionKind.ServerVoiceActivityDetection;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ConversationTurnDetectionKind value.");
        }
    }
}
