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