<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/datastream/v1/datastream_resources.proto

namespace Google\Cloud\Datastream\V1;

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

/**
 * MySQL database.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.MysqlDatabase</code>
 */
class MysqlDatabase extends \Google\Protobuf\Internal\Message
{
    /**
     * Database name.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     */
    private $database = '';
    /**
     * Tables in the database.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.MysqlTable mysql_tables = 2;</code>
     */
    private $mysql_tables;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $database
     *           Database name.
     *     @type array<\Google\Cloud\Datastream\V1\MysqlTable>|\Google\Protobuf\Internal\RepeatedField $mysql_tables
     *           Tables in the database.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Database name.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     * @return string
     */
    public function getDatabase()
    {
        return $this->database;
    }

    /**
     * Database name.
     *
     * Generated from protobuf field <code>string database = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setDatabase($var)
    {
        GPBUtil::checkString($var, True);
        $this->database = $var;

        return $this;
    }

    /**
     * Tables in the database.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.MysqlTable mysql_tables = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMysqlTables()
    {
        return $this->mysql_tables;
    }

    /**
     * Tables in the database.
     *
     * Generated from protobuf field <code>repeated .google.cloud.datastream.v1.MysqlTable mysql_tables = 2;</code>
     * @param array<\Google\Cloud\Datastream\V1\MysqlTable>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMysqlTables($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Datastream\V1\MysqlTable::class);
        $this->mysql_tables = $arr;

        return $this;
    }

}

