// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Responses
{
    internal readonly partial struct InternalResponsesTextFormatType : IEquatable<InternalResponsesTextFormatType>
    {
        private readonly string _value;
        private const string TextValue = "text";
        private const string JsonSchemaValue = "json_schema";
        private const string JsonObjectValue = "json_object";

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

            _value = value;
        }

        internal static InternalResponsesTextFormatType Text { get; } = new InternalResponsesTextFormatType(TextValue);

        internal static InternalResponsesTextFormatType JsonSchema { get; } = new InternalResponsesTextFormatType(JsonSchemaValue);

        internal static InternalResponsesTextFormatType JsonObject { get; } = new InternalResponsesTextFormatType(JsonObjectValue);

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

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

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

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

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