# Google Cloud Retail V2 Client - Class DeleteProductRequest (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 DeleteProductRequest.

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

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

## Namespace

Google \\ Cloud \\ Retail \\ V2

## Methods

### __construct

Constructor.

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

### getName

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 delete 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.
If the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete does not exist,
a NOT_FOUND error is returned.
The [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete can neither be a
[Product.Type.COLLECTION](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__COLLECTION)
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) member nor a
[Product.Type.PRIMARY](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__PRIMARY)
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) with more than one
[variants](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__VARIANT). Otherwise, an
INVALID_ARGUMENT error is returned.
All inventory information for the named
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) will be deleted.

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

### setName

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 delete 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.
If the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete does not exist,
a NOT_FOUND error is returned.
The [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete can neither be a
[Product.Type.COLLECTION](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__COLLECTION)
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) member nor a
[Product.Type.PRIMARY](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__PRIMARY)
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) with more than one
[variants](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__VARIANT). Otherwise, an
INVALID_ARGUMENT error is returned.
All inventory information for the named
[Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) will be deleted.

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

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

### static::build

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `name` | `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 delete 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. If the [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete does not exist, a NOT_FOUND error is returned. The [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) to delete can neither be a [Product.Type.COLLECTION](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__COLLECTION) [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) member nor a [Product.Type.PRIMARY](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__PRIMARY) [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) with more than one [variants](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__VARIANT). Otherwise, an INVALID_ARGUMENT error is returned. All inventory information for the named [Product](https://docs.cloud.google.com/php/docs/reference/cloud-retail/latest/V2.Product) will be deleted. Please see ProductServiceClient::productName() for help formatting this field. |

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