<?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 link requested, which can take one of the following values:
 * - LINK_TYPE_ETHERNET_10G_LR: A 10G Ethernet with LR optics
 * - LINK_TYPE_ETHERNET_100G_LR: A 100G Ethernet with LR optics. Note that this field indicates the speed of each of the links in the bundle, not the speed of the entire bundle.
 *
 * Protobuf type <code>google.cloud.compute.v1.Interconnect.LinkType</code>
 */
class LinkType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_LINK_TYPE = 0;</code>
     */
    const UNDEFINED_LINK_TYPE = 0;
    /**
     * Generated from protobuf enum <code>LINK_TYPE_ETHERNET_100G_LR = 337672551;</code>
     */
    const LINK_TYPE_ETHERNET_100G_LR = 337672551;
    /**
     * Generated from protobuf enum <code>LINK_TYPE_ETHERNET_10G_LR = 236739749;</code>
     */
    const LINK_TYPE_ETHERNET_10G_LR = 236739749;

    private static $valueToName = [
        self::UNDEFINED_LINK_TYPE => 'UNDEFINED_LINK_TYPE',
        self::LINK_TYPE_ETHERNET_100G_LR => 'LINK_TYPE_ETHERNET_100G_LR',
        self::LINK_TYPE_ETHERNET_10G_LR => 'LINK_TYPE_ETHERNET_10G_LR',
    ];

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


