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

namespace Google\Cloud\Dataproc\V1\AutoscalingPolicy;

use UnexpectedValueException;

/**
 * The type of the clusters for which this autoscaling policy is to be
 * configured.
 *
 * Protobuf type <code>google.cloud.dataproc.v1.AutoscalingPolicy.ClusterType</code>
 */
class ClusterType
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>CLUSTER_TYPE_UNSPECIFIED = 0;</code>
     */
    const CLUSTER_TYPE_UNSPECIFIED = 0;
    /**
     * Standard dataproc cluster with a minimum of two primary workers.
     *
     * Generated from protobuf enum <code>STANDARD = 1;</code>
     */
    const STANDARD = 1;
    /**
     * Clusters that can use only secondary workers and be scaled down to zero
     * secondary worker nodes.
     *
     * Generated from protobuf enum <code>ZERO_SCALE = 2;</code>
     */
    const ZERO_SCALE = 2;

    private static $valueToName = [
        self::CLUSTER_TYPE_UNSPECIFIED => 'CLUSTER_TYPE_UNSPECIFIED',
        self::STANDARD => 'STANDARD',
        self::ZERO_SCALE => 'ZERO_SCALE',
    ];

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

