Compilateur pour les objets CardWithId
. Cette classe est l'identifiant unique d'une carte dans un message lors de l'envoi de plusieurs cartes.
Disponible uniquement pour les applications Google Chat. Non disponible pour les modules complémentaires 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);
Méthodes
Méthode | Type renvoyé | Brève description |
---|---|---|
setCard(card) | CardWithId | Définit la carte de cardWithId . |
setCardId(id) | CardWithId | Définit l'ID unique de la carte de cardWithId . |
Documentation détaillée
setCard(card)
Définit la carte de 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);
Paramètres
Nom | Type | Description |
---|---|---|
card | Card | Le Card à utiliser. |
Renvois
CardWithId
: objet pour le chaînage.
setCardId(id)
Définit l'ID unique de la carte de cardWithId
.
const cardWithId = CardService.newCardWithId(); // Sets the card ID of the cardWithId. cardWithId.setCardId('card_id');
Paramètres
Nom | Type | Description |
---|---|---|
id | String | Texte à utiliser. |
Renvois
CardWithId
: objet pour le chaînage.