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

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](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). |
| `↳ 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`. |
| `↳ collapse_control` | `Google\Apps\Card\V1\CollapseControl` Optional. Define the expand and collapse button of the section. This button will be shown only if the section is collapsible. If this field isn't set, the default button is used. |

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

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

### getWidgets

All the widgets in the section.

Must contain at least one widget.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Protobuf\RepeatedField<Google\Apps\Card\V1\Widget>` |   |

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

### getCollapseControl

Optional. Define the expand and collapse button of the section.

This button will be shown only if the section is collapsible.
If this field isn't set, the default button is used.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Google\Apps\Card\V1\CollapseControl|null` |   |

### hasCollapseControl

### clearCollapseControl

### setCollapseControl

Optional. Define the expand and collapse button of the section.

This button will be shown only if the section is collapsible.
If this field isn't set, the default button is used.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `var` | `Google\Apps\Card\V1\CollapseControl` |

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