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

namespace Google\Cloud\BareMetalSolution\V2\Volume;

use UnexpectedValueException;

/**
 * The kinds of auto delete behavior to use when snapshot reserved space is
 * full.
 *
 * Protobuf type <code>google.cloud.baremetalsolution.v2.Volume.SnapshotAutoDeleteBehavior</code>
 */
class SnapshotAutoDeleteBehavior
{
    /**
     * The unspecified behavior.
     *
     * Generated from protobuf enum <code>SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0;</code>
     */
    const SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED = 0;
    /**
     * Don't delete any snapshots. This disables new snapshot creation, as
     * long as the snapshot reserved space is full.
     *
     * Generated from protobuf enum <code>DISABLED = 1;</code>
     */
    const DISABLED = 1;
    /**
     * Delete the oldest snapshots first.
     *
     * Generated from protobuf enum <code>OLDEST_FIRST = 2;</code>
     */
    const OLDEST_FIRST = 2;
    /**
     * Delete the newest snapshots first.
     *
     * Generated from protobuf enum <code>NEWEST_FIRST = 3;</code>
     */
    const NEWEST_FIRST = 3;

    private static $valueToName = [
        self::SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED => 'SNAPSHOT_AUTO_DELETE_BEHAVIOR_UNSPECIFIED',
        self::DISABLED => 'DISABLED',
        self::OLDEST_FIRST => 'OLDEST_FIRST',
        self::NEWEST_FIRST => 'NEWEST_FIRST',
    ];

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

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SnapshotAutoDeleteBehavior::class, \Google\Cloud\BareMetalSolution\V2\Volume_SnapshotAutoDeleteBehavior::class);

