Объект ответа, который может быть возвращен методом, создающим универсальное действие.
// 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();
[[["Прост для понимания","easyToUnderstand","thumb-up"],["Помог мне решить мою проблему","solvedMyProblem","thumb-up"],["Другое","otherUp","thumb-up"]],[["Отсутствует нужная мне информация","missingTheInformationINeed","thumb-down"],["Слишком сложен/слишком много шагов","tooComplicatedTooManySteps","thumb-down"],["Устарел","outOfDate","thumb-down"],["Проблема с переводом текста","translationIssue","thumb-down"],["Проблемы образцов/кода","samplesCodeIssue","thumb-down"],["Другое","otherDown","thumb-down"]],["Последнее обновление: 2025-01-06 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"]]