Class ActionResponse

ActionResponse

Objek respons yang mungkin ditampilkan dari fungsi callback (misalnya, pengendali respons formulir) untuk melakukan satu atau beberapa tindakan pada klien. Beberapa kombinasi tindakan tidak didukung.

// 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();

Metode

MetodeJenis hasil yang ditampilkanDeskripsi singkat
printJson()StringMencetak representasi JSON objek ini.

Dokumentasi mendetail

printJson()

Mencetak representasi JSON objek ini. Ini hanya untuk proses debug.

Return

String