Class: Google::Apis::ChatV1::GoogleAppsCardV1Widget
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::GoogleAppsCardV1Widget
- 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
Each card is made up of widgets. A widget is a composite object that can represent one of text, images, buttons, and other object types.
Instance Attribute Summary collapse
-
#button_list ⇒ Google::Apis::ChatV1::GoogleAppsCardV1ButtonList
A list of buttons layed out horizontally.
-
#columns ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Columns
The
Columnswidget displays up to 2 columns in a card or dialog. -
#date_time_picker ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
Lets users input a date, a time, or both a date and a time.
-
#decorated_text ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DecoratedText
A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text.
-
#divider ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Divider
Displays a divider between widgets as a horizontal line.
-
#grid ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Grid
Displays a grid with a collection of items.
-
#horizontal_alignment ⇒ String
Specifies whether widgets align to the left, right, or center of a column.
-
#image ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Image
An image that is specified by a URL and can have an
onClickaction. -
#selection_input ⇒ Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput
A widget that creates one or more UI items that users can select.
-
#text_input ⇒ Google::Apis::ChatV1::GoogleAppsCardV1TextInput
A field in which users can enter text.
-
#text_paragraph ⇒ Google::Apis::ChatV1::GoogleAppsCardV1TextParagraph
A paragraph of text that supports formatting.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleAppsCardV1Widget
constructor
A new instance of GoogleAppsCardV1Widget.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleAppsCardV1Widget
Returns a new instance of GoogleAppsCardV1Widget.
2896 2897 2898 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2896 def initialize(**args) update!(**args) end |
Instance Attribute Details
#button_list ⇒ Google::Apis::ChatV1::GoogleAppsCardV1ButtonList
A list of buttons layed out horizontally. For an example in Google Chat apps,
see Button list.
Google Workspace Add-ons and Chat apps:
Corresponds to the JSON property buttonList
2775 2776 2777 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2775 def @button_list end |
#columns ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Columns
The Columns widget displays up to 2 columns in a card or dialog. You can add
widgets to each column; the widgets appear in the order that they are
specified. For an example in Google Chat apps, see Columns. The height of each column is
determined by the taller column. For example, if the first column is taller
than the second column, both columns have the height of the first column.
Because each column can contain a different number of widgets, you can't
define rows or align widgets between the columns. Columns are displayed side-
by-side. You can customize the width of each column using the
HorizontalSizeStyle field. If the user's screen width is too narrow, the
second column wraps below the first: * On web, the second column wraps if the
screen width is less than or equal to 480 pixels. * On iOS devices, the second
column wraps if the screen width is less than or equal to 300 pt. * On Android
devices, the second column wraps if the screen width is less than or equal to
320 dp. To include more than 2 columns, or to use rows, use the Grid widget.
Google Workspace Add-ons and Chat apps: Columns for Google Workspace Add-ons are in Developer
Preview.
Corresponds to the JSON property columns
2797 2798 2799 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2797 def columns @columns end |
#date_time_picker ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
Lets users input a date, a time, or both a date and a time. For an example in
Google Chat apps, see Date time picker. Users can input text or use the picker to select
dates and times. If users input an invalid date or time, the picker shows an
error that prompts users to input the information correctly. Google Workspace
Add-ons and Chat apps:
Corresponds to the JSON property dateTimePicker
2807 2808 2809 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2807 def date_time_picker @date_time_picker end |
#decorated_text ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DecoratedText
A widget that displays text with optional decorations such as a label above or
below the text, an icon in front of the text, a selection widget, or a button
after the text. For an example in Google Chat apps, see Decorated text. Google Workspace Add-
ons and Chat apps:
Corresponds to the JSON property decoratedText
2816 2817 2818 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2816 def decorated_text @decorated_text end |
#divider ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Divider
Displays a divider between widgets as a horizontal line. For an example in
Google Chat apps, see Divider. Google Workspace Add-ons and Chat apps: For example, the following JSON creates a divider: "
divider": ``
Corresponds to the JSON property divider
2825 2826 2827 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2825 def divider @divider end |
#grid ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Grid
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 Grid. 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" ` ` `
Corresponds to the JSON property grid
2843 2844 2845 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2843 def grid @grid end |
#horizontal_alignment ⇒ String
Specifies whether widgets align to the left, right, or center of a column.
Corresponds to the JSON property horizontalAlignment
2848 2849 2850 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2848 def horizontal_alignment @horizontal_alignment end |
#image ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Image
An image that is specified by a URL and can have an onClick action. For an
example, see Image.
Google Workspace Add-ons and Chat apps:
Corresponds to the JSON property image
2856 2857 2858 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2856 def image @image end |
#selection_input ⇒ Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput
A widget that creates one or more UI items that users can select. For example,
a dropdown menu or checkboxes. You can use this widget to collect data that
can be predicted or enumerated. For an example in Google Chat apps, see
Selection input
. Chat apps can process the value of items that users select or input. For
details about working with form inputs, see Receive form data. To collect undefined or
abstract data from users, use the TextInput widget. Google Workspace Add-ons
and Chat apps:
Corresponds to the JSON property selectionInput
2869 2870 2871 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2869 def selection_input @selection_input end |
#text_input ⇒ Google::Apis::ChatV1::GoogleAppsCardV1TextInput
A field in which users can enter text. Supports suggestions and on-change
actions. For an example in Google Chat apps, see Text input. Chat apps receive and can
process the value of entered text during form input events. For details about
working with form inputs, see Receive form data. When you need to collect undefined or abstract
data from users, use a text input. To collect defined or enumerated data from
users, use the SelectionInput widget. Google Workspace Add-ons and Chat apps:
Corresponds to the JSON property textInput
2882 2883 2884 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2882 def text_input @text_input end |
#text_paragraph ⇒ Google::Apis::ChatV1::GoogleAppsCardV1TextParagraph
A paragraph of text that supports formatting. For an example in Google Chat
apps, see Text paragraph. For more information about formatting text, see Formatting text
in Google Chat apps and Formatting text in Google Workspace Add-ons.
Google Workspace Add-ons and Chat apps:
Corresponds to the JSON property textParagraph
2894 2895 2896 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2894 def text_paragraph @text_paragraph end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2901 def update!(**args) @button_list = args[:button_list] if args.key?(:button_list) @columns = args[:columns] if args.key?(:columns) @date_time_picker = args[:date_time_picker] if args.key?(:date_time_picker) @decorated_text = args[:decorated_text] if args.key?(:decorated_text) @divider = args[:divider] if args.key?(:divider) @grid = args[:grid] if args.key?(:grid) @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment) @image = args[:image] if args.key?(:image) @selection_input = args[:selection_input] if args.key?(:selection_input) @text_input = args[:text_input] if args.key?(:text_input) @text_paragraph = args[:text_paragraph] if args.key?(:text_paragraph) end |