Class ActionResponse

ActionResponse

Obiekt odpowiedzi, który może zostać zwrócony przez funkcję wywołania zwrotnego (np. moduł obsługi odpowiedzi na formularz), aby wykonać co najmniej 1 działanie po stronie klienta. Niektóre kombinacje działań nie są obsługiwane.

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

Metody

MetodaZwracany typKrótki opis
printJson()StringDrukuje reprezentację tego obiektu w formacie JSON.

Szczegółowa dokumentacja

printJson()

Drukuje reprezentację tego obiektu w formacie JSON. Służy tylko do debugowania.

Powroty

String