Class Action (0.1.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
TypeDescription
int

INTERACTION_FIELD_NUMBER

public static final int INTERACTION_FIELD_NUMBER
Field Value
TypeDescription
int

LOAD_INDICATOR_FIELD_NUMBER

public static final int LOAD_INDICATOR_FIELD_NUMBER
Field Value
TypeDescription
int

PARAMETERS_FIELD_NUMBER

public static final int PARAMETERS_FIELD_NUMBER
Field Value
TypeDescription
int

PERSIST_VALUES_FIELD_NUMBER

public static final int PERSIST_VALUES_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static Action getDefaultInstance()
Returns
TypeDescription
Action

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static Action.Builder newBuilder()
Returns
TypeDescription
Action.Builder

newBuilder(Action prototype)

public static Action.Builder newBuilder(Action prototype)
Parameter
NameDescription
prototypeAction
Returns
TypeDescription
Action.Builder

parseDelimitedFrom(InputStream input)

public static Action parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static Action parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static Action parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static Action parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static Action parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static Action parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static Action parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<Action> parser()
Returns
TypeDescription
Parser<Action>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getDefaultInstanceForType()

public Action getDefaultInstanceForType()
Returns
TypeDescription
Action

getFunction()

public String getFunction()

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

For example usage, see Create interactive cards.

string function = 1;

Returns
TypeDescription
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 Create interactive cards.

string function = 1;

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Action.ActionParameter

getParametersCount()

public int getParametersCount()

List of action parameters.

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

Returns
TypeDescription
int

getParametersList()

public List<Action.ActionParameter> getParametersList()

List of action parameters.

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

Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Action.ActionParameterOrBuilder

getParametersOrBuilderList()

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

List of action parameters.

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

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

getParserForType()

public Parser<Action> getParserForType()
Returns
TypeDescription
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
TypeDescription
boolean

The persistValues.

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public Action.Builder newBuilderForType()
Returns
TypeDescription
Action.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected Action.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
Action.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public Action.Builder toBuilder()
Returns
TypeDescription
Action.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException