Class: Google::Apps::Card::V1::Action

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/apps/card/v1/card.rb

Overview

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:

Defined Under Namespace

Modules: Interaction, LoadIndicator Classes: ActionParameter

Instance Attribute Summary collapse

Instance Attribute Details

#function::String

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

For example usage, see Read form data.

Returns:

  • (::String)

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

    For example usage, see Read form data.



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'proto_docs/google/apps/card/v1/card.rb', line 2060

class Action
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # List of string parameters to supply when the action method is invoked.
  # For example, consider three snooze buttons: snooze now, snooze one day,
  # or snooze next week. You might use `action method = snooze()`, passing the
  # snooze type and snooze time in the list of string parameters.
  #
  # To learn more, see
  # [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] key
  #   @return [::String]
  #     The name of the parameter for the action script.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value of the parameter.
  class ActionParameter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Specifies the loading indicator that the action displays while
  # making the call to the action.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module LoadIndicator
    # Displays a spinner to indicate that content is loading.
    SPINNER = 0

    # Nothing is displayed.
    NONE = 1
  end

  # 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):
  module Interaction
    # Default value. The `action` executes as normal.
    INTERACTION_UNSPECIFIED = 0

    # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
    # windowed, card-based interface that Chat apps use to interact with users.
    #
    # Only supported by Chat apps in response to button-clicks on card
    # messages. 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):
    OPEN_DIALOG = 1
  end
end

#interaction::Google::Apps::Card::V1::Action::Interaction

Returns 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:.

Returns:

  • (::Google::Apps::Card::V1::Action::Interaction)

    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:



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'proto_docs/google/apps/card/v1/card.rb', line 2060

class Action
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # List of string parameters to supply when the action method is invoked.
  # For example, consider three snooze buttons: snooze now, snooze one day,
  # or snooze next week. You might use `action method = snooze()`, passing the
  # snooze type and snooze time in the list of string parameters.
  #
  # To learn more, see
  # [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] key
  #   @return [::String]
  #     The name of the parameter for the action script.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value of the parameter.
  class ActionParameter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Specifies the loading indicator that the action displays while
  # making the call to the action.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module LoadIndicator
    # Displays a spinner to indicate that content is loading.
    SPINNER = 0

    # Nothing is displayed.
    NONE = 1
  end

  # 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):
  module Interaction
    # Default value. The `action` executes as normal.
    INTERACTION_UNSPECIFIED = 0

    # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
    # windowed, card-based interface that Chat apps use to interact with users.
    #
    # Only supported by Chat apps in response to button-clicks on card
    # messages. 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):
    OPEN_DIALOG = 1
  end
end

#load_indicator::Google::Apps::Card::V1::Action::LoadIndicator

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

Returns:



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'proto_docs/google/apps/card/v1/card.rb', line 2060

class Action
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # List of string parameters to supply when the action method is invoked.
  # For example, consider three snooze buttons: snooze now, snooze one day,
  # or snooze next week. You might use `action method = snooze()`, passing the
  # snooze type and snooze time in the list of string parameters.
  #
  # To learn more, see
  # [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] key
  #   @return [::String]
  #     The name of the parameter for the action script.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value of the parameter.
  class ActionParameter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Specifies the loading indicator that the action displays while
  # making the call to the action.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module LoadIndicator
    # Displays a spinner to indicate that content is loading.
    SPINNER = 0

    # Nothing is displayed.
    NONE = 1
  end

  # 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):
  module Interaction
    # Default value. The `action` executes as normal.
    INTERACTION_UNSPECIFIED = 0

    # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
    # windowed, card-based interface that Chat apps use to interact with users.
    #
    # Only supported by Chat apps in response to button-clicks on card
    # messages. 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):
    OPEN_DIALOG = 1
  end
end

#parameters::Array<::Google::Apps::Card::V1::Action::ActionParameter>

Returns List of action parameters.

Returns:



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'proto_docs/google/apps/card/v1/card.rb', line 2060

class Action
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # List of string parameters to supply when the action method is invoked.
  # For example, consider three snooze buttons: snooze now, snooze one day,
  # or snooze next week. You might use `action method = snooze()`, passing the
  # snooze type and snooze time in the list of string parameters.
  #
  # To learn more, see
  # [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] key
  #   @return [::String]
  #     The name of the parameter for the action script.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value of the parameter.
  class ActionParameter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Specifies the loading indicator that the action displays while
  # making the call to the action.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module LoadIndicator
    # Displays a spinner to indicate that content is loading.
    SPINNER = 0

    # Nothing is displayed.
    NONE = 1
  end

  # 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):
  module Interaction
    # Default value. The `action` executes as normal.
    INTERACTION_UNSPECIFIED = 0

    # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
    # windowed, card-based interface that Chat apps use to interact with users.
    #
    # Only supported by Chat apps in response to button-clicks on card
    # messages. 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):
    OPEN_DIALOG = 1
  end
end

#persist_values::Boolean

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

Returns:

  • (::Boolean)

    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.



2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
# File 'proto_docs/google/apps/card/v1/card.rb', line 2060

class Action
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # List of string parameters to supply when the action method is invoked.
  # For example, consider three snooze buttons: snooze now, snooze one day,
  # or snooze next week. You might use `action method = snooze()`, passing the
  # snooze type and snooze time in the list of string parameters.
  #
  # To learn more, see
  # [`CommonEventObject`](https://developers.google.com/workspace/chat/api/reference/rest/v1/Event#commoneventobject).
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  # @!attribute [rw] key
  #   @return [::String]
  #     The name of the parameter for the action script.
  # @!attribute [rw] value
  #   @return [::String]
  #     The value of the parameter.
  class ActionParameter
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Specifies the loading indicator that the action displays while
  # making the call to the action.
  #
  # [Google Workspace Add-ons and Chat
  # apps](https://developers.google.com/workspace/extend):
  module LoadIndicator
    # Displays a spinner to indicate that content is loading.
    SPINNER = 0

    # Nothing is displayed.
    NONE = 1
  end

  # 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):
  module Interaction
    # Default value. The `action` executes as normal.
    INTERACTION_UNSPECIFIED = 0

    # Opens a [dialog](https://developers.google.com/workspace/chat/dialogs), a
    # windowed, card-based interface that Chat apps use to interact with users.
    #
    # Only supported by Chat apps in response to button-clicks on card
    # messages. 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):
    OPEN_DIALOG = 1
  end
end