// <auto-generated/>

#nullable disable

using System;

namespace OpenAI.Responses
{
    internal static partial class ComputerCallActionMouseButtonExtensions
    {
        public static string ToSerialString(this ComputerCallActionMouseButton value) => value switch
        {
            ComputerCallActionMouseButton.Left => "left",
            ComputerCallActionMouseButton.Right => "right",
            ComputerCallActionMouseButton.Wheel => "wheel",
            ComputerCallActionMouseButton.Back => "back",
            ComputerCallActionMouseButton.Forward => "forward,",
            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputerCallActionMouseButton value.")
        };

        public static ComputerCallActionMouseButton ToComputerCallActionMouseButton(this string value)
        {
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "left"))
            {
                return ComputerCallActionMouseButton.Left;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "right"))
            {
                return ComputerCallActionMouseButton.Right;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "wheel"))
            {
                return ComputerCallActionMouseButton.Wheel;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "back"))
            {
                return ComputerCallActionMouseButton.Back;
            }
            if (StringComparer.OrdinalIgnoreCase.Equals(value, "forward,"))
            {
                return ComputerCallActionMouseButton.Forward;
            }
            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ComputerCallActionMouseButton value.");
        }
    }
}
