Class ActionResponse

ActionResponse

O objeto de resposta que pode ser retornado de uma função de callback (por exemplo, um gerenciador de respostas de formulário) para executar uma ou mais ações no cliente. Algumas combinações de ações não são compatíveis.

// 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étodos

MétodoTipo de retornoBreve descrição
printJson()StringMostra a representação JSON desse objeto.

Documentação detalhada

printJson()

Mostra a representação JSON desse objeto. Isso é apenas para depuração.

Retorno

String