// <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 JsonObjectValue = "json_object";
        private const string JsonSchemaValue = "json_schema";

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

            _value = value;
        }

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

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

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

        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;
    }
}
