Class InsertSection

InsertSection

InsertSection 对象的构建器。开发者可以通过将 InsertSection传递给ModifyCard

仅适用于扩展 Google Workspace Studio 的 Google Workspace 插件。

用法示例:

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

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

方法

方法返回值类型简介
insertAtTop(onCardTop)InsertSection设置 onCardTop 标志,该标志用于指明是否应将新部分插入到卡片的顶部。
insertBelowSection(sectionId)InsertSection设置部分 ID,新部分会插入到该 ID 下方。
setSection(section)InsertSection设置要插入的卡片部分。

详细文档

insertAtTop(onCardTop)

设置 onCardTop 标志,该标志用于指明是否应将新部分插入到卡片的顶部。

参数

名称类型说明
onCardTopBooleanonCardTop 标志。

返回

InsertSection - 用于连锁调用的插入部分对象。


insertBelowSection(sectionId)

设置部分 ID,新部分会插入到该 ID 下方。如果找不到部分 ID,则新部分会插入到卡片的末尾。

参数

名称类型说明
sectionIdString要插入到下方的部分的 ID。

返回

InsertSection - 用于连锁调用的插入部分对象。


setSection(section)

设置要插入的卡片部分。

参数

名称类型说明
sectionCardSection要插入的 CardSection

返回

InsertSection - 用于连锁调用的插入部分对象。