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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1SelectionInput

Returns a new instance of GoogleAppsCardV1SelectionInput.



2213
2214
2215
# File 'lib/google/apis/chat_v1/classes.rb', line 2213

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

Instance Attribute Details

#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



2181
2182
2183
# File 'lib/google/apis/chat_v1/classes.rb', line 2181

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)


2189
2190
2191
# File 'lib/google/apis/chat_v1/classes.rb', line 2189

def label
  @label
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)


2196
2197
2198
# File 'lib/google/apis/chat_v1/classes.rb', line 2196

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



2203
2204
2205
# File 'lib/google/apis/chat_v1/classes.rb', line 2203

def on_change_action
  @on_change_action
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)


2211
2212
2213
# File 'lib/google/apis/chat_v1/classes.rb', line 2211

def type
  @type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2218
2219
2220
2221
2222
2223
2224
# File 'lib/google/apis/chat_v1/classes.rb', line 2218

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