// <auto-generated/>

#nullable disable

using System;

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

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