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

namespace Google\Cloud\Compute\V1\LocationPolicy;

use UnexpectedValueException;

/**
 * Strategy for distributing VMs across zones in a region.
 *
 * Protobuf type <code>google.cloud.compute.v1.LocationPolicy.TargetShape</code>
 */
class TargetShape
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_TARGET_SHAPE = 0;</code>
     */
    const UNDEFINED_TARGET_SHAPE = 0;
    /**
     * GCE picks zones for creating VM instances to fulfill the requested number of VMs within present resource constraints and to maximize utilization of unused zonal reservations. Recommended for batch workloads that do not require high availability.
     *
     * Generated from protobuf enum <code>ANY = 64972;</code>
     */
    const ANY = 64972;
    /**
     * GCE always selects a single zone for all the VMs, optimizing for resource quotas, available reservations and general capacity. Recommended for batch workloads that cannot tollerate distribution over multiple zones. This the default shape in Bulk Insert and Capacity Advisor APIs.
     *
     * Generated from protobuf enum <code>ANY_SINGLE_ZONE = 61100880;</code>
     */
    const ANY_SINGLE_ZONE = 61100880;
    /**
     * GCE prioritizes acquisition of resources, scheduling VMs in zones where resources are available while distributing VMs as evenly as possible across allowed zones to minimize the impact of zonal failure. Recommended for highly available serving workloads.
     *
     * Generated from protobuf enum <code>BALANCED = 468409608;</code>
     */
    const BALANCED = 468409608;

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

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


