Class: Google::Apis::ChatV1::GoogleAppsCardV1Grid
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::GoogleAppsCardV1Grid
- 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. 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. Currently supported in dialogs. Support for card messages is coming soon.
For example, the following JSON creates a 2 column grid with a single item:
"grid": ` "title": "A fine collection of items", "numColumns": 2, "
borderStyle": ` "type": "STROKE", "cornerRadius": 4.0 `, "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
-
#border_style ⇒ Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle
Represents the complete border style applied to items in a widget.
-
#column_count ⇒ Fixnum
The number of columns to display in the grid.
-
#items ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1GridItem>
The items to display in the grid.
-
#on_click ⇒ Google::Apis::ChatV1::GoogleAppsCardV1OnClick
Represents how to respond when users click an interactive element on a card, such as a button.
-
#title ⇒ String
The text that displays in the grid header.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleAppsCardV1Grid
constructor
A new instance of GoogleAppsCardV1Grid.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleAppsCardV1Grid
Returns a new instance of GoogleAppsCardV1Grid.
1628 1629 1630 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1628 def initialize(**args) update!(**args) end |
Instance Attribute Details
#border_style ⇒ Google::Apis::ChatV1::GoogleAppsCardV1BorderStyle
Represents the complete border style applied to items in a widget.
Corresponds to the JSON property borderStyle
1603 1604 1605 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1603 def border_style @border_style end |
#column_count ⇒ Fixnum
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
1610 1611 1612 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1610 def column_count @column_count end |
#items ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1GridItem>
The items to display in the grid.
Corresponds to the JSON property items
1615 1616 1617 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1615 def items @items end |
#on_click ⇒ Google::Apis::ChatV1::GoogleAppsCardV1OnClick
Represents how to respond when users click an interactive element on a card,
such as a button.
Corresponds to the JSON property onClick
1621 1622 1623 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1621 def on_click @on_click end |
#title ⇒ String
The text that displays in the grid header.
Corresponds to the JSON property title
1626 1627 1628 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1626 def title @title end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1633 1634 1635 1636 1637 1638 1639 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1633 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 |