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

namespace Google\Cloud\Notebooks\V1\Instance;

use UnexpectedValueException;

/**
 * The type of vNIC driver.
 * Default should be UNSPECIFIED_NIC_TYPE.
 *
 * Protobuf type <code>google.cloud.notebooks.v1.Instance.NicType</code>
 */
class NicType
{
    /**
     * No type specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED_NIC_TYPE = 0;</code>
     */
    const UNSPECIFIED_NIC_TYPE = 0;
    /**
     * VIRTIO
     *
     * Generated from protobuf enum <code>VIRTIO_NET = 1;</code>
     */
    const VIRTIO_NET = 1;
    /**
     * GVNIC
     *
     * 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);
    }
}


