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);
メソッド
| メソッド | 戻り値の型 | 概要 |
|---|---|---|
set | Card | card のカードを設定します。 |
set | Card | card の一意のカード ID を設定します。 |
詳細なドキュメント
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 の一意のカード ID を設定します。
const cardWithId = CardService.newCardWithId(); // Sets the card ID of the cardWithId. cardWithId.setCardId('card_id');
パラメータ
| 名前 | タイプ | 説明 |
|---|---|---|
id | String | 使用するテキスト。 |
戻る
CardWithId \- チェーン用のこのオブジェクト。