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

namespace Google\Cloud\Bigtable\V2\ReadChangeStreamResponse;

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

/**
 * A partial or complete mutation.
 *
 * Generated from protobuf message <code>google.bigtable.v2.ReadChangeStreamResponse.MutationChunk</code>
 */
class MutationChunk extends \Google\Protobuf\Internal\Message
{
    /**
     * If set, then the mutation is a `SetCell` with a chunked value across
     * multiple messages.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1;</code>
     */
    protected $chunk_info = null;
    /**
     * If this is a continuation of a chunked message (`chunked_value_offset` >
     * 0), ignore all fields except the `SetCell`'s value and merge it with
     * the previous message by concatenating the value fields.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation mutation = 2;</code>
     */
    protected $mutation = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo $chunk_info
     *           If set, then the mutation is a `SetCell` with a chunked value across
     *           multiple messages.
     *     @type \Google\Cloud\Bigtable\V2\Mutation $mutation
     *           If this is a continuation of a chunked message (`chunked_value_offset` >
     *           0), ignore all fields except the `SetCell`'s value and merge it with
     *           the previous message by concatenating the value fields.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Bigtable::initOnce();
        parent::__construct($data);
    }

    /**
     * If set, then the mutation is a `SetCell` with a chunked value across
     * multiple messages.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo|null
     */
    public function getChunkInfo()
    {
        return $this->chunk_info;
    }

    public function hasChunkInfo()
    {
        return isset($this->chunk_info);
    }

    public function clearChunkInfo()
    {
        unset($this->chunk_info);
    }

    /**
     * If set, then the mutation is a `SetCell` with a chunked value across
     * multiple messages.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.ReadChangeStreamResponse.MutationChunk.ChunkInfo chunk_info = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo $var
     * @return $this
     */
    public function setChunkInfo($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse\MutationChunk\ChunkInfo::class);
        $this->chunk_info = $var;

        return $this;
    }

    /**
     * If this is a continuation of a chunked message (`chunked_value_offset` >
     * 0), ignore all fields except the `SetCell`'s value and merge it with
     * the previous message by concatenating the value fields.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation mutation = 2;</code>
     * @return \Google\Cloud\Bigtable\V2\Mutation|null
     */
    public function getMutation()
    {
        return $this->mutation;
    }

    public function hasMutation()
    {
        return isset($this->mutation);
    }

    public function clearMutation()
    {
        unset($this->mutation);
    }

    /**
     * If this is a continuation of a chunked message (`chunked_value_offset` >
     * 0), ignore all fields except the `SetCell`'s value and merge it with
     * the previous message by concatenating the value fields.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation mutation = 2;</code>
     * @param \Google\Cloud\Bigtable\V2\Mutation $var
     * @return $this
     */
    public function setMutation($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation::class);
        $this->mutation = $var;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(MutationChunk::class, \Google\Cloud\Bigtable\V2\ReadChangeStreamResponse_MutationChunk::class);

