Class: Google::Apis::ChatV1::GoogleAppsCardV1Widget

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

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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1Widget

Returns a new instance of GoogleAppsCardV1Widget.



4234
4235
4236
# File 'lib/google/apis/chat_v1/classes.rb', line 4234

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

Instance Attribute Details

#button_listGoogle::Apis::ChatV1::GoogleAppsCardV1ButtonList

A list of buttons layed out horizontally. For an example in Google Chat apps, see Add a button. Google Workspace add-ons and Chat apps: Corresponds to the JSON property buttonList



4052
4053
4054
# File 'lib/google/apis/chat_v1/classes.rb', line 4052

def button_list
  @button_list
end

A carousel, also known as a slider, rotates and displays a list of widgets in a slideshow format, with buttons navigating to the previous or next widget. For example, this is a JSON representation of a carousel that contains three text paragraph widgets. ` "carouselCards": [ ` "widgets": [ ` " textParagraph": ` "text": "First text paragraph in carousel", ` ` ] `, ` " widgets": [ ` "textParagraph": ` "text": "Second text paragraph in carousel", ` ` ] `, ` "widgets": [ ` "textParagraph": ` "text": "Third text paragraph in carousel", ` ` ] ` ] ` Google Chat apps: Corresponds to the JSON property carousel



4065
4066
4067
# File 'lib/google/apis/chat_v1/classes.rb', line 4065

def carousel
  @carousel
end

#chip_listGoogle::Apis::ChatV1::GoogleAppsCardV1ChipList

A list of chips layed out horizontally, which can either scroll horizontally or wrap to the next line. Google Workspace add-ons and Chat apps: Corresponds to the JSON property chipList



4072
4073
4074
# File 'lib/google/apis/chat_v1/classes.rb', line 4072

def chip_list
  @chip_list
end

#columnsGoogle::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 Display cards and dialogs in 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 two columns, or to use rows, use the Grid widget. Google Workspace add-ons and Chat apps: The add-on UIs that support columns include: * The dialog displayed when users open the add-on from an email draft. * The dialog displayed when users open the add-on from the Add attachment menu in a Google Calendar event. Corresponds to the JSON property columns



4097
4098
4099
# File 'lib/google/apis/chat_v1/classes.rb', line 4097

def columns
  @columns
end

#date_time_pickerGoogle::Apis::ChatV1::GoogleAppsCardV1DateTimePicker

Lets users input a date, a time, or both a date and a time. Supports form submission validation. When Action.all_widgets_are_required is set to true or this widget is specified in Action.required_widgets, the submission action is blocked unless a value is selected. For an example in Google Chat apps, see Let a user pick a date and time. 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



4111
4112
4113
# File 'lib/google/apis/chat_v1/classes.rb', line 4111

def date_time_picker
  @date_time_picker
end

#decorated_textGoogle::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 Display text with decorative text. Google Workspace add-ons and Chat apps: Corresponds to the JSON property decoratedText



4121
4122
4123
# File 'lib/google/apis/chat_v1/classes.rb', line 4121

def decorated_text
  @decorated_text
end

#dividerGoogle::Apis::ChatV1::GoogleAppsCardV1Divider

Displays a divider between widgets as a horizontal line. For an example in Google Chat apps, see Add a horizontal divider between widgets. Google Workspace add-ons and Chat apps: For example, the following JSON creates a divider: "divider": `` Corresponds to the JSON property divider



4131
4132
4133
# File 'lib/google/apis/chat_v1/classes.rb', line 4131

def divider
  @divider
end

#event_actionsArray<Google::Apis::ChatV1::GoogleAppsCardV1EventAction>

Specifies the event actions that can be performed on the widget. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps. Corresponds to the JSON property eventActions



4138
4139
4140
# File 'lib/google/apis/chat_v1/classes.rb', line 4138

def event_actions
  @event_actions
end

#gridGoogle::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 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" ` ` ` Corresponds to the JSON property grid



4157
4158
4159
# File 'lib/google/apis/chat_v1/classes.rb', line 4157

def grid
  @grid
end

#horizontal_alignmentString

Specifies whether widgets align to the left, right, or center of a column. Corresponds to the JSON property horizontalAlignment

Returns:

  • (String)


4162
4163
4164
# File 'lib/google/apis/chat_v1/classes.rb', line 4162

def horizontal_alignment
  @horizontal_alignment
end

#idString

A unique ID assigned to the widget that's used to identify the widget to be mutated. The ID has a character limit of 64 characters and should be in the format of [a-zA-Z0-9-]+. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps. Corresponds to the JSON property id

Returns:

  • (String)


4170
4171
4172
# File 'lib/google/apis/chat_v1/classes.rb', line 4170

def id
  @id
end

#imageGoogle::Apis::ChatV1::GoogleAppsCardV1Image

An image that is specified by a URL and can have an onClick action. For an example, see Add an image. Google Workspace add-ons and Chat apps: Corresponds to the JSON property image



4178
4179
4180
# File 'lib/google/apis/chat_v1/classes.rb', line 4178

def image
  @image
end

#selection_inputGoogle::Apis::ChatV1::GoogleAppsCardV1SelectionInput

A widget that creates one or more UI items that users can select. Supports form submission validation for dropdown and multiselect menus only. When Action.all_widgets_are_required is set to true or this widget is specified in Action.required_widgets, the submission action is blocked unless a value is selected. 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 Add selectable UI elements. 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



4195
4196
4197
# File 'lib/google/apis/chat_v1/classes.rb', line 4195

def selection_input
  @selection_input
end

#text_inputGoogle::Apis::ChatV1::GoogleAppsCardV1TextInput

A field in which users can enter text. Supports suggestions and on-change actions. Supports form submission validation. When Action. all_widgets_are_required is set to true or this widget is specified in Action.required_widgets, the submission action is blocked unless a value is entered. For an example in Google Chat apps, see Add a field in which a user can enter text. 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



4212
4213
4214
# File 'lib/google/apis/chat_v1/classes.rb', line 4212

def text_input
  @text_input
end

#text_paragraphGoogle::Apis::ChatV1::GoogleAppsCardV1TextParagraph

A paragraph of text that supports formatting. For an example in Google Chat apps, see Add a paragraph of formatted text. 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



4225
4226
4227
# File 'lib/google/apis/chat_v1/classes.rb', line 4225

def text_paragraph
  @text_paragraph
end

#visibilityString

Specifies whether the widget is visible or hidden. The default value is VISIBLE. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps. Corresponds to the JSON property visibility

Returns:

  • (String)


4232
4233
4234
# File 'lib/google/apis/chat_v1/classes.rb', line 4232

def visibility
  @visibility
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
# File 'lib/google/apis/chat_v1/classes.rb', line 4239

def update!(**args)
  @button_list = args[:button_list] if args.key?(:button_list)
  @carousel = args[:carousel] if args.key?(:carousel)
  @chip_list = args[:chip_list] if args.key?(:chip_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)
  @event_actions = args[:event_actions] if args.key?(:event_actions)
  @grid = args[:grid] if args.key?(:grid)
  @horizontal_alignment = args[:horizontal_alignment] if args.key?(:horizontal_alignment)
  @id = args[:id] if args.key?(:id)
  @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)
  @visibility = args[:visibility] if args.key?(:visibility)
end