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

namespace Google\Cloud\Bigtable\Admin\V2\ModifyColumnFamiliesRequest;

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

/**
 * A create, update, or delete of a particular column family.
 *
 * Generated from protobuf message <code>google.bigtable.admin.v2.ModifyColumnFamiliesRequest.Modification</code>
 */
class Modification extends \Google\Protobuf\Internal\Message
{
    /**
     * The ID of the column family to be modified.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     */
    private $id = '';
    protected $mod;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           The ID of the column family to be modified.
     *     @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $create
     *           Create a new column family with the specified schema, or fail if
     *           one already exists with the given ID.
     *     @type \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $update
     *           Update an existing column family to the specified schema, or fail
     *           if no column family exists with the given ID.
     *     @type bool $drop
     *           Drop (delete) the column family with the given ID, or fail if no such
     *           family exists.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Bigtable\Admin\V2\BigtableTableAdmin::initOnce();
        parent::__construct($data);
    }

    /**
     * The ID of the column family to be modified.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * The ID of the column family to be modified.
     *
     * Generated from protobuf field <code>string id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Create a new column family with the specified schema, or fail if
     * one already exists with the given ID.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ColumnFamily create = 2;</code>
     * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily
     */
    public function getCreate()
    {
        return $this->readOneof(2);
    }

    /**
     * Create a new column family with the specified schema, or fail if
     * one already exists with the given ID.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ColumnFamily create = 2;</code>
     * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var
     * @return $this
     */
    public function setCreate($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * Update an existing column family to the specified schema, or fail
     * if no column family exists with the given ID.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ColumnFamily update = 3;</code>
     * @return \Google\Cloud\Bigtable\Admin\V2\ColumnFamily
     */
    public function getUpdate()
    {
        return $this->readOneof(3);
    }

    /**
     * Update an existing column family to the specified schema, or fail
     * if no column family exists with the given ID.
     *
     * Generated from protobuf field <code>.google.bigtable.admin.v2.ColumnFamily update = 3;</code>
     * @param \Google\Cloud\Bigtable\Admin\V2\ColumnFamily $var
     * @return $this
     */
    public function setUpdate($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Bigtable\Admin\V2\ColumnFamily::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Drop (delete) the column family with the given ID, or fail if no such
     * family exists.
     *
     * Generated from protobuf field <code>bool drop = 4;</code>
     * @return bool
     */
    public function getDrop()
    {
        return $this->readOneof(4);
    }

    /**
     * Drop (delete) the column family with the given ID, or fail if no such
     * family exists.
     *
     * Generated from protobuf field <code>bool drop = 4;</code>
     * @param bool $var
     * @return $this
     */
    public function setDrop($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(4, $var);

        return $this;
    }

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

}

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

