CardWithId

A builder for `https://developers.google.com/apps-script/reference/card-service/card-with-id#` objects. This class is a unique identifier for a card in a
message when sending multiple cards.

Only available for Google Chat apps. Not available for Google Workspace add-ons.

```javascript
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

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/card-service/card-with-id#setCard(Card)` | `https://developers.google.com/apps-script/reference/card-service/card-with-id#` | Sets the card of the `cardWithId`. |
| `https://developers.google.com/apps-script/reference/card-service/card-with-id#setCardId(String)` | `https://developers.google.com/apps-script/reference/card-service/card-with-id#` | Sets the unique card ID of the `cardWithId`. |

## Detailed documentation

### `setCard(card)`

Sets the card of the `cardWithId`.

```javascript
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);
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `card` | `https://developers.google.com/apps-script/reference/card-service/card` | The `https://developers.google.com/apps-script/reference/card-service/card` to use. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/card-with-id#` --- This object, for chaining.

*** ** * ** ***

### `setCardId(id)`

Sets the unique card ID of the `cardWithId`.

```javascript
const cardWithId = CardService.newCardWithId();

// Sets the card ID of the cardWithId.
cardWithId.setCardId('card_id');
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `id` | `String` | The text to use. |

#### Return


`https://developers.google.com/apps-script/reference/card-service/card-with-id#` --- This object, for chaining.