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

namespace Google\Cloud\CapacityPlanner\V1beta;

use UnexpectedValueException;

/**
 * The level of the Google Cloud Platform location.
 *
 * Protobuf type <code>google.cloud.capacityplanner.v1beta.LocationLevel</code>
 */
class LocationLevel
{
    /**
     * Location level is unspecified.
     *
     * Generated from protobuf enum <code>LOCATION_LEVEL_UNSPECIFIED = 0;</code>
     */
    const LOCATION_LEVEL_UNSPECIFIED = 0;
    /**
     * Cloud region.
     *
     * Generated from protobuf enum <code>REGION = 1;</code>
     */
    const REGION = 1;
    /**
     * Cloud zone.
     *
     * Generated from protobuf enum <code>ZONE = 2;</code>
     */
    const ZONE = 2;
    /**
     * Globally.
     *
     * Generated from protobuf enum <code>GLOBAL = 3;</code>
     */
    const PBGLOBAL = 3;
    /**
     * A metro.
     *
     * Generated from protobuf enum <code>METRO = 4;</code>
     */
    const METRO = 4;
    /**
     * Dual region pair.
     *
     * Generated from protobuf enum <code>DUAL_REGION = 5;</code>
     */
    const DUAL_REGION = 5;
    /**
     * Multiple regions.
     *
     * Generated from protobuf enum <code>MULTI_REGION = 6;</code>
     */
    const MULTI_REGION = 6;

    private static $valueToName = [
        self::LOCATION_LEVEL_UNSPECIFIED => 'LOCATION_LEVEL_UNSPECIFIED',
        self::REGION => 'REGION',
        self::ZONE => 'ZONE',
        self::PBGLOBAL => 'GLOBAL',
        self::METRO => 'METRO',
        self::DUAL_REGION => 'DUAL_REGION',
        self::MULTI_REGION => 'MULTI_REGION',
    ];

    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)) {
            $pbconst =  __CLASS__. '::PB' . strtoupper($name);
            if (!defined($pbconst)) {
                throw new UnexpectedValueException(sprintf(
                        'Enum %s has no value defined for name %s', __CLASS__, $name));
            }
            return constant($pbconst);
        }
        return constant($const);
    }
}

