Class: Google::Apis::VisionV1p2beta1::Result

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

Overview

Information about a product.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ Result

Returns a new instance of Result



7502
7503
7504
# File 'generated/google/apis/vision_v1p2beta1/classes.rb', line 7502

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

Instance Attribute Details

#imageString

The resource name of the image from the product that is the closest match to the query. Corresponds to the JSON property image

Returns:

  • (String)


7489
7490
7491
# File 'generated/google/apis/vision_v1p2beta1/classes.rb', line 7489

def image
  @image
end

#productGoogle::Apis::VisionV1p2beta1::Product

A Product contains ReferenceImages. Corresponds to the JSON property product



7494
7495
7496
# File 'generated/google/apis/vision_v1p2beta1/classes.rb', line 7494

def product
  @product
end

#scoreFloat

A confidence level on the match, ranging from 0 (no confidence) to 1 (full confidence). Corresponds to the JSON property score

Returns:

  • (Float)


7500
7501
7502
# File 'generated/google/apis/vision_v1p2beta1/classes.rb', line 7500

def score
  @score
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



7507
7508
7509
7510
7511
# File 'generated/google/apis/vision_v1p2beta1/classes.rb', line 7507

def update!(**args)
  @image = args[:image] if args.key?(:image)
  @product = args[:product] if args.key?(:product)
  @score = args[:score] if args.key?(:score)
end