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

namespace Google\Cloud\Bigtable\V2;

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

/**
 * Request message for Bigtable.ReadModifyWriteRow.
 *
 * Generated from protobuf message <code>google.bigtable.v2.ReadModifyWriteRowRequest</code>
 */
class ReadModifyWriteRowRequest extends \Google\Protobuf\Internal\Message
{
    /**
     * The unique name of the table to which the read/modify/write rules should be
     * applied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>`.
     *
     * Generated from protobuf field <code>string table_name = 1;</code>
     */
    private $table_name = '';
    /**
     * This value specifies routing for replication. If not specified, the
     * "default" application profile will be used.
     *
     * Generated from protobuf field <code>string app_profile_id = 4;</code>
     */
    private $app_profile_id = '';
    /**
     * The key of the row to which the read/modify/write rules should be applied.
     *
     * Generated from protobuf field <code>bytes row_key = 2;</code>
     */
    private $row_key = '';
    /**
     * Rules specifying how the specified row's contents are to be transformed
     * into writes. Entries are applied in order, meaning that earlier rules will
     * affect the results of later ones.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3;</code>
     */
    private $rules;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $table_name
     *           The unique name of the table to which the read/modify/write rules should be
     *           applied.
     *           Values are of the form
     *           `projects/<project>/instances/<instance>/tables/<table>`.
     *     @type string $app_profile_id
     *           This value specifies routing for replication. If not specified, the
     *           "default" application profile will be used.
     *     @type string $row_key
     *           The key of the row to which the read/modify/write rules should be applied.
     *     @type \Google\Cloud\Bigtable\V2\ReadModifyWriteRule[]|\Google\Protobuf\Internal\RepeatedField $rules
     *           Rules specifying how the specified row's contents are to be transformed
     *           into writes. Entries are applied in order, meaning that earlier rules will
     *           affect the results of later ones.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce();
        parent::__construct($data);
    }

    /**
     * The unique name of the table to which the read/modify/write rules should be
     * applied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>`.
     *
     * Generated from protobuf field <code>string table_name = 1;</code>
     * @return string
     */
    public function getTableName()
    {
        return $this->table_name;
    }

    /**
     * The unique name of the table to which the read/modify/write rules should be
     * applied.
     * Values are of the form
     * `projects/<project>/instances/<instance>/tables/<table>`.
     *
     * Generated from protobuf field <code>string table_name = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setTableName($var)
    {
        GPBUtil::checkString($var, True);
        $this->table_name = $var;

        return $this;
    }

    /**
     * This value specifies routing for replication. If not specified, the
     * "default" application profile will be used.
     *
     * Generated from protobuf field <code>string app_profile_id = 4;</code>
     * @return string
     */
    public function getAppProfileId()
    {
        return $this->app_profile_id;
    }

    /**
     * This value specifies routing for replication. If not specified, the
     * "default" application profile will be used.
     *
     * Generated from protobuf field <code>string app_profile_id = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAppProfileId($var)
    {
        GPBUtil::checkString($var, True);
        $this->app_profile_id = $var;

        return $this;
    }

    /**
     * The key of the row to which the read/modify/write rules should be applied.
     *
     * Generated from protobuf field <code>bytes row_key = 2;</code>
     * @return string
     */
    public function getRowKey()
    {
        return $this->row_key;
    }

    /**
     * The key of the row to which the read/modify/write rules should be applied.
     *
     * Generated from protobuf field <code>bytes row_key = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setRowKey($var)
    {
        GPBUtil::checkString($var, False);
        $this->row_key = $var;

        return $this;
    }

    /**
     * Rules specifying how the specified row's contents are to be transformed
     * into writes. Entries are applied in order, meaning that earlier rules will
     * affect the results of later ones.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRules()
    {
        return $this->rules;
    }

    /**
     * Rules specifying how the specified row's contents are to be transformed
     * into writes. Entries are applied in order, meaning that earlier rules will
     * affect the results of later ones.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadModifyWriteRule rules = 3;</code>
     * @param \Google\Cloud\Bigtable\V2\ReadModifyWriteRule[]|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRules($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadModifyWriteRule::class);
        $this->rules = $arr;

        return $this;
    }

}

