Class 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,新區段會插入其下方。
setSection(section)InsertSection設定要插入的卡片區塊。

內容詳盡的說明文件

insertAtTop(onCardTop)

設定 onCardTop 旗標,指出是否應在資訊卡頂端插入新區段。

參數

名稱類型說明
onCardTopBooleanonCardTop 旗標。

回攻員

InsertSection:插入區段物件,用於鏈結。


insertBelowSection(sectionId)

設定區段 ID,新區段會插入其下方。如果找不到區段 ID,新區段會插入卡片結尾。

參數

名稱類型說明
sectionIdString要插入下方區段的 ID。

回攻員

InsertSection:插入區段物件,用於鏈結。


setSection(section)

設定要插入的卡片區段。

參數

名稱類型說明
sectionCardSection要插入的 CardSection

回攻員

InsertSection:插入區段物件,用於鏈結。