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

namespace Google\Cloud\Compute\V1\AutoscalingPolicyCustomMetricUtilization;

use UnexpectedValueException;

/**
 * Defines how target utilization value is expressed for a Stackdriver Monitoring metric. Either GAUGE, DELTA_PER_SECOND, or DELTA_PER_MINUTE.
 *
 * Protobuf type <code>google.cloud.compute.v1.AutoscalingPolicyCustomMetricUtilization.UtilizationTargetType</code>
 */
class UtilizationTargetType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_UTILIZATION_TARGET_TYPE = 0;</code>
     */
    const UNDEFINED_UTILIZATION_TARGET_TYPE = 0;
    /**
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per minute.
     *
     * Generated from protobuf enum <code>DELTA_PER_MINUTE = 87432861;</code>
     */
    const DELTA_PER_MINUTE = 87432861;
    /**
     * Sets the utilization target value for a cumulative or delta metric, expressed as the rate of growth per second.
     *
     * Generated from protobuf enum <code>DELTA_PER_SECOND = 255180029;</code>
     */
    const DELTA_PER_SECOND = 255180029;
    /**
     * Sets the utilization target value for a gauge metric. The autoscaler will collect the average utilization of the virtual machines from the last couple of minutes, and compare the value to the utilization target value to perform autoscaling.
     *
     * Generated from protobuf enum <code>GAUGE = 67590361;</code>
     */
    const GAUGE = 67590361;

    private static $valueToName = [
        self::UNDEFINED_UTILIZATION_TARGET_TYPE => 'UNDEFINED_UTILIZATION_TARGET_TYPE',
        self::DELTA_PER_MINUTE => 'DELTA_PER_MINUTE',
        self::DELTA_PER_SECOND => 'DELTA_PER_SECOND',
        self::GAUGE => 'GAUGE',
    ];

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


