// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace OpenAI
{
    internal readonly partial struct AcceptHeaderValue : IEquatable<AcceptHeaderValue>
    {
        private readonly string _value;
        private const string ApplicationJsonValue = "application/json";
        private const string TextEventStreamValue = "text/event-stream";

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

            _value = value;
        }

        public static AcceptHeaderValue ApplicationJson { get; } = new AcceptHeaderValue(ApplicationJsonValue);

        public static AcceptHeaderValue TextEventStream { get; } = new AcceptHeaderValue(TextEventStreamValue);

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

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

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

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

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