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.



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'proto_docs/google/apps/card/v1/card.rb', line 2002

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:



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'proto_docs/google/apps/card/v1/card.rb', line 2002

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:



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'proto_docs/google/apps/card/v1/card.rb', line 2002

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:



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'proto_docs/google/apps/card/v1/card.rb', line 2002

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.



2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
# File 'proto_docs/google/apps/card/v1/card.rb', line 2002

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