// <auto-generated/>

#nullable disable

using System;

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

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