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

namespace Google\Cloud\Redis\Cluster\V1;

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

/**
 * Request for [UpdateCluster][CloudRedis.UpdateCluster].
 *
 * Generated from protobuf message <code>google.cloud.redis.cluster.v1.UpdateClusterRequest</code>
 */
class UpdateClusterRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Mask of fields to update. At least one path must be supplied in
     * this field. The elements of the repeated paths field may only include these
     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
     *  *   `size_gb`
     *  *   `replica_count`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $update_mask = null;
    /**
     * Required. Update description.
     * Only fields specified in update_mask are updated.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $cluster = null;
    /**
     * Idempotent request UUID.
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     */
    protected $request_id = '';

    /**
     * @param \Google\Cloud\Redis\Cluster\V1\Cluster $cluster    Required. Update description.
     *                                                           Only fields specified in update_mask are updated.
     * @param \Google\Protobuf\FieldMask             $updateMask Required. Mask of fields to update. At least one path must be supplied in
     *                                                           this field. The elements of the repeated paths field may only include these
     *                                                           fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
     *
     *                                                           *   `size_gb`
     *                                                           *   `replica_count`
     *
     * @return \Google\Cloud\Redis\Cluster\V1\UpdateClusterRequest
     *
     * @experimental
     */
    public static function build(\Google\Cloud\Redis\Cluster\V1\Cluster $cluster, \Google\Protobuf\FieldMask $updateMask): self
    {
        return (new self())
            ->setCluster($cluster)
            ->setUpdateMask($updateMask);
    }

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\FieldMask $update_mask
     *           Required. Mask of fields to update. At least one path must be supplied in
     *           this field. The elements of the repeated paths field may only include these
     *           fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
     *            *   `size_gb`
     *            *   `replica_count`
     *     @type \Google\Cloud\Redis\Cluster\V1\Cluster $cluster
     *           Required. Update description.
     *           Only fields specified in update_mask are updated.
     *     @type string $request_id
     *           Idempotent request UUID.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Redis\Cluster\V1\CloudRedisCluster::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Mask of fields to update. At least one path must be supplied in
     * this field. The elements of the repeated paths field may only include these
     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
     *  *   `size_gb`
     *  *   `replica_count`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Protobuf\FieldMask|null
     */
    public function getUpdateMask()
    {
        return $this->update_mask;
    }

    public function hasUpdateMask()
    {
        return isset($this->update_mask);
    }

    public function clearUpdateMask()
    {
        unset($this->update_mask);
    }

    /**
     * Required. Mask of fields to update. At least one path must be supplied in
     * this field. The elements of the repeated paths field may only include these
     * fields from [Cluster][google.cloud.redis.cluster.v1.Cluster]:
     *  *   `size_gb`
     *  *   `replica_count`
     *
     * Generated from protobuf field <code>.google.protobuf.FieldMask update_mask = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Protobuf\FieldMask $var
     * @return $this
     */
    public function setUpdateMask($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\FieldMask::class);
        $this->update_mask = $var;

        return $this;
    }

    /**
     * Required. Update description.
     * Only fields specified in update_mask are updated.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\Redis\Cluster\V1\Cluster|null
     */
    public function getCluster()
    {
        return $this->cluster;
    }

    public function hasCluster()
    {
        return isset($this->cluster);
    }

    public function clearCluster()
    {
        unset($this->cluster);
    }

    /**
     * Required. Update description.
     * Only fields specified in update_mask are updated.
     *
     * Generated from protobuf field <code>.google.cloud.redis.cluster.v1.Cluster cluster = 2 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\Redis\Cluster\V1\Cluster $var
     * @return $this
     */
    public function setCluster($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Redis\Cluster\V1\Cluster::class);
        $this->cluster = $var;

        return $this;
    }

    /**
     * Idempotent request UUID.
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     * @return string
     */
    public function getRequestId()
    {
        return $this->request_id;
    }

    /**
     * Idempotent request UUID.
     *
     * Generated from protobuf field <code>string request_id = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setRequestId($var)
    {
        GPBUtil::checkString($var, True);
        $this->request_id = $var;

        return $this;
    }

}

