Class ActionResponse

ActionResponse

ออบเจ็กต์การตอบกลับที่อาจส่งคืนจากฟังก์ชัน Callback (เช่น ตัวแฮนเดิลการตอบกลับแบบฟอร์ม) เพื่อดำเนินการอย่างน้อย 1 อย่างในไคลเอ็นต์ ระบบไม่รองรับการดำเนินการบางอย่างร่วมกัน

// An action that opens a link
const actionResponse =
    CardService.newActionResponseBuilder()
        .setOpenLink(CardService.newOpenLink().setUrl('https://www.google.com'))
        .build();

// An action that shows a notification.
const notificationActionResponse = 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.

const cardBuilder = CardService.newCardBuilder();
// Build card ...
const navigationActionResponse = CardService.newActionResponseBuilder()
                           .setNavigation(CardService.newNavigation().pushCard(
                               cardBuilder.build()))
                           .setStateChanged(true)
                           .build();

เมธอด

วิธีการประเภทการแสดงผลรายละเอียดแบบย่อ
printJson()Stringพิมพ์การแสดง JSON ของออบเจ็กต์นี้

เอกสารโดยละเอียด

printJson()

พิมพ์การแสดง JSON ของออบเจ็กต์นี้ ซึ่งใช้สำหรับการแก้ไขข้อบกพร่องเท่านั้น

รีเทิร์น

String