Class: Google::Apps::Card::V1::SelectionInput

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/apps/card/v1/card.rb

Overview

A widget that creates one or more UI items that users can select. Supports form submission validation for dropdown and multiselect menus only. When Action.all_widgets_are_required is set to true or this widget is specified in Action.required_widgets, the submission action is blocked unless a value is selected. For example, a dropdown menu or checkboxes. You can use this widget to collect data that can be predicted or enumerated. For an example in Google Chat apps, see Add selectable UI elements.

Chat apps can process the value of items that users select or input. For details about working with form inputs, see Receive form data.

To collect undefined or abstract data from users, use the TextInput widget.

Google Workspace add-ons and Chat apps:

Defined Under Namespace

Modules: SelectionType Classes: PlatformDataSource, SelectionItem

Instance Attribute Summary collapse

Instance Attribute Details

#external_data_source::Google::Apps::Card::V1::Action

Returns An external data source, such as a relational database.

Note: The following fields are mutually exclusive: external_data_source, platform_data_source. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:

  • (::Google::Apps::Card::V1::Action)

    An external data source, such as a relational database.

    Note: The following fields are mutually exclusive: external_data_source, platform_data_source. If a field in that set is populated, all other fields in the set will automatically be cleared.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#items::Array<::Google::Apps::Card::V1::SelectionInput::SelectionItem>

Returns An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items.

Returns:



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#label::String

Returns The text that appears above the selection input field in the user interface.

Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency".

Returns:

  • (::String)

    The text that appears above the selection input field in the user interface.

    Specify text that helps the user enter the information your app needs. For example, if users are selecting the urgency of a work ticket from a drop-down menu, the label might be "Urgency" or "Select urgency".



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#multi_select_max_selected_items::Integer

Returns For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.

Returns:

  • (::Integer)

    For multiselect menus, the maximum number of items that a user can select. Minimum value is 1 item. If unspecified, defaults to 3 items.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#multi_select_min_query_length::Integer

Returns For multiselect menus, the number of text characters that a user inputs before the menu returns suggested selection items.

If unset, the multiselect menu uses the following default values:

  • If the menu uses a static array of SelectionInput items, defaults to 0 characters and immediately populates items from the array.
  • If the menu uses a dynamic data source (multi_select_data_source), defaults to 3 characters before querying the data source to return suggested items.

Returns:

  • (::Integer)

    For multiselect menus, the number of text characters that a user inputs before the menu returns suggested selection items.

    If unset, the multiselect menu uses the following default values:

    • If the menu uses a static array of SelectionInput items, defaults to 0 characters and immediately populates items from the array.
    • If the menu uses a dynamic data source (multi_select_data_source), defaults to 3 characters before querying the data source to return suggested items.


1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#name::String

Returns Required. The name that identifies the selection input in a form input event.

For details about working with form inputs, see Receive form data.

Returns:

  • (::String)

    Required. The name that identifies the selection input in a form input event.

    For details about working with form inputs, see Receive form data.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#on_change_action::Google::Apps::Card::V1::Action

Returns If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form.

For details about working with form inputs, see Receive form data.

Returns:

  • (::Google::Apps::Card::V1::Action)

    If specified, the form is submitted when the selection changes. If not specified, you must specify a separate button that submits the form.

    For details about working with form inputs, see Receive form data.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#platform_data_source::Google::Apps::Card::V1::SelectionInput::PlatformDataSource

Returns A data source from Google Workspace.

Note: The following fields are mutually exclusive: platform_data_source, external_data_source. If a field in that set is populated, all other fields in the set will automatically be cleared.

Returns:



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end

#type::Google::Apps::Card::V1::SelectionInput::SelectionType

Returns The type of items that are displayed to users in a SelectionInput widget. Selection types support different types of interactions. For example, users can select one or more checkboxes, but they can only select one value from a dropdown menu.

Returns:

  • (::Google::Apps::Card::V1::SelectionInput::SelectionType)

    The type of items that are displayed to users in a SelectionInput widget. Selection types support different types of interactions. For example, users can select one or more checkboxes, but they can only select one value from a dropdown menu.



1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'proto_docs/google/apps/card/v1/card.rb', line 1305

class SelectionInput
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # An item that users can select in a selection input, such as a checkbox
  # or switch. Supports up to 100 items.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] text
  #   @return [::String]
  #     The text that identifies or describes the item to users.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value associated with this item. The client should use this as a form
  #     input value.
  #
  #     For details about working with form inputs, see [Receive form
  #     data](https://developers.google.com/workspace/chat/read-form-data).
  # @!attribute [rw] selected
  #   @return [::Boolean]
  #     Whether the item is selected by default. If the selection input only
  #     accepts one value (such as for radio buttons or a dropdown menu), only
  #     set this field for one item.
  # @!attribute [rw] start_icon_uri
  #   @return [::String]
  # @!attribute [rw] bottom_text
  #   @return [::String]
  #     For multiselect menus, a text description or label that's
  #     displayed below the item's `text` field.
  class SelectionItem
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # For a
  # {::Google::Apps::Card::V1::SelectionInput `SelectionInput`} widget that uses a
  # multiselect menu, a data source from Google Workspace. Used to populate
  # items in a multiselect menu.
  #
  # [Google Chat apps](https://developers.google.com/workspace/chat):
  # @!attribute [rw] common_data_source
  #   @return [::Google::Apps::Card::V1::SelectionInput::PlatformDataSource::CommonDataSource]
  #     A data source shared by all Google Workspace applications, such as
  #     users in a Google Workspace organization.
  class PlatformDataSource
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # A data source shared by all [Google Workspace
    # applications]
    # (https://developers.google.com/workspace/chat/api/reference/rest/v1/HostApp).
    #
    # [Google Chat apps](https://developers.google.com/workspace/chat):
    module CommonDataSource
      # Default value. Don't use.
      UNKNOWN = 0

      # Google Workspace users. The user can only view and select users from
      # their Google Workspace organization.
      USER = 1
    end
  end

  # The format for the items that users can select. Different options support
  # different types of interactions. For example, users can select multiple
  # checkboxes, but can only select one item from a dropdown menu.
  #
  # Each selection input supports one type of selection. Mixing checkboxes
  # and switches, for example, isn't supported.
  #
  # [Google Workspace add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module SelectionType
    # A set of checkboxes. Users can select one or more checkboxes.
    CHECK_BOX = 0

    # A set of radio buttons. Users can select one radio button.
    RADIO_BUTTON = 1

    # A set of switches. Users can turn on one or more switches.
    SWITCH = 2

    # A dropdown menu. Users can select one item from the menu.
    DROPDOWN = 3

    # A menu with a text box. Users can type and select one or more items.
    # For Google Workspace add-ons, you must populate items using a static
    # array of `SelectionItem` objects.
    #
    # For Google Chat apps, you can also populate items using a dynamic data
    # source and autosuggest items as users type in the menu. For example,
    # users can start typing the name of a Google Chat space and the widget
    # autosuggests the space. To dynamically populate items for a multiselect
    # menu, use one of the following types of data sources:
    #
    #  * Google Workspace data: Items are populated using data from Google
    #    Workspace, such as Google Workspace users or Google Chat spaces.
    #  * External data: Items are populated from an external data
    #    source outside of Google Workspace.
    #
    # For examples of how to implement multiselect menus for Chat apps, see
    # [Add a multiselect
    # menu](https://developers.google.com/workspace/chat/design-interactive-card-dialog#multiselect-menu).
    #
    # [Google Workspace add-ons and Chat
    # apps](https://developers.google.com/workspace/extend):
    MULTI_SELECT = 4
  end
end