final class Widget extends GeneratedMessageV3 with WidgetOrBuilder
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.
Protobuf type google.apps.card.v1.Widget
- Source
- Widget.java
- Alphabetic
- By Inheritance
- Widget
- WidgetOrBuilder
- GeneratedMessageV3
- Serializable
- AbstractMessage
- Message
- MessageOrBuilder
- AbstractMessageLite
- MessageLite
- MessageLiteOrBuilder
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(obj: AnyRef): Boolean
- Definition Classes
- Widget → AbstractMessage → Message → AnyRef → Any
- Annotations
- @Override()
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def findInitializationErrors(): List[String]
- Definition Classes
- AbstractMessage → MessageOrBuilder
- def getAllFields(): Map[FieldDescriptor, AnyRef]
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def getButtonList(): ButtonList
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
.google.apps.card.v1.ButtonList button_list = 4;
- returns
The buttonList.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getButtonListOrBuilder(): ButtonListOrBuilder
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
.google.apps.card.v1.ButtonList button_list = 4;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def getColumns(): Columns
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
.google.apps.card.v1.Columns columns = 11;
- returns
The columns.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getColumnsOrBuilder(): ColumnsOrBuilder
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
.google.apps.card.v1.Columns columns = 11;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDataCase(): DataCase
- Definition Classes
- Widget → WidgetOrBuilder
- def getDateTimePicker(): DateTimePicker
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
- returns
The dateTimePicker.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDateTimePickerOrBuilder(): DateTimePickerOrBuilder
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDecoratedText(): DecoratedText
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
.google.apps.card.v1.DecoratedText decorated_text = 3;
- returns
The decoratedText.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDecoratedTextOrBuilder(): DecoratedTextOrBuilder
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
.google.apps.card.v1.DecoratedText decorated_text = 3;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDefaultInstanceForType(): Widget
- Definition Classes
- Widget → MessageOrBuilder → MessageLiteOrBuilder
- Annotations
- @Override()
- def getDescriptorForType(): Descriptor
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def getDivider(): Divider
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
.google.apps.card.v1.Divider divider = 9;
- returns
The divider.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getDividerOrBuilder(): DividerOrBuilder
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
.google.apps.card.v1.Divider divider = 9;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getField(arg0: FieldDescriptor): AnyRef
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def getGrid(): Grid
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
.google.apps.card.v1.Grid grid = 10;
- returns
The grid.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getGridOrBuilder(): GridOrBuilder
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
.google.apps.card.v1.Grid grid = 10;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getHorizontalAlignment(): HorizontalAlignment
Specifies whether widgets align to the left, right, or center of a column.
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
- returns
The horizontalAlignment.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getHorizontalAlignmentValue(): Int
Specifies whether widgets align to the left, right, or center of a column.
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
- returns
The enum numeric value on the wire for horizontalAlignment.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getImage(): Image
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
.google.apps.card.v1.Image image = 2;
- returns
The image.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getImageOrBuilder(): ImageOrBuilder
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
.google.apps.card.v1.Image image = 2;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getInitializationErrorString(): String
- Definition Classes
- AbstractMessage → MessageOrBuilder
- def getOneofFieldDescriptor(arg0: OneofDescriptor): FieldDescriptor
- Definition Classes
- GeneratedMessageV3 → AbstractMessage → MessageOrBuilder
- def getParserForType(): Parser[Widget]
- Definition Classes
- Widget → GeneratedMessageV3 → Message → MessageLite
- Annotations
- @Override()
- def getRepeatedField(arg0: FieldDescriptor, arg1: Int): AnyRef
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def getRepeatedFieldCount(arg0: FieldDescriptor): Int
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def getSelectionInput(): SelectionInput
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
.google.apps.card.v1.SelectionInput selection_input = 6;
- returns
The selectionInput.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getSelectionInputOrBuilder(): SelectionInputOrBuilder
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
.google.apps.card.v1.SelectionInput selection_input = 6;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getSerializedSize(): Int
- Definition Classes
- Widget → GeneratedMessageV3 → AbstractMessage → MessageLite
- Annotations
- @Override()
- def getTextInput(): TextInput
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
.google.apps.card.v1.TextInput text_input = 5;
- returns
The textInput.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getTextInputOrBuilder(): TextInputOrBuilder
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
.google.apps.card.v1.TextInput text_input = 5;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getTextParagraph(): TextParagraph
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
.google.apps.card.v1.TextParagraph text_paragraph = 1;
- returns
The textParagraph.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getTextParagraphOrBuilder(): TextParagraphOrBuilder
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
.google.apps.card.v1.TextParagraph text_paragraph = 1;
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def getUnknownFields(): UnknownFieldSet
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def hasButtonList(): Boolean
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
A list of buttons. For example, the following JSON creates two buttons. The first is a blue text button and the second is an image button that opens a link: ``` "buttonList": { "buttons": [ { "text": "Edit", "color": { "red": 0, "green": 0, "blue": 1, "alpha": 1 }, "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```
.google.apps.card.v1.ButtonList button_list = 4;
- returns
Whether the buttonList field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasColumns(): Boolean
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
Displays up to 2 columns. To include more than 2 columns, or to use rows, use the `Grid` widget. For example, the following JSON creates 2 columns that each contain text paragraphs: ``` "columns": { "columnItems": [ { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "First column text paragraph" } } ] }, { "horizontalSizeStyle": "FILL_AVAILABLE_SPACE", "horizontalAlignment": "CENTER", "verticalAlignment": "CENTER", "widgets": [ { "textParagraph": { "text": "Second column text paragraph" } } ] } ] } ```
.google.apps.card.v1.Columns columns = 11;
- returns
Whether the columns field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasDateTimePicker(): Boolean
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
Displays a widget that lets users input a date, time, or date and time. For example, the following JSON creates a date time picker to schedule an appointment: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": "796435200000" } ```
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
- returns
Whether the dateTimePicker field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasDecoratedText(): Boolean
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
Displays a decorated text item. For example, the following JSON creates a decorated text widget showing email address: ``` "decoratedText": { "icon": { "knownIcon": "EMAIL" }, "topLabel": "Email Address", "text": "sasha@example.com", "bottomLabel": "This is a new Email address!", "switchControl": { "name": "has_send_welcome_email_to_sasha", "selected": false, "controlType": "CHECKBOX" } } ```
.google.apps.card.v1.DecoratedText decorated_text = 3;
- returns
Whether the decoratedText field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasDivider(): Boolean
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```
.google.apps.card.v1.Divider divider = 9;
- returns
Whether the divider field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasField(arg0: FieldDescriptor): Boolean
- Definition Classes
- GeneratedMessageV3 → MessageOrBuilder
- def hasGrid(): Boolean
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
Displays a grid with a collection of items. A grid supports any number of columns and items. The number of rows is determined by the upper bounds of the number items divided by the number of 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](https://developers.google.com/workspace/extend): 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" } } } ```
.google.apps.card.v1.Grid grid = 10;
- returns
Whether the grid field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasImage(): Boolean
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
Displays an image. For example, the following JSON creates an image with alternative text: ``` "image": { "imageUrl": "https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png", "altText": "Chat app avatar" } ```
.google.apps.card.v1.Image image = 2;
- returns
Whether the image field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasOneof(arg0: OneofDescriptor): Boolean
- Definition Classes
- GeneratedMessageV3 → AbstractMessage → MessageOrBuilder
- def hasSelectionInput(): Boolean
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
Displays a selection control that lets users select items. Selection controls can be checkboxes, radio buttons, switches, or dropdown menus. For example, the following JSON creates a dropdown menu that lets users choose a size: ``` "selectionInput": { "name": "size", "label": "Size" "type": "DROPDOWN", "items": [ { "text": "S", "value": "small", "selected": false }, { "text": "M", "value": "medium", "selected": true }, { "text": "L", "value": "large", "selected": false }, { "text": "XL", "value": "extra_large", "selected": false } ] } ```
.google.apps.card.v1.SelectionInput selection_input = 6;
- returns
Whether the selectionInput field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasTextInput(): Boolean
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
Displays a text box that users can type into. For example, the following JSON creates a text input for an email address: ``` "textInput": { "name": "mailing_address", "label": "Mailing Address" } ``` As another example, the following JSON creates a text input for a programming language with static suggestions: ``` "textInput": { "name": "preferred_programing_language", "label": "Preferred Language", "initialSuggestions": { "items": [ { "text": "C++" }, { "text": "Java" }, { "text": "JavaScript" }, { "text": "Python" } ] } } ```
.google.apps.card.v1.TextInput text_input = 5;
- returns
Whether the textInput field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hasTextParagraph(): Boolean
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). For example, the following JSON creates a bolded text: ``` "textParagraph": { "text": " <b>bold text</b>" } ```
.google.apps.card.v1.TextParagraph text_paragraph = 1;
- returns
Whether the textParagraph field is set.
- Definition Classes
- Widget → WidgetOrBuilder
- Annotations
- @Override()
- def hashCode(): Int
- Definition Classes
- Widget → AbstractMessage → Message → AnyRef → Any
- Annotations
- @Override()
- def internalGetFieldAccessorTable(): FieldAccessorTable
- def internalGetMapField(arg0: Int): MapField[_ <: AnyRef, _ <: AnyRef]
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- final def isInitialized(): Boolean
- Definition Classes
- Widget → GeneratedMessageV3 → AbstractMessage → MessageLiteOrBuilder
- Annotations
- @Override()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeExtensionsImmutable(): Unit
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def newBuilderForType(parent: BuilderParent): Builder
- def newBuilderForType(): Builder
- Definition Classes
- Widget → Message → MessageLite
- Annotations
- @Override()
- def newBuilderForType(arg0: BuilderParent): Builder
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3 → AbstractMessage
- def newInstance(unused: UnusedPrivateParameter): AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parseUnknownField(arg0: CodedInputStream, arg1: Builder, arg2: ExtensionRegistryLite, arg3: Int): Boolean
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- Annotations
- @throws(classOf[java.io.IOException])
- def parseUnknownFieldProto3(arg0: CodedInputStream, arg1: Builder, arg2: ExtensionRegistryLite, arg3: Int): Boolean
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- Annotations
- @throws(classOf[java.io.IOException])
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toBuilder(): Builder
- Definition Classes
- Widget → Message → MessageLite
- Annotations
- @Override()
- def toByteArray(): Array[Byte]
- Definition Classes
- AbstractMessageLite → MessageLite
- def toByteString(): ByteString
- Definition Classes
- AbstractMessageLite → MessageLite
- final def toString(): String
- Definition Classes
- AbstractMessage → Message → AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def writeDelimitedTo(arg0: OutputStream): Unit
- Definition Classes
- AbstractMessageLite → MessageLite
- Annotations
- @throws(classOf[java.io.IOException])
- def writeReplace(): AnyRef
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- Annotations
- @throws(classOf[java.io.ObjectStreamException])
- def writeTo(output: CodedOutputStream): Unit
- Definition Classes
- Widget → GeneratedMessageV3 → AbstractMessage → MessageLite
- Annotations
- @Override()
- def writeTo(arg0: OutputStream): Unit
- Definition Classes
- AbstractMessageLite → MessageLite
- Annotations
- @throws(classOf[java.io.IOException])
Deprecated Value Members
- def mergeFromAndMakeImmutableInternal(arg0: CodedInputStream, arg1: ExtensionRegistryLite): Unit
- Attributes
- protected[protobuf]
- Definition Classes
- GeneratedMessageV3
- Annotations
- @throws(classOf[com.google.protobuf.InvalidProtocolBufferException]) @Deprecated
- Deprecated