<?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 destination.
 *
 * Generated from protobuf message <code>google.cloud.datastream.v1.DestinationConfig</code>
 */
class DestinationConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Destination connection profile resource.
     * Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *
     * Generated from protobuf field <code>string destination_connection_profile = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = {</code>
     */
    private $destination_connection_profile = '';
    protected $destination_stream_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $destination_connection_profile
     *           Required. Destination connection profile resource.
     *           Format: `projects/{project}/locations/{location}/connectionProfiles/{name}`
     *     @type \Google\Cloud\Datastream\V1\GcsDestinationConfig $gcs_destination_config
     *           A configuration for how data should be loaded to Cloud Storage.
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig $bigquery_destination_config
     *           BigQuery destination configuration.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

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

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

        return $this;
    }

    /**
     * A configuration for how data should be loaded to Cloud Storage.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.GcsDestinationConfig gcs_destination_config = 100;</code>
     * @return \Google\Cloud\Datastream\V1\GcsDestinationConfig|null
     */
    public function getGcsDestinationConfig()
    {
        return $this->readOneof(100);
    }

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

    /**
     * A configuration for how data should be loaded to Cloud Storage.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.GcsDestinationConfig gcs_destination_config = 100;</code>
     * @param \Google\Cloud\Datastream\V1\GcsDestinationConfig $var
     * @return $this
     */
    public function setGcsDestinationConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\GcsDestinationConfig::class);
        $this->writeOneof(100, $var);

        return $this;
    }

    /**
     * BigQuery destination configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig bigquery_destination_config = 101;</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig|null
     */
    public function getBigqueryDestinationConfig()
    {
        return $this->readOneof(101);
    }

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

    /**
     * BigQuery destination configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig bigquery_destination_config = 101;</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig $var
     * @return $this
     */
    public function setBigqueryDestinationConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig::class);
        $this->writeOneof(101, $var);

        return $this;
    }

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

}

