// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.FineTuning
{
    internal static partial class FineTuningJobEventLevelExtensions
    {
        public static string ToSerialString(this FineTuningJobEventLevel value) => value switch
        {
            FineTuningJobEventLevel.Info => "info",
            FineTuningJobEventLevel.Warn => "warn",
            FineTuningJobEventLevel.Error => "error",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FineTuningJobEventLevel value.")
        };

        public static FineTuningJobEventLevel ToFineTuningJobEventLevel(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "info"))
            {
                return FineTuningJobEventLevel.Info;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "warn"))
            {
                return FineTuningJobEventLevel.Warn;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "error"))
            {
                return FineTuningJobEventLevel.Error;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FineTuningJobEventLevel value.");
        }
    }
}
