<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: proApi.proto

namespace Rv\Data\ProLink\HandlerIn\LogRequest;

use UnexpectedValueException;

/**
 * Protobuf type <code>rv.data.ProLink.HandlerIn.LogRequest.Severity</code>
 */
class Severity
{
    /**
     * Generated from protobuf enum <code>SEVERITY_DEBUG = 0;</code>
     */
    const SEVERITY_DEBUG = 0;
    /**
     * Generated from protobuf enum <code>SEVERITY_DEBUG_WARNING = 1;</code>
     */
    const SEVERITY_DEBUG_WARNING = 1;
    /**
     * Generated from protobuf enum <code>SEVERITY_INFO = 2;</code>
     */
    const SEVERITY_INFO = 2;
    /**
     * Generated from protobuf enum <code>SEVERITY_WARNING = 3;</code>
     */
    const SEVERITY_WARNING = 3;
    /**
     * Generated from protobuf enum <code>SEVERITY_ERROR = 4;</code>
     */
    const SEVERITY_ERROR = 4;
    /**
     * Generated from protobuf enum <code>SEVERITY_FATAL_ERROR = 5;</code>
     */
    const SEVERITY_FATAL_ERROR = 5;

    private static $valueToName = [
        self::SEVERITY_DEBUG => 'SEVERITY_DEBUG',
        self::SEVERITY_DEBUG_WARNING => 'SEVERITY_DEBUG_WARNING',
        self::SEVERITY_INFO => 'SEVERITY_INFO',
        self::SEVERITY_WARNING => 'SEVERITY_WARNING',
        self::SEVERITY_ERROR => 'SEVERITY_ERROR',
        self::SEVERITY_FATAL_ERROR => 'SEVERITY_FATAL_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);
    }
}

