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

namespace Google\Cloud\Compute\V1\InterconnectRemoteLocationConstraints;

use UnexpectedValueException;

/**
 * [Output Only] Port pair VLAN constraints, which can take one of the following values: PORT_PAIR_UNCONSTRAINED_VLAN, PORT_PAIR_MATCHING_VLAN
 *
 * Protobuf type <code>google.cloud.compute.v1.InterconnectRemoteLocationConstraints.PortPairVlan</code>
 */
class PortPairVlan
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_PORT_PAIR_VLAN = 0;</code>
     */
    const UNDEFINED_PORT_PAIR_VLAN = 0;
    /**
     * If PORT_PAIR_MATCHING_VLAN, the Interconnect for this attachment is part of a pair of ports that should have matching VLAN allocations. This occurs with Cross-Cloud Interconnect to Azure remote locations. While GCP's API does not explicitly group pairs of ports, the UI uses this field to ensure matching VLAN ids when configuring a redundant VLAN pair.
     *
     * Generated from protobuf enum <code>PORT_PAIR_MATCHING_VLAN = 250295358;</code>
     */
    const PORT_PAIR_MATCHING_VLAN = 250295358;
    /**
     * PORT_PAIR_UNCONSTRAINED_VLAN means there is no constraint.
     *
     * Generated from protobuf enum <code>PORT_PAIR_UNCONSTRAINED_VLAN = 175227948;</code>
     */
    const PORT_PAIR_UNCONSTRAINED_VLAN = 175227948;

    private static $valueToName = [
        self::UNDEFINED_PORT_PAIR_VLAN => 'UNDEFINED_PORT_PAIR_VLAN',
        self::PORT_PAIR_MATCHING_VLAN => 'PORT_PAIR_MATCHING_VLAN',
        self::PORT_PAIR_UNCONSTRAINED_VLAN => 'PORT_PAIR_UNCONSTRAINED_VLAN',
    ];

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


