Google Apps Chat V1 Client - Class OnClick (0.3.0)

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 Google\Apps\Card\V1\Action

If specified, an action is triggered by this onClick.

↳ open_link Google\Apps\Card\V1\OpenLink

If specified, this onClick triggers an open link action.

↳ open_dynamic_link_action Google\Apps\Card\V1\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 Google\Apps\Card\V1\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
Google\Apps\Card\V1\Action|null

hasAction

setAction

If specified, an action is triggered by this onClick.

Parameter
Name Description
var Google\Apps\Card\V1\Action
Returns
Type Description
$this

If specified, this onClick triggers an open link action.

Returns
Type Description
Google\Apps\Card\V1\OpenLink|null

If specified, this onClick triggers an open link action.

Parameter
Name Description
var Google\Apps\Card\V1\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
Google\Apps\Card\V1\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 Google\Apps\Card\V1\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
Google\Apps\Card\V1\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 Google\Apps\Card\V1\Card
Returns
Type Description
$this

getData

Returns
Type Description
string