// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Audio
{
    internal static partial class AudioTranslationFormatExtensions
    {
        public static string ToSerialString(this AudioTranslationFormat value) => value switch
        {
            AudioTranslationFormat.Simple => "json",
            AudioTranslationFormat.Text => "text",
            AudioTranslationFormat.Srt => "srt",
            AudioTranslationFormat.Verbose => "verbose_json",
            AudioTranslationFormat.Vtt => "vtt",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AudioTranslationFormat value.")
        };

        public static AudioTranslationFormat ToAudioTranslationFormat(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "json")) return AudioTranslationFormat.Simple;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "text")) return AudioTranslationFormat.Text;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "srt")) return AudioTranslationFormat.Srt;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "verbose_json")) return AudioTranslationFormat.Verbose;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "vtt")) return AudioTranslationFormat.Vtt;
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown AudioTranslationFormat value.");
        }
    }
}
