Class: Google::Apis::ChatV1::Image

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

Overview

An image that is specified by a URL and can have an onclick action.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ Image

Returns a new instance of Image.



2225
2226
2227
# File 'lib/google/apis/chat_v1/classes.rb', line 2225

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

Instance Attribute Details

#aspect_ratioFloat

The aspect ratio of this image (width/height). This field allows clients to reserve the right height for the image while waiting for it to load. It's not meant to override the native aspect ratio of the image. If unset, the server fills it by prefetching the image. Corresponds to the JSON property aspectRatio

Returns:

  • (Float)


2213
2214
2215
# File 'lib/google/apis/chat_v1/classes.rb', line 2213

def aspect_ratio
  @aspect_ratio
end

#image_urlString

The URL of the image. Corresponds to the JSON property imageUrl

Returns:

  • (String)


2218
2219
2220
# File 'lib/google/apis/chat_v1/classes.rb', line 2218

def image_url
  @image_url
end

#on_clickGoogle::Apis::ChatV1::OnClick

An onclick action (e.g. open a link). Corresponds to the JSON property onClick



2223
2224
2225
# File 'lib/google/apis/chat_v1/classes.rb', line 2223

def on_click
  @on_click
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2230
2231
2232
2233
2234
# File 'lib/google/apis/chat_v1/classes.rb', line 2230

def update!(**args)
  @aspect_ratio = args[:aspect_ratio] if args.key?(:aspect_ratio)
  @image_url = args[:image_url] if args.key?(:image_url)
  @on_click = args[:on_click] if args.key?(:on_click)
end