<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/shopping/merchant/datasources/v1beta/datasourcetypes.proto

namespace Google\Shopping\Merchant\DataSources\V1beta;

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

/**
 * Data source reference can be used to manage related data sources within the
 * data source service.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1beta.DataSourceReference</code>
 */
class DataSourceReference extends \Google\Protobuf\Internal\Message
{
    protected $data_source_id;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $self
     *           Self should be used to reference the primary data source itself.
     *     @type string $primary_data_source_name
     *           Optional. The name of the primary data source.
     *           Format:
     *           `accounts/{account}/dataSources/{datasource}`
     *     @type string $supplemental_data_source_name
     *           Optional. The name of the supplemental data source.
     *           Format:
     *           `accounts/{account}/dataSources/{datasource}`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Self should be used to reference the primary data source itself.
     *
     * Generated from protobuf field <code>bool self = 1;</code>
     * @return bool
     */
    public function getSelf()
    {
        return $this->readOneof(1);
    }

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

    /**
     * Self should be used to reference the primary data source itself.
     *
     * Generated from protobuf field <code>bool self = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setSelf($var)
    {
        GPBUtil::checkBool($var);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * Optional. The name of the primary data source.
     * Format:
     * `accounts/{account}/dataSources/{datasource}`
     *
     * Generated from protobuf field <code>string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getPrimaryDataSourceName()
    {
        return $this->readOneof(3);
    }

    public function hasPrimaryDataSourceName()
    {
        return $this->hasOneof(3);
    }

    /**
     * Optional. The name of the primary data source.
     * Format:
     * `accounts/{account}/dataSources/{datasource}`
     *
     * Generated from protobuf field <code>string primary_data_source_name = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setPrimaryDataSourceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Optional. The name of the supplemental data source.
     * Format:
     * `accounts/{account}/dataSources/{datasource}`
     *
     * Generated from protobuf field <code>string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getSupplementalDataSourceName()
    {
        return $this->readOneof(2);
    }

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

    /**
     * Optional. The name of the supplemental data source.
     * Format:
     * `accounts/{account}/dataSources/{datasource}`
     *
     * Generated from protobuf field <code>string supplemental_data_source_name = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setSupplementalDataSourceName($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(2, $var);

        return $this;
    }

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

}

