Class CardWithId

CardWithId

ה-builder של אובייקטים מסוג CardWithId. הסיווג הזה הוא מזהה ייחודי של כרטיס בהודעה כששולחים כמה כרטיסים.

האפשרות הזו זמינה רק לאפליקציות של Google Chat. לא זמין לתוספים של Google Workspace.

const cardSection = CardService.newCardSection();
cardSection.addWidget(
    CardService.newTextParagraph().setText('This is a text paragraph widget.'),
);

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

const cardWithId =
    CardService.newCardWithId().setCardId('card_id').setCard(card);

Methods

שיטהסוג הערך המוחזרתיאור קצר
setCard(card)CardWithIdהגדרת הכרטיס של cardWithId.
setCardId(id)CardWithIdמגדיר את מזהה הכרטיס הייחודי של cardWithId.

מסמכים מפורטים

setCard(card)

הגדרת הכרטיס של cardWithId.

const cardHeader = CardService.newCardHeader()
                       .setTitle('Card Header Title')
                       .setSubtitle('Card Header Subtitle');

const card = CardService.newCardBuilder().setHeader(cardHeader).build();

const cardWithId = CardService.newCardWithId().setCard(card);

פרמטרים

שםסוגתיאור
cardCardה-Card לשימוש.

חזרה

CardWithId – האובייקט הזה, לצורך קישור.


setCardId(id)

מגדיר את מזהה הכרטיס הייחודי של cardWithId.

const cardWithId = CardService.newCardWithId();

// Sets the card ID of the cardWithId.
cardWithId.setCardId('card_id');

פרמטרים

שםסוגתיאור
idStringהטקסט שרוצים להשתמש בו.

חזרה

CardWithId – האובייקט הזה, לצורך קישור.