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

namespace Google\Cloud\Compute\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 *
 * Generated from protobuf message <code>google.cloud.compute.v1.InstanceGroupManagerInstanceLifecyclePolicy</code>
 */
class InstanceGroupManagerInstanceLifecyclePolicy extends \Google\Protobuf\Internal\Message
{
    /**
     * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM.
     * Check the DefaultActionOnFailure enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string default_action_on_failure = 61383253;</code>
     */
    private $default_action_on_failure = null;
    /**
     * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
     * Check the ForceUpdateOnRepair enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string force_update_on_repair = 356302027;</code>
     */
    private $force_update_on_repair = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $default_action_on_failure
     *           The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM.
     *           Check the DefaultActionOnFailure enum for the list of possible values.
     *     @type string $force_update_on_repair
     *           A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
     *           Check the ForceUpdateOnRepair enum for the list of possible values.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Compute\V1\Compute::initOnce();
        parent::__construct($data);
    }

    /**
     * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM.
     * Check the DefaultActionOnFailure enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string default_action_on_failure = 61383253;</code>
     * @return string
     */
    public function getDefaultActionOnFailure()
    {
        return isset($this->default_action_on_failure) ? $this->default_action_on_failure : '';
    }

    public function hasDefaultActionOnFailure()
    {
        return isset($this->default_action_on_failure);
    }

    public function clearDefaultActionOnFailure()
    {
        unset($this->default_action_on_failure);
    }

    /**
     * The action that a MIG performs on a failed or an unhealthy VM. A VM is marked as unhealthy when the application running on that VM fails a health check. Valid values are - REPAIR (default): MIG automatically repairs a failed or an unhealthy VM by recreating it. For more information, see About repairing VMs in a MIG. - DO_NOTHING: MIG does not repair a failed or an unhealthy VM.
     * Check the DefaultActionOnFailure enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string default_action_on_failure = 61383253;</code>
     * @param string $var
     * @return $this
     */
    public function setDefaultActionOnFailure($var)
    {
        GPBUtil::checkString($var, True);
        $this->default_action_on_failure = $var;

        return $this;
    }

    /**
     * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
     * Check the ForceUpdateOnRepair enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string force_update_on_repair = 356302027;</code>
     * @return string
     */
    public function getForceUpdateOnRepair()
    {
        return isset($this->force_update_on_repair) ? $this->force_update_on_repair : '';
    }

    public function hasForceUpdateOnRepair()
    {
        return isset($this->force_update_on_repair);
    }

    public function clearForceUpdateOnRepair()
    {
        unset($this->force_update_on_repair);
    }

    /**
     * A bit indicating whether to forcefully apply the group's latest configuration when repairing a VM. Valid options are: - NO (default): If configuration updates are available, they are not forcefully applied during repair. Instead, configuration updates are applied according to the group's update policy. - YES: If configuration updates are available, they are applied during repair.
     * Check the ForceUpdateOnRepair enum for the list of possible values.
     *
     * Generated from protobuf field <code>optional string force_update_on_repair = 356302027;</code>
     * @param string $var
     * @return $this
     */
    public function setForceUpdateOnRepair($var)
    {
        GPBUtil::checkString($var, True);
        $this->force_update_on_repair = $var;

        return $this;
    }

}

