Class: Google::Apis::ChatV1::GoogleAppsCardV1Action

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

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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1Action

Returns a new instance of GoogleAppsCardV1Action.



1198
1199
1200
# File 'lib/google/apis/chat_v1/classes.rb', line 1198

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

Instance Attribute Details

#functionString

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

Returns:

  • (String)


1152
1153
1154
# File 'lib/google/apis/chat_v1/classes.rb', line 1152

def function
  @function
end

#interactionString

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

Returns:

  • (String)


1166
1167
1168
# File 'lib/google/apis/chat_v1/classes.rb', line 1166

def interaction
  @interaction
end

#load_indicatorString

Specifies the loading indicator that the action displays while making the call to the action. Corresponds to the JSON property loadIndicator

Returns:

  • (String)


1172
1173
1174
# File 'lib/google/apis/chat_v1/classes.rb', line 1172

def load_indicator
  @load_indicator
end

#parametersArray<Google::Apis::ChatV1::GoogleAppsCardV1ActionParameter>

List of action parameters. Corresponds to the JSON property parameters



1177
1178
1179
# File 'lib/google/apis/chat_v1/classes.rb', line 1177

def parameters
  @parameters
end

#persist_valuesBoolean 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

Returns:

  • (Boolean)


1195
1196
1197
# File 'lib/google/apis/chat_v1/classes.rb', line 1195

def persist_values
  @persist_values
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1203
1204
1205
1206
1207
1208
1209
# File 'lib/google/apis/chat_v1/classes.rb', line 1203

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