Class AddOnsResponseService

سرویس پاسخ افزودنی‌ها

Add Ons Response Service امکان ایجاد پاسخ برای افزونه‌های Google Workspace را فراهم می‌کند.

نمونه استفاده:

function myFunction() {
  return AddOnsResponseService.newChatDataActionBuilder();
}

مثال زیر نشان می‌دهد که چگونه یک برنامه چت با یک کادر محاوره‌ای پاسخ می‌دهد:

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const actionResponse = AddOnsResponseService.newActionResponseBuilder()
    .setNavigation(AddOnsResponseService.newNavigation().pushCard(card))
    .build();

مثال زیر نشان می‌دهد که چگونه یک برنامه چت با کارت پیش‌نمایش لینک پاسخ می‌دهد:

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();

خواص

ملک نوع توضیحات
Addon Compose Ui Action Type Addon Compose Ui Action Type شمارش Addon Compose Ui Action Type .
Composed Email Type Composed Email Type شمارش Composed Email Type .
Content Type Content Type شمارش Content Type .
End Navigation End Navigation شمارش End Navigation .
On Close On Close شمارش On Close .
Open As Open As شمارش Open As .
Send Status Send Status شمارش Send Status .
Update Draft Body Type Update Draft Body Type شمارش Update Draft Body Type .

روش‌ها

روش نوع بازگشتی شرح مختصر
new Accessory Widget() Accessory Widget یک Accessory Widget جدید ایجاد می‌کند.
new Action() Action یک Action جدید ایجاد می‌کند.
new Action Response Builder() Action Response Builder یک Action Response Builder ایجاد می‌کند.
new Addon Compose Ui Action Response Builder() Addon Compose Ui Action Response Builder یک Addon Compose Ui Action Response Builder ایجاد می‌کند.
new Attachment() Attachment یک Attachment ایجاد می‌کند.
new Calendar Event Action Response Builder() Calendar Event Action Response Builder یک Calendar Event Action Response Builder ایجاد می‌کند.
new Chat Data Action Builder() Chat Data Actions Response Builder یک Chat Data Actions Response Builder ایجاد می‌کند.
new Chat Message() Chat Message یک Chat Message ایجاد می‌کند.
new Compose Action Response Builder() Compose Action Response Builder یک Compose Action Response Builder ایجاد می‌کند.
new Create Message Action() Create Message Action یک Create Message Action ایجاد می‌کند.
new Drive Items Selected Action Response Builder() Drive Items Selected Action Response Builder یک Drive Items Selected Action Response Builder .
new Editor File Scope Action Response Builder() Editor File Scope Action Response Builder یک Editor File Scope Action Response Builder ایجاد می‌کند.
new Link Preview() Link Preview Link Preview ایجاد می‌کند.
new Navigation() Navigation یک Navigation ایجاد می‌کند.
new Notification() Notification یک Notification ایجاد می‌کند.
new Open Link() Open Link یک Open Link ایجاد می‌کند.
new Render Action Builder() Render Action Builder یک Render Action Builder جدید ایجاد می‌کند.
new Universal Action Response Builder() Universal Action Response Builder یک Universal Action Response Builder ایجاد می‌کند.
new Update Draft Action Response Builder() Update Draft Action Response Builder یک Update Draft Action Response Builder ایجاد می‌کند.
new Update Draft Bcc Recipients Action() Update Draft Bcc Recipients Action یک Update Draft Bcc Recipients Action ایجاد می‌کند؛
new Update Draft Body Action() Update Draft Body Action یک Update Draft Body Action ایجاد می‌کند.
new Update Draft Cc Recipients Action() Update Draft Cc Recipients Action یک Update Draft Cc Recipients Action ایجاد می‌کند.
new Update Draft Subject Action() Update Draft Subject Action یک Update Draft Subject Action ایجاد می‌کند.
new Update Draft To Recipients Action() Update Draft To Recipients Action یک Update Draft To Recipients Action ایجاد می‌کند.
new Update Inline Preview Action() Update Inline Preview Action یک Update Inline Preview Action ایجاد می‌کند.
new Update Message Action() Update Message Action یک Update Message Action ایجاد می‌کند.

مستندات دقیق

new Accessory Widget()

یک Accessory Widget جدید ایجاد می‌کند.

const widget = CardService.newButtonSet()
    .addButton(CardService.newImageButton()
      .setIcon(CardService.Icon.PHONE)
      .setOnClickAction(CardService.newAction()
        .setFunctionName("phone")))
    .addButton(CardService.newTextButton()
      .setText("Robot")
      .setIconUrl("https://developers.google.com/chat/images/quickstart-app-avatar.png")
      .setOnClickAction(CardService.newAction()
        .setFunctionName("robot")));

const accessoryWidget = AddOnsResponseService.newAccessoryWidget()
    .addWidget(widget);

بازگشت

Accessory Widget — یک ابزارک لوازم جانبی خالی.


new Action()

