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

/**
 * NOTE: This API is intended to be used by Apache Beam BigtableIO.
 * Response message for Bigtable.ReadChangeStream.
 *
 * Generated from protobuf message <code>google.bigtable.v2.ReadChangeStreamResponse</code>
 */
class ReadChangeStreamResponse extends \Google\Protobuf\Internal\Message
{
    protected $stream_record;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange $data_change
     *           A mutation to the partition.
     *     @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat $heartbeat
     *           A periodic heartbeat message.
     *     @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream $close_stream
     *           An indication that the stream should be closed.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce();
        parent::__construct($data);
    }

    /**
     * A mutation to the partition.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange|null
     */
    public function getDataChange()
    {
        return $this->readOneof(1);
    }

    public function hasDataChange()
    {
        return $this->hasOneof(1);
    }

    /**
     * A mutation to the partition.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.DataChange data_change = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange $var
     * @return $this
     */
    public function setDataChange($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\DataChange::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A periodic heartbeat message.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2;</code>
     * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat|null
     */
    public function getHeartbeat()
    {
        return $this->readOneof(2);
    }

    public function hasHeartbeat()
    {
        return $this->hasOneof(2);
    }

    /**
     * A periodic heartbeat message.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.Heartbeat heartbeat = 2;</code>
     * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat $var
     * @return $this
     */
    public function setHeartbeat($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\Heartbeat::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * An indication that the stream should be closed.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3;</code>
     * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream|null
     */
    public function getCloseStream()
    {
        return $this->readOneof(3);
    }

    public function hasCloseStream()
    {
        return $this->hasOneof(3);
    }

    /**
     * An indication that the stream should be closed.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.CloseStream close_stream = 3;</code>
     * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream $var
     * @return $this
     */
    public function setCloseStream($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\CloseStream::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getStreamRecord()
    {
        return $this->whichOneof("stream_record");
    }

}

