// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Files
{
    internal static partial class FileStatusExtensions
    {
        public static string ToSerialString(this FileStatus value) => value switch
        {
            FileStatus.Uploaded => "uploaded",
            FileStatus.Processed => "processed",
            FileStatus.Error => "error",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FileStatus value.")
        };

        public static FileStatus ToFileStatus(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "uploaded"))
            {
                return FileStatus.Uploaded;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "processed"))
            {
                return FileStatus.Processed;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "error"))
            {
                return FileStatus.Error;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FileStatus value.");
        }
    }
}
