Reference documentation and code samples for the Cloud Vision V1 API class Google::Cloud::Vision::V1::Product.
A Product contains ReferenceImages.
Inherits
Object
Extended By
Google::Protobuf::MessageExts::ClassMethods
Includes
Google::Protobuf::MessageExts
Methods
#description
defdescription()->::String
Returns
(::String) — User-provided metadata to be stored with this product. Must be at most 4096
characters long.
#description=
defdescription=(value)->::String
Parameter
value (::String) — User-provided metadata to be stored with this product. Must be at most 4096
characters long.
Returns
(::String) — User-provided metadata to be stored with this product. Must be at most 4096
characters long.
#display_name
defdisplay_name()->::String
Returns
(::String) — The user-provided name for this Product. Must not be empty. Must be at most
4096 characters long.
#display_name=
defdisplay_name=(value)->::String
Parameter
value (::String) — The user-provided name for this Product. Must not be empty. Must be at most
4096 characters long.
Returns
(::String) — The user-provided name for this Product. Must not be empty. Must be at most
4096 characters long.
#name
defname()->::String
Returns
(::String) — The resource name of the product.
Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.
This field is ignored when creating a product.
#name=
defname=(value)->::String
Parameter
value (::String) — The resource name of the product.
Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.
This field is ignored when creating a product.
Returns
(::String) — The resource name of the product.
Format is:
projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID.
This field is ignored when creating a product.
#product_category
defproduct_category()->::String
Returns
(::String) — Immutable. The category for the product identified by the reference image.
This should be one of "homegoods-v2", "apparel-v2", "toys-v2",
"packagedgoods-v1" or "general-v1". The legacy categories "homegoods",
"apparel", and "toys" are still supported, but these should not be used for
new products.
#product_category=
defproduct_category=(value)->::String
Parameter
value (::String) — Immutable. The category for the product identified by the reference image.
This should be one of "homegoods-v2", "apparel-v2", "toys-v2",
"packagedgoods-v1" or "general-v1". The legacy categories "homegoods",
"apparel", and "toys" are still supported, but these should not be used for
new products.
Returns
(::String) — Immutable. The category for the product identified by the reference image.
This should be one of "homegoods-v2", "apparel-v2", "toys-v2",
"packagedgoods-v1" or "general-v1". The legacy categories "homegoods",
"apparel", and "toys" are still supported, but these should not be used for
new products.
Note that integer values can be provided as strings, e.g. "1199". Only
strings with integer values can match a range-based restriction which is
to be supported soon.
Multiple values can be assigned to the same key. One product may have up to
500 product_labels.
Notice that the total number of distinct product_labels over all products
in one ProductSet cannot exceed 1M, otherwise the product search pipeline
will refuse to work for that ProductSet.
value (::Array<::Google::Cloud::Vision::V1::Product::KeyValue>) — Key-value pairs that can be attached to a product. At query time,
constraints can be specified based on the product_labels.
Note that integer values can be provided as strings, e.g. "1199". Only
strings with integer values can match a range-based restriction which is
to be supported soon.
Multiple values can be assigned to the same key. One product may have up to
500 product_labels.
Notice that the total number of distinct product_labels over all products
in one ProductSet cannot exceed 1M, otherwise the product search pipeline
will refuse to work for that ProductSet.
Note that integer values can be provided as strings, e.g. "1199". Only
strings with integer values can match a range-based restriction which is
to be supported soon.
Multiple values can be assigned to the same key. One product may have up to
500 product_labels.
Notice that the total number of distinct product_labels over all products
in one ProductSet cannot exceed 1M, otherwise the product search pipeline
will refuse to work for that ProductSet.
[[["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,["# Cloud Vision V1 API - Class Google::Cloud::Vision::V1::Product (v1.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [1.3.1 (latest)](/ruby/docs/reference/google-cloud-vision-v1/latest/Google-Cloud-Vision-V1-Product)\n- [1.3.0](/ruby/docs/reference/google-cloud-vision-v1/1.3.0/Google-Cloud-Vision-V1-Product)\n- [1.2.1](/ruby/docs/reference/google-cloud-vision-v1/1.2.1/Google-Cloud-Vision-V1-Product)\n- [1.1.0](/ruby/docs/reference/google-cloud-vision-v1/1.1.0/Google-Cloud-Vision-V1-Product)\n- [1.0.1](/ruby/docs/reference/google-cloud-vision-v1/1.0.1/Google-Cloud-Vision-V1-Product)\n- [0.15.0](/ruby/docs/reference/google-cloud-vision-v1/0.15.0/Google-Cloud-Vision-V1-Product)\n- [0.14.0](/ruby/docs/reference/google-cloud-vision-v1/0.14.0/Google-Cloud-Vision-V1-Product)\n- [0.13.2](/ruby/docs/reference/google-cloud-vision-v1/0.13.2/Google-Cloud-Vision-V1-Product)\n- [0.12.0](/ruby/docs/reference/google-cloud-vision-v1/0.12.0/Google-Cloud-Vision-V1-Product)\n- [0.11.1](/ruby/docs/reference/google-cloud-vision-v1/0.11.1/Google-Cloud-Vision-V1-Product)\n- [0.10.0](/ruby/docs/reference/google-cloud-vision-v1/0.10.0/Google-Cloud-Vision-V1-Product)\n- [0.9.0](/ruby/docs/reference/google-cloud-vision-v1/0.9.0/Google-Cloud-Vision-V1-Product)\n- [0.8.0](/ruby/docs/reference/google-cloud-vision-v1/0.8.0/Google-Cloud-Vision-V1-Product)\n- [0.7.0](/ruby/docs/reference/google-cloud-vision-v1/0.7.0/Google-Cloud-Vision-V1-Product)\n- [0.6.4](/ruby/docs/reference/google-cloud-vision-v1/0.6.4/Google-Cloud-Vision-V1-Product) \nReference documentation and code samples for the Cloud Vision V1 API class Google::Cloud::Vision::V1::Product.\n\nA Product contains ReferenceImages. \n\nInherits\n--------\n\n- Object \n\nExtended By\n-----------\n\n- Google::Protobuf::MessageExts::ClassMethods \n\nIncludes\n--------\n\n- Google::Protobuf::MessageExts\n\nMethods\n-------\n\n### #description\n\n def description() -\u003e ::String\n\n**Returns**\n\n- (::String) --- User-provided metadata to be stored with this product. Must be at most 4096 characters long.\n\n### #description=\n\n def description=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- User-provided metadata to be stored with this product. Must be at most 4096 characters long. \n**Returns**\n\n- (::String) --- User-provided metadata to be stored with this product. Must be at most 4096 characters long.\n\n### #display_name\n\n def display_name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.\n\n### #display_name=\n\n def display_name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long. \n**Returns**\n\n- (::String) --- The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long.\n\n### #name\n\n def name() -\u003e ::String\n\n**Returns**\n\n- (::String) --- The resource name of the product.\n\n Format is:\n `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.\n\n This field is ignored when creating a product.\n\n### #name=\n\n def name=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- The resource name of the product.\n\n\n Format is:\n `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.\n\nThis field is ignored when creating a product. \n**Returns**\n\n- (::String) --- The resource name of the product.\n\n Format is:\n `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`.\n\n This field is ignored when creating a product.\n\n### #product_category\n\n def product_category() -\u003e ::String\n\n**Returns**\n\n- (::String) --- Immutable. The category for the product identified by the reference image. This should be one of \"homegoods-v2\", \"apparel-v2\", \"toys-v2\", \"packagedgoods-v1\" or \"general-v1\". The legacy categories \"homegoods\", \"apparel\", and \"toys\" are still supported, but these should not be used for new products.\n\n### #product_category=\n\n def product_category=(value) -\u003e ::String\n\n**Parameter**\n\n- **value** (::String) --- Immutable. The category for the product identified by the reference image. This should be one of \"homegoods-v2\", \"apparel-v2\", \"toys-v2\", \"packagedgoods-v1\" or \"general-v1\". The legacy categories \"homegoods\", \"apparel\", and \"toys\" are still supported, but these should not be used for new products. \n**Returns**\n\n- (::String) --- Immutable. The category for the product identified by the reference image. This should be one of \"homegoods-v2\", \"apparel-v2\", \"toys-v2\", \"packagedgoods-v1\" or \"general-v1\". The legacy categories \"homegoods\", \"apparel\", and \"toys\" are still supported, but these should not be used for new products.\n\n### #product_labels\n\n def product_labels() -\u003e ::Array\u003c::Google::Cloud::Vision::V1::Product::KeyValue\u003e\n\n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Vision::V1::Product::KeyValue](./Google-Cloud-Vision-V1-Product-KeyValue)\\\u003e) --- Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.\n\n\n Note that integer values can be provided as strings, e.g. \"1199\". Only\n strings with integer values can match a range-based restriction which is\n to be supported soon.\n\n Multiple values can be assigned to the same key. One product may have up to\n 500 product_labels.\n\n Notice that the total number of distinct product_labels over all products\n in one ProductSet cannot exceed 1M, otherwise the product search pipeline\n will refuse to work for that ProductSet.\n\n### #product_labels=\n\n def product_labels=(value) -\u003e ::Array\u003c::Google::Cloud::Vision::V1::Product::KeyValue\u003e\n\n**Parameter**\n\n- **value** (::Array\\\u003c[::Google::Cloud::Vision::V1::Product::KeyValue](./Google-Cloud-Vision-V1-Product-KeyValue)\\\u003e) --- Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.\n\n\n Note that integer values can be provided as strings, e.g. \"1199\". Only\n strings with integer values can match a range-based restriction which is\n to be supported soon.\n\n Multiple values can be assigned to the same key. One product may have up to\n 500 product_labels.\n\n Notice that the total number of distinct product_labels over all products\n in one ProductSet cannot exceed 1M, otherwise the product search pipeline\nwill refuse to work for that ProductSet. \n**Returns**\n\n- (::Array\\\u003c[::Google::Cloud::Vision::V1::Product::KeyValue](./Google-Cloud-Vision-V1-Product-KeyValue)\\\u003e) --- Key-value pairs that can be attached to a product. At query time, constraints can be specified based on the product_labels.\n\n\n Note that integer values can be provided as strings, e.g. \"1199\". Only\n strings with integer values can match a range-based restriction which is\n to be supported soon.\n\n Multiple values can be assigned to the same key. One product may have up to\n 500 product_labels.\n\n Notice that the total number of distinct product_labels over all products\n in one ProductSet cannot exceed 1M, otherwise the product search pipeline\n will refuse to work for that ProductSet."]]