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