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

A UI element contains a key (label) and a value (content). This
element can also contain some actions such as `onclick` button.

Generated from protobuf message `google.chat.v1.WidgetMarkup.KeyValue`

## Namespace

Google \\ Apps \\ Chat \\ V1 \\ WidgetMarkup

## Methods

### __construct

Constructor.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `data` | `array` Optional. Data for populating the Message object. |
| `↳ icon` | `int` An enum value that's replaced by the Chat API with the corresponding icon image. |
| `↳ icon_url` | `string` The icon specified by a URL. |
| `↳ top_label` | `string` The text of the top label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). |
| `↳ content` | `string` The text of the content. Formatted text supported and always required. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). |
| `↳ content_multiline` | `bool` If the content should be multiline. |
| `↳ bottom_label` | `string` The text of the bottom label. Formatted text supported. For more information about formatting text, see [Formatting text in Google Chat apps](https://developers.google.com/workspace/chat/format-messages#card-formatting) and [Formatting text in Google Workspace Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting). |
| `↳ on_click` | `OnClick` The `onclick` action. Only the top label, bottom label, and content region are clickable. |
| `↳ button` | `Button` A button that can be clicked to trigger an action. |

### getIcon

An enum value that's replaced by the Chat API with the
corresponding icon image.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `int` | Enum of type [Icon](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.WidgetMarkup.Icon.md.txt). |

### hasIcon

### setIcon

An enum value that's replaced by the Chat API with the
corresponding icon image.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `int` Enum of type [Icon](https://docs.cloud.google.com/php/docs/reference/apps-chat/latest/Chat.V1.WidgetMarkup.Icon.md.txt). |

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

### getIconUrl

The icon specified by a URL.

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

### hasIconUrl

### setIconUrl

The icon specified by a URL.

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

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

### getTopLabel

The text of the top label. Formatted text supported. For more information
about formatting text, see
[Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

### setTopLabel

The text of the top label. Formatted text supported. For more information
about formatting text, see
[Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

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

### getContent

The text of the content. Formatted text supported and always required.

For more information
about formatting text, see
[Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

### setContent

The text of the content. Formatted text supported and always required.

For more information
about formatting text, see
[Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

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

### getContentMultiline

If the content should be multiline.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `bool` |   |

### setContentMultiline

If the content should be multiline.

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

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

### getBottomLabel

The text of the bottom label. Formatted text supported. For more
information about formatting text, see [Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

### setBottomLabel

The text of the bottom label. Formatted text supported. For more
information about formatting text, see [Formatting text in Google Chat
apps](https://developers.google.com/workspace/chat/format-messages#card-formatting)
and
[Formatting
text in Google Workspace
Add-ons](https://developers.google.com/apps-script/add-ons/concepts/widgets#text_formatting).

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

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

### getOnClick

The `onclick` action. Only the top label, bottom label, and content
region are clickable.

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

### hasOnClick

### clearOnClick

### setOnClick

The `onclick` action. Only the top label, bottom label, and content
region are clickable.

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

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

### getButton

A button that can be clicked to trigger an action.

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

### hasButton

### setButton

A button that can be clicked to trigger an action.

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

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

### getIcons

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

### getControl

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