Package com.google.apps.card.v1
Class Widget
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.apps.card.v1.Widget
- All Implemented Interfaces:
WidgetOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
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- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classEach card is made up of widgets.static enumstatic enumSpecifies whether widgets align to the left, right, or center of a column.static enumThe shape used to crop the image.static enumRepresents vertical alignment attribute.Nested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleanA list of buttons.A list of buttons.A carousel contains a collection of nested widgets.A carousel contains a collection of nested widgets.A list of chips.A list of chips.Displays up to 2 columns.Displays up to 2 columns.Displays a widget that lets users input a date, time, or date and time.Displays a widget that lets users input a date, time, or date and time.Displays a decorated text item.Displays a decorated text item.static Widgetstatic final com.google.protobuf.Descriptors.DescriptorDisplays a horizontal line divider between widgets.Displays a horizontal line divider between widgets.getGrid()Displays a grid with a collection of items.Displays a grid with a collection of items.Specifies whether widgets align to the left, right, or center of a column.intSpecifies whether widgets align to the left, right, or center of a column.getImage()Displays an image.Displays an image.com.google.protobuf.Parser<Widget>Displays a selection control that lets users select items.Displays a selection control that lets users select items.intDisplays a text box that users can type into.Displays a text box that users can type into.Displays a text paragraph.Displays a text paragraph.booleanA list of buttons.booleanA carousel contains a collection of nested widgets.booleanA list of chips.booleanDisplays up to 2 columns.booleanDisplays a widget that lets users input a date, time, or date and time.booleanDisplays a decorated text item.booleanDisplays a horizontal line divider between widgets.booleanhasGrid()Displays a grid with a collection of items.inthashCode()booleanhasImage()Displays an image.booleanDisplays a selection control that lets users select items.booleanDisplays a text box that users can type into.booleanDisplays a text paragraph.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic Widget.Builderstatic Widget.BuildernewBuilder(Widget prototype) protected Widget.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static WidgetparseDelimitedFrom(InputStream input) static WidgetparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static WidgetparseFrom(byte[] data) static WidgetparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static WidgetparseFrom(com.google.protobuf.ByteString data) static WidgetparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static WidgetparseFrom(com.google.protobuf.CodedInputStream input) static WidgetparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static WidgetparseFrom(InputStream input) static WidgetparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static WidgetparseFrom(ByteBuffer data) static WidgetparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Widget>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
TEXT_PARAGRAPH_FIELD_NUMBER
public static final int TEXT_PARAGRAPH_FIELD_NUMBER- See Also:
-
IMAGE_FIELD_NUMBER
public static final int IMAGE_FIELD_NUMBER- See Also:
-
DECORATED_TEXT_FIELD_NUMBER
public static final int DECORATED_TEXT_FIELD_NUMBER- See Also:
-
BUTTON_LIST_FIELD_NUMBER
public static final int BUTTON_LIST_FIELD_NUMBER- See Also:
-
TEXT_INPUT_FIELD_NUMBER
public static final int TEXT_INPUT_FIELD_NUMBER- See Also:
-
SELECTION_INPUT_FIELD_NUMBER
public static final int SELECTION_INPUT_FIELD_NUMBER- See Also:
-
DATE_TIME_PICKER_FIELD_NUMBER
public static final int DATE_TIME_PICKER_FIELD_NUMBER- See Also:
-
DIVIDER_FIELD_NUMBER
public static final int DIVIDER_FIELD_NUMBER- See Also:
-
GRID_FIELD_NUMBER
public static final int GRID_FIELD_NUMBER- See Also:
-
COLUMNS_FIELD_NUMBER
public static final int COLUMNS_FIELD_NUMBER- See Also:
-
CAROUSEL_FIELD_NUMBER
public static final int CAROUSEL_FIELD_NUMBER- See Also:
-
CHIP_LIST_FIELD_NUMBER
public static final int CHIP_LIST_FIELD_NUMBER- See Also:
-
HORIZONTAL_ALIGNMENT_FIELD_NUMBER
public static final int HORIZONTAL_ALIGNMENT_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
getDataCase
- Specified by:
getDataCasein interfaceWidgetOrBuilder
-
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](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;- Specified by:
hasTextParagraphin interfaceWidgetOrBuilder- Returns:
- Whether the textParagraph field is set.
-
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: ``` "textParagraph": { "text": " <b>bold text</b>" } ```.google.apps.card.v1.TextParagraph text_paragraph = 1;- Specified by:
getTextParagraphin interfaceWidgetOrBuilder- Returns:
- The textParagraph.
-
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: ``` "textParagraph": { "text": " <b>bold text</b>" } ```.google.apps.card.v1.TextParagraph text_paragraph = 1;- Specified by:
getTextParagraphOrBuilderin interfaceWidgetOrBuilder
-
hasImage
public boolean hasImage()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;- Specified by:
hasImagein interfaceWidgetOrBuilder- Returns:
- Whether the image field is set.
-
getImage
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;- Specified by:
getImagein interfaceWidgetOrBuilder- Returns:
- The image.
-
getImageOrBuilder
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;- Specified by:
getImageOrBuilderin interfaceWidgetOrBuilder
-
hasDecoratedText
public boolean hasDecoratedText()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;- Specified by:
hasDecoratedTextin interfaceWidgetOrBuilder- Returns:
- Whether the decoratedText field is set.
-
getDecoratedText
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;- Specified by:
getDecoratedTextin interfaceWidgetOrBuilder- Returns:
- The decoratedText.
-
getDecoratedTextOrBuilder
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;- Specified by:
getDecoratedTextOrBuilderin interfaceWidgetOrBuilder
-
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: ``` "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" } } } ] } ```.google.apps.card.v1.ButtonList button_list = 4;- Specified by:
hasButtonListin interfaceWidgetOrBuilder- Returns:
- Whether the buttonList field is set.
-
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: ``` "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" } } } ] } ```.google.apps.card.v1.ButtonList button_list = 4;- Specified by:
getButtonListin interfaceWidgetOrBuilder- Returns:
- The buttonList.
-
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: ``` "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" } } } ] } ```.google.apps.card.v1.ButtonList button_list = 4;- Specified by:
getButtonListOrBuilderin interfaceWidgetOrBuilder
-
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;- Specified by:
hasTextInputin interfaceWidgetOrBuilder- Returns:
- Whether the textInput field is set.
-
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;- Specified by:
getTextInputin interfaceWidgetOrBuilder- Returns:
- The textInput.
-
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;- Specified by:
getTextInputOrBuilderin interfaceWidgetOrBuilder
-
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: ``` "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;- Specified by:
hasSelectionInputin interfaceWidgetOrBuilder- Returns:
- Whether the selectionInput field is set.
-
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: ``` "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;- Specified by:
getSelectionInputin interfaceWidgetOrBuilder- Returns:
- The selectionInput.
-
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: ``` "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;- Specified by:
getSelectionInputOrBuilderin interfaceWidgetOrBuilder
-
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: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": 796435200000 } ```.google.apps.card.v1.DateTimePicker date_time_picker = 7;- Specified by:
hasDateTimePickerin interfaceWidgetOrBuilder- Returns:
- Whether the dateTimePicker field is set.
-
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: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": 796435200000 } ```.google.apps.card.v1.DateTimePicker date_time_picker = 7;- Specified by:
getDateTimePickerin interfaceWidgetOrBuilder- Returns:
- The dateTimePicker.
-
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: ``` "dateTimePicker": { "name": "appointment_time", "label": "Book your appointment at:", "type": "DATE_AND_TIME", "valueMsEpoch": 796435200000 } ```.google.apps.card.v1.DateTimePicker date_time_picker = 7;- Specified by:
getDateTimePickerOrBuilderin interfaceWidgetOrBuilder
-
hasDivider
public boolean hasDivider()Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```.google.apps.card.v1.Divider divider = 9;- Specified by:
hasDividerin interfaceWidgetOrBuilder- Returns:
- Whether the divider field is set.
-
getDivider
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```.google.apps.card.v1.Divider divider = 9;- Specified by:
getDividerin interfaceWidgetOrBuilder- Returns:
- The divider.
-
getDividerOrBuilder
Displays a horizontal line divider between widgets. For example, the following JSON creates a divider: ``` "divider": { } ```.google.apps.card.v1.Divider divider = 9;- Specified by:
getDividerOrBuilderin interfaceWidgetOrBuilder
-
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](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;- Specified by:
hasGridin interfaceWidgetOrBuilder- Returns:
- Whether the grid field is set.
-
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: ``` "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;- Specified by:
getGridin interfaceWidgetOrBuilder- Returns:
- The grid.
-
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: ``` "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;- Specified by:
getGridOrBuilderin interfaceWidgetOrBuilder
-
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: ``` "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;- Specified by:
hasColumnsin interfaceWidgetOrBuilder- Returns:
- Whether the columns field is set.
-
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: ``` "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;- Specified by:
getColumnsin interfaceWidgetOrBuilder- Returns:
- The columns.
-
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: ``` "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;- Specified by:
getColumnsOrBuilderin interfaceWidgetOrBuilder
-
hasCarousel
public 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. ``` { "widgets": [ { "textParagraph": { "text": "First text paragraph in the carousel." } }, { "textParagraph": { "text": "Second text paragraph in the carousel." } } ] } ```.google.apps.card.v1.Carousel carousel = 13;- Specified by:
hasCarouselin interfaceWidgetOrBuilder- Returns:
- Whether the carousel field is set.
-
getCarousel
A carousel contains a collection of nested widgets. For example, this is a JSON representation of a carousel that contains two text paragraphs. ``` { "widgets": [ { "textParagraph": { "text": "First text paragraph in the carousel." } }, { "textParagraph": { "text": "Second text paragraph in the carousel." } } ] } ```.google.apps.card.v1.Carousel carousel = 13;- Specified by:
getCarouselin interfaceWidgetOrBuilder- Returns:
- The carousel.
-
getCarouselOrBuilder
A carousel contains a collection of nested widgets. For example, this is a JSON representation of a carousel that contains two text paragraphs. ``` { "widgets": [ { "textParagraph": { "text": "First text paragraph in the carousel." } }, { "textParagraph": { "text": "Second text paragraph in the carousel." } } ] } ```.google.apps.card.v1.Carousel carousel = 13;- Specified by:
getCarouselOrBuilderin interfaceWidgetOrBuilder
-
hasChipList
public 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: ``` "chipList": { "chips": [ { "text": "Edit", "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```.google.apps.card.v1.ChipList chip_list = 14;- Specified by:
hasChipListin interfaceWidgetOrBuilder- Returns:
- Whether the chipList field is set.
-
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: ``` "chipList": { "chips": [ { "text": "Edit", "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```.google.apps.card.v1.ChipList chip_list = 14;- Specified by:
getChipListin interfaceWidgetOrBuilder- Returns:
- The chipList.
-
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: ``` "chipList": { "chips": [ { "text": "Edit", "disabled": true, }, { "icon": { "knownIcon": "INVITE", "altText": "check calendar" }, "onClick": { "openLink": { "url": "https://example.com/calendar" } } } ] } ```.google.apps.card.v1.ChipList chip_list = 14;- Specified by:
getChipListOrBuilderin interfaceWidgetOrBuilder
-
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;- Specified by:
getHorizontalAlignmentValuein interfaceWidgetOrBuilder- Returns:
- The enum numeric value on the wire for horizontalAlignment.
-
getHorizontalAlignment
Specifies whether widgets align to the left, right, or center of a column.
.google.apps.card.v1.Widget.HorizontalAlignment horizontal_alignment = 8;- Specified by:
getHorizontalAlignmentin interfaceWidgetOrBuilder- Returns:
- The horizontalAlignment.
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Widget parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Widget parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Widget parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Widget parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Widget parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Widget parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Widget parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Widget parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Widget parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Widget.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-