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

namespace Google\Cloud\NetworkConnectivity\V1\InternalRange;

use UnexpectedValueException;

/**
 * Peering type.
 *
 * Protobuf type <code>google.cloud.networkconnectivity.v1.InternalRange.Peering</code>
 */
class Peering
{
    /**
     * If Peering is left unspecified in CreateInternalRange or
     * UpdateInternalRange, it will be defaulted to FOR_SELF.
     *
     * Generated from protobuf enum <code>PEERING_UNSPECIFIED = 0;</code>
     */
    const PEERING_UNSPECIFIED = 0;
    /**
     * This is the default behavior and represents the case that this
     * internal range is intended to be used in the VPC in which it is created
     * and is accessible from its peers. This implies that peers or
     * peers-of-peers cannot use this range.
     *
     * Generated from protobuf enum <code>FOR_SELF = 1;</code>
     */
    const FOR_SELF = 1;
    /**
     * This behavior can be set when the internal range is being reserved for
     * usage by peers. This means that no resource within the VPC in which
     * it is being created can use this to associate with a VPC resource, but
     * one of the peers can. This represents donating a range for peers to
     * use.
     *
     * Generated from protobuf enum <code>FOR_PEER = 2;</code>
     */
    const FOR_PEER = 2;
    /**
     * This behavior can be set when the internal range is being reserved for
     * usage by the VPC in which it is created, but not shared with peers.
     * In a sense, it is local to the VPC. This can be used to create internal
     * ranges for various purposes like HTTP_INTERNAL_LOAD_BALANCER or for
     * Interconnect routes that are not shared with peers. This also implies
     * that peers cannot use this range in a way that is visible to this VPC,
     * but can re-use this range as long as it is NOT_SHARED from the peer VPC,
     * too.
     *
     * Generated from protobuf enum <code>NOT_SHARED = 3;</code>
     */
    const NOT_SHARED = 3;

    private static $valueToName = [
        self::PEERING_UNSPECIFIED => 'PEERING_UNSPECIFIED',
        self::FOR_SELF => 'FOR_SELF',
        self::FOR_PEER => 'FOR_PEER',
        self::NOT_SHARED => 'NOT_SHARED',
    ];

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


