Class ActionResponse

ActionResponse

可能会从回调函数(例如表单回复处理程序)返回的响应对象,用于在客户端上执行一项或多项操作。不支持某些操作组合。

// An action that opens a link
const actionResponse =
    CardService.newActionResponseBuilder()
        .setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com'))
        .build();

// An action that shows a notification.
const notificationActionResponse = 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.

const cardBuilder = CardService.newCardBuilder();
// Build card ...
const navigationActionResponse = CardService.newActionResponseBuilder()
                           .setNavigation(CardService.newNavigation().pushCard(
                               cardBuilder.build()))
                           .setStateChanged(true)
                           .build();

方法

方法返回值类型简介
printJson()String输出此对象的 JSON 表示法。

详细文档

printJson()

输出此对象的 JSON 表示法。此方法仅用于调试。

返回

String