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

namespace Google\Cloud\Compute\V1\Instance;

use UnexpectedValueException;

/**
 * KeyRevocationActionType of the instance. Supported options are "STOP" and
 * "NONE". The default value is "NONE" if it is not specified.
 *
 * Protobuf type <code>google.cloud.compute.v1.Instance.KeyRevocationActionType</code>
 */
class KeyRevocationActionType
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0;</code>
     */
    const UNDEFINED_KEY_REVOCATION_ACTION_TYPE = 0;
    /**
     * Default value. This value is unused.
     *
     * Generated from protobuf enum <code>KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106;</code>
     */
    const KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 467110106;
    /**
     * Indicates user chose no operation.
     *
     * Generated from protobuf enum <code>NONE = 2402104;</code>
     */
    const NONE = 2402104;
    /**
     * Indicates user chose to opt for VM shutdown on key revocation.
     *
     * Generated from protobuf enum <code>STOP = 2555906;</code>
     */
    const STOP = 2555906;

    private static $valueToName = [
        self::UNDEFINED_KEY_REVOCATION_ACTION_TYPE => 'UNDEFINED_KEY_REVOCATION_ACTION_TYPE',
        self::KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED => 'KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED',
        self::NONE => 'NONE',
        self::STOP => 'STOP',
    ];

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


