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 – האובייקט הזה, לשרשור.