// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Chat
{
    public readonly partial struct ChatOutputAudioFormat : IEquatable<ChatOutputAudioFormat>
    {
        private readonly string _value;
        private const string WavValue = "wav";
        private const string Mp3Value = "mp3";
        private const string FlacValue = "flac";
        private const string OpusValue = "opus";
        private const string Pcm16Value = "pcm16";

        public ChatOutputAudioFormat(string value)
        {
            Argument.AssertNotNull(value, nameof(value));

            _value = value;
        }

        public static ChatOutputAudioFormat Wav { get; } = new ChatOutputAudioFormat(WavValue);

        public static ChatOutputAudioFormat Mp3 { get; } = new ChatOutputAudioFormat(Mp3Value);

        public static ChatOutputAudioFormat Flac { get; } = new ChatOutputAudioFormat(FlacValue);

        public static ChatOutputAudioFormat Opus { get; } = new ChatOutputAudioFormat(OpusValue);

        public static ChatOutputAudioFormat Pcm16 { get; } = new ChatOutputAudioFormat(Pcm16Value);

        public static bool operator ==(ChatOutputAudioFormat left, ChatOutputAudioFormat right) => left.Equals(right);

        public static bool operator !=(ChatOutputAudioFormat left, ChatOutputAudioFormat right) => !left.Equals(right);

        public static implicit operator ChatOutputAudioFormat(string value) => new ChatOutputAudioFormat(value);

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is ChatOutputAudioFormat other && Equals(other);

        public bool Equals(ChatOutputAudioFormat other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase);

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0;

        public override string ToString() => _value;
    }
}
