// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Responses
{
    internal static partial class FileSearchCallStatusExtensions
    {
        public static string ToSerialString(this FileSearchCallStatus value) => value switch
        {
            FileSearchCallStatus.InProgress => "in_progress",
            FileSearchCallStatus.Searching => "searching",
            FileSearchCallStatus.Completed => "completed",
            FileSearchCallStatus.Incomplete => "incomplete",
            FileSearchCallStatus.Failed => "failed",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FileSearchCallStatus value.")
        };

        public static FileSearchCallStatus ToFileSearchCallStatus(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "in_progress"))
            {
                return FileSearchCallStatus.InProgress;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "searching"))
            {
                return FileSearchCallStatus.Searching;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "completed"))
            {
                return FileSearchCallStatus.Completed;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "incomplete"))
            {
                return FileSearchCallStatus.Incomplete;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "failed"))
            {
                return FileSearchCallStatus.Failed;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown FileSearchCallStatus value.");
        }
    }
}
