Class ActionResponse

ActionResponse

كائن الردّ الذي قد يتم إرجاعه من دالة رد الاتصال (مثل معالج ردّ على نموذج) لتنفيذ إجراء واحد أو أكثر على العميل. لا تتوفّر بعض مجموعات الإجراءات.

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