# Google Shopping Merchant DataSources V1 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 Reference documentation and code samples for the Google Shopping Merchant DataSources V1 Client class DataSource.

The [data source](https://docs.cloud.google.com/merchant/api/guides/data-sources/overview) for
the Merchant Center account.

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

## Namespace

Google \\ Shopping \\ Merchant \\ DataSources \\ V1

## 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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.MerchantReviewDataSource` The [merchant review](https://support.google.com/merchants/answer/7045996) data source. |
| `↳ name` | `string` Required. Identifier. The name of the data source. Format: `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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.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/V1.MerchantReviewDataSource` |

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

### getName

Required. Identifier. The name of the data source.

Format:
`accounts/{account}/dataSources/{datasource}`

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

### setName

Required. Identifier. The name of the data source.

Format:
`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/V1.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/V1.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/V1.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/V1.FileInput` |

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

### getType

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