Class: Google::Apis::RetailV2::GoogleCloudRetailV2Image

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

Overview

Product image. Recommendations AI and Retail Search do not use product images to improve prediction and search results. However, product images can be returned in results, and are shown in prediction or search previews in the console.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudRetailV2Image

Returns a new instance of GoogleCloudRetailV2Image.



1999
2000
2001
# File 'lib/google/apis/retail_v2/classes.rb', line 1999

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)


1982
1983
1984
# File 'lib/google/apis/retail_v2/classes.rb', line 1982

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)


1991
1992
1993
# File 'lib/google/apis/retail_v2/classes.rb', line 1991

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)


1997
1998
1999
# File 'lib/google/apis/retail_v2/classes.rb', line 1997

def width
  @width
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2004
2005
2006
2007
2008
# File 'lib/google/apis/retail_v2/classes.rb', line 2004

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