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

namespace Google\Cloud\Notebooks\V1beta1\Instance;

use UnexpectedValueException;

/**
 * The type of vNIC driver.
 *
 * Protobuf type <code>google.cloud.notebooks.v1beta1.Instance.NicType</code>
 */
class NicType
{
    /**
     * No type specified. Default should be UNSPECIFIED_NIC_TYPE.
     *
     * Generated from protobuf enum <code>UNSPECIFIED_NIC_TYPE = 0;</code>
     */
    const UNSPECIFIED_NIC_TYPE = 0;
    /**
     * VIRTIO. Default in Notebooks DLVM.
     *
     * Generated from protobuf enum <code>VIRTIO_NET = 1;</code>
     */
    const VIRTIO_NET = 1;
    /**
     * GVNIC. Alternative to VIRTIO.
     * https://github.com/GoogleCloudPlatform/compute-virtual-ethernet-linux
     *
     * Generated from protobuf enum <code>GVNIC = 2;</code>
     */
    const GVNIC = 2;

    private static $valueToName = [
        self::UNSPECIFIED_NIC_TYPE => 'UNSPECIFIED_NIC_TYPE',
        self::VIRTIO_NET => 'VIRTIO_NET',
        self::GVNIC => 'GVNIC',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(NicType::class, \Google\Cloud\Notebooks\V1beta1\Instance_NicType::class);

