Class ActionResponseBuilder
內容詳盡的說明文件
setNavigation(navigation)
setNotification(notification)
setStateChanged(stateChanged)
設定標記,表示此動作已變更現有資料狀態。舉例來說,如果動作建立了工作或更新了聯絡資訊,將這個旗標設為 true 後,Gmail 等服務就能嘗試清除與此動作相關聯的任何快取狀態資料。
參數
名稱 | 類型 | 說明 |
stateChanged | Boolean | 這項操作是否已變更現有的狀態資料。預設值為 false。 |
回攻員
ActionResponseBuilder
:這個物件用於鏈結。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-12-02 (世界標準時間)。
[null,null,["上次更新時間:2024-12-02 (世界標準時間)。"],[[["`ActionResponseBuilder` helps create responses for actions within Google Apps Script cards."],["It provides methods to define navigation, notifications, open links, and signal state changes when an action is performed."],["The `build()` method finalizes the response and ensures its validity before execution."],["Methods like `setNavigation()`, `setNotification()`, `setOpenLink()`, and `setStateChanged()` allow customization of the action's outcome."],["Using an `ActionResponseBuilder` streamlines the process of defining how user interactions within a card trigger specific application behaviors."]]],["The `ActionResponseBuilder` constructs `ActionResponse` objects. Key actions include: `build()`, which creates and validates the response; `setNavigation()`, which sets a navigation action; `setNotification()`, which sets a notification to display; `setOpenLink()`, which sets a URL for navigation; and `setStateChanged()`, which flags if the action modifies existing data. Each setter method allows for chaining and accepts specific object types like `Navigation`, `Notification`, or `OpenLink` to define the response.\n"]]