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

namespace Google\Cloud\Compute\V1\ManagedInstance;

use UnexpectedValueException;

/**
 * [Output Only] The current action that the managed instance group has scheduled for the instance. Possible values: - NONE The instance is running, and the managed instance group does not have any scheduled actions for this instance. - CREATING The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful. - CREATING_WITHOUT_RETRIES The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased instead. - RECREATING The managed instance group is recreating this instance. - DELETING The managed instance group is permanently deleting this instance. - ABANDONING The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group. - RESTARTING The managed instance group is restarting the instance. - REFRESHING The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance. - VERIFYING The managed instance group has created the instance and it is in the process of being verified.
 * Additional supported values which may be not listed in the enum directly due to technical reasons:
 * STOPPING
 * SUSPENDING
 *
 * Protobuf type <code>google.cloud.compute.v1.ManagedInstance.CurrentAction</code>
 */
class CurrentAction
{
    /**
     * A value indicating that the enum field is not set.
     *
     * Generated from protobuf enum <code>UNDEFINED_CURRENT_ACTION = 0;</code>
     */
    const UNDEFINED_CURRENT_ACTION = 0;
    /**
     * The managed instance group is abandoning this instance. The instance will be removed from the instance group and from any target pools that are associated with this group.
     *
     * Generated from protobuf enum <code>ABANDONING = 388244813;</code>
     */
    const ABANDONING = 388244813;
    /**
     * The managed instance group is creating this instance. If the group fails to create this instance, it will try again until it is successful.
     *
     * Generated from protobuf enum <code>CREATING = 455564985;</code>
     */
    const CREATING = 455564985;
    /**
     * The managed instance group is attempting to create this instance only once. If the group fails to create this instance, it does not try again and the group's targetSize value is decreased.
     *
     * Generated from protobuf enum <code>CREATING_WITHOUT_RETRIES = 428843785;</code>
     */
    const CREATING_WITHOUT_RETRIES = 428843785;
    /**
     * The managed instance group is permanently deleting this instance.
     *
     * Generated from protobuf enum <code>DELETING = 528602024;</code>
     */
    const DELETING = 528602024;
    /**
     * The managed instance group has not scheduled any actions for this instance.
     *
     * Generated from protobuf enum <code>NONE = 2402104;</code>
     */
    const NONE = 2402104;
    /**
     * The managed instance group is recreating this instance.
     *
     * Generated from protobuf enum <code>RECREATING = 287278572;</code>
     */
    const RECREATING = 287278572;
    /**
     * The managed instance group is applying configuration changes to the instance without stopping it. For example, the group can update the target pool list for an instance without stopping that instance.
     *
     * Generated from protobuf enum <code>REFRESHING = 163266343;</code>
     */
    const REFRESHING = 163266343;
    /**
     * The managed instance group is restarting this instance.
     *
     * Generated from protobuf enum <code>RESTARTING = 320534387;</code>
     */
    const RESTARTING = 320534387;
    /**
     * The managed instance group is resuming this instance.
     *
     * Generated from protobuf enum <code>RESUMING = 446856618;</code>
     */
    const RESUMING = 446856618;
    /**
     * The managed instance group is starting this instance.
     *
     * Generated from protobuf enum <code>STARTING = 488820800;</code>
     */
    const STARTING = 488820800;
    /**
     * The managed instance group is verifying this already created instance. Verification happens every time the instance is (re)created or restarted and consists of: 1. Waiting until health check specified as part of this managed instance group's autohealing policy reports HEALTHY. Note: Applies only if autohealing policy has a health check specified 2. Waiting for addition verification steps performed as post-instance creation (subject to future extensions).
     *
     * Generated from protobuf enum <code>VERIFYING = 16982185;</code>
     */
    const VERIFYING = 16982185;

    private static $valueToName = [
        self::UNDEFINED_CURRENT_ACTION => 'UNDEFINED_CURRENT_ACTION',
        self::ABANDONING => 'ABANDONING',
        self::CREATING => 'CREATING',
        self::CREATING_WITHOUT_RETRIES => 'CREATING_WITHOUT_RETRIES',
        self::DELETING => 'DELETING',
        self::NONE => 'NONE',
        self::RECREATING => 'RECREATING',
        self::REFRESHING => 'REFRESHING',
        self::RESTARTING => 'RESTARTING',
        self::RESUMING => 'RESUMING',
        self::STARTING => 'STARTING',
        self::VERIFYING => 'VERIFYING',
    ];

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


