// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Realtime
{
    internal static partial class TurnDetectionKindExtensions
    {
        public static string ToSerialString(this TurnDetectionKind value) => value switch
        {
            TurnDetectionKind.ServerVoiceActivityDetection => "server_vad",
            TurnDetectionKind.SemanticVoiceActivityDetection => "semantic_vad",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown TurnDetectionKind value.")
        };

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