Interface WidgetOrBuilder

All Superinterfaces:
com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder
All Known Implementing Classes:
Widget, Widget.Builder

public interface WidgetOrBuilder extends com.google.protobuf.MessageOrBuilder
  • Method Details

    • hasTextParagraph

      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;
      Returns:
      Whether the textParagraph field is set.
    • getTextParagraph

      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:
       ```
       "textParagraph": {
         "text": "  <b>bold text</b>"
       }
       ```
       
      .google.apps.card.v1.TextParagraph text_paragraph = 1;
      Returns:
      The textParagraph.
    • getTextParagraphOrBuilder

      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:
       ```
       "textParagraph": {
         "text": "  <b>bold text</b>"
       }
       ```
       
      .google.apps.card.v1.TextParagraph text_paragraph = 1;
    • hasImage

      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;
      Returns:
      Whether the image field is set.
    • getImage

      Image 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;
      Returns:
      The image.
    • getImageOrBuilder

      ImageOrBuilder 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;
    • hasDecoratedText

      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;
      Returns:
      Whether the decoratedText field is set.
    • getDecoratedText

      DecoratedText 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;
      Returns:
      The decoratedText.
    • getDecoratedTextOrBuilder

      DecoratedTextOrBuilder 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;
    • hasButtonList

      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,
               "alpha": 1
             },
             "disabled": true,
           },
           {
             "icon": {
               "knownIcon": "INVITE",
               "altText": "check calendar"
             },
             "onClick": {
               "openLink": {
                 "url": "https://example.com/calendar"
               }
             }
           }
         ]
       }
       ```
       
      .google.apps.card.v1.ButtonList button_list = 4;
      Returns:
      Whether the buttonList field is set.
    • getButtonList

      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:
       ```
       "buttonList": {
         "buttons": [
           {
             "text": "Edit",
             "color": {
               "red": 0,
               "green": 0,
               "blue": 1,
               "alpha": 1
             },
             "disabled": true,
           },
           {
             "icon": {
               "knownIcon": "INVITE",
               "altText": "check calendar"
             },
             "onClick": {
               "openLink": {
                 "url": "https://example.com/calendar"
               }
             }
           }
         ]
       }
       ```
       
      .google.apps.card.v1.ButtonList button_list = 4;
      Returns:
      The buttonList.
    • getButtonListOrBuilder

      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:
       ```
       "buttonList": {
         "buttons": [
           {
             "text": "Edit",
             "color": {
               "red": 0,
               "green": 0,
               "blue": 1,
               "alpha": 1
             },
             "disabled": true,
           },
           {
             "icon": {
               "knownIcon": "INVITE",
               "altText": "check calendar"
             },
             "onClick": {
               "openLink": {
                 "url": "https://example.com/calendar"
               }
             }
           }
         ]
       }
       ```
       
      .google.apps.card.v1.ButtonList button_list = 4;
    • hasTextInput

      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:
      Whether the textInput field is set.
    • getTextInput

      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:
      The textInput.
    • getTextInputOrBuilder

      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;
    • hasSelectionInput

      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;
      Returns:
      Whether the selectionInput field is set.
    • getSelectionInput

      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:
      
       ```
       "selectionInput": {
         "name": "size",
         "label": "Size"
         "type": "DROPDOWN",
         "items": [
           {
             "text": "S",
             "value": "small",
             "selected": false
           },
           {
             "text": "M",
             "value": "medium",
             "selected": true
           },
           {
             "text": "L",
             "value": "large",
             "selected": false
           },
           {
             "text": "XL",
             "value": "extra_large",
             "selected": false
           }
         ]
       }
       ```
       
      .google.apps.card.v1.SelectionInput selection_input = 6;
      Returns:
      The selectionInput.
    • getSelectionInputOrBuilder

      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:
      
       ```
       "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;
    • hasDateTimePicker

      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;
      Returns:
      Whether the dateTimePicker field is set.
    • getDateTimePicker

      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:
      
      
       ```
       "dateTimePicker": {
         "name": "appointment_time",
         "label": "Book your appointment at:",
         "type": "DATE_AND_TIME",
         "valueMsEpoch": "796435200000"
       }
       ```
       
      .google.apps.card.v1.DateTimePicker date_time_picker = 7;
      Returns:
      The dateTimePicker.
    • getDateTimePickerOrBuilder

      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:
      
      
       ```
       "dateTimePicker": {
         "name": "appointment_time",
         "label": "Book your appointment at:",
         "type": "DATE_AND_TIME",
         "valueMsEpoch": "796435200000"
       }
       ```
       
      .google.apps.card.v1.DateTimePicker date_time_picker = 7;
    • hasDivider

      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;
      Returns:
      Whether the divider field is set.
    • getDivider

      Divider getDivider()
       Displays a horizontal line divider between widgets.
      
       For example, the following JSON creates a divider:
       ```
       "divider": {
       }
       ```
       
      .google.apps.card.v1.Divider divider = 9;
      Returns:
      The divider.
    • getDividerOrBuilder

      DividerOrBuilder getDividerOrBuilder()
       Displays a horizontal line divider between widgets.
      
       For example, the following JSON creates a divider:
       ```
       "divider": {
       }
       ```
       
      .google.apps.card.v1.Divider divider = 9;
    • hasGrid

      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;
      Returns:
      Whether the grid field is set.
    • getGrid

      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:
      
       ```
       "grid": {
         "title": "A fine collection of items",
         "columnCount": 2,
         "borderStyle": {
           "type": "STROKE",
           "cornerRadius": 4
         },
         "items": [
           {
             "image": {
               "imageUri": "https://www.example.com/image.png",
               "cropStyle": {
                 "type": "SQUARE"
               },
               "borderStyle": {
                 "type": "STROKE"
               }
             },
             "title": "An item",
             "textAlignment": "CENTER"
           }
         ],
         "onClick": {
           "openLink": {
             "url": "https://www.example.com"
           }
         }
       }
       ```
       
      .google.apps.card.v1.Grid grid = 10;
      Returns:
      The grid.
    • getGridOrBuilder

      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:
      
       ```
       "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;
    • hasColumns

      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;
      Returns:
      Whether the columns field is set.
    • getColumns

      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:
      
       ```
       "columns": {
         "columnItems": [
           {
             "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
             "horizontalAlignment": "CENTER",
             "verticalAlignment": "CENTER",
             "widgets": [
               {
                 "textParagraph": {
                   "text": "First column text paragraph"
                 }
               }
             ]
           },
           {
             "horizontalSizeStyle": "FILL_AVAILABLE_SPACE",
             "horizontalAlignment": "CENTER",
             "verticalAlignment": "CENTER",
             "widgets": [
               {
                 "textParagraph": {
                   "text": "Second column text paragraph"
                 }
               }
             ]
           }
         ]
       }
       ```
       
      .google.apps.card.v1.Columns columns = 11;
      Returns:
      The columns.
    • getColumnsOrBuilder

      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:
      
       ```
       "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;
    • getHorizontalAlignmentValue

      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:
      The enum numeric value on the wire for horizontalAlignment.
    • getHorizontalAlignment

      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:
      The horizontalAlignment.
    • getDataCase

      Widget.DataCase getDataCase()