Google Apps Chat V1 Client - Class Section (0.2.0)

Reference documentation and code samples for the Google Apps Chat V1 Client class Section.

A section contains a collection of widgets that are rendered vertically in the order that they're specified.

Google Workspace Add-ons and Chat apps:

Generated from protobuf message google.apps.card.v1.Card.Section

Namespace

Google \ Apps \ Card \ V1 \ Card

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ header string

Text that appears at the top of a section. Supports simple HTML formatted text. For more information about formatting text, see Formatting text in Google Chat apps and Formatting text in Google Workspace Add-ons.

↳ widgets array<Google\Apps\Card\V1\Widget>

All the widgets in the section. Must contain at least one widget.

↳ collapsible bool

Indicates whether this section is collapsible. Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less. To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

↳ uncollapsible_widgets_count int

The number of uncollapsible widgets which remain visible even when a section is collapsed. For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

getHeader

Text that appears at the top of a section.

Supports simple HTML formatted text. 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

setHeader

Text that appears at the top of a section.

Supports simple HTML formatted text. 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

getWidgets

All the widgets in the section.

Must contain at least one widget.

Returns
Type Description
Google\Protobuf\Internal\RepeatedField

setWidgets

All the widgets in the section.

Must contain at least one widget.

Parameter
Name Description
var array<Google\Apps\Card\V1\Widget>
Returns
Type Description
$this

getCollapsible

Indicates whether this section is collapsible.

Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less. To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

Returns
Type Description
bool

setCollapsible

Indicates whether this section is collapsible.

Collapsible sections hide some or all widgets, but users can expand the section to reveal the hidden widgets by clicking Show more. Users can hide the widgets again by clicking Show less. To determine which widgets are hidden, specify uncollapsibleWidgetsCount.

Parameter
Name Description
var bool
Returns
Type Description
$this

getUncollapsibleWidgetsCount

The number of uncollapsible widgets which remain visible even when a section is collapsed.

For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

Returns
Type Description
int

setUncollapsibleWidgetsCount

The number of uncollapsible widgets which remain visible even when a section is collapsed.

For example, when a section contains five widgets and the uncollapsibleWidgetsCount is set to 2, the first two widgets are always shown and the last three are collapsed by default. The uncollapsibleWidgetsCount is taken into account only when collapsible is true.

Parameter
Name Description
var int
Returns
Type Description
$this