// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.Assistants
{
    internal readonly partial struct InternalMessageContentType : IEquatable<InternalMessageContentType>
    {
        private readonly string _value;
        private const string TextValue = "text";
        private const string ImageFileValue = "image_file";
        private const string ImageUrlValue = "image_url";
        private const string RefusalValue = "refusal";

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

            _value = value;
        }

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

        internal static InternalMessageContentType ImageFile { get; } = new InternalMessageContentType(ImageFileValue);

        internal static InternalMessageContentType ImageUrl { get; } = new InternalMessageContentType(ImageUrlValue);

        internal static InternalMessageContentType Refusal { get; } = new InternalMessageContentType(RefusalValue);

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

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

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

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

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