# Interface WidgetOrBuilder (2.72.0)

2.72.0 (latest) 2.70.0 2.67.0 2.66.0 2.65.1 2.64.1 2.63.2 2.62.0 2.61.3 2.60.0 2.59.2 2.58.0 2.57.0 2.56.0 2.54.1 2.53.0 2.52.0 2.51.0 2.50.1 2.49.0 2.48.0 2.46.0 2.45.1 2.44.0 2.43.0 2.42.0 2.41.0 2.40.0 2.39.1 2.38.0 2.37.1 2.36.0 2.34.0 2.33.0 2.32.0 2.30.0 2.29.0 2.28.0 2.27.0 2.26.0 2.25.1 2.24.0 2.23.1 2.22.1 2.21.1 2.15.0 2.14.3 2.13.0 2.12.0 2.11.0 2.10.0 2.9.6 2.8.4 2.7.4

    public interface WidgetOrBuilder extends MessageOrBuilder

## Implements

[MessageOrBuilder](https://cloud.google.com/java/docs/reference/protobuf/latest/com.google.protobuf.MessageOrBuilder.html)

## Methods

### getButtonList()

    public abstract 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,
},
"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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ButtonList` | The buttonList. |

### getButtonListOrBuilder()

    public abstract 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,
},
"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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ButtonListOrBuilder` |   |

### getCarousel()

    public abstract Carousel getCarousel()

A carousel contains a collection of nested widgets.
For example, this is a JSON representation of a carousel that contains
two text paragraphs.

`<code><code>
{
"widgets": [
{
"textParagraph": {
"text": "First text paragraph in the carousel."
}
},
{
"textParagraph": {
"text": "Second text paragraph in the carousel."
}
}
]
}
</code></code>`

`.google.apps.card.v1.Carousel carousel = 13;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Carousel` | The carousel. |

### getCarouselOrBuilder()

    public abstract CarouselOrBuilder getCarouselOrBuilder()

A carousel contains a collection of nested widgets.
For example, this is a JSON representation of a carousel that contains
two text paragraphs.

`<code><code>
{
"widgets": [
{
"textParagraph": {
"text": "First text paragraph in the carousel."
}
},
{
"textParagraph": {
"text": "Second text paragraph in the carousel."
}
}
]
}
</code></code>`

`.google.apps.card.v1.Carousel carousel = 13;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.CarouselOrBuilder` |   |

### getChipList()

    public abstract ChipList getChipList()

A list of chips.

For example, the following JSON creates two chips. The first
is a text chip and the second is an icon chip that opens a
link:
`<code><code>
"chipList": {
"chips": [
{
"text": "Edit",
"disabled": true,
},
{
"icon": {
"knownIcon": "INVITE",
"altText": "check calendar"
},
"onClick": {
"openLink": {
"url": "https://example.com/calendar"
}
}
}
]
}
</code></code>`

`.google.apps.card.v1.ChipList chip_list = 14;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ChipList` | The chipList. |

### getChipListOrBuilder()

    public abstract ChipListOrBuilder getChipListOrBuilder()

A list of chips.

For example, the following JSON creates two chips. The first
is a text chip and the second is an icon chip that opens a
link:
`<code><code>
"chipList": {
"chips": [
{
"text": "Edit",
"disabled": true,
},
{
"icon": {
"knownIcon": "INVITE",
"altText": "check calendar"
},
"onClick": {
"openLink": {
"url": "https://example.com/calendar"
}
}
}
]
}
</code></code>`

`.google.apps.card.v1.ChipList chip_list = 14;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ChipListOrBuilder` |   |

### getColumns()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Columns` | The columns. |

### getColumnsOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ColumnsOrBuilder` |   |

### getDataCase()

    public abstract Widget.DataCase getDataCase()

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Widget.DataCase` |   |

### getDateTimePicker()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.DateTimePicker` | The dateTimePicker. |

### getDateTimePickerOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.DateTimePickerOrBuilder` |   |

