// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.RealtimeConversation
{
    internal readonly partial struct InternalRealtimeResponseOutputAudioFormat : IEquatable<InternalRealtimeResponseOutputAudioFormat>
    {
        private readonly string _value;
        private const string Pcm16Value = "pcm16";
        private const string G711UlawValue = "g711_ulaw";
        private const string G711AlawValue = "g711_alaw";

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

            _value = value;
        }

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

        public static InternalRealtimeResponseOutputAudioFormat G711Ulaw { get; } = new InternalRealtimeResponseOutputAudioFormat(G711UlawValue);

        public static InternalRealtimeResponseOutputAudioFormat G711Alaw { get; } = new InternalRealtimeResponseOutputAudioFormat(G711AlawValue);

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

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

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

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

        public bool Equals(InternalRealtimeResponseOutputAudioFormat 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;
    }
}
