Class Action.Builder (2.40.0)

public static final class Action.Builder extends GeneratedMessageV3.Builder<Action.Builder> 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 Methods

getDescriptor()

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

Methods

addAllParameters(Iterable<? extends Action.ActionParameter> values)

public Action.Builder addAllParameters(Iterable<? extends Action.ActionParameter> values)

List of action parameters.

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

Parameter
Name Description
values Iterable<? extends com.google.apps.card.v1.Action.ActionParameter>
Returns
Type Description
Action.Builder

addParameters(Action.ActionParameter value)

public Action.Builder addParameters(Action.ActionParameter value)

List of action parameters.

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

Parameter
Name Description
value Action.ActionParameter
Returns
Type Description
Action.Builder

addParameters(Action.ActionParameter.Builder builderForValue)

public Action.Builder addParameters(Action.ActionParameter.Builder builderForValue)

List of action parameters.

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

Parameter
Name Description
builderForValue Action.ActionParameter.Builder
Returns
Type Description
Action.Builder

addParameters(int index, Action.ActionParameter value)

public Action.Builder addParameters(int index, Action.ActionParameter value)

List of action parameters.

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

Parameters
Name Description
index int
value Action.ActionParameter
Returns
Type Description
Action.Builder

addParameters(int index, Action.ActionParameter.Builder builderForValue)

public Action.Builder addParameters(int index, Action.ActionParameter.Builder builderForValue)

List of action parameters.

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

Parameters
Name Description
index int
builderForValue Action.ActionParameter.Builder
Returns
Type Description
Action.Builder

addParametersBuilder()

public Action.ActionParameter.Builder addParametersBuilder()

List of action parameters.

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

Returns
Type Description
Action.ActionParameter.Builder

addParametersBuilder(int index)

public Action.ActionParameter.Builder addParametersBuilder(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.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Action.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Action.Builder
Overrides

build()

public Action build()
Returns
Type Description
Action

buildPartial()

public Action buildPartial()
Returns
Type Description
Action

clear()

public Action.Builder clear()
Returns
Type Description
Action.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Action.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
Name Description
field FieldDescriptor
Returns
Type Description
Action.Builder
Overrides

clearFunction()

public Action.Builder clearFunction()

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
Action.Builder

This builder for chaining.

clearInteraction()

public Action.Builder clearInteraction()

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.Builder

This builder for chaining.

clearLoadIndicator()

public Action.Builder clearLoadIndicator()

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.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Action.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
Name Description
oneof OneofDescriptor
Returns
Type Description
Action.Builder
Overrides

clearParameters()

public Action.Builder clearParameters()

List of action parameters.

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

Returns
Type Description
Action.Builder

clearPersistValues()

public Action.Builder clearPersistValues()

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
Action.Builder

This builder for chaining.

clone()

public Action.Builder clone()
Returns
Type Description
Action.Builder
Overrides

getDefaultInstanceForType()

public Action getDefaultInstanceForType()
Returns
Type Description
Action

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
Type Description
Descriptor
Overrides

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

getParametersBuilder(int index)

public Action.ActionParameter.Builder getParametersBuilder(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.Builder

getParametersBuilderList()

public List<Action.ActionParameter.Builder> getParametersBuilderList()

List of action parameters.

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

Returns
Type Description
List<Builder>

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>

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.

internalGetFieldAccessorTable()

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

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

mergeFrom(Action other)

public Action.Builder mergeFrom(Action other)
Parameter
Name Description
other Action
Returns
Type Description
Action.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Action.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
Action.Builder
Overrides
Exceptions
Type Description
IOException

mergeFrom(Message other)

public Action.Builder mergeFrom(Message other)
Parameter
Name Description
other Message
Returns
Type Description
Action.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Action.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Action.Builder
Overrides

removeParameters(int index)

public Action.Builder removeParameters(int index)

List of action parameters.

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

Parameter
Name Description
index int
Returns
Type Description
Action.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Action.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
Name Description
field FieldDescriptor
value Object
Returns
Type Description
Action.Builder
Overrides

setFunction(String value)

public Action.Builder setFunction(String value)

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

For example usage, see Read form data.

string function = 1;

Parameter
Name Description
value String

The function to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setFunctionBytes(ByteString value)

public Action.Builder setFunctionBytes(ByteString value)

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

For example usage, see Read form data.

string function = 1;

Parameter
Name Description
value ByteString

The bytes for function to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setInteraction(Action.Interaction value)

public Action.Builder setInteraction(Action.Interaction value)

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;

Parameter
Name Description
value Action.Interaction

The interaction to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setInteractionValue(int value)

public Action.Builder setInteractionValue(int value)

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;

Parameter
Name Description
value int

The enum numeric value on the wire for interaction to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setLoadIndicator(Action.LoadIndicator value)

public Action.Builder setLoadIndicator(Action.LoadIndicator value)

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

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

Parameter
Name Description
value Action.LoadIndicator

The loadIndicator to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setLoadIndicatorValue(int value)

public Action.Builder setLoadIndicatorValue(int value)

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

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

Parameter
Name Description
value int

The enum numeric value on the wire for loadIndicator to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setParameters(int index, Action.ActionParameter value)

public Action.Builder setParameters(int index, Action.ActionParameter value)

List of action parameters.

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

Parameters
Name Description
index int
value Action.ActionParameter
Returns
Type Description
Action.Builder

setParameters(int index, Action.ActionParameter.Builder builderForValue)

public Action.Builder setParameters(int index, Action.ActionParameter.Builder builderForValue)

List of action parameters.

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

Parameters
Name Description
index int
builderForValue Action.ActionParameter.Builder
Returns
Type Description
Action.Builder

setPersistValues(boolean value)

public Action.Builder setPersistValues(boolean value)

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;

Parameter
Name Description
value boolean

The persistValues to set.

Returns
Type Description
Action.Builder

This builder for chaining.

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Action.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
Name Description
field FieldDescriptor
index int
value Object
Returns
Type Description
Action.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Action.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
Name Description
unknownFields UnknownFieldSet
Returns
Type Description
Action.Builder
Overrides