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

namespace Google\Cloud\Run\V2;

use UnexpectedValueException;

/**
 * Specifies behavior if an encryption key used by a resource is revoked.
 *
 * Protobuf type <code>google.cloud.run.v2.EncryptionKeyRevocationAction</code>
 */
class EncryptionKeyRevocationAction
{
    /**
     * Unspecified
     *
     * Generated from protobuf enum <code>ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0;</code>
     */
    const ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED = 0;
    /**
     * Prevents the creation of new instances.
     *
     * Generated from protobuf enum <code>PREVENT_NEW = 1;</code>
     */
    const PREVENT_NEW = 1;
    /**
     * Shuts down existing instances, and prevents creation of new ones.
     *
     * Generated from protobuf enum <code>SHUTDOWN = 2;</code>
     */
    const SHUTDOWN = 2;

    private static $valueToName = [
        self::ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED => 'ENCRYPTION_KEY_REVOCATION_ACTION_UNSPECIFIED',
        self::PREVENT_NEW => 'PREVENT_NEW',
        self::SHUTDOWN => 'SHUTDOWN',
    ];

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

