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

namespace Google\Cloud\BareMetalSolution\V2\VolumeConfig;

use UnexpectedValueException;

/**
 * The protocol used to access the volume.
 *
 * Protobuf type <code>google.cloud.baremetalsolution.v2.VolumeConfig.Protocol</code>
 */
class Protocol
{
    /**
     * Unspecified value.
     *
     * Generated from protobuf enum <code>PROTOCOL_UNSPECIFIED = 0;</code>
     */
    const PROTOCOL_UNSPECIFIED = 0;
    /**
     * Fibre channel.
     *
     * Generated from protobuf enum <code>PROTOCOL_FC = 1;</code>
     */
    const PROTOCOL_FC = 1;
    /**
     * Network file system.
     *
     * Generated from protobuf enum <code>PROTOCOL_NFS = 2;</code>
     */
    const PROTOCOL_NFS = 2;

    private static $valueToName = [
        self::PROTOCOL_UNSPECIFIED => 'PROTOCOL_UNSPECIFIED',
        self::PROTOCOL_FC => 'PROTOCOL_FC',
        self::PROTOCOL_NFS => 'PROTOCOL_NFS',
    ];

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

