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

namespace Google\Cloud\BackupDR\V1\BackupLocation;

use UnexpectedValueException;

/**
 * The type of the location.
 *
 * Protobuf type <code>google.cloud.backupdr.v1.BackupLocation.Type</code>
 */
class Type
{
    /**
     * Location type is unspecified.
     *
     * Generated from protobuf enum <code>TYPE_UNSPECIFIED = 0;</code>
     */
    const TYPE_UNSPECIFIED = 0;
    /**
     * Location type is zonal.
     *
     * Generated from protobuf enum <code>ZONAL = 1;</code>
     */
    const ZONAL = 1;
    /**
     * Location type is regional.
     *
     * Generated from protobuf enum <code>REGIONAL = 2;</code>
     */
    const REGIONAL = 2;
    /**
     * Location type is multi regional.
     *
     * Generated from protobuf enum <code>MULTI_REGIONAL = 3;</code>
     */
    const MULTI_REGIONAL = 3;

    private static $valueToName = [
        self::TYPE_UNSPECIFIED => 'TYPE_UNSPECIFIED',
        self::ZONAL => 'ZONAL',
        self::REGIONAL => 'REGIONAL',
        self::MULTI_REGIONAL => 'MULTI_REGIONAL',
    ];

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

