Class: Google::Apis::ChatV1::GoogleAppsCardV1Action
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::GoogleAppsCardV1Action
- 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
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:
Instance Attribute Summary collapse
-
#all_widgets_are_required ⇒ Boolean
(also: #all_widgets_are_required?)
Optional.
-
#function ⇒ String
A custom function to invoke when the containing element is clicked or otherwise activated.
-
#interaction ⇒ String
Optional.
-
#load_indicator ⇒ String
Specifies the loading indicator that the action displays while making the call to the action.
-
#parameters ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>
List of action parameters.
-
#persist_values ⇒ Boolean
(also: #persist_values?)
Indicates whether form values persist after the action.
-
#required_widgets ⇒ Array<String>
Optional.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleAppsCardV1Action
constructor
A new instance of GoogleAppsCardV1Action.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleAppsCardV1Action
Returns a new instance of GoogleAppsCardV1Action.
1804 1805 1806 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1804 def initialize(**args) update!(**args) end |
Instance Attribute Details
#all_widgets_are_required ⇒ Boolean Also known as: all_widgets_are_required?
Optional. If this is true, then all widgets are considered required by this
action. Google Workspace add-ons and Chat apps:
Corresponds to the JSON property allWidgetsAreRequired
1741 1742 1743 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1741 def @all_widgets_are_required end |
#function ⇒ String
A custom function to invoke when the containing element is clicked or
otherwise activated. For example usage, see Read form data.
Corresponds to the JSON property function
1749 1750 1751 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1749 def function @function end |
#interaction ⇒ String
Optional. Required when opening a dialog. What to do in response to an interaction with a user,
such as a user clicking a button in a card message. If unspecified, the app
responds by executing an action—like opening a link or running a function—as
normal. By specifying an interaction, the app can respond in special
interactive ways. For example, by setting interaction to OPEN_DIALOG, the
app can open a dialog.
When specified, a loading indicator isn't shown. If specified for an add-on,
the entire card is stripped and nothing is shown in the client. Google Chat
apps:
Corresponds to the JSON property interaction
1763 1764 1765 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1763 def interaction @interaction end |
#load_indicator ⇒ String
Specifies the loading indicator that the action displays while making the call
to the action.
Corresponds to the JSON property loadIndicator
1769 1770 1771 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1769 def load_indicator @load_indicator end |
#parameters ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>
List of action parameters.
Corresponds to the JSON property parameters
1774 1775 1776 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1774 def parameters @parameters end |
#persist_values ⇒ Boolean Also known as: persist_values?
Indicates whether form values persist after the action. The default value is
false. If true, form values remain after the action is triggered. To let
the user make changes while the action is being processed, set LoadIndicator
to NONE. For card messages in Chat apps,
you must also set the action's ResponseType to
UPDATE_MESSAGE and use the same card_id from the card
that contained the action. If false, the form values are cleared when the
action is triggered. To prevent the user from making changes while the action
is being processed, set LoadIndicator to SPINNER
.
Corresponds to the JSON property persistValues
1793 1794 1795 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1793 def persist_values @persist_values end |
#required_widgets ⇒ Array<String>
Optional. Fill this list with the names of widgets that this Action needs for
a valid submission. If the widgets listed here don't have a value when this
Action is invoked, the form submission is aborted. Google Workspace add-ons
and Chat apps:
Corresponds to the JSON property requiredWidgets
1802 1803 1804 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1802 def @required_widgets end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1809 1810 1811 1812 1813 1814 1815 1816 1817 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1809 def update!(**args) @all_widgets_are_required = args[:all_widgets_are_required] if args.key?(:all_widgets_are_required) @function = args[:function] if args.key?(:function) @interaction = args[:interaction] if args.key?(:interaction) @load_indicator = args[:load_indicator] if args.key?(:load_indicator) @parameters = args[:parameters] if args.key?(:parameters) @persist_values = args[:persist_values] if args.key?(:persist_values) @required_widgets = args[:required_widgets] if args.key?(:required_widgets) end |