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);
שיטות
שיטה | סוג הערך שמוחזר | תיאור קצר |
---|---|---|
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);
פרמטרים
שם | סוג | תיאור |
---|---|---|
card | Card | Card שבו צריך להשתמש. |
החזרות
CardWithId
– האובייקט הזה, לשרשור.
setCardId(id)
מגדיר את מזהה הכרטיס הייחודי של cardWithId
.
const cardWithId = CardService.newCardWithId(); // Sets the card ID of the cardWithId. cardWithId.setCardId('card_id');
פרמטרים
שם | סוג | תיאור |
---|---|---|
id | String | הטקסט שבו רוצים להשתמש. |
החזרות
CardWithId
– האובייקט הזה, לשרשור.