Class: Google::Apis::ChatV1::GoogleAppsCardV1SelectionInput

Inherits:
Object
  • Object
show all
Includes:
Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
Defined in:
lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb

Overview

A widget that creates one or more UI items that users can select. 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 Selection input . 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:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1SelectionInput

Returns a new instance of GoogleAppsCardV1SelectionInput.



2454
2455
2456
# File 'lib/google/apis/chat_v1/classes.rb', line 2454

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#external_data_sourceGoogle::Apis::ChatV1::GoogleAppsCardV1Action

An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. Google Workspace Add-ons and Chat apps: Corresponds to the JSON property externalDataSource



2394
2395
2396
# File 'lib/google/apis/chat_v1/classes.rb', line 2394

def external_data_source
  @external_data_source
end

#itemsArray<Google::Apis::ChatV1::GoogleAppsCardV1SelectionItem>

An array of selectable items. For example, an array of radio buttons or checkboxes. Supports up to 100 items. Corresponds to the JSON property items



2400
2401
2402
# File 'lib/google/apis/chat_v1/classes.rb', line 2400

def items
  @items
end

#labelString

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". Corresponds to the JSON property label

Returns:

  • (String)


2408
2409
2410
# File 'lib/google/apis/chat_v1/classes.rb', line 2408

def label
  @label
end

#multi_select_max_selected_itemsFixnum

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

Returns:

  • (Fixnum)


2414
2415
2416
# File 'lib/google/apis/chat_v1/classes.rb', line 2414

def multi_select_max_selected_items
  @multi_select_max_selected_items
end

#multi_select_min_query_lengthFixnum

For multiselect menus, the number of text characters that a user inputs before the Chat app queries autocomplete and displays suggested items in the menu. If unspecified, defaults to 0 characters for static data sources and 3 characters for external data sources. Corresponds to the JSON property multiSelectMinQueryLength

Returns:

  • (Fixnum)


2422
2423
2424
# File 'lib/google/apis/chat_v1/classes.rb', line 2422

def multi_select_min_query_length
  @multi_select_min_query_length
end

#nameString

The name that identifies the selection input in a form input event. For details about working with form inputs, see Receive form data. Corresponds to the JSON property name

Returns:

  • (String)


2429
2430
2431
# File 'lib/google/apis/chat_v1/classes.rb', line 2429

def name
  @name
end

#on_change_actionGoogle::Apis::ChatV1::GoogleAppsCardV1Action

An action that describes the behavior when the form is submitted. For example, you can invoke an Apps Script script to handle the form. If the action is triggered, the form values are sent to the server. Google Workspace Add-ons and Chat apps: Corresponds to the JSON property onChangeAction



2437
2438
2439
# File 'lib/google/apis/chat_v1/classes.rb', line 2437

def on_change_action
  @on_change_action
end

#platform_data_sourceGoogle::Apis::ChatV1::GoogleAppsCardV1PlatformDataSource

For a SelectionInput widget that uses a multiselect menu, a data source from Google Workspace. Used to populate items in a multiselect menu. Google Chat apps: Corresponds to the JSON property platformDataSource



2444
2445
2446
# File 'lib/google/apis/chat_v1/classes.rb', line 2444

def platform_data_source
  @platform_data_source
end

#typeString

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. Corresponds to the JSON property type

Returns:

  • (String)


2452
2453
2454
# File 'lib/google/apis/chat_v1/classes.rb', line 2452

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
# File 'lib/google/apis/chat_v1/classes.rb', line 2459

def update!(**args)
  @external_data_source = args[:external_data_source] if args.key?(:external_data_source)
  @items = args[:items] if args.key?(:items)
  @label = args[:label] if args.key?(:label)
  @multi_select_max_selected_items = args[:multi_select_max_selected_items] if args.key?(:multi_select_max_selected_items)
  @multi_select_min_query_length = args[:multi_select_min_query_length] if args.key?(:multi_select_min_query_length)
  @name = args[:name] if args.key?(:name)
  @on_change_action = args[:on_change_action] if args.key?(:on_change_action)
  @platform_data_source = args[:platform_data_source] if args.key?(:platform_data_source)
  @type = args[:type] if args.key?(:type)
end