یک Action جدید ایجاد می‌کند.

بازگشت

Action — یک اکشن خالی.


new Action Response Builder()

یک Action Response Builder ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const actionResponse = AddOnsResponseService.newActionResponseBuilder()
    .setNavigation(AddOnsResponseService.newNavigation().pushCard(card))
    .build();

بازگشت

Action Response Builder — یک سازنده‌ی اکشن‌ریسپانس خالی.


new Addon Compose Ui Action Response Builder()

یک Addon Compose Ui Action Response Builder ایجاد می‌کند.

بازگشت

Addon Compose Ui Action Response Builder — یک سازنده‌ی پاسخ اکشن رابط کاربری خالی افزونه‌ی ComposeUi.


new Attachment()

یک Attachment ایجاد می‌کند.

بازگشت

Attachment — یک پیوست خالی.


new Calendar Event Action Response Builder()


new Chat Data Action Builder()

یک Chat Data Actions Response Builder ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setCreateChatMessageAction(AddOnsResponseService.newCreateMessageAction()
    .setMessage(message))
    .build();

بازگشت

Chat Data Actions Response Builder - یک سازنده‌ی پاسخ ChatDataActionsخالی.


new Chat Message()

یک Chat Message ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

بازگشت

Chat Message — یک پیام چت خالی.


new Compose Action Response Builder()

یک Compose Action Response Builder ایجاد می‌کند.

بازگشت

Compose Action Response Builder — یک سازنده‌ی خالی ComposeActionResponse.


new Create Message Action()

یک Create Message Action ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setCreateChatMessageAction(AddOnsResponseService.newCreateMessageAction()
    .setMessage(message))
    .build();

بازگشت

Create Message Action - یک CreateMessageAction خالی.


new Drive Items Selected Action Response Builder()


new Editor File Scope Action Response Builder()


new Link Preview()

Link Preview ایجاد می‌کند.

بازگشت

Link Preview — یک پیش‌نمایش لینک خالی.


new Navigation()

یک Navigation ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle('Card title'))
    .addSection(cardSection)
    .build();

const navigation = AddOnsResponseService.newNavigation()
    .pushCard(card);

بازگشت

Navigation — یک ناوبری خالی.


new Notification()

یک Notification ایجاد می‌کند.

const notification = AddOnsResponseService.newNotification().setText("You closed a dialog!");

const navigation = AddOnsResponseService.newNavigation()
    .setEndNavigation(AddOnsResponseService.EndNavigation.CLOSE_DIALOG);

بازگشت

Notification — یک اعلان خالی.


یک Open Link ایجاد می‌کند.

بازگشت

Open Link - یک پیوند باز خالی.


new Render Action Builder()

یک Render Action Builder جدید ایجاد می‌کند.

بازگشت

Render Action Builder - یک RenderActionBuilder خالی.


new Universal Action Response Builder()

یک Universal Action Response Builder ایجاد می‌کند.

بازگشت

Universal Action Response Builder - یک سازنده خالی UniversalActionResponse.


new Update Draft Action Response Builder()

یک Update Draft Action Response Builder ایجاد می‌کند.

بازگشت

Update Draft Action Response Builder - یک سازنده‌ی پاسخِ خالیِ UpdateDraftActionResponse.


new Update Draft Bcc Recipients Action()

یک Update Draft Bcc Recipients Action ایجاد می‌کند؛

بازگشت

Update Draft Bcc Recipients Action — یک اقدام خالی برای UpdateDraftBccRecipientsAction.


new Update Draft Body Action()

یک Update Draft Body Action ایجاد می‌کند.

بازگشت

Update Draft Body Action — یک اقدام خالیِ به‌روزرسانی بدنه‌ی پیش‌نویس.


new Update Draft Cc Recipients Action()

یک Update Draft Cc Recipients Action ایجاد می‌کند.

بازگشت

Update Draft Cc Recipients Action - یک اقدام خالی UpdateDraftCcRecipientsAction.


new Update Draft Subject Action()

یک Update Draft Subject Action ایجاد می‌کند.

بازگشت

Update Draft Subject Action — یک اقدام موضوع پیش‌نمایش خالی.


new Update Draft To Recipients Action()

یک Update Draft To Recipients Action ایجاد می‌کند.

بازگشت

Update Draft To Recipients Action - یک اقدام خالی UpdateDraftToRecipients.


new Update Inline Preview Action()

یک Update Inline Preview Action ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();

بازگشت

Update Inline Preview Action — یک اکشن خالی UpdateInlinePreviewAction.


new Update Message Action()

یک Update Message Action ایجاد می‌کند.

const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Card Title"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("Text paragraph")))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const message = AddOnsResponseService.newChatMessage().addCardWithId(cardWithId);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateChatMessageAction(AddOnsResponseService.newUpdateMessageAction()
    .setMessage(message))
    .build();

بازگشت

Update Message Action - یک اقدام به‌روزرسانی پیام خالی.