### getDecoratedText()

    public abstract 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&#64;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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.DecoratedText` | The decoratedText. |

### getDecoratedTextOrBuilder()

    public abstract 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&#64;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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.DecoratedTextOrBuilder` |   |

### getDivider()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Divider` | The divider. |

### getDividerOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.DividerOrBuilder` |   |

### getGrid()

    public abstract 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](https://developers.google.com/workspace/extend):

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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Grid` | The grid. |

### getGridOrBuilder()

    public abstract 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](https://developers.google.com/workspace/extend):

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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.GridOrBuilder` |   |

### getHorizontalAlignment()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Widget.HorizontalAlignment` | The horizontalAlignment. |

### getHorizontalAlignmentValue()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | The enum numeric value on the wire for horizontalAlignment. |

### getImage()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.Image` | The image. |

### getImageOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.ImageOrBuilder` |   |

### getSelectionInput()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.SelectionInput` | The selectionInput. |

### getSelectionInputOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.SelectionInputOrBuilder` |   |

### getTextInput()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.TextInput` | The textInput. |

### getTextInputOrBuilder()

    public abstract 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** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.TextInputOrBuilder` |   |

### getTextParagraph()

    public abstract TextParagraph getTextParagraph()

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:
`<code><code>
"textParagraph": {
"text": " &lt;b&gt;bold text&lt;/b&gt;"
}
</code></code>`

`.google.apps.card.v1.TextParagraph text_paragraph = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.TextParagraph` | The textParagraph. |

### getTextParagraphOrBuilder()

    public abstract TextParagraphOrBuilder getTextParagraphOrBuilder()

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:
`<code><code>
"textParagraph": {
"text": " &lt;b&gt;bold text&lt;/b&gt;"
}
</code></code>`

`.google.apps.card.v1.TextParagraph text_paragraph = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/java/docs/reference/proto-google-common-protos/latest/com.google.apps.card.v1.TextParagraphOrBuilder` |   |

### hasButtonList()

    public abstract 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,
},
"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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the buttonList field is set. |

### hasCarousel()

    public abstract boolean hasCarousel()

A carousel contains a collection of nested widgets.
For example, this is a JSON representation of a carousel that contains
two text paragraphs.

`<code><code>
{
"widgets": [
{
"textParagraph": {
"text": "First text paragraph in the carousel."
}
},
{
"textParagraph": {
"text": "Second text paragraph in the carousel."
}
}
]
}
</code></code>`

`.google.apps.card.v1.Carousel carousel = 13;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the carousel field is set. |

### hasChipList()

    public abstract boolean hasChipList()

A list of chips.

For example, the following JSON creates two chips. The first
is a text chip and the second is an icon chip that opens a
link:
`<code><code>
"chipList": {
"chips": [
{
"text": "Edit",
"disabled": true,
},
{
"icon": {
"knownIcon": "INVITE",
"altText": "check calendar"
},
"onClick": {
"openLink": {
"url": "https://example.com/calendar"
}
}
}
]
}
</code></code>`

`.google.apps.card.v1.ChipList chip_list = 14;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the chipList field is set. |

### hasColumns()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the columns field is set. |

### hasDateTimePicker()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the dateTimePicker field is set. |

### hasDecoratedText()

    public abstract 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&#64;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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the decoratedText field is set. |

### hasDivider()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the divider field is set. |

### hasGrid()

    public abstract 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](https://developers.google.com/workspace/extend):

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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the grid field is set. |

### hasImage()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the image field is set. |

### hasSelectionInput()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the selectionInput field is set. |

### hasTextInput()

    public abstract 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** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the textInput field is set. |

### hasTextParagraph()

    public abstract boolean hasTextParagraph()

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:
`<code><code>
"textParagraph": {
"text": " &lt;b&gt;bold text&lt;/b&gt;"
}
</code></code>`

`.google.apps.card.v1.TextParagraph text_paragraph = 1;`

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html` | Whether the textParagraph field is set. |