Reference documentation and code samples for the Google Apps Chat V1 Client class DecoratedText.
A widget that displays text with optional decorations such as a label above or below the text, an icon in front of the text, a selection widget, or a button after the text. For an example in Google Chat apps, see Display text with decorative text .
Google Workspace add-ons and Chat apps :
Generated from protobuf message google.apps.card.v1.DecoratedText
Namespace
Google \ Apps \ Card \ V1Methods
__construct
Constructor.
data
array
Optional. Data for populating the Message object.
↳ icon
↳ start_icon
↳ start_icon_vertical_alignment
int
Optional. Vertical alignment of the start icon. If not set, the icon will be vertically centered. Google Chat apps :
↳ top_label
string
The text that appears above text
. Always truncates.
↳ top_label_text
TextParagraph
TextParagraph
equivalent of top_label
. Always truncates. Allows for more complex formatting than top_label
. Google Chat apps
:
↳ text
string
Required. The primary text. Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons .
↳ content_text
TextParagraph
TextParagraph
equivalent of text
. Allows for more complex formatting than text
. Google Chat apps
:
↳ wrap_text
bool
The wrap text setting. If true
, the text wraps and displays on multiple lines. Otherwise, the text is truncated. Only applies to text
, not topLabel
and bottomLabel
.
↳ bottom_label
string
The text that appears below text
. Always wraps.
↳ bottom_label_text
TextParagraph
TextParagraph
equivalent of bottom_label
. Always wraps. Allows for more complex formatting than bottom_label
. Google Chat apps
:
↳ on_click
↳ button
↳ switch_control
DecoratedText\SwitchControl
A switch widget that a user can click to change its state and trigger an action.
getIcon
Deprecated in favor of startIcon
.
hasIcon
clearIcon
setIcon
Deprecated in favor of startIcon
.
$this
getStartIcon
The icon displayed in front of the text.
hasStartIcon
clearStartIcon
setStartIcon
The icon displayed in front of the text.
$this
getStartIconVerticalAlignment
Optional. Vertical alignment of the start icon. If not set, the icon will be vertically centered.
setStartIconVerticalAlignment
Optional. Vertical alignment of the start icon. If not set, the icon will be vertically centered.
$this
getTopLabel
The text that appears above text
. Always truncates.
string
setTopLabel
The text that appears above text
. Always truncates.
var
string
$this
getTopLabelText
TextParagraph
equivalent of top_label
. Always truncates. Allows for
more complex formatting than top_label
.
hasTopLabelText
clearTopLabelText
setTopLabelText
TextParagraph
equivalent of top_label
. Always truncates. Allows for
more complex formatting than top_label
.
$this
getText
Required. The primary text.
Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons .
string
setText
Required. The primary text.
Supports simple formatting. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace add-ons .
var
string
$this
getContentText
TextParagraph
equivalent of text
. Allows for more complex formatting
than text
.
hasContentText
clearContentText
setContentText
TextParagraph
equivalent of text
. Allows for more complex formatting
than text
.
$this
getWrapText
The wrap text setting. If true
, the text wraps and displays on
multiple lines. Otherwise, the text is truncated.
Only applies to text
, not topLabel
and bottomLabel
.
bool
setWrapText
The wrap text setting. If true
, the text wraps and displays on
multiple lines. Otherwise, the text is truncated.
Only applies to text
, not topLabel
and bottomLabel
.
var
bool
$this
getBottomLabel
The text that appears below text
. Always wraps.
string
setBottomLabel
The text that appears below text
. Always wraps.
var
string
$this
getBottomLabelText
TextParagraph
equivalent of bottom_label
. Always wraps. Allows for
more complex formatting than bottom_label
.
hasBottomLabelText
clearBottomLabelText
setBottomLabelText
TextParagraph
equivalent of bottom_label
. Always wraps. Allows for
more complex formatting than bottom_label
.
$this
getOnClick
This action is triggered when users click topLabel
or bottomLabel
.
hasOnClick
clearOnClick
setOnClick
This action is triggered when users click topLabel
or bottomLabel
.
$this
getButton
A button that a user can click to trigger an action.
hasButton
setButton
A button that a user can click to trigger an action.
$this
getSwitchControl
A switch widget that a user can click to change its state and trigger an action.
hasSwitchControl
setSwitchControl
A switch widget that a user can click to change its state and trigger an action.
$this
getEndIcon
hasEndIcon
setEndIcon
$this
getControl
string

