Compilateur pour les objets CardWithId. Cette classe est un identifiant unique pour une carte dans un message lorsque plusieurs cartes sont envoyées.
Uniquement disponible 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 |
|---|---|---|
set | Card | Définit la carte du card. |
set | Card | Définit l'identifiant unique de la carte card. |
Documentation détaillée
setCard(card)
Définit la carte du 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 : cet objet, pour le chaînage.
setCardId(id)
Définit l'identifiant unique de la carte 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 : cet objet, pour le chaînage.