Class Action.Builder

  • All Implemented Interfaces:
    ActionOrBuilder, com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>, com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, java.lang.Cloneable
    Enclosing class:
    Action

    public static final class Action.Builder
    extends com.google.protobuf.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](https://developers.google.com/workspace/extend):
     
    Protobuf type google.apps.card.v1.Action
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Overrides:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • clear

        public Action.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessage.Builder<Action.Builder>
      • getDefaultInstanceForType

        public Action getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.GeneratedMessage.ExtendableMessageOrBuilder<com.google.protobuf.GeneratedMessageV3>
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Action build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Action buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Action.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • setField

        public Action.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                       java.lang.Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • clearField

        public Action.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • clearOneof

        public Action.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • setRepeatedField

        public Action.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                               int index,
                                               java.lang.Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • addRepeatedField

        public Action.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                               java.lang.Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • mergeFrom

        public Action.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Action.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessage.ExtendableBuilder<com.google.protobuf.GeneratedMessageV3,​Action.Builder>
      • mergeFrom

        public Action.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                 throws java.io.IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Action.Builder>
        Throws:
        java.io.IOException
      • getFunction

        public java.lang.String getFunction()
         A custom function to invoke when the containing element is
         clicked or othrwise activated.
        
         For example usage, see [Read form
         data](https://developers.google.com/workspace/chat/read-form-data).
         
        string function = 1;
        Specified by:
        getFunction in interface ActionOrBuilder
        Returns:
        The function.
      • getFunctionBytes

        public com.google.protobuf.ByteString getFunctionBytes()
         A custom function to invoke when the containing element is
         clicked or othrwise activated.
        
         For example usage, see [Read form
         data](https://developers.google.com/workspace/chat/read-form-data).
         
        string function = 1;
        Specified by:
        getFunctionBytes in interface ActionOrBuilder
        Returns:
        The bytes for function.
      • setFunction

        public Action.Builder setFunction​(java.lang.String value)
         A custom function to invoke when the containing element is
         clicked or othrwise activated.
        
         For example usage, see [Read form
         data](https://developers.google.com/workspace/chat/read-form-data).
         
        string function = 1;
        Parameters:
        value - The function to set.
        Returns:
        This builder for chaining.
      • 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](https://developers.google.com/workspace/chat/read-form-data).
         
        string function = 1;
        Returns:
        This builder for chaining.
      • setFunctionBytes

        public Action.Builder setFunctionBytes​(com.google.protobuf.ByteString value)
         A custom function to invoke when the containing element is
         clicked or othrwise activated.
        
         For example usage, see [Read form
         data](https://developers.google.com/workspace/chat/read-form-data).
         
        string function = 1;
        Parameters:
        value - The bytes for function to set.
        Returns:
        This builder for chaining.
      • getParametersCount

        public int getParametersCount()
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
        Specified by:
        getParametersCount in interface ActionOrBuilder
      • setParameters

        public Action.Builder setParameters​(int index,
                                            Action.ActionParameter value)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • addParameters

        public Action.Builder addParameters​(Action.ActionParameter value)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • addParameters

        public Action.Builder addParameters​(int index,
                                            Action.ActionParameter value)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • addAllParameters

        public Action.Builder addAllParameters​(java.lang.Iterable<? extends Action.ActionParameter> values)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • clearParameters

        public Action.Builder clearParameters()
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • removeParameters

        public Action.Builder removeParameters​(int index)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • getParametersBuilder

        public Action.ActionParameter.Builder getParametersBuilder​(int index)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • addParametersBuilder

        public Action.ActionParameter.Builder addParametersBuilder()
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • addParametersBuilder

        public Action.ActionParameter.Builder addParametersBuilder​(int index)
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • getParametersBuilderList

        public java.util.List<Action.ActionParameter.Builder> getParametersBuilderList()
         List of action parameters.
         
        repeated .google.apps.card.v1.Action.ActionParameter parameters = 2;
      • 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;
        Specified by:
        getLoadIndicatorValue in interface ActionOrBuilder
        Returns:
        The enum numeric value on the wire for loadIndicator.
      • setLoadIndicatorValue

        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;
        Parameters:
        value - The enum numeric value on the wire for loadIndicator to set.
        Returns:
        This builder for chaining.
      • 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;
        Specified by:
        getLoadIndicator in interface ActionOrBuilder
        Returns:
        The loadIndicator.
      • setLoadIndicator

        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;
        Parameters:
        value - The loadIndicator to set.
        Returns:
        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:
        This builder for chaining.
      • 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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `NONE`. For [card
         messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
         in Chat apps, you must also set the action's
         [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
         to `UPDATE_MESSAGE` and use the same
         [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
         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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `SPINNER`.
         
        bool persist_values = 4;
        Specified by:
        getPersistValues in interface ActionOrBuilder
        Returns:
        The persistValues.
      • setPersistValues

        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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `NONE`. For [card
         messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
         in Chat apps, you must also set the action's
         [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
         to `UPDATE_MESSAGE` and use the same
         [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
         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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `SPINNER`.
         
        bool persist_values = 4;
        Parameters:
        value - The persistValues to set.
        Returns:
        This builder for chaining.
      • 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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `NONE`. For [card
         messages](https://developers.google.com/workspace/chat/api/guides/v1/messages/create#create)
         in Chat apps, you must also set the action's
         [`ResponseType`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#responsetype)
         to `UPDATE_MESSAGE` and use the same
         [`card_id`](https://developers.google.com/workspace/chat/api/reference/rest/v1/spaces.messages#CardWithId)
         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`](https://developers.google.com/workspace/add-ons/reference/rpc/google.apps.card.v1#loadindicator)
         to `SPINNER`.
         
        bool persist_values = 4;
        Returns:
        This builder for chaining.
      • getInteractionValue

        public int getInteractionValue()
         Optional. Required when opening a
         [dialog](https://developers.google.com/workspace/chat/dialogs).
        
         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](https://developers.google.com/workspace/chat/dialogs). 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](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.Action.Interaction interaction = 5;
        Specified by:
        getInteractionValue in interface ActionOrBuilder
        Returns:
        The enum numeric value on the wire for interaction.
      • setInteractionValue

        public Action.Builder setInteractionValue​(int value)
         Optional. Required when opening a
         [dialog](https://developers.google.com/workspace/chat/dialogs).
        
         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](https://developers.google.com/workspace/chat/dialogs). 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](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.Action.Interaction interaction = 5;
        Parameters:
        value - The enum numeric value on the wire for interaction to set.
        Returns:
        This builder for chaining.
      • getInteraction

        public Action.Interaction getInteraction()
         Optional. Required when opening a
         [dialog](https://developers.google.com/workspace/chat/dialogs).
        
         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](https://developers.google.com/workspace/chat/dialogs). 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](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.Action.Interaction interaction = 5;
        Specified by:
        getInteraction in interface ActionOrBuilder
        Returns:
        The interaction.
      • setInteraction

        public Action.Builder setInteraction​(Action.Interaction value)
         Optional. Required when opening a
         [dialog](https://developers.google.com/workspace/chat/dialogs).
        
         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](https://developers.google.com/workspace/chat/dialogs). 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](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.Action.Interaction interaction = 5;
        Parameters:
        value - The interaction to set.
        Returns:
        This builder for chaining.
      • clearInteraction

        public Action.Builder clearInteraction()
         Optional. Required when opening a
         [dialog](https://developers.google.com/workspace/chat/dialogs).
        
         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](https://developers.google.com/workspace/chat/dialogs). 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](https://developers.google.com/workspace/chat):
         
        .google.apps.card.v1.Action.Interaction interaction = 5;
        Returns:
        This builder for chaining.
      • setUnknownFields

        public final Action.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>
      • mergeUnknownFields

        public final Action.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Action.Builder>