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

/**
 * The primary data source for local and online products.
 *
 * Generated from protobuf message <code>google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource</code>
 */
class PrimaryProductDataSource extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Immutable. Specifies the type of data source channel.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $channel = 0;
    /**
     * Optional. Immutable. The feed label that is specified on the data source
     * level.
     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
     * and dashes (-).
     * See also [migration to feed
     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
     * `feedLabel` and `contentLanguage` must be either both set or unset for data
     * sources with product content type.
     * They must be set for data sources with a file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $feed_label = null;
    /**
     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
     * data source.
     * `feedLabel` and `contentLanguage` must be either both set or unset.
     * The fields can only be unset for data sources without file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     */
    protected $content_language = null;
    /**
     * Optional. The countries where the items may be displayed. Represented as a
     * [CLDR territory
     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $countries;
    /**
     * Optional. Default rule management of the data source. If set, the linked
     * data sources will be replaced.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    protected $default_rule = null;
    /**
     * Optional. A list of destinations describing where products of the data
     * source can be shown.
     * When retrieving the data source, the list contains all the destinations
     * that can be used for the data source, including the ones that are disabled
     * for the data source but enabled for the account.
     * Only destinations that are enabled on the account, for example through
     * program participation, can be enabled on the data source.
     * If unset, during creation, the destinations will be inherited based on the
     * account level program participation.
     * If set, during creation or update, the data source will be set only for the
     * specified destinations.
     * Updating this field requires at least one destination.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $destinations;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $channel
     *           Optional. Immutable. Specifies the type of data source channel.
     *     @type string $feed_label
     *           Optional. Immutable. The feed label that is specified on the data source
     *           level.
     *           Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
     *           and dashes (-).
     *           See also [migration to feed
     *           labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
     *           `feedLabel` and `contentLanguage` must be either both set or unset for data
     *           sources with product content type.
     *           They must be set for data sources with a file input.
     *           If set, the data source will only accept products matching this
     *           combination. If unset, the data source will accept products without that
     *           restriction.
     *     @type string $content_language
     *           Optional. Immutable. The two-letter ISO 639-1 language of the items in the
     *           data source.
     *           `feedLabel` and `contentLanguage` must be either both set or unset.
     *           The fields can only be unset for data sources without file input.
     *           If set, the data source will only accept products matching this
     *           combination. If unset, the data source will accept products without that
     *           restriction.
     *     @type string[] $countries
     *           Optional. The countries where the items may be displayed. Represented as a
     *           [CLDR territory
     *           code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
     *     @type \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\DefaultRule $default_rule
     *           Optional. Default rule management of the data source. If set, the linked
     *           data sources will be replaced.
     *     @type \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\Destination[] $destinations
     *           Optional. A list of destinations describing where products of the data
     *           source can be shown.
     *           When retrieving the data source, the list contains all the destinations
     *           that can be used for the data source, including the ones that are disabled
     *           for the data source but enabled for the account.
     *           Only destinations that are enabled on the account, for example through
     *           program participation, can be enabled on the data source.
     *           If unset, during creation, the destinations will be inherited based on the
     *           account level program participation.
     *           If set, during creation or update, the data source will be set only for the
     *           specified destinations.
     *           Updating this field requires at least one destination.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Shopping\Merchant\Datasources\V1Beta\Datasourcetypes::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Immutable. Specifies the type of data source channel.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return int
     */
    public function getChannel()
    {
        return $this->channel;
    }

    /**
     * Optional. Immutable. Specifies the type of data source channel.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Channel channel = 3 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param int $var
     * @return $this
     */
    public function setChannel($var)
    {
        GPBUtil::checkEnum($var, \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\Channel::class);
        $this->channel = $var;

        return $this;
    }

    /**
     * Optional. Immutable. The feed label that is specified on the data source
     * level.
     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
     * and dashes (-).
     * See also [migration to feed
     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
     * `feedLabel` and `contentLanguage` must be either both set or unset for data
     * sources with product content type.
     * They must be set for data sources with a file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getFeedLabel()
    {
        return isset($this->feed_label) ? $this->feed_label : '';
    }

    public function hasFeedLabel()
    {
        return isset($this->feed_label);
    }

    public function clearFeedLabel()
    {
        unset($this->feed_label);
    }

    /**
     * Optional. Immutable. The feed label that is specified on the data source
     * level.
     * Must be less than or equal to 20 uppercase letters (A-Z), numbers (0-9),
     * and dashes (-).
     * See also [migration to feed
     * labels](https://developers.google.com/shopping-content/guides/products/feed-labels).
     * `feedLabel` and `contentLanguage` must be either both set or unset for data
     * sources with product content type.
     * They must be set for data sources with a file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setFeedLabel($var)
    {
        GPBUtil::checkString($var, True);
        $this->feed_label = $var;

        return $this;
    }

    /**
     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
     * data source.
     * `feedLabel` and `contentLanguage` must be either both set or unset.
     * The fields can only be unset for data sources without file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @return string
     */
    public function getContentLanguage()
    {
        return isset($this->content_language) ? $this->content_language : '';
    }

    public function hasContentLanguage()
    {
        return isset($this->content_language);
    }

    public function clearContentLanguage()
    {
        unset($this->content_language);
    }

    /**
     * Optional. Immutable. The two-letter ISO 639-1 language of the items in the
     * data source.
     * `feedLabel` and `contentLanguage` must be either both set or unset.
     * The fields can only be unset for data sources without file input.
     * If set, the data source will only accept products matching this
     * combination. If unset, the data source will accept products without that
     * restriction.
     *
     * Generated from protobuf field <code>optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];</code>
     * @param string $var
     * @return $this
     */
    public function setContentLanguage($var)
    {
        GPBUtil::checkString($var, True);
        $this->content_language = $var;

        return $this;
    }

    /**
     * Optional. The countries where the items may be displayed. Represented as a
     * [CLDR territory
     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<string>
     */
    public function getCountries()
    {
        return $this->countries;
    }

    /**
     * Optional. The countries where the items may be displayed. Represented as a
     * [CLDR territory
     * code](https://github.com/unicode-org/cldr/blob/latest/common/main/en.xml).
     *
     * Generated from protobuf field <code>repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string[] $var
     * @return $this
     */
    public function setCountries($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->countries = $arr;

        return $this;
    }

    /**
     * Optional. Default rule management of the data source. If set, the linked
     * data sources will be replaced.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\DefaultRule|null
     */
    public function getDefaultRule()
    {
        return $this->default_rule;
    }

    public function hasDefaultRule()
    {
        return isset($this->default_rule);
    }

    public function clearDefaultRule()
    {
        unset($this->default_rule);
    }

    /**
     * Optional. Default rule management of the data source. If set, the linked
     * data sources will be replaced.
     *
     * Generated from protobuf field <code>.google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\DefaultRule $var
     * @return $this
     */
    public function setDefaultRule($var)
    {
        GPBUtil::checkMessage($var, \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\DefaultRule::class);
        $this->default_rule = $var;

        return $this;
    }

    /**
     * Optional. A list of destinations describing where products of the data
     * source can be shown.
     * When retrieving the data source, the list contains all the destinations
     * that can be used for the data source, including the ones that are disabled
     * for the data source but enabled for the account.
     * Only destinations that are enabled on the account, for example through
     * program participation, can be enabled on the data source.
     * If unset, during creation, the destinations will be inherited based on the
     * account level program participation.
     * If set, during creation or update, the data source will be set only for the
     * specified destinations.
     * Updating this field requires at least one destination.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return RepeatedField<\Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\Destination>
     */
    public function getDestinations()
    {
        return $this->destinations;
    }

    /**
     * Optional. A list of destinations describing where products of the data
     * source can be shown.
     * When retrieving the data source, the list contains all the destinations
     * that can be used for the data source, including the ones that are disabled
     * for the data source but enabled for the account.
     * Only destinations that are enabled on the account, for example through
     * program participation, can be enabled on the data source.
     * If unset, during creation, the destinations will be inherited based on the
     * account level program participation.
     * If set, during creation or update, the data source will be set only for the
     * specified destinations.
     * Updating this field requires at least one destination.
     *
     * Generated from protobuf field <code>repeated .google.shopping.merchant.datasources.v1beta.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\Destination[] $var
     * @return $this
     */
    public function setDestinations($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Shopping\Merchant\DataSources\V1beta\PrimaryProductDataSource\Destination::class);
        $this->destinations = $arr;

        return $this;
    }

}

