Class: Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct
- Inherits:
-
Object
- Object
- Google::Apis::RetailV2beta::GoogleCloudRetailV2betaProduct
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/retail_v2beta/classes.rb,
lib/google/apis/retail_v2beta/representations.rb,
lib/google/apis/retail_v2beta/representations.rb
Overview
Product captures all metadata information of items to be recommended or searched.
Instance Attribute Summary collapse
-
#attributes ⇒ Hash<String,Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCustomAttribute>
Highly encouraged.
-
#availability ⇒ String
The online availability of the Product.
-
#available_quantity ⇒ Fixnum
The available quantity of the item.
-
#available_time ⇒ String
The timestamp when this Product becomes available for recommendation.
-
#categories ⇒ Array<String>
Product categories.
-
#description ⇒ String
Product description.
-
#id ⇒ String
Immutable.
-
#images ⇒ Array<Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImage>
Product images for the product.Highly recommended to put the main image to the first.
-
#name ⇒ String
Immutable.
-
#price_info ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPriceInfo
The price information of a Product.
-
#primary_product_id ⇒ String
Variant group identifier.
-
#tags ⇒ Array<String>
Custom tags associated with the product.
-
#title ⇒ String
Required.
-
#type ⇒ String
Immutable.
-
#uri ⇒ String
Canonical URL directly linking to the product detail page.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleCloudRetailV2betaProduct
constructor
A new instance of GoogleCloudRetailV2betaProduct.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleCloudRetailV2betaProduct
Returns a new instance of GoogleCloudRetailV2betaProduct.
1669 1670 1671 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1669 def initialize(**args) update!(**args) end |
Instance Attribute Details
#attributes ⇒ Hash<String,Google::Apis::RetailV2beta::GoogleCloudRetailV2betaCustomAttribute>
Highly encouraged. Extra product attributes to be included. For example, for
products, this could include the store name, vendor, style, color, etc. These
are very strong signals for recommendation model, thus we highly recommend
providing the attributes here. Features that can take on one of a limited
number of possible values. Two types of features can be set are: Textual
features. some examples would be the brand/maker of a product, or country of a
customer. Numerical features. Some examples would be the height/weight of a
product, or age of a customer. For example: "vendor": `"text": ["vendor123",
"vendor456"]`, "lengths_cm": `"numbers":[2.3, 15.4]`, "heights_cm": `"numbers"
:[8.1, 6.4]`. This field needs to pass all below criteria, otherwise an
INVALID_ARGUMENT error is returned: * Max entries count: 150 by default; 100
for Type.VARIANT. * Max indexable entries count: 150 by default; 40 for Type.
VARIANT. * Max searchable entries count: 30. * The key must be a UTF-8 encoded
string with a length limit of 128 characters.
Corresponds to the JSON property attributes
1541 1542 1543 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1541 def attributes @attributes end |
#availability ⇒ String
The online availability of the Product. Default to Availability.IN_STOCK.
Google Merchant Center Property availability. Schema.org Property Offer.availability.
Corresponds to the JSON property availability
1549 1550 1551 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1549 def availability @availability end |
#available_quantity ⇒ Fixnum
The available quantity of the item.
Corresponds to the JSON property availableQuantity
1554 1555 1556 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1554 def available_quantity @available_quantity end |
#available_time ⇒ String
The timestamp when this Product becomes available for recommendation.
Corresponds to the JSON property availableTime
1559 1560 1561 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1559 def available_time @available_time end |
#categories ⇒ Array<String>
Product categories. This field is repeated for supporting one product
belonging to several parallel categories. Strongly recommended using the full
path for better search / recommendation quality. To represent full path of
category, use '>' sign to separate different hierarchies. If '>' is part of
the category name, please replace it with other character(s). For example, if
a shoes product belongs to both ["Shoes & Accessories" -> "Shoes"] and ["
Sports & Fitness" -> "Athletic Clothing" -> "Shoes"], it could be represented
as: "categories": [ "Shoes & Accessories > Shoes", "Sports & Fitness >
Athletic Clothing > Shoes" ] Must be set for Type.PRIMARY Product otherwise an
INVALID_ARGUMENT error is returned. At most 250 values are allowed per Product.
Empty values are not allowed. Each value must be a UTF-8 encoded string with
a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is
returned. Google Merchant Center property google_product_category. Schema.org
property Product.category. [
mc_google_product_category]: https://support.google.com/merchants/answer/
6324436
Corresponds to the JSON property categories
1579 1580 1581 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1579 def categories @categories end |
#description ⇒ String
Product description. This field must be a UTF-8 encoded string with a length
limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center property description. schema.org property Product.description.
Corresponds to the JSON property description
1588 1589 1590 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1588 def description @description end |
#id ⇒ String
Immutable. Product identifier, which is the final component of name. For
example, this field is "id_1", if name is projects/*/locations/global/
catalogs/default_catalog/branches/default_branch/products/id_1. This field
must be a UTF-8 encoded string with a length limit of 128 characters.
Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center
property id. Schema.org
Property Product.sku.
Corresponds to the JSON property id
1599 1600 1601 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1599 def id @id end |
#images ⇒ Array<Google::Apis::RetailV2beta::GoogleCloudRetailV2betaImage>
Product images for the product.Highly recommended to put the main image to the
first. A maximum of 300 images are allowed. Google Merchant Center property
image_link. Schema.org
property Product.image.
Corresponds to the JSON property images
1607 1608 1609 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1607 def images @images end |
#name ⇒ String
Immutable. Full resource name of the product, such as projects/*/locations/
global/catalogs/default_catalog/branches/default_branch/products/product_id.
The branch ID must be "default_branch".
Corresponds to the JSON property name
1614 1615 1616 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1614 def name @name end |
#price_info ⇒ Google::Apis::RetailV2beta::GoogleCloudRetailV2betaPriceInfo
The price information of a Product.
Corresponds to the JSON property priceInfo
1619 1620 1621 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1619 def price_info @price_info end |
#primary_product_id ⇒ String
Variant group identifier. Must be an id, with the same parent branch with this
product. Otherwise, an error is thrown. For Type.PRIMARY Products, this field
can only be empty or set to the same value as id. For VARIANT Products, this
field cannot be empty. A maximum of 2,000 products are allowed to share the
same Type.PRIMARY Product. Otherwise, an INVALID_ARGUMENT error is returned.
Google Merchant Center Property item_group_id. Schema.org Property Product.inProductGroupWithID. This field must be enabled before it
can be used. Learn more.
Corresponds to the JSON property primaryProductId
1632 1633 1634 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1632 def primary_product_id @primary_product_id end |
#tags ⇒ Array<String>
Custom tags associated with the product. At most 250 values are allowed per
Product. This value must be a UTF-8 encoded string with a length limit of 1,
000 characters. Otherwise, an INVALID_ARGUMENT error is returned. This tag can
be used for filtering recommendation results by passing the tag as part of the
PredictRequest.filter. Google Merchant Center property custom_label_0–4.
Corresponds to the JSON property tags
1642 1643 1644 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1642 def @tags end |
#title ⇒ String
Required. Product title. This field must be a UTF-8 encoded string with a
length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is
returned. Google Merchant Center property title. Schema.org property Product.name.
Corresponds to the JSON property title
1651 1652 1653 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1651 def title @title end |
#type ⇒ String
Immutable. The type of the product. This field is output-only.
Corresponds to the JSON property type
1656 1657 1658 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1656 def type @type end |
#uri ⇒ String
Canonical URL directly linking to the product detail page. It is strongly
recommended to provide a valid uri for the product, otherwise the service
performance could be significantly degraded. This field must be a UTF-8
encoded string with a length limit of 5,000 characters. Otherwise, an
INVALID_ARGUMENT error is returned. Google Merchant Center property link. Schema.org property
Offer.url.
Corresponds to the JSON property uri
1667 1668 1669 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1667 def uri @uri end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 |
# File 'lib/google/apis/retail_v2beta/classes.rb', line 1674 def update!(**args) @attributes = args[:attributes] if args.key?(:attributes) @availability = args[:availability] if args.key?(:availability) @available_quantity = args[:available_quantity] if args.key?(:available_quantity) @available_time = args[:available_time] if args.key?(:available_time) @categories = args[:categories] if args.key?(:categories) @description = args[:description] if args.key?(:description) @id = args[:id] if args.key?(:id) @images = args[:images] if args.key?(:images) @name = args[:name] if args.key?(:name) @price_info = args[:price_info] if args.key?(:price_info) @primary_product_id = args[:primary_product_id] if args.key?(:primary_product_id) @tags = args[:tags] if args.key?(:tags) @title = args[:title] if args.key?(:title) @type = args[:type] if args.key?(:type) @uri = args[:uri] if args.key?(:uri) end |