Action 物件的建構工具。
適用於 Google Workspace 外掛程式。
const notification = AddOnsResponseService.newNotification().setText("You closed a dialog!"); const navigation = AddOnsResponseService.newNavigation() .setEndNavigation(AddOnsResponseService.EndNavigation.CLOSE_DIALOG); const action = AddOnsResponseService.newActionResponseBuilder() .setNavigation(navigation) .setNotification(notification) .build();
方法
| 方法 | 傳回類型 | 簡短說明 |
|---|---|---|
add | Action | 將修改資訊卡作業設為動作。 |
build() | Action | 建構並驗證目前動作的回覆。 |
set | Action | 將 LinkPreview 設為動作。 |
set | Action | 設定對 Navigation 動作的回應。 |
set | Action | 設定動作啟動時顯示的通知。 |
set | Action | 設定啟用動作時要前往的網址。 |
set | Action | 設定旗標,指出這項動作變更了現有資料狀態。 |
內容詳盡的說明文件
add Modify Card(modifyCard)
build()
set Link Preview(linkPreview)
將 LinkPreview 設為動作。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
link | Link | 要使用的 Link。 |
回攻員
Action - 這個物件,用於鏈結。
set Notification(notification)
設定在啟用動作時顯示的通知。
const notification = AddOnsResponseService.newNotification().setText("You closed a dialog!"); const action = AddOnsResponseService.newActionResponseBuilder() .setNotification(notification) .build();
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
notification | Notification | 要使用的 Notification。 |
回攻員
Action - 這個物件,用於鏈結。
set Open Link(openLink)
set State Changed(stateChanged)
設定標記,指出這項動作變更了現有資料狀態。舉例來說,如果動作是建立工作或更新聯絡資訊,如果這個旗標設為 true,Gmail 等服務可以嘗試清除與這項動作相關聯的任何快取狀態資料。
參數
| 名稱 | 類型 | 說明 |
|---|---|---|
state | Boolean | 這項動作是否已變更現有的狀態資料。預設值為 false。 |
回攻員
Action - 這個物件,用於鏈結。