Class: Google::Apis::RetailV2alpha::GoogleCloudRetailV2alphaImage

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

Overview

Product image. Recommendations AI and Retail Search use product images to improve prediction and search results. Product images can be returned in results, and are shown in prediction or search previews in the console. Please try to provide correct product images and avoid using images with size too small.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2alphaImage

Returns a new instance of GoogleCloudRetailV2alphaImage.



3519
3520
3521
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3519

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

Instance Attribute Details

#heightFixnum

Height of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property height

Returns:

  • (Fixnum)


3502
3503
3504
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3502

def height
  @height
end

#uriString

Required. URI of the image. This field must be a valid UTF-8 encoded URI with a length limit of 5,000 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property image_link. Schema.org property Product.image. Corresponds to the JSON property uri

Returns:

  • (String)


3511
3512
3513
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3511

def uri
  @uri
end

#widthFixnum

Width of the image in number of pixels. This field must be nonnegative. Otherwise, an INVALID_ARGUMENT error is returned. Corresponds to the JSON property width

Returns:

  • (Fixnum)


3517
3518
3519
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3517

def width
  @width
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3524
3525
3526
3527
3528
# File 'lib/google/apis/retail_v2alpha/classes.rb', line 3524

def update!(**args)
  @height = args[:height] if args.key?(:height)
  @uri = args[:uri] if args.key?(:uri)
  @width = args[:width] if args.key?(:width)
end