Class ActionResponse

ActionResponse (Action de réponse)

Objet de réponse qui peut être renvoyé par une fonction de rappel (par exemple, un gestionnaire de réponses aux formulaires) pour effectuer une ou plusieurs actions sur le client. Certaines combinaisons d'actions ne sont pas acceptées.

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

Méthodes

MéthodeType renvoyéBrève description
printJson()StringAffiche la représentation JSON de cet objet.

Documentation détaillée

printJson()

Affiche la représentation JSON de cet objet. Cette étape est réservée au débogage.

Aller-retour

String