InsertSection

A builder for InsertSection objects. Developers can insert a new section to the card by passing a
`https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` to `https://developers.google.com/apps-script/reference/add-ons-response-service/modify-card`


Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

```javascript
const insertSection = AddOnsResponseService.newInsertSection().insertBelowSection('sample_id')
.setSection(CardService.newCardSection().setHeader('New Section'));

const modifyCard = AddOnsResponseService.newModifyCard()
.setInsertSection(insertSection);
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#insertAtTop(Boolean)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` | Sets the onCardTop flag, which indicates whether the new section should be inserted at the top of the card. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#insertBelowSection(String)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` | Sets the section ID, and the new section is inserted below it. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#setSection(CardSection)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` | Sets the card section to be inserted. |

## Detailed documentation

### `insertAtTop(onCardTop)`

Sets the onCardTop flag, which indicates whether the new section should be inserted at the top
of the card.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `onCardTop` | `Boolean` | The onCardTop flag. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` --- The insert section object, for chaining.

*** ** * ** ***

### `insertBelowSection(sectionId)`

Sets the section ID, and the new section is inserted below it. If the section ID is not found,
then the new section is inserted at the end of the card.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `sectionId` | `String` | The ID of the section to insert below. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` --- The insert section object, for chaining.

*** ** * ** ***

### `setSection(section)`

Sets the card section to be inserted.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `section` | `https://developers.google.com/apps-script/reference/card-service/card-section.html` | The `https://developers.google.com/apps-script/reference/card-service/card-section.html` to be inserted. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/insert-section#` --- The insert section object, for chaining.