// <auto-generated/>

#nullable disable

using System;
using System.ComponentModel;
using OpenAI;

namespace OpenAI.FineTuning
{
    internal readonly partial struct FineTuningJobStatus : IEquatable<FineTuningJobStatus>
    {
        private readonly string _value;
        private const string ValidatingFilesValue = "validating_files";
        private const string QueuedValue = "queued";
        private const string RunningValue = "running";
        private const string SucceededValue = "succeeded";
        private const string FailedValue = "failed";
        private const string CancelledValue = "cancelled";

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

            _value = value;
        }

        public static FineTuningJobStatus ValidatingFiles { get; } = new FineTuningJobStatus(ValidatingFilesValue);

        public static FineTuningJobStatus Queued { get; } = new FineTuningJobStatus(QueuedValue);

        public static FineTuningJobStatus Running { get; } = new FineTuningJobStatus(RunningValue);

        public static FineTuningJobStatus Succeeded { get; } = new FineTuningJobStatus(SucceededValue);

        public static FineTuningJobStatus Failed { get; } = new FineTuningJobStatus(FailedValue);

        public static FineTuningJobStatus Cancelled { get; } = new FineTuningJobStatus(CancelledValue);

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

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

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

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

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