<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/securitycenter/v2/resource_value_config.proto

namespace Google\Cloud\SecurityCenter\V2;

use UnexpectedValueException;

/**
 * Value enum to map to a resource
 *
 * Protobuf type <code>google.cloud.securitycenter.v2.ResourceValue</code>
 */
class ResourceValue
{
    /**
     * Unspecific value
     *
     * Generated from protobuf enum <code>RESOURCE_VALUE_UNSPECIFIED = 0;</code>
     */
    const RESOURCE_VALUE_UNSPECIFIED = 0;
    /**
     * High resource value
     *
     * Generated from protobuf enum <code>HIGH = 1;</code>
     */
    const HIGH = 1;
    /**
     * Medium resource value
     *
     * Generated from protobuf enum <code>MEDIUM = 2;</code>
     */
    const MEDIUM = 2;
    /**
     * Low resource value
     *
     * Generated from protobuf enum <code>LOW = 3;</code>
     */
    const LOW = 3;
    /**
     * No resource value, e.g. ignore these resources
     *
     * Generated from protobuf enum <code>NONE = 4;</code>
     */
    const NONE = 4;

    private static $valueToName = [
        self::RESOURCE_VALUE_UNSPECIFIED => 'RESOURCE_VALUE_UNSPECIFIED',
        self::HIGH => 'HIGH',
        self::MEDIUM => 'MEDIUM',
        self::LOW => 'LOW',
        self::NONE => 'NONE',
    ];

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

