Google Apps Chat V1 Client - Class OnClick (0.6.1)

Reference documentation and code samples for the Google Apps Chat V1 Client class OnClick.

Represents how to respond when users click an interactive element on a card, such as a button.

Google Workspace Add-ons and Chat apps:

Generated from protobuf message google.apps.card.v1.OnClick

Namespace

Google \ Apps \ Card \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ action Action

If specified, an action is triggered by this onClick.

↳ open_link OpenLink

If specified, this onClick triggers an open link action.

↳ open_dynamic_link_action Action

An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back. Google Workspace Add-ons:

↳ card Card

A new card is pushed to the card stack after clicking if specified. Google Workspace Add-ons:

getAction

If specified, an action is triggered by this onClick.

Returns
Type Description
Action|null

hasAction

setAction

If specified, an action is triggered by this onClick.

Parameter
Name Description
var Action
Returns
Type Description
$this

If specified, this onClick triggers an open link action.

Returns
Type Description
OpenLink|null

If specified, this onClick triggers an open link action.

Parameter
Name Description
var OpenLink
Returns
Type Description
$this

getOpenDynamicLinkAction

An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.

Google Workspace Add-ons:

Returns
Type Description
Action|null

hasOpenDynamicLinkAction

setOpenDynamicLinkAction

An add-on triggers this action when the action needs to open a link. This differs from the open_link above in that this needs to talk to server to get the link. Thus some preparation work is required for web client to do before the open link action response comes back.

Google Workspace Add-ons:

Parameter
Name Description
var Action
Returns
Type Description
$this

getCard

A new card is pushed to the card stack after clicking if specified.

Google Workspace Add-ons:

Returns
Type Description
Card|null

hasCard

setCard

A new card is pushed to the card stack after clicking if specified.

Google Workspace Add-ons:

Parameter
Name Description
var Card
Returns
Type Description
$this

getData

Returns
Type Description
string