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. 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:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1SelectionInput

Returns a new instance of GoogleAppsCardV1SelectionInput.



3731
3732
3733
# File 'lib/google/apis/chat_v1/classes.rb', line 3731

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

Instance Attribute Details

#data_source_configsArray<Google::Apis::ChatV1::GoogleAppsCardV1DataSourceConfig>

Optional. The data source configs for the selection control. This field provides more fine-grained control over the data source. If specified, the multi_select_max_selected_items field, multi_select_min_query_length field, external_data_source field and platform_data_source field are ignored. Available for Google Workspace add-ons that extend Google Workspace Studio. Available for the Dropdown widget in Google Chat apps. For the Dropdown widget in Google Chat apps, only one DataSourceConfig is supported. If multiple DataSourceConfigs are set, only the first one is used. Corresponds to the JSON property dataSourceConfigs



3652
3653
3654
# File 'lib/google/apis/chat_v1/classes.rb', line 3652

def data_source_configs
  @data_source_configs
end

#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



3660
3661
3662
# File 'lib/google/apis/chat_v1/classes.rb', line 3660

def external_data_source
  @external_data_source
end

#hint_textString

Optional. Text that appears below the selection input field meant to assist users by prompting them to enter a certain value. This text is always visible. Available for Google Workspace add-ons that extend Google Workspace Studio. Unavailable for Google Chat apps. Corresponds to the JSON property hintText

Returns:

  • (String)


3668
3669
3670
# File 'lib/google/apis/chat_v1/classes.rb', line 3668

def hint_text
  @hint_text
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



3674
3675
3676
# File 'lib/google/apis/chat_v1/classes.rb', line 3674

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)


3682
3683
3684
# File 'lib/google/apis/chat_v1/classes.rb', line 3682

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)


3688
3689
3690
# File 'lib/google/apis/chat_v1/classes.rb', line 3688

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

Returns:

  • (Fixnum)


3699
3700
3701
# File 'lib/google/apis/chat_v1/classes.rb', line 3699

def multi_select_min_query_length
  @multi_select_min_query_length
end

#nameString

Required. 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)


3706
3707
3708
# File 'lib/google/apis/chat_v1/classes.rb', line 3706

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



3714
3715
3716
# File 'lib/google/apis/chat_v1/classes.rb', line 3714

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



3721
3722
3723
# File 'lib/google/apis/chat_v1/classes.rb', line 3721

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)


3729
3730
3731
# File 'lib/google/apis/chat_v1/classes.rb', line 3729

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
# File 'lib/google/apis/chat_v1/classes.rb', line 3736

def update!(**args)
  @data_source_configs = args[:data_source_configs] if args.key?(:data_source_configs)
  @external_data_source = args[:external_data_source] if args.key?(:external_data_source)
  @hint_text = args[:hint_text] if args.key?(:hint_text)
  @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