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

namespace Google\Cloud\BackupDR\V1\AttachedDisk;

use UnexpectedValueException;

/**
 * List of the states of the Disk.
 *
 * Protobuf type <code>google.cloud.backupdr.v1.AttachedDisk.DiskSavedState</code>
 */
class DiskSavedState
{
    /**
     * Default Disk state has not been preserved.
     *
     * Generated from protobuf enum <code>DISK_SAVED_STATE_UNSPECIFIED = 0;</code>
     */
    const DISK_SAVED_STATE_UNSPECIFIED = 0;
    /**
     * Disk state has been preserved.
     *
     * Generated from protobuf enum <code>PRESERVED = 1;</code>
     */
    const PRESERVED = 1;

    private static $valueToName = [
        self::DISK_SAVED_STATE_UNSPECIFIED => 'DISK_SAVED_STATE_UNSPECIFIED',
        self::PRESERVED => 'PRESERVED',
    ];

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

