Create
|
|||||
|
|
Creates and returns a new product resource.
Possible errors:
- Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 characters.
- Returns INVALID_ARGUMENT if description is longer than 4096 characters.
- Returns INVALID_ARGUMENT if product_category is missing or invalid
Authorization
To use this building block you will have to grant access to at least one of the following scopes:
- View and manage your data across Google Cloud Platform services
- Apply machine learning models to understand and label images
Input
This building block consumes 9 input parameters
Name | Format | Description |
---|---|---|
parent Required |
STRING |
The project in which the Product should be created. Format is
|
productId |
STRING |
A user-supplied resource id for this Product. If set, the server will
attempt to use this value as the resource id. If it is already in use, an
error is returned with code ALREADY_EXISTS. Must be at most 128 characters
long. It cannot contain the character |
name |
STRING |
The resource name of the product. Format is:
This field is ignored when creating a product |
displayName |
STRING |
The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long |
description |
STRING |
User-provided metadata to be stored with this product. Must be at most 4096 characters long |
productCategory |
STRING |
The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. This field is immutable |
productLabels[] |
OBJECT |
A product label represented as a key-value pair |
productLabels[].value |
STRING |
The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
productLabels[].key |
STRING |
The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
= Parameter name
= Format
parent STRING Required The project in which the Product should be created. Format is
|
productId STRING A user-supplied resource id for this Product. If set, the server will
attempt to use this value as the resource id. If it is already in use, an
error is returned with code ALREADY_EXISTS. Must be at most 128 characters
long. It cannot contain the character |
name STRING The resource name of the product. Format is:
This field is ignored when creating a product |
displayName STRING The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long |
description STRING User-provided metadata to be stored with this product. Must be at most 4096 characters long |
productCategory STRING The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. This field is immutable |
productLabels[] OBJECT A product label represented as a key-value pair |
productLabels[].value STRING The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
productLabels[].key STRING The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
Output
This building block provides 7 output parameters
Name | Format | Description |
---|---|---|
name |
STRING |
The resource name of the product. Format is:
This field is ignored when creating a product |
displayName |
STRING |
The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long |
description |
STRING |
User-provided metadata to be stored with this product. Must be at most 4096 characters long |
productCategory |
STRING |
The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. This field is immutable |
productLabels[] |
OBJECT |
A product label represented as a key-value pair |
productLabels[].value |
STRING |
The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
productLabels[].key |
STRING |
The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
= Parameter name
= Format
name STRING The resource name of the product. Format is:
This field is ignored when creating a product |
displayName STRING The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long |
description STRING User-provided metadata to be stored with this product. Must be at most 4096 characters long |
productCategory STRING The category for the product identified by the reference image. This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories "homegoods", "apparel", and "toys" are still supported, but these should not be used for new products. This field is immutable |
productLabels[] OBJECT A product label represented as a key-value pair |
productLabels[].value STRING The value of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |
productLabels[].key STRING The key of the label attached to the product. Cannot be empty and cannot exceed 128 bytes |