// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Audio
{
    internal static partial class GeneratedSpeechVoiceExtensions
    {
        public static string ToSerialString(this GeneratedSpeechVoice value) => value switch
        {
            GeneratedSpeechVoice.Alloy => "alloy",
            GeneratedSpeechVoice.Echo => "echo",
            GeneratedSpeechVoice.Fable => "fable",
            GeneratedSpeechVoice.Onyx => "onyx",
            GeneratedSpeechVoice.Nova => "nova",
            GeneratedSpeechVoice.Shimmer => "shimmer",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown GeneratedSpeechVoice value.")
        };

        public static GeneratedSpeechVoice ToGeneratedSpeechVoice(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "alloy")) return GeneratedSpeechVoice.Alloy;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "echo")) return GeneratedSpeechVoice.Echo;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "fable")) return GeneratedSpeechVoice.Fable;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "onyx")) return GeneratedSpeechVoice.Onyx;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "nova")) return GeneratedSpeechVoice.Nova;
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "shimmer")) return GeneratedSpeechVoice.Shimmer;
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown GeneratedSpeechVoice value.");
        }
    }
}
