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

namespace Google\Cloud\Bigtable\V2;

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

/**
 * Specifies a particular change to be made to the contents of a row.
 *
 * Generated from protobuf message <code>google.bigtable.v2.Mutation</code>
 */
class Mutation extends \Google\Protobuf\Internal\Message
{
    protected $mutation;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Bigtable\V2\Mutation\SetCell $set_cell
     *           Set a cell's value.
     *     @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $delete_from_column
     *           Deletes cells from a column.
     *     @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $delete_from_family
     *           Deletes cells from a column family.
     *     @type \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $delete_from_row
     *           Deletes cells from the entire row.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\V2\Data::initOnce();
        parent::__construct($data);
    }

    /**
     * Set a cell's value.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.SetCell set_cell = 1;</code>
     * @return \Google\Cloud\Bigtable\V2\Mutation\SetCell|null
     */
    public function getSetCell()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Set a cell's value.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.SetCell set_cell = 1;</code>
     * @param \Google\Cloud\Bigtable\V2\Mutation\SetCell $var
     * @return $this
     */
    public function setSetCell($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\SetCell::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Deletes cells from a column.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2;</code>
     * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn|null
     */
    public function getDeleteFromColumn()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Deletes cells from a column.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromColumn delete_from_column = 2;</code>
     * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn $var
     * @return $this
     */
    public function setDeleteFromColumn($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromColumn::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Deletes cells from a column family.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3;</code>
     * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily|null
     */
    public function getDeleteFromFamily()
    {
        return $this->readOneof(3);
    }

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

    /**
     * Deletes cells from a column family.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromFamily delete_from_family = 3;</code>
     * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily $var
     * @return $this
     */
    public function setDeleteFromFamily($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromFamily::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Deletes cells from the entire row.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4;</code>
     * @return \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow|null
     */
    public function getDeleteFromRow()
    {
        return $this->readOneof(4);
    }

    public function hasDeleteFromRow()
    {
        return $this->hasOneof(4);
    }

    /**
     * Deletes cells from the entire row.
     *
     * Generated from protobuf field <code>.google.bigtable.v2.Mutation.DeleteFromRow delete_from_row = 4;</code>
     * @param \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow $var
     * @return $this
     */
    public function setDeleteFromRow($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\V2\Mutation\DeleteFromRow::class);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

