Class UniversalActionResponse
UniversalActionResponse
ออบเจ็กต์การตอบกลับที่อาจแสดงผลจากเมธอดที่สร้างการดำเนินการแบบสากล
// 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();
เมธอด
วิธีการ | ประเภทการแสดงผล | รายละเอียดแบบย่อ |
printJson() | String | พิมพ์การแสดง JSON ของออบเจ็กต์นี้ |
เอกสารประกอบโดยละเอียด
printJson()
พิมพ์การแสดง JSON ของออบเจ็กต์นี้ การดำเนินการนี้มีไว้สำหรับการแก้ไขข้อบกพร่องเท่านั้น
รีเทิร์น
String
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-12-21 UTC
[null,null,["อัปเดตล่าสุด 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"]]