// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Chat;

internal static partial class ChatMessageContentPartKindExtensions
{
    public static string ToSerialString(this ChatMessageContentPartKind value) => value switch
    {
        ChatMessageContentPartKind.Text => "text",
        ChatMessageContentPartKind.Refusal => "refusal",
        ChatMessageContentPartKind.Image => "image_url",
        _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChatMessageContentPartKind value.")
    };

    public static ChatMessageContentPartKind ToChatMessageContentPartKind(this string value)
    {
        if (StringComparer.OrdinalIgnoreCase.Equals(value, "text")) return ChatMessageContentPartKind.Text;
        if (StringComparer.OrdinalIgnoreCase.Equals(value, "refusal")) return ChatMessageContentPartKind.Refusal;
        if (StringComparer.OrdinalIgnoreCase.Equals(value, "image_url")) return ChatMessageContentPartKind.Image;
        throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ChatMessageContentPartKind value.");
    }
}
