Google Shopping Merchant Products V1beta Client - Class ProductInput (0.6.1)

Reference documentation and code samples for the Google Shopping Merchant Products V1beta Client class ProductInput.

This resource represents input data you submit for a product, not the processed product that you see in Merchant Center, in Shopping ads, or across Google surfaces. Product inputs, rules and supplemental data source data are combined to create the processed Product . For more information, see Manage products .

Required product input attributes to pass data validation checks are primarily defined in the Products Data Specification . The following attributes are required: feedLabel , contentLanguage and offerId . After inserting, updating, or deleting a product input, it may take several minutes before the processed product can be retrieved. All fields in the product input and its sub-messages match the English name of their corresponding attribute in the Products Data Specification with some exceptions . The following reference documentation lists the field names in the camelCasecasing style while the Products Data Specification lists the names in the snake_casecasing style.

Generated from protobuf message google.shopping.merchant.products.v1beta.ProductInput

Namespace

Google \ Shopping \ Merchant \ Products \ V1beta

Methods

__construct

Constructor.

Parameters
Name
Description
data
array

Optional. Data for populating the Message object.

↳ name
string

Identifier. The name of the product input. Format: accounts/{account}/productInputs/{productinput} where the last section productinput consists of 4 parts: channel~content_language~feed_label~offer_id example for product input name is accounts/123/productInputs/online~en~US~sku123

↳ product
string

Output only. The name of the processed product. Format: accounts/{account}/products/{product}

↳ channel
int

Immutable. The channel of the product.

↳ offer_id
string

Required. Immutable. 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 products data specification for details.

↳ content_language
string

Required. Immutable. The two-letter ISO 639-1 language code for the product.

↳ feed_label
string

Required. Immutable. The label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are A-Z , 0-9 , hyphen, and underscore. The feed label must not include any spaces. For more information, see Using feed labels .

↳ version_number
int|string

Optional. Immutable. 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. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown.

↳ attributes
Attributes

Optional. A list of product attributes.

↳ custom_attributes
array< Google\Shopping\Type\CustomAttribute >

Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting 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. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion.

getName

Identifier. The name of the product input.

Format: accounts/{account}/productInputs/{productinput} where the last section productinput consists of 4 parts: channel~content_language~feed_label~offer_id example for product input name is accounts/123/productInputs/online~en~US~sku123

Returns
Type
Description
string

setName

Identifier. The name of the product input.

Format: accounts/{account}/productInputs/{productinput} where the last section productinput consists of 4 parts: channel~content_language~feed_label~offer_id example for product input name is accounts/123/productInputs/online~en~US~sku123

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getProduct

Output only. The name of the processed product.

Format: accounts/{account}/products/{product}

Returns
Type
Description
string

setProduct

Output only. The name of the processed product.

Format: accounts/{account}/products/{product}

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getChannel

Immutable. The channel of the product.

Returns
Type
Description
int

setChannel

Immutable. The channel of the product.

Parameter
Name
Description
var
int
Returns
Type
Description
$this

getOfferId

Required. Immutable. 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 products data specification for details.

Returns
Type
Description
string

setOfferId

Required. Immutable. 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 products data specification for details.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getContentLanguage

Required. Immutable. The two-letter ISO 639-1 language code for the product.

Returns
Type
Description
string

setContentLanguage

Required. Immutable. The two-letter ISO 639-1 language code for the product.

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getFeedLabel

Required. Immutable. The label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are A-Z , 0-9 , hyphen, and underscore. The feed label must not include any spaces. For more information, see Using feed labels .

Returns
Type
Description
string

setFeedLabel

Required. Immutable. The label that lets you categorize and identify your products. The maximum allowed characters are 20, and the supported characters are A-Z , 0-9 , hyphen, and underscore. The feed label must not include any spaces. For more information, see Using feed labels .

Parameter
Name
Description
var
string
Returns
Type
Description
$this

getVersionNumber

Optional. Immutable. 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. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown.

Returns
Type
Description
int|string

hasVersionNumber

clearVersionNumber

setVersionNumber

Optional. Immutable. 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. Do not set this field for updates. Do not set this field for insertions into supplemental data sources. If the operation is prevented, the aborted exception will be thrown.

Parameter
Name
Description
var
int|string
Returns
Type
Description
$this

getAttributes

Optional. A list of product attributes.

Returns
Type
Description
Attributes |null

hasAttributes

clearAttributes

setAttributes

Optional. A list of product attributes.

Parameter
Name
Description
Returns
Type
Description
$this

getCustomAttributes

Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting 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. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion.

Returns
Type
Description

setCustomAttributes

Optional. A list of custom (merchant-provided) attributes. It can also be used for submitting 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. Maximum allowed number of characters for each custom attribute is 10240 (represents sum of characters for name and value). Maximum 2500 custom attributes can be set per product, with total size of 102.4kB. Underscores in custom attribute names are replaced by spaces upon insertion.

Parameter
Name
Description
Returns
Type
Description
$this
Design a Mobile Site
View Site in Mobile | Classic
Share by: