// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

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

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

            _value = value;
        }

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

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

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

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

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

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

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

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