# Google Cloud Retail V2 Client - Class AddLocalInventoriesRequest (2.5.3)

2.5.3 (latest) 2.5.2 2.4.0 2.3.1 2.2.1 2.1.3 2.0.0 1.7.0 1.6.4 1.5.0 1.4.2 1.3.1 1.2.1 1.1.1 1.0.1 Reference documentation and code samples for the Google Cloud Retail V2 Client class AddLocalInventoriesRequest.

Request message for
[ProductService.AddLocalInventories](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Client.ProductServiceClient#_Google_Cloud_Retail_V2_Client_ProductServiceClient__addLocalInventories__)
method.

Generated from protobuf message `google.cloud.retail.v2.AddLocalInventoriesRequest`

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `data` | `mixed` |

### getProduct

Required. Full resource name of [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product),
such as
`projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.

If the caller does not have permission to access the
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product), regardless of whether or not it
exists, a PERMISSION_DENIED error is returned.

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

### setProduct

Required. Full resource name of [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product),
such as
`projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`.

If the caller does not have permission to access the
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product), regardless of whether or not it
exists, a PERMISSION_DENIED error is returned.

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

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

### getLocalInventories

Required. A list of inventory information at difference places. Each place
is identified by its place ID. At most 3000 inventories are allowed per
request.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/RepeatedField<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.LocalInventory>` |   |

### setLocalInventories

Required. A list of inventory information at difference places. Each place
is identified by its place ID. At most 3000 inventories are allowed per
request.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `array<https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.LocalInventory>` |

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

### getAddMask

Indicates which inventory fields in the provided list of
[LocalInventory](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.LocalInventory) to update. The
field is updated to the provided value.

If a field is set while the place does not have a previous local inventory,
the local inventory at that store is created.
If a field is set while the value of that field is not provided, the
original field value, if it exists, is deleted.
If the mask is not set or set with empty paths, all inventory fields will
be updated.
If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
is returned and the entire update will be ignored.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/FieldMask|null` |   |

### hasAddMask

### clearAddMask

### setAddMask

Indicates which inventory fields in the provided list of
[LocalInventory](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.LocalInventory) to update. The
field is updated to the provided value.

If a field is set while the place does not have a previous local inventory,
the local inventory at that store is created.
If a field is set while the value of that field is not provided, the
original field value, if it exists, is deleted.
If the mask is not set or set with empty paths, all inventory fields will
be updated.
If an unsupported or unknown field is provided, an INVALID_ARGUMENT error
is returned and the entire update will be ignored.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/FieldMask` |

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

### getAddTime

The time when the inventory updates are issued. Used to prevent
out-of-order updates on local inventory fields. If not provided, the
internal system time will be used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp|null` |   |

### hasAddTime

### clearAddTime

### setAddTime

The time when the inventory updates are issued. Used to prevent
out-of-order updates on local inventory fields. If not provided, the
internal system time will be used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `https://protobuf.dev/reference/php/api-docs/Google/Protobuf/Timestamp` |

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

### getAllowMissing

If set to true, and the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is not
found, the local inventory will still be processed and retained for at most
1 day and processed once the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is
created. If set to false, a NOT_FOUND error is returned if the
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is not found.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setAllowMissing

If set to true, and the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is not
found, the local inventory will still be processed and retained for at most
1 day and processed once the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is
created. If set to false, a NOT_FOUND error is returned if the
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) is not found.

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

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

### static::build

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `product` | `string` Required. Full resource name of [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product), such as `projects/*/locations/global/catalogs/default_catalog/branches/default_branch/products/some_product_id`. If the caller does not have permission to access the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product), regardless of whether or not it exists, a PERMISSION_DENIED error is returned. Please see ProductServiceClient::productName() for help formatting this field. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.AddLocalInventoriesRequest` |   |