Reference documentation and code samples for the Google Shopping Merchant Products V1beta Client class Product.
The processed product, built from multiple product inputs after applying rules and supplemental data sources. This processed product matches what is shown in your Merchant Center account and in Shopping ads and other surfaces across Google. Each product is built from exactly one primary data source product input, and multiple supplemental data source inputs.
After inserting, updating, or deleting a product input, it may take several minutes before the updated processed product can be retrieved. All fields in the processed product and its sub-messages match the name of their corresponding attribute in the Product data specification with some exceptions.
Generated from protobuf message google.shopping.merchant.products.v1beta.Product
Namespace
Google \ Shopping \ Merchant \ Products \ V1betaMethods
__construct
Constructor.
Parameters | |
---|---|
Name | Description |
data |
array
Optional. Data for populating the Message object. |
↳ name |
string
The name of the product. Format: |
↳ channel |
int
Output only. The channel of the product. |
↳ offer_id |
string
Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the product data specification for details. |
↳ content_language |
string
Output only. The two-letter ISO 639-1 language code for the product. |
↳ feed_label |
string
Output only. The feed label for the product. |
↳ data_source |
string
Output only. The primary data source of the product. |
↳ version_number |
int|string
Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time. If set, the insertion is prevented when version number is lower than the current version number of the existing product. Re-insertion (for example, product refresh after 30 days) can be performed with the current |
↳ attributes |
Attributes
Output only. A list of product attributes. |
↳ custom_attributes |
array<Google\Shopping\Type\CustomAttribute>
Output only. A list of custom (merchant-provided) attributes. It can also be used to submit any attribute of the data specification in its generic form (for example, |
↳ product_status |
ProductStatus
Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously. |
getName
The name of the product.
Format:
"{product.name=accounts/{account}/products/{product}}"
where the last
section product
consists of 4 parts:
channel~content_language~feed_label~offer_id
example for product name is "accounts/123/products/online~en~US~sku123"
Returns | |
---|---|
Type | Description |
string |
setName
The name of the product.
Format:
"{product.name=accounts/{account}/products/{product}}"
where the last
section product
consists of 4 parts:
channel~content_language~feed_label~offer_id
example for product name is "accounts/123/products/online~en~US~sku123"
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getChannel
Output only. The channel of the product.
Returns | |
---|---|
Type | Description |
int |
setChannel
Output only. The channel of the product.
Parameter | |
---|---|
Name | Description |
var |
int
|
Returns | |
---|---|
Type | Description |
$this |
getOfferId
Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the product data specification for details.
Returns | |
---|---|
Type | Description |
string |
setOfferId
Output only. Your unique identifier for the product. This is the same for the product input and processed product. Leading and trailing whitespaces are stripped and multiple whitespaces are replaced by a single whitespace upon submission. See the product data specification for details.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getContentLanguage
Output only. The two-letter ISO 639-1 language code for the product.
Returns | |
---|---|
Type | Description |
string |
setContentLanguage
Output only. The two-letter ISO 639-1 language code for the product.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getFeedLabel
Output only. The feed label for the product.
Returns | |
---|---|
Type | Description |
string |
setFeedLabel
Output only. The feed label for the product.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getDataSource
Output only. The primary data source of the product.
Returns | |
---|---|
Type | Description |
string |
setDataSource
Output only. The primary data source of the product.
Parameter | |
---|---|
Name | Description |
var |
string
|
Returns | |
---|---|
Type | Description |
$this |
getVersionNumber
Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time.
If set, the insertion is prevented when version number is lower than
the current version number of the existing product. Re-insertion (for
example, product refresh after 30 days) can be performed with the current
version_number
.
Only supported for insertions into primary data sources.
If the operation is prevented, the aborted exception will be
thrown.
Returns | |
---|---|
Type | Description |
int|string |
hasVersionNumber
clearVersionNumber
setVersionNumber
Output only. Represents the existing version (freshness) of the product, which can be used to preserve the right order when multiple updates are done at the same time.
If set, the insertion is prevented when version number is lower than
the current version number of the existing product. Re-insertion (for
example, product refresh after 30 days) can be performed with the current
version_number
.
Only supported for insertions into primary data sources.
If the operation is prevented, the aborted exception will be
thrown.
Parameter | |
---|---|
Name | Description |
var |
int|string
|
Returns | |
---|---|
Type | Description |
$this |
getAttributes
Output only. A list of product attributes.
Returns | |
---|---|
Type | Description |
Attributes|null |
hasAttributes
clearAttributes
setAttributes
Output only. A list of product attributes.
Parameter | |
---|---|
Name | Description |
var |
Attributes
|
Returns | |
---|---|
Type | Description |
$this |
getCustomAttributes
Output only. A list of custom (merchant-provided) attributes. It can also
be used to submit any attribute of the data specification in its generic
form (for example,
{ "name": "size type", "value": "regular" }
).
This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.
Returns | |
---|---|
Type | Description |
Google\Protobuf\Internal\RepeatedField |
setCustomAttributes
Output only. A list of custom (merchant-provided) attributes. It can also
be used to submit any attribute of the data specification in its generic
form (for example,
{ "name": "size type", "value": "regular" }
).
This is useful for submitting attributes not explicitly exposed by the API, such as additional attributes used for Buy on Google.
Parameter | |
---|---|
Name | Description |
var |
array<Google\Shopping\Type\CustomAttribute>
|
Returns | |
---|---|
Type | Description |
$this |
getProductStatus
Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.
Returns | |
---|---|
Type | Description |
ProductStatus|null |
hasProductStatus
clearProductStatus
setProductStatus
Output only. The status of a product, data validation issues, that is, information about a product computed asynchronously.
Parameter | |
---|---|
Name | Description |
var |
ProductStatus
|
Returns | |
---|---|
Type | Description |
$this |