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

namespace Google\Cloud\Compute\V1\NetworkInterface;

use UnexpectedValueException;

/**
 * The type of vNIC to be used on this interface. This may be gVNIC or VirtioNet.
 *
 * Protobuf type <code>google.cloud.compute.v1.NetworkInterface.NicType</code>
 */
class NicType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_NIC_TYPE = 0;</code>
     */
    const UNDEFINED_NIC_TYPE = 0;
    /**
     * GVNIC
     *
     * Generated from protobuf enum <code>GVNIC = 68209305;</code>
     */
    const GVNIC = 68209305;
    /**
     * No type specified.
     *
     * Generated from protobuf enum <code>UNSPECIFIED_NIC_TYPE = 67411801;</code>
     */
    const UNSPECIFIED_NIC_TYPE = 67411801;
    /**
     * VIRTIO
     *
     * Generated from protobuf enum <code>VIRTIO_NET = 452123481;</code>
     */
    const VIRTIO_NET = 452123481;

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

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


