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

namespace Google\Cloud\Compute\V1\Interconnect;

use UnexpectedValueException;

/**
 * Type of interconnect, which can take one of the following values:
 * - PARTNER: A partner-managed interconnection shared between customers though a partner.
 * - DEDICATED: A dedicated physical interconnection with the customer. Note that a value IT_PRIVATE has been deprecated in favor of DEDICATED.
 *
 * Protobuf type <code>google.cloud.compute.v1.Interconnect.InterconnectType</code>
 */
class InterconnectType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_INTERCONNECT_TYPE = 0;</code>
     */
    const UNDEFINED_INTERCONNECT_TYPE = 0;
    /**
     * Generated from protobuf enum <code>DEDICATED = 258411983;</code>
     */
    const DEDICATED = 258411983;
    /**
     * Generated from protobuf enum <code>IT_PRIVATE = 67241551;</code>
     */
    const IT_PRIVATE = 67241551;
    /**
     * Generated from protobuf enum <code>PARTNER = 193489064;</code>
     */
    const PARTNER = 193489064;

    private static $valueToName = [
        self::UNDEFINED_INTERCONNECT_TYPE => 'UNDEFINED_INTERCONNECT_TYPE',
        self::DEDICATED => 'DEDICATED',
        self::IT_PRIVATE => 'IT_PRIVATE',
        self::PARTNER => 'PARTNER',
    ];

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


