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, an Apps Script can be invoked to handle the form.
Instance Attribute Summary collapse
-
#function ⇒ String
A custom function to invoke when the containing element is clicked or othrwise 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.
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.
966 967 968 |
# File 'lib/google/apis/chat_v1/classes.rb', line 966 def initialize(**args) update!(**args) end |
Instance Attribute Details
#function ⇒ String
A custom function to invoke when the containing element is clicked or othrwise
activated. For example usage, see Create interactive cards.
Corresponds to the JSON property function
922 923 924 |
# File 'lib/google/apis/chat_v1/classes.rb', line 922 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 button on 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 is not shown. Supported by Chat apps, but
not Google Workspace Add-ons. If specified for an add-on, the entire card is
stripped and nothing is shown in the client.
Corresponds to the JSON property interaction
936 937 938 |
# File 'lib/google/apis/chat_v1/classes.rb', line 936 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
942 943 944 |
# File 'lib/google/apis/chat_v1/classes.rb', line 942 def load_indicator @load_indicator end |
#parameters ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>
List of action parameters.
Corresponds to the JSON property parameters
947 948 949 |
# File 'lib/google/apis/chat_v1/classes.rb', line 947 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. When
using LoadIndicator.NONE for actions, persist_values
= trueis recommended, as it ensures that any changes made by the user after
form or on change actions are sent to the server are not overwritten by the
response. If false, the form values are cleared when the action is triggered.
When persist_values is set to false, it is strongly recommended that the
card use LoadIndicator.SPINNER for all actions, as this
locks the UI to ensure no changes are made by the user while the action is
being processed. Not supported by Chat apps.
Corresponds to the JSON property persistValues
963 964 965 |
# File 'lib/google/apis/chat_v1/classes.rb', line 963 def persist_values @persist_values end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
971 972 973 974 975 976 977 |
# File 'lib/google/apis/chat_v1/classes.rb', line 971 def update!(**args) @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) end |