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

namespace Google\Cloud\Container\V1\NodePoolAutoscaling;

use UnexpectedValueException;

/**
 * Location policy specifies how zones are picked when scaling up the
 * nodepool.
 *
 * Protobuf type <code>google.container.v1.NodePoolAutoscaling.LocationPolicy</code>
 */
class LocationPolicy
{
    /**
     * Not set.
     *
     * Generated from protobuf enum <code>LOCATION_POLICY_UNSPECIFIED = 0;</code>
     */
    const LOCATION_POLICY_UNSPECIFIED = 0;
    /**
     * BALANCED is a best effort policy that aims to balance the sizes of
     * different zones.
     *
     * Generated from protobuf enum <code>BALANCED = 1;</code>
     */
    const BALANCED = 1;
    /**
     * ANY policy picks zones that have the highest capacity available.
     *
     * Generated from protobuf enum <code>ANY = 2;</code>
     */
    const ANY = 2;

    private static $valueToName = [
        self::LOCATION_POLICY_UNSPECIFIED => 'LOCATION_POLICY_UNSPECIFIED',
        self::BALANCED => 'BALANCED',
        self::ANY => 'ANY',
    ];

    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(LocationPolicy::class, \Google\Cloud\Container\V1\NodePoolAutoscaling_LocationPolicy::class);

