// <auto-generated/>

#nullable disable

using System;

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

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