// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;

namespace OpenAI.Assistants
{
    public readonly partial struct MessageFailureReason : IEquatable<MessageFailureReason>
    {
        private readonly string _value;

        public MessageFailureReason(string value)
        {
            _value = value ?? throw new ArgumentNullException(nameof(value));
        }

        private const string ContentFilterValue = "content_filter";
        private const string MaxTokensValue = "max_tokens";
        private const string RunCancelledValue = "run_cancelled";
        private const string RunExpiredValue = "run_expired";
        private const string RunFailedValue = "run_failed";

        public static MessageFailureReason ContentFilter { get; } = new MessageFailureReason(ContentFilterValue);
        public static MessageFailureReason MaxTokens { get; } = new MessageFailureReason(MaxTokensValue);
        public static MessageFailureReason RunCancelled { get; } = new MessageFailureReason(RunCancelledValue);
        public static MessageFailureReason RunExpired { get; } = new MessageFailureReason(RunExpiredValue);
        public static MessageFailureReason RunFailed { get; } = new MessageFailureReason(RunFailedValue);
        public static bool operator ==(MessageFailureReason left, MessageFailureReason right) => left.Equals(right);
        public static bool operator !=(MessageFailureReason left, MessageFailureReason right) => !left.Equals(right);
        public static implicit operator MessageFailureReason(string value) => new MessageFailureReason(value);

        [EditorBrowsable(EditorBrowsableState.Never)]
        public override bool Equals(object obj) => obj is MessageFailureReason other && Equals(other);
        public bool Equals(MessageFailureReason 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;
    }
}
