Objet de réponse pouvant être renvoyé par une fonction de rappel (par exemple, un gestionnaire de réponses à un formulaire) 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éthode | Type renvoyé | Brève description |
---|---|---|
printJson() | String | Affiche la représentation JSON de cet objet. |
Documentation détaillée
printJson()
Affiche la représentation JSON de cet objet. Elle sert uniquement au débogage.
Renvois
String