Class Action (2.41.0)

public final class Action extends GeneratedMessageV3 implements ActionOrBuilder

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:

Protobuf type google.apps.card.v1.Action

Implements

ActionOrBuilder

Static Fields

FUNCTION_FIELD_NUMBER

public static final int FUNCTION_FIELD_NUMBER
Field Value
Type Description
int

INTERACTION_FIELD_NUMBER

public static final int INTERACTION_FIELD_NUMBER
Field Value
Type Description
int

LOAD_INDICATOR_FIELD_NUMBER

public static final int LOAD_INDICATOR_FIELD_NUMBER
Field Value
Type Description
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
Type Description
int

PERSIST_VALUES_FIELD_NUMBER

public static final int PERSIST_VALUES_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static Action getDefaultInstance()
Returns
Type Description
Action

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static Action.Builder newBuilder()
Returns
Type Description
Action.Builder

newBuilder(Action prototype)

public static Action.Builder newBuilder(Action prototype)
Parameter
Name Description
prototype Action
Returns
Type Description
Action.Builder

parseDelimitedFrom(InputStream input)

public static Action parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static Action parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Action parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Action parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static Action parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static Action parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<Action> parser()
Returns
Type Description
Parser<Action>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getDefaultInstanceForType()

public Action getDefaultInstanceForType()
Returns
Type Description
Action

getFunction()

public String getFunction()

A custom function to invoke when the containing element is clicked or othrwise activated.

For example usage, see Read form data.

string function = 1;

Returns
Type Description
String

The function.

getFunctionBytes()

public ByteString getFunctionBytes()

A custom function to invoke when the containing element is clicked or othrwise activated.

For example usage, see Read form data.

string function = 1;

Returns
Type Description
ByteString

The bytes for function.

getInteraction()

public Action.Interaction getInteraction()

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:

.google.apps.card.v1.Action.Interaction interaction = 5;

Returns
Type Description
Action.Interaction

The interaction.

getInteractionValue()

public int getInteractionValue()

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:

.google.apps.card.v1.Action.Interaction interaction = 5;

Returns
Type Description
int

The enum numeric value on the wire for interaction.

getLoadIndicator()

public Action.LoadIndicator getLoadIndicator()

Specifies the loading indicator that the action displays while making the call to the action.

.google.apps.card.v1.Action.LoadIndicator load_indicator = 3;

Returns
Type Description
Action.LoadIndicator

The loadIndicator.

getLoadIndicatorValue()

public int getLoadIndicatorValue()

Specifies the loading indicator that the action displays while making the call to the action.

.google.apps.card.v1.Action.LoadIndicator load_indicator = 3;

Returns
Type Description
int

The enum numeric value on the wire for loadIndicator.

getParameters(int index)

public Action.ActionParameter getParameters(int index)

List of action parameters.

repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;

Parameter
Name Description
index int
Returns
Type Description
Action.ActionParameter

getParametersCount()

public int getParametersCount()

List of action parameters.

repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;

Returns
Type Description
int

getParametersList()

public List<Action.ActionParameter> getParametersList()

List of action parameters.

repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;

Returns
Type Description
List<ActionParameter>

getParametersOrBuilder(int index)

public Action.ActionParameterOrBuilder getParametersOrBuilder(int index)

List of action parameters.

repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;

Parameter
Name Description
index int
Returns
Type Description
Action.ActionParameterOrBuilder

getParametersOrBuilderList()

public List<? extends Action.ActionParameterOrBuilder> getParametersOrBuilderList()

List of action parameters.

repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;

Returns
Type Description
List<? extends com.google.apps.card.v1.Action.ActionParameterOrBuilder>

getParserForType()

public Parser<Action> getParserForType()
Returns
Type Description
Parser<Action>
Overrides

getPersistValues()

public boolean getPersistValues()

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.

bool persist_values = 4;

Returns
Type Description
boolean

The persistValues.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public Action.Builder newBuilderForType()
Returns
Type Description
Action.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Action.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
Action.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public Action.Builder toBuilder()
Returns
Type Description
Action.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException