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

/**
 * Generated from protobuf message <code>google.cloud.datastream.v1.BigQueryDestinationConfig</code>
 */
class BigQueryDestinationConfig extends \Google\Protobuf\Internal\Message
{
    /**
     * The guaranteed data freshness (in seconds) when querying tables created by
     * the stream. Editing this field will only affect new tables created in the
     * future, but existing tables will not be impacted. Lower values mean that
     * queries will return fresher data, but may result in higher cost.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration data_freshness = 300;</code>
     */
    private $data_freshness = null;
    protected $dataset_config;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SingleTargetDataset $single_target_dataset
     *           Single destination dataset.
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SourceHierarchyDatasets $source_hierarchy_datasets
     *           Source hierarchy datasets.
     *     @type \Google\Protobuf\Duration $data_freshness
     *           The guaranteed data freshness (in seconds) when querying tables created by
     *           the stream. Editing this field will only affect new tables created in the
     *           future, but existing tables will not be impacted. Lower values mean that
     *           queries will return fresher data, but may result in higher cost.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Datastream\V1\DatastreamResources::initOnce();
        parent::__construct($data);
    }

    /**
     * Single destination dataset.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset single_target_dataset = 201;</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SingleTargetDataset|null
     */
    public function getSingleTargetDataset()
    {
        return $this->readOneof(201);
    }

    public function hasSingleTargetDataset()
    {
        return $this->hasOneof(201);
    }

    /**
     * Single destination dataset.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.SingleTargetDataset single_target_dataset = 201;</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SingleTargetDataset $var
     * @return $this
     */
    public function setSingleTargetDataset($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SingleTargetDataset::class);
        $this->writeOneof(201, $var);

        return $this;
    }

    /**
     * Source hierarchy datasets.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets source_hierarchy_datasets = 202;</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SourceHierarchyDatasets|null
     */
    public function getSourceHierarchyDatasets()
    {
        return $this->readOneof(202);
    }

    public function hasSourceHierarchyDatasets()
    {
        return $this->hasOneof(202);
    }

    /**
     * Source hierarchy datasets.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.SourceHierarchyDatasets source_hierarchy_datasets = 202;</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SourceHierarchyDatasets $var
     * @return $this
     */
    public function setSourceHierarchyDatasets($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\SourceHierarchyDatasets::class);
        $this->writeOneof(202, $var);

        return $this;
    }

    /**
     * The guaranteed data freshness (in seconds) when querying tables created by
     * the stream. Editing this field will only affect new tables created in the
     * future, but existing tables will not be impacted. Lower values mean that
     * queries will return fresher data, but may result in higher cost.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration data_freshness = 300;</code>
     * @return \Google\Protobuf\Duration|null
     */
    public function getDataFreshness()
    {
        return $this->data_freshness;
    }

    public function hasDataFreshness()
    {
        return isset($this->data_freshness);
    }

    public function clearDataFreshness()
    {
        unset($this->data_freshness);
    }

    /**
     * The guaranteed data freshness (in seconds) when querying tables created by
     * the stream. Editing this field will only affect new tables created in the
     * future, but existing tables will not be impacted. Lower values mean that
     * queries will return fresher data, but may result in higher cost.
     *
     * Generated from protobuf field <code>.google.protobuf.Duration data_freshness = 300;</code>
     * @param \Google\Protobuf\Duration $var
     * @return $this
     */
    public function setDataFreshness($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Duration::class);
        $this->data_freshness = $var;

        return $this;
    }

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

}

