Google Apps Chat V1 Client - Class KeyValue (0.7.1)

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 and Formatting text in Google Workspace Add-ons.

↳ 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 and Formatting text in Google Workspace Add-ons.

↳ 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 and Formatting text in Google Workspace Add-ons.

↳ 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

hasIcon

setIcon

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

Parameter
Name Description
var int
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 and Formatting text in Google Workspace Add-ons.

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 and Formatting text in Google Workspace Add-ons.

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 and Formatting text in Google Workspace Add-ons.

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 and Formatting text in Google Workspace Add-ons.

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 and Formatting text in Google Workspace Add-ons.

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 and Formatting text in Google Workspace Add-ons.

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