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

namespace Google\Cloud\GkeBackup\V1\VolumeBackup;

use UnexpectedValueException;

/**
 * Identifies the format used for the volume backup.
 *
 * Protobuf type <code>google.cloud.gkebackup.v1.VolumeBackup.VolumeBackupFormat</code>
 */
class VolumeBackupFormat
{
    /**
     * Default value, not specified.
     *
     * Generated from protobuf enum <code>VOLUME_BACKUP_FORMAT_UNSPECIFIED = 0;</code>
     */
    const VOLUME_BACKUP_FORMAT_UNSPECIFIED = 0;
    /**
     * Compute Engine Persistent Disk snapshot based volume backup.
     *
     * Generated from protobuf enum <code>GCE_PERSISTENT_DISK = 1;</code>
     */
    const GCE_PERSISTENT_DISK = 1;

    private static $valueToName = [
        self::VOLUME_BACKUP_FORMAT_UNSPECIFIED => 'VOLUME_BACKUP_FORMAT_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);
    }
}


