Class: Google::Apis::ChatV1::GoogleAppsCardV1Grid

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

Displays a grid with a collection of items. Items can only include text or images. For responsive columns, or to include more than text or images, use Columns. For an example in Google Chat apps, see Display a Grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by items divided by columns. A grid with 10 items and 2 columns has 5 rows. A grid with 11 items and 2 columns has 6 rows. Google Workspace Add-ons and Chat apps: For example, the following JSON creates a 2 column grid with a single item: "grid": ` " title": "A fine collection of items", "columnCount": 2, "borderStyle": ` "type" : "STROKE", "cornerRadius": 4 `, "items": [ ` "image": ` "imageUri": "https:// www.example.com/image.png", "cropStyle": ` "type": "SQUARE" `, "borderStyle": ` "type": "STROKE" ` `, "title": "An item", "textAlignment": "CENTER" ` ], " onClick": ` "openLink": ` "url": "https://www.example.com" ` ` `

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1Grid

Returns a new instance of GoogleAppsCardV1Grid.



2113
2114
2115
# File 'lib/google/apis/chat_v1/classes.rb', line 2113

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

Instance Attribute Details

#border_styleGoogle::Apis::ChatV1::GoogleAppsCardV1BorderStyle

The style options for the border of a card or widget, including the border type and color. Google Workspace Add-ons and Chat apps: Corresponds to the JSON property borderStyle



2087
2088
2089
# File 'lib/google/apis/chat_v1/classes.rb', line 2087

def border_style
  @border_style
end

#column_countFixnum

The number of columns to display in the grid. A default value is used if this field isn't specified, and that default value is different depending on where the grid is shown (dialog versus companion). Corresponds to the JSON property columnCount

Returns:

  • (Fixnum)


2094
2095
2096
# File 'lib/google/apis/chat_v1/classes.rb', line 2094

def column_count
  @column_count
end

#itemsArray<Google::Apis::ChatV1::GoogleAppsCardV1GridItem>

The items to display in the grid. Corresponds to the JSON property items



2099
2100
2101
# File 'lib/google/apis/chat_v1/classes.rb', line 2099

def items
  @items
end

#on_clickGoogle::Apis::ChatV1::GoogleAppsCardV1OnClick

Represents how to respond when users click an interactive element on a card, such as a button. Google Workspace Add-ons and Chat apps: Corresponds to the JSON property onClick



2106
2107
2108
# File 'lib/google/apis/chat_v1/classes.rb', line 2106

def on_click
  @on_click
end

#titleString

The text that displays in the grid header. Corresponds to the JSON property title

Returns:

  • (String)


2111
2112
2113
# File 'lib/google/apis/chat_v1/classes.rb', line 2111

def title
  @title
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2118
2119
2120
2121
2122
2123
2124
# File 'lib/google/apis/chat_v1/classes.rb', line 2118

def update!(**args)
  @border_style = args[:border_style] if args.key?(:border_style)
  @column_count = args[:column_count] if args.key?(:column_count)
  @items = args[:items] if args.key?(:items)
  @on_click = args[:on_click] if args.key?(:on_click)
  @title = args[:title] if args.key?(:title)
end