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

/**
 * BigQuery destination configuration
 *
 * 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>
     */
    protected $data_freshness = null;
    /**
     * Optional. Big Lake Managed Tables (BLMT) configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig blmt_config = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $blmt_config = null;
    protected $dataset_config;
    protected $write_mode;

    /**
     * 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.
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\BlmtConfig $blmt_config
     *           Optional. Big Lake Managed Tables (BLMT) configuration.
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\Merge $merge
     *           The standard mode
     *     @type \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\AppendOnly $append_only
     *           Append only mode
     * }
     */
    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;
    }

    /**
     * Optional. Big Lake Managed Tables (BLMT) configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig blmt_config = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\BlmtConfig|null
     */
    public function getBlmtConfig()
    {
        return $this->blmt_config;
    }

    public function hasBlmtConfig()
    {
        return isset($this->blmt_config);
    }

    public function clearBlmtConfig()
    {
        unset($this->blmt_config);
    }

    /**
     * Optional. Big Lake Managed Tables (BLMT) configuration.
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.BlmtConfig blmt_config = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\BlmtConfig $var
     * @return $this
     */
    public function setBlmtConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\BlmtConfig::class);
        $this->blmt_config = $var;

        return $this;
    }

    /**
     * The standard mode
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.Merge merge = 301;</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\Merge|null
     */
    public function getMerge()
    {
        return $this->readOneof(301);
    }

    public function hasMerge()
    {
        return $this->hasOneof(301);
    }

    /**
     * The standard mode
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.Merge merge = 301;</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\Merge $var
     * @return $this
     */
    public function setMerge($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\Merge::class);
        $this->writeOneof(301, $var);

        return $this;
    }

    /**
     * Append only mode
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly append_only = 302;</code>
     * @return \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\AppendOnly|null
     */
    public function getAppendOnly()
    {
        return $this->readOneof(302);
    }

    public function hasAppendOnly()
    {
        return $this->hasOneof(302);
    }

    /**
     * Append only mode
     *
     * Generated from protobuf field <code>.google.cloud.datastream.v1.BigQueryDestinationConfig.AppendOnly append_only = 302;</code>
     * @param \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\AppendOnly $var
     * @return $this
     */
    public function setAppendOnly($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Datastream\V1\BigQueryDestinationConfig\AppendOnly::class);
        $this->writeOneof(302, $var);

        return $this;
    }

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

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

}

