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

namespace Google\Cloud\GkeBackup\V1\VolumeRestore;

use UnexpectedValueException;

/**
 * Supported volume types.
 *
 * Protobuf type <code>google.cloud.gkebackup.v1.VolumeRestore.VolumeType</code>
 */
class VolumeType
{
    /**
     * Default
     *
     * Generated from protobuf enum <code>VOLUME_TYPE_UNSPECIFIED = 0;</code>
     */
    const VOLUME_TYPE_UNSPECIFIED = 0;
    /**
     * Compute Engine Persistent Disk volume
     *
     * Generated from protobuf enum <code>GCE_PERSISTENT_DISK = 1;</code>
     */
    const GCE_PERSISTENT_DISK = 1;

    private static $valueToName = [
        self::VOLUME_TYPE_UNSPECIFIED => 'VOLUME_TYPE_UNSPECIFIED',
        self::GCE_PERSISTENT_DISK => 'GCE_PERSISTENT_DISK',
    ];

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


