<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: grafeas/v1/severity.proto

namespace Grafeas\V1;

use UnexpectedValueException;

/**
 * Note provider assigned severity/impact ranking.
 *
 * Protobuf type <code>grafeas.v1.Severity</code>
 */
class Severity
{
    /**
     * Unknown.
     *
     * Generated from protobuf enum <code>SEVERITY_UNSPECIFIED = 0;</code>
     */
    const SEVERITY_UNSPECIFIED = 0;
    /**
     * Minimal severity.
     *
     * Generated from protobuf enum <code>MINIMAL = 1;</code>
     */
    const MINIMAL = 1;
    /**
     * Low severity.
     *
     * Generated from protobuf enum <code>LOW = 2;</code>
     */
    const LOW = 2;
    /**
     * Medium severity.
     *
     * Generated from protobuf enum <code>MEDIUM = 3;</code>
     */
    const MEDIUM = 3;
    /**
     * High severity.
     *
     * Generated from protobuf enum <code>HIGH = 4;</code>
     */
    const HIGH = 4;
    /**
     * Critical severity.
     *
     * Generated from protobuf enum <code>CRITICAL = 5;</code>
     */
    const CRITICAL = 5;

    private static $valueToName = [
        self::SEVERITY_UNSPECIFIED => 'SEVERITY_UNSPECIFIED',
        self::MINIMAL => 'MINIMAL',
        self::LOW => 'LOW',
        self::MEDIUM => 'MEDIUM',
        self::HIGH => 'HIGH',
        self::CRITICAL => 'CRITICAL',
    ];

    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);
    }
}

