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

namespace Google\Cloud\Memcache\V1beta2;

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

/**
 * Request for [ApplySoftwareUpdate][google.cloud.memcache.v1beta2.CloudMemcache.ApplySoftwareUpdate].
 *
 * Generated from protobuf message <code>google.cloud.memcache.v1beta2.ApplySoftwareUpdateRequest</code>
 */
class ApplySoftwareUpdateRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Resource name of the Memcached instance for which software update should be
     * applied.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $instance = '';
    /**
     * Nodes to which we should apply the update to. Note all the selected nodes
     * are updated in parallel.
     *
     * Generated from protobuf field <code>repeated string node_ids = 2;</code>
     */
    private $node_ids;
    /**
     * Whether to apply the update to all nodes. If set to
     * true, will explicitly restrict users from specifying any nodes, and apply
     * software update to all nodes (where applicable) within the instance.
     *
     * Generated from protobuf field <code>bool apply_all = 3;</code>
     */
    private $apply_all = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $instance
     *           Required. Resource name of the Memcached instance for which software update should be
     *           applied.
     *     @type string[]|\Google\Protobuf\Internal\RepeatedField $node_ids
     *           Nodes to which we should apply the update to. Note all the selected nodes
     *           are updated in parallel.
     *     @type bool $apply_all
     *           Whether to apply the update to all nodes. If set to
     *           true, will explicitly restrict users from specifying any nodes, and apply
     *           software update to all nodes (where applicable) within the instance.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Memcache\V1Beta2\CloudMemcache::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Resource name of the Memcached instance for which software update should be
     * applied.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getInstance()
    {
        return $this->instance;
    }

    /**
     * Required. Resource name of the Memcached instance for which software update should be
     * applied.
     *
     * Generated from protobuf field <code>string instance = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setInstance($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance = $var;

        return $this;
    }

    /**
     * Nodes to which we should apply the update to. Note all the selected nodes
     * are updated in parallel.
     *
     * Generated from protobuf field <code>repeated string node_ids = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getNodeIds()
    {
        return $this->node_ids;
    }

    /**
     * Nodes to which we should apply the update to. Note all the selected nodes
     * are updated in parallel.
     *
     * Generated from protobuf field <code>repeated string node_ids = 2;</code>
     * @param string[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setNodeIds($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->node_ids = $arr;

        return $this;
    }

    /**
     * Whether to apply the update to all nodes. If set to
     * true, will explicitly restrict users from specifying any nodes, and apply
     * software update to all nodes (where applicable) within the instance.
     *
     * Generated from protobuf field <code>bool apply_all = 3;</code>
     * @return bool
     */
    public function getApplyAll()
    {
        return $this->apply_all;
    }

    /**
     * Whether to apply the update to all nodes. If set to
     * true, will explicitly restrict users from specifying any nodes, and apply
     * software update to all nodes (where applicable) within the instance.
     *
     * Generated from protobuf field <code>bool apply_all = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setApplyAll($var)
    {
        GPBUtil::checkBool($var);
        $this->apply_all = $var;

        return $this;
    }

}

