0.31.0 (latest) 0.30.0 0.29.0 0.28.0 0.27.0 0.23.0 0.20.0 0.19.0 0.18.0 0.17.1 0.16.1 0.15.0 0.14.0 0.13.1 0.12.1 0.11.2 0.10.0 0.9.0 0.8.1 0.7.2 0.6.1 0.5.0 0.4.0 0.3.0 0.2.0 0.1.4 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](https://developers.google.com/workspace/extend):

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](https://developers.google.com/workspace/add-ons): |
| `↳ card` | `Card` A new card is pushed to the card stack after clicking if specified. [Google Workspace add-ons](https://developers.google.com/workspace/add-ons): |
| `↳ overflow_menu` | `OverflowMenu` If specified, this `onClick` opens an overflow menu. |

### 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` |   |

### getOpenLink

If specified, this `onClick` triggers an open link action.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OpenLink|null` |   |

### hasOpenLink

### setOpenLink

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](https://developers.google.com/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](https://developers.google.com/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](https://developers.google.com/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](https://developers.google.com/workspace/add-ons):

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Card` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getOverflowMenu

If specified, this `onClick` opens an overflow menu.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OverflowMenu|null` |   |

### hasOverflowMenu

### setOverflowMenu

If specified, this `onClick` opens an overflow menu.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `OverflowMenu` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `$this` |   |

### getData

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `string` |   |