Class ActionResponse
ActionResponse شی پاسخی که ممکن است از یک تابع پاسخ به تماس (به عنوان مثال، یک کنترل کننده پاسخ فرم) برای انجام یک یا چند عمل بر روی مشتری بازگردانده شود. برخی از ترکیبات عملکردها پشتیبانی نمی شوند.
// An action that opens a link
var actionResponse = CardService.newActionResponseBuilder()
.setOpenLink(CardService.newOpenLink()
.setUrl("https://www.google.com"))
.build();
// An action that shows a notification.
var actionResponse = CardService.newActionResponseBuilder()
.setNotification(CardService.newNotification()
.setText("Some info to display to user"))
.build();
// An action that shows an additional card. It also sets a flag to indicate that the original
// state data has changed.
var cardBuilder = CardService.newCardBuilder();
// Build card ...
var actionResponse = CardService.newActionResponseBuilder()
.setNavigation(CardService.newNavigation()
.pushCard(cardBuilder.build()))
.setStateChanged(true)
.build();
روش ها
روش | نوع برگشت | شرح مختصر |
---|
printJson() | String | نمایش JSON این شی را چاپ می کند. |
مستندات دقیق
printJson()
نمایش JSON این شی را چاپ می کند. این فقط برای رفع اشکال است.
بازگشت
String
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-01-15 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-01-15 بهوقت ساعت هماهنگ جهانی."],[[["`ActionResponse` enables callback functions to trigger actions like opening links, displaying notifications, and navigating between cards within Google Workspace add-ons."],["Developers can use `ActionResponseBuilder` methods to define these actions and control client-side behavior based on user interactions."],["The `printJson()` method helps with debugging by providing the JSON representation of the `ActionResponse` object."]]],["The `ActionResponse` object enables client-side actions from callback functions. It supports actions like opening a link, displaying a notification, or showing a new card. `setOpenLink` opens a specified URL, `setNotification` displays text to the user, and `setNavigation` pushes a new card. `setStateChanged` indicates changes in original data. `printJson()` provides a JSON representation of the object for debugging. Certain action combinations may be unsupported.\n"]]