<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/retail/v2/export_config.proto

namespace Google\Cloud\Retail\V2;

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

/**
 * The output configuration setting.
 *
 * Generated from protobuf message <code>google.cloud.retail.v2.OutputConfig</code>
 */
class OutputConfig extends \Google\Protobuf\Internal\Message
{
    protected $destination;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $gcs_destination
     *           The Google Cloud Storage location where the output is to be written to.
     *     @type \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $bigquery_destination
     *           The BigQuery location where the output is to be written to.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Retail\V2\ExportConfig::initOnce();
        parent::__construct($data);
    }

    /**
     * The Google Cloud Storage location where the output is to be written to.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1;</code>
     * @return \Google\Cloud\Retail\V2\OutputConfig\GcsDestination|null
     */
    public function getGcsDestination()
    {
        return $this->readOneof(1);
    }

    public function hasGcsDestination()
    {
        return $this->hasOneof(1);
    }

    /**
     * The Google Cloud Storage location where the output is to be written to.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.OutputConfig.GcsDestination gcs_destination = 1;</code>
     * @param \Google\Cloud\Retail\V2\OutputConfig\GcsDestination $var
     * @return $this
     */
    public function setGcsDestination($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\GcsDestination::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * The BigQuery location where the output is to be written to.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2;</code>
     * @return \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination|null
     */
    public function getBigqueryDestination()
    {
        return $this->readOneof(2);
    }

    public function hasBigqueryDestination()
    {
        return $this->hasOneof(2);
    }

    /**
     * The BigQuery location where the output is to be written to.
     *
     * Generated from protobuf field <code>.google.cloud.retail.v2.OutputConfig.BigQueryDestination bigquery_destination = 2;</code>
     * @param \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination $var
     * @return $this
     */
    public function setBigqueryDestination($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Retail\V2\OutputConfig\BigQueryDestination::class);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

