<?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;

/**
 * The configuration of the stream source.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.SourceConfig</code>
 */
class SourceConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Source connection profile resoource.
     * Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *
     * Generated from protobuf field <code>string source_connection_profile = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $source_connection_profile = '';
    protected $source_stream_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $source_connection_profile
     *           Required. Source connection profile resoource.
     *           Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *     @type \Google\Cloud\Datastream\V1\OracleSourceConfig $oracle_source_config
     *           Oracle data source configuration.
     *     @type \Google\Cloud\Datastream\V1\MysqlSourceConfig $mysql_source_config
     *           MySQL data source configuration.
     *     @type \Google\Cloud\Datastream\V1\PostgresqlSourceConfig $postgresql_source_config
     *           PostgreSQL data source configuration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. Source connection profile resoource.
     * Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *
     * Generated from protobuf field <code>string source_connection_profile = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @return string
     */
    public function getSourceConnectionProfile()
    {
        return $this->source_connection_profile;
    }

    /**
     * Required. Source connection profile resoource.
     * Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *
     * Generated from protobuf field <code>string source_connection_profile = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     * @param string $var
     * @return $this
     */
    public function setSourceConnectionProfile($var)
    {
        GPBUtil::checkString($var, True);
        $this->source_connection_profile = $var;

        return $this;
    }

    /**
     * Oracle data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.OracleSourceConfig oracle_source_config = 100;</code>
     * @return \Google\Cloud\Datastream\V1\OracleSourceConfig|null
     */
    public function getOracleSourceConfig()
    {
        return $this->readOneof(100);
    }

    public function hasOracleSourceConfig()
    {
        return $this->hasOneof(100);
    }

    /**
     * Oracle data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.OracleSourceConfig oracle_source_config = 100;</code>
     * @param \Google\Cloud\Datastream\V1\OracleSourceConfig $var
     * @return $this
     */
    public function setOracleSourceConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\OracleSourceConfig::class);
        $this->writeOneof(100, $var);

        return $this;
    }

    /**
     * MySQL data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlSourceConfig mysql_source_config = 101;</code>
     * @return \Google\Cloud\Datastream\V1\MysqlSourceConfig|null
     */
    public function getMysqlSourceConfig()
    {
        return $this->readOneof(101);
    }

    public function hasMysqlSourceConfig()
    {
        return $this->hasOneof(101);
    }

    /**
     * MySQL data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.MysqlSourceConfig mysql_source_config = 101;</code>
     * @param \Google\Cloud\Datastream\V1\MysqlSourceConfig $var
     * @return $this
     */
    public function setMysqlSourceConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\MysqlSourceConfig::class);
        $this->writeOneof(101, $var);

        return $this;
    }

    /**
     * PostgreSQL data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.PostgresqlSourceConfig postgresql_source_config = 102;</code>
     * @return \Google\Cloud\Datastream\V1\PostgresqlSourceConfig|null
     */
    public function getPostgresqlSourceConfig()
    {
        return $this->readOneof(102);
    }

    public function hasPostgresqlSourceConfig()
    {
        return $this->hasOneof(102);
    }

    /**
     * PostgreSQL data source configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.PostgresqlSourceConfig postgresql_source_config = 102;</code>
     * @param \Google\Cloud\Datastream\V1\PostgresqlSourceConfig $var
     * @return $this
     */
    public function setPostgresqlSourceConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\PostgresqlSourceConfig::class);
        $this->writeOneof(102, $var);

        return $this;
    }

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

}

