// <auto-generated/>

#nullable disable

using System;

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

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