Reference documentation and code samples for the Google Cloud Retail V2 Client class ProductLevelConfig.
Configures what level the product should be uploaded with regards to
how users will be send events and how predictions will be made.
Generated from protobuf message google.cloud.retail.v2.ProductLevelConfig
Namespace
Google \ Cloud \ Retail \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ ingestion_product_type
string
The type of Products allowed to be ingested into the catalog. Acceptable values are: * * primary (default): You can ingest Products of all types. When ingesting a Product, its type will default to Product.Type.PRIMARY if unset. * * variant (incompatible with Retail Search): You can only ingest Product.Type.VARIANTProducts. This means Product.primary_product_id cannot be empty. If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. If this field is variant and merchant_center_product_id_field is itemGroupId, an INVALID_ARGUMENT error is returned. See Product levels for more details.
↳ merchant_center_product_id_field
string
Which field of Merchant Center Product should be imported as Product.id. Acceptable values are: * * offerId (default): Import offerId as the product ID. * * itemGroupId: Import itemGroupId as the product ID. Notice that Retail API will choose one item from the ones with the same itemGroupId, and use it to represent the item group. If this field is set to an invalid value other than these, an INVALID_ARGUMENT error is returned. If this field is itemGroupId and ingestion_product_type is variant, an INVALID_ARGUMENT error is returned. See Product levels for more details.
getIngestionProductType
The type of Products allowed to be
ingested into the catalog. Acceptable values are:
primary (default): You can ingest
Products of all types. When
ingesting a Product, its type will
default to
Product.Type.PRIMARY if
unset.
variant (incompatible with Retail Search): You can only
ingest
Product.Type.VARIANTProducts. This means
Product.primary_product_id
cannot be empty.
If this field is set to an invalid value other than these, an
INVALID_ARGUMENT error is returned.
If this field is variant and
merchant_center_product_id_field
is itemGroupId, an INVALID_ARGUMENT error is returned.
See Product
levels
for more details.
Returns
Type
Description
string
setIngestionProductType
The type of Products allowed to be
ingested into the catalog. Acceptable values are:
primary (default): You can ingest
Products of all types. When
ingesting a Product, its type will
default to
Product.Type.PRIMARY if
unset.
variant (incompatible with Retail Search): You can only
ingest
Product.Type.VARIANTProducts. This means
Product.primary_product_id
cannot be empty.
If this field is set to an invalid value other than these, an
INVALID_ARGUMENT error is returned.
If this field is variant and
merchant_center_product_id_field
is itemGroupId, an INVALID_ARGUMENT error is returned.
See Product
levels
for more details.
offerId (default): Import offerId as the product ID.
itemGroupId: Import itemGroupId as the product ID. Notice that Retail
API will choose one item from the ones with the same itemGroupId, and
use it to represent the item group.
If this field is set to an invalid value other than these, an
INVALID_ARGUMENT error is returned.
If this field is itemGroupId and
ingestion_product_type
is variant, an INVALID_ARGUMENT error is returned.
See Product
levels
for more details.
offerId (default): Import offerId as the product ID.
itemGroupId: Import itemGroupId as the product ID. Notice that Retail
API will choose one item from the ones with the same itemGroupId, and
use it to represent the item group.
If this field is set to an invalid value other than these, an
INVALID_ARGUMENT error is returned.
If this field is itemGroupId and
ingestion_product_type
is variant, an INVALID_ARGUMENT error is returned.
See Product
levels
for more details.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-09 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class ProductLevelConfig (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.ProductLevelConfig)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.ProductLevelConfig)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.ProductLevelConfig)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.ProductLevelConfig)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.ProductLevelConfig)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.ProductLevelConfig)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.ProductLevelConfig)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.ProductLevelConfig)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.ProductLevelConfig)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.ProductLevelConfig)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.ProductLevelConfig)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.ProductLevelConfig)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.ProductLevelConfig) \nReference documentation and code samples for the Google Cloud Retail V2 Client class ProductLevelConfig.\n\nConfigures what level the product should be uploaded with regards to\nhow users will be send events and how predictions will be made.\n\nGenerated from protobuf message `google.cloud.retail.v2.ProductLevelConfig`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getIngestionProductType\n\nThe type of [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s allowed to be\ningested into the catalog. Acceptable values are:\n\n- `primary` (default): You can ingest\n [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s of all types. When\n ingesting a [Product](/php/docs/reference/cloud-retail/latest/V2.Product), its type will\n default to\n [Product.Type.PRIMARY](/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__PRIMARY) if\n unset.\n\n- `variant` (incompatible with Retail Search): You can only\n ingest\n [Product.Type.VARIANT](/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__VARIANT)\n [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s. This means\n [Product.primary_product_id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getPrimaryProductId__)\n cannot be empty.\n If this field is set to an invalid value other than these, an\n INVALID_ARGUMENT error is returned.\n If this field is `variant` and\n [merchant_center_product_id_field](/php/docs/reference/cloud-retail/latest/V2.ProductLevelConfig#_Google_Cloud_Retail_V2_ProductLevelConfig__getMerchantCenterProductIdField__)\n is `itemGroupId`, an INVALID_ARGUMENT error is returned.\n See [Product\n levels](https://cloud.google.com/retail/docs/catalog#product-levels)\n for more details.\n\n### setIngestionProductType\n\nThe type of [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s allowed to be\ningested into the catalog. Acceptable values are:\n\n- `primary` (default): You can ingest\n [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s of all types. When\n ingesting a [Product](/php/docs/reference/cloud-retail/latest/V2.Product), its type will\n default to\n [Product.Type.PRIMARY](/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__PRIMARY) if\n unset.\n\n- `variant` (incompatible with Retail Search): You can only\n ingest\n [Product.Type.VARIANT](/php/docs/reference/cloud-retail/latest/V2.Product.Type#_Google_Cloud_Retail_V2_Product_Type__VARIANT)\n [Product](/php/docs/reference/cloud-retail/latest/V2.Product)s. This means\n [Product.primary_product_id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getPrimaryProductId__)\n cannot be empty.\n If this field is set to an invalid value other than these, an\n INVALID_ARGUMENT error is returned.\n If this field is `variant` and\n [merchant_center_product_id_field](/php/docs/reference/cloud-retail/latest/V2.ProductLevelConfig#_Google_Cloud_Retail_V2_ProductLevelConfig__getMerchantCenterProductIdField__)\n is `itemGroupId`, an INVALID_ARGUMENT error is returned.\n See [Product\n levels](https://cloud.google.com/retail/docs/catalog#product-levels)\n for more details.\n\n### getMerchantCenterProductIdField\n\nWhich field of [Merchant Center\nProduct](/bigquery-transfer/docs/merchant-center-products-schema) should be\nimported as [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__). Acceptable\nvalues are:\n\n- `offerId` (default): Import `offerId` as the product ID.\n\n- `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail\n API will choose one item from the ones with the same `itemGroupId`, and\n use it to represent the item group.\n If this field is set to an invalid value other than these, an\n INVALID_ARGUMENT error is returned.\n If this field is `itemGroupId` and\n [ingestion_product_type](/php/docs/reference/cloud-retail/latest/V2.ProductLevelConfig#_Google_Cloud_Retail_V2_ProductLevelConfig__getIngestionProductType__)\n is `variant`, an INVALID_ARGUMENT error is returned.\n See [Product\n levels](https://cloud.google.com/retail/docs/catalog#product-levels)\n for more details.\n\n### setMerchantCenterProductIdField\n\nWhich field of [Merchant Center\nProduct](/bigquery-transfer/docs/merchant-center-products-schema) should be\nimported as [Product.id](/php/docs/reference/cloud-retail/latest/V2.Product#_Google_Cloud_Retail_V2_Product__getId__). Acceptable\nvalues are:\n\n- `offerId` (default): Import `offerId` as the product ID.\n\n- `itemGroupId`: Import `itemGroupId` as the product ID. Notice that Retail\n API will choose one item from the ones with the same `itemGroupId`, and\n use it to represent the item group.\n If this field is set to an invalid value other than these, an\n INVALID_ARGUMENT error is returned.\n If this field is `itemGroupId` and\n [ingestion_product_type](/php/docs/reference/cloud-retail/latest/V2.ProductLevelConfig#_Google_Cloud_Retail_V2_ProductLevelConfig__getIngestionProductType__)\n is `variant`, an INVALID_ARGUMENT error is returned.\n See [Product\n levels](https://cloud.google.com/retail/docs/catalog#product-levels)\n for more details."]]