Class Action.Builder (2.37.1)

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
TypeDescription
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
NameDescription
valuesIterable<? extends com.google.apps.card.v1.Action.ActionParameter>
Returns
TypeDescription
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
NameDescription
valueAction.ActionParameter
Returns
TypeDescription
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
NameDescription
builderForValueAction.ActionParameter.Builder
Returns
TypeDescription
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
NameDescription
indexint
valueAction.ActionParameter
Returns
TypeDescription
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
NameDescription
indexint
builderForValueAction.ActionParameter.Builder
Returns
TypeDescription
Action.Builder

addParametersBuilder()

public Action.ActionParameter.Builder addParametersBuilder()

List of action parameters.

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

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

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Action.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Action.Builder
Overrides

build()

public Action build()
Returns
TypeDescription
Action

buildPartial()

public Action buildPartial()
Returns
TypeDescription
Action

clear()

public Action.Builder clear()
Returns
TypeDescription
Action.Builder
Overrides

clearField(Descriptors.FieldDescriptor field)

public Action.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
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 Create interactive cards.

string function = 1;

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

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Action.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Action.Builder
Overrides

clearParameters()

public Action.Builder clearParameters()

List of action parameters.

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

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

This builder for chaining.

clone()

public Action.Builder clone()
Returns
TypeDescription
Action.Builder
Overrides

getDefaultInstanceForType()

public Action getDefaultInstanceForType()
Returns
TypeDescription
Action

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

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

getParametersBuilder(int index)

public Action.ActionParameter.Builder getParametersBuilder(int index)

List of action parameters.

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

Parameter
NameDescription
indexint
Returns
TypeDescription
Action.ActionParameter.Builder

getParametersBuilderList()

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

List of action parameters.

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

Returns
TypeDescription
List<Builder>

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>

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.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFrom(Action other)

public Action.Builder mergeFrom(Action other)
Parameter
NameDescription
otherAction
Returns
TypeDescription
Action.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Action.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Action.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Action.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Action.Builder
Overrides

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Action.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
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
NameDescription
indexint
Returns
TypeDescription
Action.Builder

setField(Descriptors.FieldDescriptor field, Object value)

public Action.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
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 Create interactive cards.

string function = 1;

Parameter
NameDescription
valueString

The function to set.

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

string function = 1;

Parameter
NameDescription
valueByteString

The bytes for function to set.

Returns
TypeDescription
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
NameDescription
valueAction.Interaction

The interaction to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
valueAction.LoadIndicator

The loadIndicator to set.

Returns
TypeDescription
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
NameDescription
valueint

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

Returns
TypeDescription
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
NameDescription
indexint
valueAction.ActionParameter
Returns
TypeDescription
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
NameDescription
indexint
builderForValueAction.ActionParameter.Builder
Returns
TypeDescription
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
NameDescription
valueboolean

The persistValues to set.

Returns
TypeDescription
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
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Action.Builder
Overrides

setUnknownFields(UnknownFieldSet unknownFields)

public final Action.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Action.Builder
Overrides