Class ActionResponseBuilder
详细文档
setNavigation(navigation)
setNotification(notification)
setStateChanged(stateChanged)
设置一个标志,以指示此操作更改了现有数据状态。例如,如果操作创建了任务或更新了联系信息。将此标志设为 true 后,Gmail 等服务可以尝试清除与此操作关联的所有缓存状态数据。
参数
名称 | 类型 | 说明 |
stateChanged | Boolean | 此操作是否更改了现有状态数据。默认值为 false。 |
返回
ActionResponseBuilder
- 此对象,用于链式调用。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-12-02。
[null,null,["最后更新时间 (UTC):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"]]