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.
-
#date_time_picker ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
Lets users specify 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, a horizontal line.
-
#grid ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Grid
Displays a grid with a collection of items.
-
#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 a UI item with options for users to 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.
2397 2398 2399 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2397 def initialize(**args) update!(**args) end |
Instance Attribute Details
#button_list ⇒ Google::Apis::ChatV1::GoogleAppsCardV1ButtonList
A list of buttons layed out horizontally.
Corresponds to the JSON property buttonList
2317 2318 2319 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2317 def @button_list end |
#date_time_picker ⇒ Google::Apis::ChatV1::GoogleAppsCardV1DateTimePicker
Lets users specify a date, a time, or both a date and a time. Accepts text
input from users, but features an interactive date and time selector that
helps users enter correctly-formatted dates and times. If users enter a date
or time incorrectly, the widget shows an error that prompts users to enter the
correct format. Not supported by Chat apps. Support by Chat apps coming soon.
Corresponds to the JSON property dateTimePicker
2326 2327 2328 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2326 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.
Corresponds to the JSON property decoratedText
2333 2334 2335 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2333 def decorated_text @decorated_text end |
#divider ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Divider
Displays a divider between widgets, a horizontal line. For example, the
following JSON creates a divider: "divider": ` `
Corresponds to the JSON property divider
2339 2340 2341 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2339 def divider @divider end |
#grid ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Grid
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" ` ` `
Corresponds to the JSON property grid
2356 2357 2358 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2356 def grid @grid end |
#image ⇒ Google::Apis::ChatV1::GoogleAppsCardV1Image
An image that is specified by a URL and can have an onClick action.
Corresponds to the JSON property image
2361 2362 2363 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2361 def image @image end |
#selection_input ⇒ Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput
A widget that creates a UI item with options for users to select. For example,
a dropdown menu or check list. 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 data from
users that matches options you set, use a selection input. To collect abstract
data from users, use the text input widget instead. Only supported in dialogs. Support for card
messages
coming soon.
Corresponds to the JSON property selectionInput
2375 2376 2377 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2375 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. 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 abstract data from
users, use a text input. To collect defined data from users, use the selection
input widget instead. Only supported in dialogs. Support for card messages coming soon.
Corresponds to the JSON property textInput
2388 2389 2390 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2388 def text_input @text_input end |
#text_paragraph ⇒ Google::Apis::ChatV1::GoogleAppsCardV1TextParagraph
A paragraph of text that supports formatting. See Text formatting for
details.
Corresponds to the JSON property textParagraph
2395 2396 2397 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2395 def text_paragraph @text_paragraph end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 |
# File 'lib/google/apis/chat_v1/classes.rb', line 2402 def update!(**args) @button_list = args[:button_list] if args.key?(:button_list) @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) @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 |