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

namespace Google\Cloud\Compute\V1\ResourcePolicySnapshotSchedulePolicyRetentionPolicy;

use UnexpectedValueException;

/**
 * Specifies the behavior to apply to scheduled snapshots when the source disk is deleted.
 *
 * Protobuf type <code>google.cloud.compute.v1.ResourcePolicySnapshotSchedulePolicyRetentionPolicy.OnSourceDiskDelete</code>
 */
class OnSourceDiskDelete
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_ON_SOURCE_DISK_DELETE = 0;</code>
     */
    const UNDEFINED_ON_SOURCE_DISK_DELETE = 0;
    /**
     * Generated from protobuf enum <code>APPLY_RETENTION_POLICY = 535071332;</code>
     */
    const APPLY_RETENTION_POLICY = 535071332;
    /**
     * Generated from protobuf enum <code>KEEP_AUTO_SNAPSHOTS = 258925689;</code>
     */
    const KEEP_AUTO_SNAPSHOTS = 258925689;
    /**
     * Generated from protobuf enum <code>UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769;</code>
     */
    const UNSPECIFIED_ON_SOURCE_DISK_DELETE = 239140769;

    private static $valueToName = [
        self::UNDEFINED_ON_SOURCE_DISK_DELETE => 'UNDEFINED_ON_SOURCE_DISK_DELETE',
        self::APPLY_RETENTION_POLICY => 'APPLY_RETENTION_POLICY',
        self::KEEP_AUTO_SNAPSHOTS => 'KEEP_AUTO_SNAPSHOTS',
        self::UNSPECIFIED_ON_SOURCE_DISK_DELETE => 'UNSPECIFIED_ON_SOURCE_DISK_DELETE',
    ];

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


