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

namespace Google\Cloud\Compute\V1\SnapshotSettingsStorageLocationSettings;

use UnexpectedValueException;

/**
 * The chosen location policy.
 *
 * Protobuf type <code>google.cloud.compute.v1.SnapshotSettingsStorageLocationSettings.Policy</code>
 */
class Policy
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_POLICY = 0;</code>
     */
    const UNDEFINED_POLICY = 0;
    /**
     * Store snapshot in the same region as with the originating disk. No additional parameters are needed.
     *
     * Generated from protobuf enum <code>LOCAL_REGION = 403535464;</code>
     */
    const LOCAL_REGION = 403535464;
    /**
     * Store snapshot in the nearest multi region Cloud Storage bucket, relative to the originating disk. No additional parameters are needed.
     *
     * Generated from protobuf enum <code>NEAREST_MULTI_REGION = 212467515;</code>
     */
    const NEAREST_MULTI_REGION = 212467515;
    /**
     * Store snapshot in the specific locations, as specified by the user. The list of regions to store must be defined under the `locations` field.
     *
     * Generated from protobuf enum <code>SPECIFIC_LOCATIONS = 280093809;</code>
     */
    const SPECIFIC_LOCATIONS = 280093809;
    /**
     * Generated from protobuf enum <code>STORAGE_LOCATION_POLICY_UNSPECIFIED = 250644592;</code>
     */
    const STORAGE_LOCATION_POLICY_UNSPECIFIED = 250644592;

    private static $valueToName = [
        self::UNDEFINED_POLICY => 'UNDEFINED_POLICY',
        self::LOCAL_REGION => 'LOCAL_REGION',
        self::NEAREST_MULTI_REGION => 'NEAREST_MULTI_REGION',
        self::SPECIFIC_LOCATIONS => 'SPECIFIC_LOCATIONS',
        self::STORAGE_LOCATION_POLICY_UNSPECIFIED => 'STORAGE_LOCATION_POLICY_UNSPECIFIED',
    ];

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


