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

namespace Google\Cloud\Compute\V1\AttachedDisk;

use UnexpectedValueException;

/**
 * For LocalSSD disks on VM Instances in STOPPED or SUSPENDED state, this field is set to PRESERVED if the LocalSSD data has been saved to a persistent location by customer request. (see the discard_local_ssd option on Stop/Suspend). Read-only in the api.
 *
 * Protobuf type <code>google.cloud.compute.v1.AttachedDisk.SavedState</code>
 */
class SavedState
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_SAVED_STATE = 0;</code>
     */
    const UNDEFINED_SAVED_STATE = 0;
    /**
     * *[Default]* Disk state has not been preserved.
     *
     * Generated from protobuf enum <code>DISK_SAVED_STATE_UNSPECIFIED = 391290831;</code>
     */
    const DISK_SAVED_STATE_UNSPECIFIED = 391290831;
    /**
     * Disk state has been preserved.
     *
     * Generated from protobuf enum <code>PRESERVED = 254159736;</code>
     */
    const PRESERVED = 254159736;

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


