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

namespace Google\Cloud\DataCatalog\V1;

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

/**
 * Specification for the BigQuery connection to a Cloud SQL instance.
 *
 * Generated from protobuf message <code>google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec</code>
 */
class CloudSqlBigQueryConnectionSpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Cloud SQL instance ID in the format of `project:location:instance`.
     *
     * Generated from protobuf field <code>string instance_id = 1;</code>
     */
    private $instance_id = '';
    /**
     * Database name.
     *
     * Generated from protobuf field <code>string database = 2;</code>
     */
    private $database = '';
    /**
     * Type of the Cloud SQL database.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType type = 3;</code>
     */
    private $type = 0;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $instance_id
     *           Cloud SQL instance ID in the format of `project:location:instance`.
     *     @type string $database
     *           Database name.
     *     @type int $type
     *           Type of the Cloud SQL database.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datacatalog\V1\Bigquery::initOnce();
        parent::__construct($data);
    }

    /**
     * Cloud SQL instance ID in the format of `project:location:instance`.
     *
     * Generated from protobuf field <code>string instance_id = 1;</code>
     * @return string
     */
    public function getInstanceId()
    {
        return $this->instance_id;
    }

    /**
     * Cloud SQL instance ID in the format of `project:location:instance`.
     *
     * Generated from protobuf field <code>string instance_id = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setInstanceId($var)
    {
        GPBUtil::checkString($var, True);
        $this->instance_id = $var;

        return $this;
    }

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

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

        return $this;
    }

    /**
     * Type of the Cloud SQL database.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType type = 3;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * Type of the Cloud SQL database.
     *
     * Generated from protobuf field <code>.google.cloud.datacatalog.v1.CloudSqlBigQueryConnectionSpec.DatabaseType type = 3;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\DataCatalog\V1\CloudSqlBigQueryConnectionSpec\DatabaseType::class);
        $this->type = $var;

        return $this;
    }

}

