<?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;

/**
 * Response message for Bigtable.ReadRows.
 *
 * Generated from protobuf message <code>google.bigtable.v2.ReadRowsResponse</code>
 */
class ReadRowsResponse extends \Google\Protobuf\Internal\Message
{
    /**
     * A collection of a row's contents as part of the read request.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1;</code>
     */
    private $chunks;
    /**
     * Optionally the server might return the row key of the last row it
     * has scanned.  The client can use this to construct a more
     * efficient retry request if needed: any row keys or portions of
     * ranges less than this row key can be dropped from the request.
     * This is primarily useful for cases where the server has read a
     * lot of data that was filtered out since the last committed row
     * key, allowing the client to skip that work on a retry.
     *
     * Generated from protobuf field <code>bytes last_scanned_row_key = 2;</code>
     */
    private $last_scanned_row_key = '';
    /**
     * If requested, provide enhanced query performance statistics. The semantics
     * dictate:
     *   * request_stats is empty on every (streamed) response, except
     *   * request_stats has non-empty information after all chunks have been
     *     streamed, where the ReadRowsResponse message only contains
     *     request_stats.
     *       * For example, if a read request would have returned an empty
     *         response instead a single ReadRowsResponse is streamed with empty
     *         chunks and request_stats filled.
     * Visually, response messages will stream as follows:
     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
     *   \______________________/  \________________________________/
     *       Primary response         Trailer of RequestStats info
     * Or if the read did not return any values:
     *   {chunks: [], request_stats: {...}}
     *   \________________________________/
     *      Trailer of RequestStats info
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RequestStats request_stats = 3;</code>
     */
    private $request_stats = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array<\Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk>|\Google\Protobuf\Internal\RepeatedField $chunks
     *           A collection of a row's contents as part of the read request.
     *     @type string $last_scanned_row_key
     *           Optionally the server might return the row key of the last row it
     *           has scanned.  The client can use this to construct a more
     *           efficient retry request if needed: any row keys or portions of
     *           ranges less than this row key can be dropped from the request.
     *           This is primarily useful for cases where the server has read a
     *           lot of data that was filtered out since the last committed row
     *           key, allowing the client to skip that work on a retry.
     *     @type \Google\Cloud\Bigtable\V2\RequestStats $request_stats
     *           If requested, provide enhanced query performance statistics. The semantics
     *           dictate:
     *             * request_stats is empty on every (streamed) response, except
     *             * request_stats has non-empty information after all chunks have been
     *               streamed, where the ReadRowsResponse message only contains
     *               request_stats.
     *                 * For example, if a read request would have returned an empty
     *                   response instead a single ReadRowsResponse is streamed with empty
     *                   chunks and request_stats filled.
     *           Visually, response messages will stream as follows:
     *              ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
     *             \______________________/  \________________________________/
     *                 Primary response         Trailer of RequestStats info
     *           Or if the read did not return any values:
     *             {chunks: [], request_stats: {...}}
     *             \________________________________/
     *                Trailer of RequestStats info
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce();
        parent::__construct($data);
    }

    /**
     * A collection of a row's contents as part of the read request.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getChunks()
    {
        return $this->chunks;
    }

    /**
     * A collection of a row's contents as part of the read request.
     *
     * Generated from protobuf field <code>repeated .google.bigtable.v2.ReadRowsResponse.CellChunk chunks = 1;</code>
     * @param array<\Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setChunks($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Bigtable\V2\ReadRowsResponse\CellChunk::class);
        $this->chunks = $arr;

        return $this;
    }

    /**
     * Optionally the server might return the row key of the last row it
     * has scanned.  The client can use this to construct a more
     * efficient retry request if needed: any row keys or portions of
     * ranges less than this row key can be dropped from the request.
     * This is primarily useful for cases where the server has read a
     * lot of data that was filtered out since the last committed row
     * key, allowing the client to skip that work on a retry.
     *
     * Generated from protobuf field <code>bytes last_scanned_row_key = 2;</code>
     * @return string
     */
    public function getLastScannedRowKey()
    {
        return $this->last_scanned_row_key;
    }

    /**
     * Optionally the server might return the row key of the last row it
     * has scanned.  The client can use this to construct a more
     * efficient retry request if needed: any row keys or portions of
     * ranges less than this row key can be dropped from the request.
     * This is primarily useful for cases where the server has read a
     * lot of data that was filtered out since the last committed row
     * key, allowing the client to skip that work on a retry.
     *
     * Generated from protobuf field <code>bytes last_scanned_row_key = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setLastScannedRowKey($var)
    {
        GPBUtil::checkString($var, False);
        $this->last_scanned_row_key = $var;

        return $this;
    }

    /**
     * If requested, provide enhanced query performance statistics. The semantics
     * dictate:
     *   * request_stats is empty on every (streamed) response, except
     *   * request_stats has non-empty information after all chunks have been
     *     streamed, where the ReadRowsResponse message only contains
     *     request_stats.
     *       * For example, if a read request would have returned an empty
     *         response instead a single ReadRowsResponse is streamed with empty
     *         chunks and request_stats filled.
     * Visually, response messages will stream as follows:
     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
     *   \______________________/  \________________________________/
     *       Primary response         Trailer of RequestStats info
     * Or if the read did not return any values:
     *   {chunks: [], request_stats: {...}}
     *   \________________________________/
     *      Trailer of RequestStats info
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RequestStats request_stats = 3;</code>
     * @return \Google\Cloud\Bigtable\V2\RequestStats|null
     */
    public function getRequestStats()
    {
        return $this->request_stats;
    }

    public function hasRequestStats()
    {
        return isset($this->request_stats);
    }

    public function clearRequestStats()
    {
        unset($this->request_stats);
    }

    /**
     * If requested, provide enhanced query performance statistics. The semantics
     * dictate:
     *   * request_stats is empty on every (streamed) response, except
     *   * request_stats has non-empty information after all chunks have been
     *     streamed, where the ReadRowsResponse message only contains
     *     request_stats.
     *       * For example, if a read request would have returned an empty
     *         response instead a single ReadRowsResponse is streamed with empty
     *         chunks and request_stats filled.
     * Visually, response messages will stream as follows:
     *    ... -> {chunks: [...]} -> {chunks: [], request_stats: {...}}
     *   \______________________/  \________________________________/
     *       Primary response         Trailer of RequestStats info
     * Or if the read did not return any values:
     *   {chunks: [], request_stats: {...}}
     *   \________________________________/
     *      Trailer of RequestStats info
     *
     * Generated from protobuf field <code>.google.bigtable.v2.RequestStats request_stats = 3;</code>
     * @param \Google\Cloud\Bigtable\V2\RequestStats $var
     * @return $this
     */
    public function setRequestStats($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\RequestStats::class);
        $this->request_stats = $var;

        return $this;
    }

}

