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. Supports form submission validation. 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 entered. For an example in Google Chat apps, see Add a field in which a user can enter text. 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. Google Workspace add-ons and Chat apps:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1TextInput

Returns a new instance of GoogleAppsCardV1TextInput.



3833
3834
3835
# File 'lib/google/apis/chat_v1/classes.rb', line 3833

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. Google Workspace add-ons and Chat apps: Corresponds to the JSON property autoCompleteAction



3752
3753
3754
# File 'lib/google/apis/chat_v1/classes.rb', line 3752

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)


3759
3760
3761
# File 'lib/google/apis/chat_v1/classes.rb', line 3759

def hint_text
  @hint_text
end

#host_app_data_sourceGoogle::Apis::ChatV1::HostAppDataSourceMarkup

A data source from a Google Workspace application. The data source populates available items for a widget. Corresponds to the JSON property hostAppDataSource



3765
3766
3767
# File 'lib/google/apis/chat_v1/classes.rb', line 3765

def host_app_data_source
  @host_app_data_source
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. Google Workspace add-ons and Chat apps: Corresponds to the JSON property initialSuggestions



3780
3781
3782
# File 'lib/google/apis/chat_v1/classes.rb', line 3780

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)


3789
3790
3791
# File 'lib/google/apis/chat_v1/classes.rb', line 3789

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)


3796
3797
3798
# File 'lib/google/apis/chat_v1/classes.rb', line 3796

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



3804
3805
3806
# File 'lib/google/apis/chat_v1/classes.rb', line 3804

def on_change_action
  @on_change_action
end

#placeholder_textString

Text that appears in the text input field when the field is empty. Use this text to prompt users to enter a value. For example, Enter a number from 0 to 100. Google Chat apps: Corresponds to the JSON property placeholderText

Returns:

  • (String)


3811
3812
3813
# File 'lib/google/apis/chat_v1/classes.rb', line 3811

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


3817
3818
3819
# File 'lib/google/apis/chat_v1/classes.rb', line 3817

def type
  @type
end

#validationGoogle::Apis::ChatV1::GoogleAppsCardV1Validation

Represents the necessary data for validating the widget it's attached to. Google Workspace add-ons and Chat apps: Corresponds to the JSON property validation



3824
3825
3826
# File 'lib/google/apis/chat_v1/classes.rb', line 3824

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


3831
3832
3833
# File 'lib/google/apis/chat_v1/classes.rb', line 3831

def value
  @value
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
# File 'lib/google/apis/chat_v1/classes.rb', line 3838

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)
  @host_app_data_source = args[:host_app_data_source] if args.key?(:host_app_data_source)
  @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)
  @placeholder_text = args[:placeholder_text] if args.key?(:placeholder_text)
  @type = args[:type] if args.key?(:type)
  @validation = args[:validation] if args.key?(:validation)
  @value = args[:value] if args.key?(:value)
end