Class UniversalActionResponse
UniversalActionResponse
L'oggetto di risposta che può essere restituito da un metodo che crea un'azione universale.
// A universal action that opens a link.
const openLinkUniversalAction =
CardService.newUniversalActionResponseBuilder()
.setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com'))
.build();
const cardBuilder1 = CardService.newCardBuilder();
const cardBuilder2 = CardService.newCardBuilder();
// Finish building the cards ...
// A universal action that shows two static cards.
const cardsUniversalAction =
CardService.newUniversalActionResponseBuilder()
.displayAddOnCards([cardBuilder1.build(), cardBuilder2.build()])
.build();
Metodi
Metodo | Tipo restituito | Breve descrizione |
printJson() | String | Stampa la rappresentazione JSON di questo oggetto. |
Documentazione dettagliata
printJson()
Stampa la rappresentazione JSON di questo oggetto. Questo è solo per il debug.
Invio
String
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-12-21 UTC.
[null,null,["Ultimo aggiornamento 2024-12-21 UTC."],[[["`UniversalActionResponse` objects are returned from methods creating universal actions, like opening links or displaying cards."],["These objects can define actions like opening a web link using `setOpenLink()` or showing cards using `displayAddOnCards()`."],["For debugging, the `printJson()` method outputs the object's JSON representation as a string."]]],["The `UniversalActionResponse` object is used to define actions within a card-based interface. Key actions include using the `setOpenLink` method to open a URL and `displayAddOnCards` to display multiple static cards. `printJson()` is a method for debugging, that returns the JSON representation of the object as a string. These methods are used within the `UniversalActionResponseBuilder` to create the object.\n"]]