Class InsertSection

插入部分

用于构建 InsertSection 对象的构建器。开发者可以通过向 ModifyCard 传递 InsertSection,在卡片中插入新部分

仅适用于扩展 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 - 用于链式调用的插入部分对象。