// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Files
{
    internal readonly partial struct InternalOpenAIFileObject : IEquatable<InternalOpenAIFileObject>
    {
        private readonly string _value;
        private const string FileValue = "file";

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

            _value = value;
        }

        public static InternalOpenAIFileObject File { get; } = new InternalOpenAIFileObject(FileValue);

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

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

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

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

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