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

namespace Google\Cloud\BackupDR\V1\NetworkInterface;

use UnexpectedValueException;

/**
 * Nic type for this network interface.
 *
 * Protobuf type <code>google.cloud.backupdr.v1.NetworkInterface.NicType</code>
 */
class NicType
{
    /**
     * Default should be NIC_TYPE_UNSPECIFIED.
     *
     * 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);
    }
}

