Class: Google::Apis::VisionV1::Product

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/vision_v1/classes.rb,
lib/google/apis/vision_v1/representations.rb,
lib/google/apis/vision_v1/representations.rb

Overview

A Product contains ReferenceImages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Product

Returns a new instance of Product.



9523
9524
9525
# File 'lib/google/apis/vision_v1/classes.rb', line 9523

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#descriptionString

User-provided metadata to be stored with this product. Must be at most 4096 characters long. Corresponds to the JSON property description

Returns:

  • (String)


9489
9490
9491
# File 'lib/google/apis/vision_v1/classes.rb', line 9489

def description
  @description
end

#display_nameString

The user-provided name for this Product. Must not be empty. Must be at most 4096 characters long. Corresponds to the JSON property displayName

Returns:

  • (String)


9495
9496
9497
# File 'lib/google/apis/vision_v1/classes.rb', line 9495

def display_name
  @display_name
end

#nameString

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. Corresponds to the JSON property name

Returns:

  • (String)


9501
9502
9503
# File 'lib/google/apis/vision_v1/classes.rb', line 9501

def name
  @name
end

#product_categoryString

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. Corresponds to the JSON property productCategory

Returns:

  • (String)


9509
9510
9511
# File 'lib/google/apis/vision_v1/classes.rb', line 9509

def product_category
  @product_category
end

#product_labelsArray<Google::Apis::VisionV1::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. Corresponds to the JSON property productLabels



9521
9522
9523
# File 'lib/google/apis/vision_v1/classes.rb', line 9521

def product_labels
  @product_labels
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



9528
9529
9530
9531
9532
9533
9534
# File 'lib/google/apis/vision_v1/classes.rb', line 9528

def update!(**args)
  @description = args[:description] if args.key?(:description)
  @display_name = args[:display_name] if args.key?(:display_name)
  @name = args[:name] if args.key?(:name)
  @product_category = args[:product_category] if args.key?(:product_category)
  @product_labels = args[:product_labels] if args.key?(:product_labels)
end