Class: Google::Apis::ChatV1::GoogleAppsCardV1TextInput

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 field in which users can enter text. Supports suggestions and on-change actions. Chat apps receive and can process the value of entered text during form input events. For details about working with form inputs, see Receive form data. When you need to collect undefined or abstract data from users, use a text input. To collect defined or enumerated data from users, use the SelectionInput widget.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1TextInput

Returns a new instance of GoogleAppsCardV1TextInput.



2439
2440
2441
# File 'lib/google/apis/chat_v1/classes.rb', line 2439

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

Instance Attribute Details

#auto_complete_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 autoCompleteAction



2380
2381
2382
# File 'lib/google/apis/chat_v1/classes.rb', line 2380

def auto_complete_action
  @auto_complete_action
end

#hint_textString

Text that appears below the text input field meant to assist users by prompting them to enter a certain value. This text is always visible. Required if label is unspecified. Otherwise, optional. Corresponds to the JSON property hintText

Returns:

  • (String)


2387
2388
2389
# File 'lib/google/apis/chat_v1/classes.rb', line 2387

def hint_text
  @hint_text
end

#initial_suggestionsGoogle::Apis::ChatV1::GoogleAppsCardV1Suggestions

Suggested values that users can enter. These values appear when users click inside the text input field. As users type, the suggested values dynamically filter to match what the users have typed. For example, a text input field for programming language might suggest Java, JavaScript, Python, and C++. When users start typing Jav, the list of suggestions filters to show Java and JavaScript. Suggested values help guide users to enter values that your app can make sense of. When referring to JavaScript, some users might enter javascript and others java script. Suggesting JavaScript can standardize how users interact with your app. When specified, TextInput.type is always SINGLE_LINE, even if it's set to MULTIPLE_LINE. Corresponds to the JSON property initialSuggestions



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

def initial_suggestions
  @initial_suggestions
end

#labelString

The text that appears above the text input field in the user interface. Specify text that helps the user enter the information your app needs. For example, if you are asking someone's name, but specifically need their surname, write surname instead of name. Required if hintText is unspecified. Otherwise, optional. Corresponds to the JSON property label

Returns:

  • (String)


2410
2411
2412
# File 'lib/google/apis/chat_v1/classes.rb', line 2410

def label
  @label
end

#nameString

The name by which the text input is identified in a form input event. For details about working with form inputs, see Receive form data. Corresponds to the JSON property name

Returns:

  • (String)


2417
2418
2419
# File 'lib/google/apis/chat_v1/classes.rb', line 2417

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



2424
2425
2426
# File 'lib/google/apis/chat_v1/classes.rb', line 2424

def on_change_action
  @on_change_action
end

#typeString

How a text input field appears in the user interface. For example, whether the field is single or multi-line. Corresponds to the JSON property type

Returns:

  • (String)


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

def type
  @type
end

#valueString

The value entered by a user, returned as part of a form input event. For details about working with form inputs, see Receive form data. Corresponds to the JSON property value

Returns:

  • (String)


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

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
# File 'lib/google/apis/chat_v1/classes.rb', line 2444

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