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

namespace Google\Identity\AccessContextManager\V1\ServicePerimeter;

use UnexpectedValueException;

/**
 * Specifies the type of the Perimeter. There are two types: regular and
 * bridge. Regular Service Perimeter contains resources, access levels, and
 * restricted services. Every resource can be in at most ONE
 * regular Service Perimeter.
 * In addition to being in a regular service perimeter, a resource can also
 * be in zero or more perimeter bridges.  A perimeter bridge only contains
 * resources.  Cross project operations are permitted if all effected
 * resources share some perimeter (whether bridge or regular). Perimeter
 * Bridge does not contain access levels or services: those are governed
 * entirely by the regular perimeter that resource is in.
 * Perimeter Bridges are typically useful when building more complex toplogies
 * with many independent perimeters that need to share some data with a common
 * perimeter, but should not be able to share data among themselves.
 *
 * Protobuf type <code>google.identity.accesscontextmanager.v1.ServicePerimeter.PerimeterType</code>
 */
class PerimeterType
{
    /**
     * Regular Perimeter.
     *
     * Generated from protobuf enum <code>PERIMETER_TYPE_REGULAR = 0;</code>
     */
    const PERIMETER_TYPE_REGULAR = 0;
    /**
     * Perimeter Bridge.
     *
     * Generated from protobuf enum <code>PERIMETER_TYPE_BRIDGE = 1;</code>
     */
    const PERIMETER_TYPE_BRIDGE = 1;

    private static $valueToName = [
        self::PERIMETER_TYPE_REGULAR => 'PERIMETER_TYPE_REGULAR',
        self::PERIMETER_TYPE_BRIDGE => 'PERIMETER_TYPE_BRIDGE',
    ];

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

