<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/recommender/v1/recommendation.proto

namespace Google\Cloud\Recommender\V1\Recommendation;

use UnexpectedValueException;

/**
 * Recommendation priority levels.
 *
 * Protobuf type <code>google.cloud.recommender.v1.Recommendation.Priority</code>
 */
class Priority
{
    /**
     * Recommendation has unspecified priority.
     *
     * Generated from protobuf enum <code>PRIORITY_UNSPECIFIED = 0;</code>
     */
    const PRIORITY_UNSPECIFIED = 0;
    /**
     * Recommendation has P4 priority (lowest priority).
     *
     * Generated from protobuf enum <code>P4 = 1;</code>
     */
    const P4 = 1;
    /**
     * Recommendation has P3 priority (second lowest priority).
     *
     * Generated from protobuf enum <code>P3 = 2;</code>
     */
    const P3 = 2;
    /**
     * Recommendation has P2 priority (second highest priority).
     *
     * Generated from protobuf enum <code>P2 = 3;</code>
     */
    const P2 = 3;
    /**
     * Recommendation has P1 priority (highest priority).
     *
     * Generated from protobuf enum <code>P1 = 4;</code>
     */
    const P1 = 4;

    private static $valueToName = [
        self::PRIORITY_UNSPECIFIED => 'PRIORITY_UNSPECIFIED',
        self::P4 => 'P4',
        self::P3 => 'P3',
        self::P2 => 'P2',
        self::P1 => 'P1',
    ];

    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(Priority::class, \Google\Cloud\Recommender\V1\Recommendation_Priority::class);

