public static final class Widget.Builder extends GeneratedMessageV3.Builder<Widget.Builder> implements 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
Inheritance
Object > AbstractMessageLite.Builder<MessageType,BuilderType> > AbstractMessage.Builder<BuilderType> > GeneratedMessageV3.Builder > Widget.BuilderImplements
WidgetOrBuilderStatic Methods
getDescriptor()
public static final Descriptors.Descriptor getDescriptor()
Returns | |
---|---|
Type | Description |
Descriptor |
Methods
addRepeatedField(Descriptors.FieldDescriptor field, Object value)
public Widget.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Widget.Builder |
build()
public Widget build()
Returns | |
---|---|
Type | Description |
Widget |
buildPartial()
public Widget buildPartial()
Returns | |
---|---|
Type | Description |
Widget |
clear()
public Widget.Builder clear()
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearButtonList()
public Widget.Builder clearButtonList()
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearColumns()
public Widget.Builder clearColumns()
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearData()
public Widget.Builder clearData()
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearDateTimePicker()
public Widget.Builder clearDateTimePicker()
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearDecoratedText()
public Widget.Builder clearDecoratedText()
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearDivider()
public Widget.Builder clearDivider()
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearField(Descriptors.FieldDescriptor field)
public Widget.Builder clearField(Descriptors.FieldDescriptor field)
Parameter | |
---|---|
Name | Description |
field |
FieldDescriptor |
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearGrid()
public Widget.Builder clearGrid()
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearHorizontalAlignment()
public Widget.Builder clearHorizontalAlignment()
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
Returns | |
---|---|
Type | Description |
Widget.Builder |
This builder for chaining. |
clearImage()
public Widget.Builder clearImage()
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearOneof(Descriptors.OneofDescriptor oneof)
public Widget.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter | |
---|---|
Name | Description |
oneof |
OneofDescriptor |
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearSelectionInput()
public Widget.Builder clearSelectionInput()
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clearTextInput()
public Widget.Builder clearTextInput()
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 | |
---|---|
Type | Description |
Widget.Builder |
clearTextParagraph()
public Widget.Builder clearTextParagraph()
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Returns | |
---|---|
Type | Description |
Widget.Builder |
clone()
public Widget.Builder clone()
Returns | |
---|---|
Type | Description |
Widget.Builder |
getButtonList()
public ButtonList getButtonList()
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Returns | |
---|---|
Type | Description |
ButtonList |
The buttonList. |
getButtonListBuilder()
public ButtonList.Builder getButtonListBuilder()
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Returns | |
---|---|
Type | Description |
ButtonList.Builder |
getButtonListOrBuilder()
public ButtonListOrBuilder getButtonListOrBuilder()
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Returns | |
---|---|
Type | Description |
ButtonListOrBuilder |
getColumns()
public Columns getColumns()
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Returns | |
---|---|
Type | Description |
Columns |
The columns. |
getColumnsBuilder()
public Columns.Builder getColumnsBuilder()
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Returns | |
---|---|
Type | Description |
Columns.Builder |
getColumnsOrBuilder()
public ColumnsOrBuilder getColumnsOrBuilder()
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Returns | |
---|---|
Type | Description |
ColumnsOrBuilder |
getDataCase()
public Widget.DataCase getDataCase()
Returns | |
---|---|
Type | Description |
Widget.DataCase |
getDateTimePicker()
public DateTimePicker getDateTimePicker()
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Returns | |
---|---|
Type | Description |
DateTimePicker |
The dateTimePicker. |
getDateTimePickerBuilder()
public DateTimePicker.Builder getDateTimePickerBuilder()
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Returns | |
---|---|
Type | Description |
DateTimePicker.Builder |
getDateTimePickerOrBuilder()
public DateTimePickerOrBuilder getDateTimePickerOrBuilder()
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Returns | |
---|---|
Type | Description |
DateTimePickerOrBuilder |
getDecoratedText()
public DecoratedText getDecoratedText()
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Returns | |
---|---|
Type | Description |
DecoratedText |
The decoratedText. |
getDecoratedTextBuilder()
public DecoratedText.Builder getDecoratedTextBuilder()
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Returns | |
---|---|
Type | Description |
DecoratedText.Builder |
getDecoratedTextOrBuilder()
public DecoratedTextOrBuilder getDecoratedTextOrBuilder()
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Returns | |
---|---|
Type | Description |
DecoratedTextOrBuilder |
getDefaultInstanceForType()
public Widget getDefaultInstanceForType()
Returns | |
---|---|
Type | Description |
Widget |
getDescriptorForType()
public Descriptors.Descriptor getDescriptorForType()
Returns | |
---|---|
Type | Description |
Descriptor |
getDivider()
public Divider getDivider()
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Returns | |
---|---|
Type | Description |
Divider |
The divider. |
getDividerBuilder()
public Divider.Builder getDividerBuilder()
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Returns | |
---|---|
Type | Description |
Divider.Builder |
getDividerOrBuilder()
public DividerOrBuilder getDividerOrBuilder()
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Returns | |
---|---|
Type | Description |
DividerOrBuilder |
getGrid()
public Grid getGrid()
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Returns | |
---|---|
Type | Description |
Grid |
The grid. |
getGridBuilder()
public Grid.Builder getGridBuilder()
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Returns | |
---|---|
Type | Description |
Grid.Builder |
getGridOrBuilder()
public GridOrBuilder getGridOrBuilder()
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Returns | |
---|---|
Type | Description |
GridOrBuilder |
getHorizontalAlignment()
public Widget.HorizontalAlignment getHorizontalAlignment()
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
Returns | |
---|---|
Type | Description |
Widget.HorizontalAlignment |
The horizontalAlignment. |
getHorizontalAlignmentValue()
public int getHorizontalAlignmentValue()
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
Returns | |
---|---|
Type | Description |
int |
The enum numeric value on the wire for horizontalAlignment. |
getImage()
public Image getImage()
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Returns | |
---|---|
Type | Description |
Image |
The image. |
getImageBuilder()
public Image.Builder getImageBuilder()
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Returns | |
---|---|
Type | Description |
Image.Builder |
getImageOrBuilder()
public ImageOrBuilder getImageOrBuilder()
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Returns | |
---|---|
Type | Description |
ImageOrBuilder |
getSelectionInput()
public SelectionInput getSelectionInput()
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Returns | |
---|---|
Type | Description |
SelectionInput |
The selectionInput. |
getSelectionInputBuilder()
public SelectionInput.Builder getSelectionInputBuilder()
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Returns | |
---|---|
Type | Description |
SelectionInput.Builder |
getSelectionInputOrBuilder()
public SelectionInputOrBuilder getSelectionInputOrBuilder()
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Returns | |
---|---|
Type | Description |
SelectionInputOrBuilder |
getTextInput()
public TextInput getTextInput()
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 | |
---|---|
Type | Description |
TextInput |
The textInput. |
getTextInputBuilder()
public TextInput.Builder getTextInputBuilder()
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 | |
---|---|
Type | Description |
TextInput.Builder |
getTextInputOrBuilder()
public TextInputOrBuilder getTextInputOrBuilder()
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 | |
---|---|
Type | Description |
TextInputOrBuilder |
getTextParagraph()
public TextParagraph getTextParagraph()
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Returns | |
---|---|
Type | Description |
TextParagraph |
The textParagraph. |
getTextParagraphBuilder()
public TextParagraph.Builder getTextParagraphBuilder()
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Returns | |
---|---|
Type | Description |
TextParagraph.Builder |
getTextParagraphOrBuilder()
public TextParagraphOrBuilder getTextParagraphOrBuilder()
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Returns | |
---|---|
Type | Description |
TextParagraphOrBuilder |
hasButtonList()
public boolean hasButtonList()
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Returns | |
---|---|
Type | Description |
boolean |
Whether the buttonList field is set. |
hasColumns()
public boolean hasColumns()
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Returns | |
---|---|
Type | Description |
boolean |
Whether the columns field is set. |
hasDateTimePicker()
public boolean hasDateTimePicker()
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Returns | |
---|---|
Type | Description |
boolean |
Whether the dateTimePicker field is set. |
hasDecoratedText()
public boolean hasDecoratedText()
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Returns | |
---|---|
Type | Description |
boolean |
Whether the decoratedText field is set. |
hasDivider()
public boolean hasDivider()
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Returns | |
---|---|
Type | Description |
boolean |
Whether the divider field is set. |
hasGrid()
public boolean hasGrid()
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Returns | |
---|---|
Type | Description |
boolean |
Whether the grid field is set. |
hasImage()
public boolean hasImage()
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Returns | |
---|---|
Type | Description |
boolean |
Whether the image field is set. |
hasSelectionInput()
public boolean hasSelectionInput()
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Returns | |
---|---|
Type | Description |
boolean |
Whether the selectionInput field is set. |
hasTextInput()
public boolean hasTextInput()
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 | |
---|---|
Type | Description |
boolean |
Whether the textInput field is set. |
hasTextParagraph()
public boolean hasTextParagraph()
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Returns | |
---|---|
Type | Description |
boolean |
Whether the textParagraph field is set. |
internalGetFieldAccessorTable()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns | |
---|---|
Type | Description |
FieldAccessorTable |
isInitialized()
public final boolean isInitialized()
Returns | |
---|---|
Type | Description |
boolean |
mergeButtonList(ButtonList value)
public Widget.Builder mergeButtonList(ButtonList value)
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Parameter | |
---|---|
Name | Description |
value |
ButtonList |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeColumns(Columns value)
public Widget.Builder mergeColumns(Columns value)
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Parameter | |
---|---|
Name | Description |
value |
Columns |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeDateTimePicker(DateTimePicker value)
public Widget.Builder mergeDateTimePicker(DateTimePicker value)
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Parameter | |
---|---|
Name | Description |
value |
DateTimePicker |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeDecoratedText(DecoratedText value)
public Widget.Builder mergeDecoratedText(DecoratedText value)
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Parameter | |
---|---|
Name | Description |
value |
DecoratedText |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeDivider(Divider value)
public Widget.Builder mergeDivider(Divider value)
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Parameter | |
---|---|
Name | Description |
value |
Divider |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeFrom(Widget other)
public Widget.Builder mergeFrom(Widget other)
Parameter | |
---|---|
Name | Description |
other |
Widget |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
public Widget.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters | |
---|---|
Name | Description |
input |
CodedInputStream |
extensionRegistry |
ExtensionRegistryLite |
Returns | |
---|---|
Type | Description |
Widget.Builder |
Exceptions | |
---|---|
Type | Description |
IOException |
mergeFrom(Message other)
public Widget.Builder mergeFrom(Message other)
Parameter | |
---|---|
Name | Description |
other |
Message |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeGrid(Grid value)
public Widget.Builder mergeGrid(Grid value)
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Parameter | |
---|---|
Name | Description |
value |
Grid |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeImage(Image value)
public Widget.Builder mergeImage(Image value)
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Parameter | |
---|---|
Name | Description |
value |
Image |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeSelectionInput(SelectionInput value)
public Widget.Builder mergeSelectionInput(SelectionInput value)
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Parameter | |
---|---|
Name | Description |
value |
SelectionInput |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeTextInput(TextInput value)
public Widget.Builder mergeTextInput(TextInput value)
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;
Parameter | |
---|---|
Name | Description |
value |
TextInput |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeTextParagraph(TextParagraph value)
public Widget.Builder mergeTextParagraph(TextParagraph value)
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Parameter | |
---|---|
Name | Description |
value |
TextParagraph |
Returns | |
---|---|
Type | Description |
Widget.Builder |
mergeUnknownFields(UnknownFieldSet unknownFields)
public final Widget.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setButtonList(ButtonList value)
public Widget.Builder setButtonList(ButtonList value)
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Parameter | |
---|---|
Name | Description |
value |
ButtonList |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setButtonList(ButtonList.Builder builderForValue)
public Widget.Builder setButtonList(ButtonList.Builder builderForValue)
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:
<code><code>
"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"
}
}
}
]
}
</code></code>
.google.apps.card.v1.ButtonList button_list = 4;
Parameter | |
---|---|
Name | Description |
builderForValue |
ButtonList.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setColumns(Columns value)
public Widget.Builder setColumns(Columns value)
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Parameter | |
---|---|
Name | Description |
value |
Columns |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setColumns(Columns.Builder builderForValue)
public Widget.Builder setColumns(Columns.Builder builderForValue)
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:
<code><code>
"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"
}
}
]
}
]
}
</code></code>
.google.apps.card.v1.Columns columns = 11;
Parameter | |
---|---|
Name | Description |
builderForValue |
Columns.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDateTimePicker(DateTimePicker value)
public Widget.Builder setDateTimePicker(DateTimePicker value)
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Parameter | |
---|---|
Name | Description |
value |
DateTimePicker |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDateTimePicker(DateTimePicker.Builder builderForValue)
public Widget.Builder setDateTimePicker(DateTimePicker.Builder builderForValue)
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:
<code><code>
"dateTimePicker": {
"name": "appointment_time",
"label": "Book your appointment at:",
"type": "DATE_AND_TIME",
"valueMsEpoch": "796435200000"
}
</code></code>
.google.apps.card.v1.DateTimePicker date_time_picker = 7;
Parameter | |
---|---|
Name | Description |
builderForValue |
DateTimePicker.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDecoratedText(DecoratedText value)
public Widget.Builder setDecoratedText(DecoratedText value)
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Parameter | |
---|---|
Name | Description |
value |
DecoratedText |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDecoratedText(DecoratedText.Builder builderForValue)
public Widget.Builder setDecoratedText(DecoratedText.Builder builderForValue)
Displays a decorated text item.
For example, the following JSON creates a decorated text widget showing email address:
<code><code>
"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"
}
}
</code></code>
.google.apps.card.v1.DecoratedText decorated_text = 3;
Parameter | |
---|---|
Name | Description |
builderForValue |
DecoratedText.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDivider(Divider value)
public Widget.Builder setDivider(Divider value)
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Parameter | |
---|---|
Name | Description |
value |
Divider |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setDivider(Divider.Builder builderForValue)
public Widget.Builder setDivider(Divider.Builder builderForValue)
Displays a horizontal line divider between widgets.
For example, the following JSON creates a divider:
<code><code>
"divider": {
}
</code></code>
.google.apps.card.v1.Divider divider = 9;
Parameter | |
---|---|
Name | Description |
builderForValue |
Divider.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setField(Descriptors.FieldDescriptor field, Object value)
public Widget.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
value |
Object |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setGrid(Grid value)
public Widget.Builder setGrid(Grid value)
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Parameter | |
---|---|
Name | Description |
value |
Grid |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setGrid(Grid.Builder builderForValue)
public Widget.Builder setGrid(Grid.Builder builderForValue)
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:
For example, the following JSON creates a 2 column grid with a single item:
<code><code>
"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"
}
}
}
</code></code>
.google.apps.card.v1.Grid grid = 10;
Parameter | |
---|---|
Name | Description |
builderForValue |
Grid.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setHorizontalAlignment(Widget.HorizontalAlignment value)
public Widget.Builder setHorizontalAlignment(Widget.HorizontalAlignment value)
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
Parameter | |
---|---|
Name | Description |
value |
Widget.HorizontalAlignment The horizontalAlignment to set. |
Returns | |
---|---|
Type | Description |
Widget.Builder |
This builder for chaining. |
setHorizontalAlignmentValue(int value)
public Widget.Builder setHorizontalAlignmentValue(int value)
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;
Parameter | |
---|---|
Name | Description |
value |
int The enum numeric value on the wire for horizontalAlignment to set. |
Returns | |
---|---|
Type | Description |
Widget.Builder |
This builder for chaining. |
setImage(Image value)
public Widget.Builder setImage(Image value)
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Parameter | |
---|---|
Name | Description |
value |
Image |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setImage(Image.Builder builderForValue)
public Widget.Builder setImage(Image.Builder builderForValue)
Displays an image.
For example, the following JSON creates an image with alternative text:
<code><code>
"image": {
"imageUrl":
"https://developers.google.com/workspace/chat/images/quickstart-app-avatar.png",
"altText": "Chat app avatar"
}
</code></code>
.google.apps.card.v1.Image image = 2;
Parameter | |
---|---|
Name | Description |
builderForValue |
Image.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
public Widget.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters | |
---|---|
Name | Description |
field |
FieldDescriptor |
index |
int |
value |
Object |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setSelectionInput(SelectionInput value)
public Widget.Builder setSelectionInput(SelectionInput value)
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Parameter | |
---|---|
Name | Description |
value |
SelectionInput |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setSelectionInput(SelectionInput.Builder builderForValue)
public Widget.Builder setSelectionInput(SelectionInput.Builder builderForValue)
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:
<code><code>
"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
}
]
}
</code></code>
.google.apps.card.v1.SelectionInput selection_input = 6;
Parameter | |
---|---|
Name | Description |
builderForValue |
SelectionInput.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setTextInput(TextInput value)
public Widget.Builder setTextInput(TextInput value)
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;
Parameter | |
---|---|
Name | Description |
value |
TextInput |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setTextInput(TextInput.Builder builderForValue)
public Widget.Builder setTextInput(TextInput.Builder builderForValue)
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;
Parameter | |
---|---|
Name | Description |
builderForValue |
TextInput.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setTextParagraph(TextParagraph value)
public Widget.Builder setTextParagraph(TextParagraph value)
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Parameter | |
---|---|
Name | Description |
value |
TextParagraph |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setTextParagraph(TextParagraph.Builder builderForValue)
public Widget.Builder setTextParagraph(TextParagraph.Builder builderForValue)
Displays a text paragraph. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.
For example, the following JSON creates a bolded text:
<code><code>
"textParagraph": {
"text": " <b>bold text</b>"
}
</code></code>
.google.apps.card.v1.TextParagraph text_paragraph = 1;
Parameter | |
---|---|
Name | Description |
builderForValue |
TextParagraph.Builder |
Returns | |
---|---|
Type | Description |
Widget.Builder |
setUnknownFields(UnknownFieldSet unknownFields)
public final Widget.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter | |
---|---|
Name | Description |
unknownFields |
UnknownFieldSet |
Returns | |
---|---|
Type | Description |
Widget.Builder |