# Google Shopping Merchant DataSources V1beta Client - Class DataSource (2.0.0)

2.0.0 (latest) 1.3.1 1.2.1 1.1.1 1.0.0 0.6.0 0.5.1 0.4.0 0.3.1 0.2.3 0.1.0

> [!WARNING]
> **Beta**
>
>
> This library is covered by the [Pre-GA Offerings Terms](https://docs.cloud.google.com/terms/service-terms#1)
> of the Terms of Service. Pre-GA libraries might have limited support,
> and changes to pre-GA libraries might not be compatible with other pre-GA versions.
> For more information, see the
> [launch stage descriptions](https://docs.cloud.google.com/products#product-launch-stages).

Reference documentation and code samples for the Google Shopping Merchant DataSources V1beta Client class DataSource.

The [data source](https://support.google.com/merchants/answer/7439058) for
the Merchant Center account.

Generated from protobuf message `google.shopping.merchant.datasources.v1beta.DataSource`

## Namespace

Google \\ Shopping \\ Merchant \\ DataSources \\ V1beta

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ primary_product_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PrimaryProductDataSource` The [primary data source](https://support.google.com/merchants/answer/7439058) for local and online products. |
| `↳ supplemental_product_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.SupplementalProductDataSource` The [supplemental data source](https://support.google.com/merchants/answer/7439058) for local and online products. |
| `↳ local_inventory_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.LocalInventoryDataSource` The [local inventory](https://support.google.com/merchants/answer/7023001) data source. |
| `↳ regional_inventory_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.RegionalInventoryDataSource` The [regional inventory](https://support.google.com/merchants/answer/7439058) data source. |
| `↳ promotion_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PromotionDataSource` The [promotion](https://support.google.com/merchants/answer/2906014) data source. |
| `↳ product_review_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.ProductReviewDataSource` The [product review](https://support.google.com/merchants/answer/7045996) data source. |
| `↳ merchant_review_data_source` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.MerchantReviewDataSource` The [merchant review](https://support.google.com/merchants/answer/7045996) data source. |
| `↳ name` | `string` Identifier. The name of the data source. Format: `{datasource.name=accounts/{account}/dataSources/{datasource}}` |
| `↳ data_source_id` | `int|string` Output only. The data source id. |
| `↳ display_name` | `string` Required. The displayed data source name in the Merchant Center UI. |
| `↳ input` | `int` Output only. Determines the type of input to the data source. Based on the input some settings might not work. Only generic data sources can be created through the API. |
| `↳ file_input` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.FileInput` Optional. The field is used only when data is managed through a file. |

### getPrimaryProductDataSource

The [primary data
source](https://support.google.com/merchants/answer/7439058) for local
and online products.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PrimaryProductDataSource|null` |   |

### hasPrimaryProductDataSource

### setPrimaryProductDataSource

The [primary data
source](https://support.google.com/merchants/answer/7439058) for local
and online products.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PrimaryProductDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getSupplementalProductDataSource

The [supplemental data
source](https://support.google.com/merchants/answer/7439058) for local
and online products.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.SupplementalProductDataSource|null` |   |

### hasSupplementalProductDataSource

### setSupplementalProductDataSource

The [supplemental data
source](https://support.google.com/merchants/answer/7439058) for local
and online products.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.SupplementalProductDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getLocalInventoryDataSource

The [local
inventory](https://support.google.com/merchants/answer/7023001) data
source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.LocalInventoryDataSource|null` |   |

### hasLocalInventoryDataSource

### setLocalInventoryDataSource

The [local
inventory](https://support.google.com/merchants/answer/7023001) data
source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.LocalInventoryDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getRegionalInventoryDataSource

The [regional
inventory](https://support.google.com/merchants/answer/7439058) data
source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.RegionalInventoryDataSource|null` |   |

### hasRegionalInventoryDataSource

### setRegionalInventoryDataSource

The [regional
inventory](https://support.google.com/merchants/answer/7439058) data
source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.RegionalInventoryDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getPromotionDataSource

The [promotion](https://support.google.com/merchants/answer/2906014)
data source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PromotionDataSource|null` |   |

### hasPromotionDataSource

### setPromotionDataSource

The [promotion](https://support.google.com/merchants/answer/2906014)
data source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.PromotionDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getProductReviewDataSource

The [product
review](https://support.google.com/merchants/answer/7045996)
data source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.ProductReviewDataSource|null` |   |

### hasProductReviewDataSource

### setProductReviewDataSource

The [product
review](https://support.google.com/merchants/answer/7045996)
data source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.ProductReviewDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getMerchantReviewDataSource

The [merchant
review](https://support.google.com/merchants/answer/7045996)
data source.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.MerchantReviewDataSource|null` |   |

### hasMerchantReviewDataSource

### setMerchantReviewDataSource

The [merchant
review](https://support.google.com/merchants/answer/7045996)
data source.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.MerchantReviewDataSource` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getName

Identifier. The name of the data source.

Format:
`{datasource.name=accounts/{account}/dataSources/{datasource}}`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setName

Identifier. The name of the data source.

Format:
`{datasource.name=accounts/{account}/dataSources/{datasource}}`

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDataSourceId

Output only. The data source id.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int|string` |   |

### setDataSourceId

Output only. The data source id.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int|string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getDisplayName

Required. The displayed data source name in the Merchant Center UI.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |

### setDisplayName

Required. The displayed data source name in the Merchant Center UI.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `string` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getInput

Output only. Determines the type of input to the data source. Based on the
input some settings might not work. Only generic data sources can be
created through the API.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Input](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.DataSource.Input). |

### setInput

Output only. Determines the type of input to the data source. Based on the
input some settings might not work. Only generic data sources can be
created through the API.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Input](https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.DataSource.Input). |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getFileInput

Optional. The field is used only when data is managed through a file.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.FileInput|null` |   |

### hasFileInput

### clearFileInput

### setFileInput

Optional. The field is used only when data is managed through a file.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://docs.cloud.google.com/php/docs/reference/shopping-merchant-datasources/latest/V1beta.FileInput` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getType

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |