<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/devtools/clouddebugger/v2/data.proto

namespace Google\Cloud\Debugger\V2\Breakpoint;

use UnexpectedValueException;

/**
 * Log severity levels.
 *
 * Protobuf type <code>google.devtools.clouddebugger.v2.Breakpoint.LogLevel</code>
 */
class LogLevel
{
    /**
     * Information log message.
     *
     * Generated from protobuf enum <code>INFO = 0;</code>
     */
    const INFO = 0;
    /**
     * Warning log message.
     *
     * Generated from protobuf enum <code>WARNING = 1;</code>
     */
    const WARNING = 1;
    /**
     * Error log message.
     *
     * Generated from protobuf enum <code>ERROR = 2;</code>
     */
    const ERROR = 2;

    private static $valueToName = [
        self::INFO => 'INFO',
        self::WARNING => 'WARNING',
        self::ERROR => 'ERROR',
    ];

    public static function name($value)
    {
        if (!isset(self::$valueToName[$value])) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no name defined for value %s', __CLASS__, $value));
        }
        return self::$valueToName[$value];
    }


    public static function value($name)
    {
        $const = __CLASS__ . '::' . strtoupper($name);
        if (!defined($const)) {
            throw new UnexpectedValueException(sprintf(
                    'Enum %s has no value defined for name %s', __CLASS__, $name));
        }
        return constant($const);
    }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(LogLevel::class, \Google\Cloud\Debugger\V2\Breakpoint_LogLevel::class);

