# Interface PrimaryProductDataSourceOrBuilder (1.21.0)

1.21.0 (latest) 1.19.0 1.16.0 1.15.0 1.13.0 1.11.0 1.10.0 1.8.0 1.6.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0 0.26.0 0.24.0 0.23.0 0.20.0 0.19.0 0.18.0 0.16.0 0.15.0 0.14.0 0.13.0 0.12.0 0.11.0 0.10.0 0.9.0 0.8.0 0.7.0 0.5.0 0.4.0 0.3.0 0.2.0 0.1.0

    public interface PrimaryProductDataSourceOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getContentLanguage()

    public abstract String getContentLanguage()

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.

`
optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The contentLanguage. |

### getContentLanguageBytes()

    public abstract ByteString getContentLanguageBytes()

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.

`
optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for contentLanguage. |

### getCountries(int index)

    public abstract String getCountries(int index)

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).

`repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the element to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The countries at the given index. |

### getCountriesBytes(int index)

    public abstract ByteString getCountriesBytes(int index)

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).

`repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` The index of the value to return. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes of the countries at the given index. |

### getCountriesCount()

    public abstract int getCountriesCount()

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).

`repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The count of countries. |

### getCountriesList()

    public abstract List<String> getCountriesList()

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).

`repeated string countries = 6 [(.google.api.field_behavior) = OPTIONAL];`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.oracle.com/javase/8/docs/api/java/lang/String.html>` | A list containing the countries. |

### getDefaultRule()

    public abstract PrimaryProductDataSource.DefaultRule getDefaultRule()

Optional. Default rule management of the data source. If set, the linked
data sources will be replaced.

`
.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule` | The defaultRule. |

### getDefaultRuleOrBuilder()

    public abstract PrimaryProductDataSource.DefaultRuleOrBuilder getDefaultRuleOrBuilder()

Optional. Default rule management of the data source. If set, the linked
data sources will be replaced.

`
.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRuleOrBuilder` |   |

### getDestinations(int index)

    public abstract PrimaryProductDataSource.Destination getDestinations(int index)

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.

`
repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination` |   |

### getDestinationsCount()

    public abstract int getDestinationsCount()

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.

`
repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |   |

### getDestinationsList()

    public abstract List<PrimaryProductDataSource.Destination> getDestinationsList()

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.

`
repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination>` |   |

### getDestinationsOrBuilder(int index)

    public abstract PrimaryProductDataSource.DestinationOrBuilder getDestinationsOrBuilder(int index)

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.

`
repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `index` | `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/google-shopping-merchant-datasources/latest/com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder` |   |

### getDestinationsOrBuilderList()

    public abstract List<? extends PrimaryProductDataSource.DestinationOrBuilder> getDestinationsOrBuilderList()

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.

`
repeated .google.shopping.merchant.datasources.v1.PrimaryProductDataSource.Destination destinations = 10 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/util/List.html<? extends com.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DestinationOrBuilder>` |   |

### getFeedLabel()

    public abstract String getFeedLabel()

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.

`
optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/8/docs/api/java/lang/String.html` | The feedLabel. |

### getFeedLabelBytes()

    public abstract ByteString getFeedLabelBytes()

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.

`
optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.ByteString.html` | The bytes for feedLabel. |

### getLegacyLocal()

    public abstract boolean getLegacyLocal()

Optional. Immutable. Determines whether the products of this data source
are **only** targeting local destinations. Legacy local products are
prefixed with `local~` in the product resource ID. For example,
`accounts/123/products/local~en~US~sku123`.

`
bool legacy_local = 11 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The legacyLocal. |

### hasContentLanguage()

    public abstract boolean hasContentLanguage()

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.

`
optional string content_language = 5 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the contentLanguage field is set. |

### hasDefaultRule()

    public abstract boolean hasDefaultRule()

Optional. Default rule management of the data source. If set, the linked
data sources will be replaced.

`
.google.shopping.merchant.datasources.v1.PrimaryProductDataSource.DefaultRule default_rule = 7 [(.google.api.field_behavior) = OPTIONAL];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the defaultRule field is set. |

### hasFeedLabel()

    public abstract boolean hasFeedLabel()

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.

`
optional string feed_label = 4 [(.google.api.field_behavior) = OPTIONAL, (.google.api.field_behavior) = IMMUTABLE];
`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the feedLabel field is set. |