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

namespace Google\Cloud\Notebooks\V2\NetworkInterface;

use UnexpectedValueException;

/**
 * The type of vNIC driver.
 * Default should be NIC_TYPE_UNSPECIFIED.
 *
 * Protobuf type <code>google.cloud.notebooks.v2.NetworkInterface.NicType</code>
 */
class NicType
{
    /**
     * No type specified.
     *
     * Generated from protobuf enum <code>NIC_TYPE_UNSPECIFIED = 0;</code>
     */
    const NIC_TYPE_UNSPECIFIED = 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::NIC_TYPE_UNSPECIFIED => 'NIC_TYPE_UNSPECIFIED',
        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);
    }
}


