UpdateInlinePreviewAction

The Chat app previews a link in a message by adding or updating one or more cards. For details,
see [Preview links in
Google Chat messages](https://developers.google.com/workspace/add-ons/chat/preview-links).

Available for Google Workspace add-ons that extend Google Chat.

```javascript
const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#addCardWithId(CardWithId)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#` | Adds the card for this action. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#addExpiration(Integer)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#` | Adds the expiration for this action. |

## Detailed documentation

### `addCardWithId(cardWithId)`

Adds the card for this action.

```javascript
const card = CardService.newCardBuilder()
    .setHeader(CardService.newCardHeader().setTitle("Unfurl Card!"))
    .addSection(CardService.newCardSection()
      .addWidget(CardService.newTextParagraph().setText("url"))
      .addWidget(CardService.newButtonSet()
        .addButton(CardService.newTextButton()
          .setText("Open URL!")
          .setOpenLink(CardService.newOpenLink().setUrl("https://www.google.com")))))
    .build();

const cardWithId = CardService.newCardWithId().setCardId("card_one").setCard(card);

const chatDataAction = AddOnsResponseService.newChatDataActionBuilder()
    .setUpdateInlinePreviewAction(AddOnsResponseService.newUpdateInlinePreviewAction()
    .addCardWithId(cardWithId)).build();
```

#### Parameters

| Name | Type | Description |
|---|---|---|
| `cardWithId` | `https://developers.google.com/apps-script/reference/card-service/card-with-id.html` | The card to be set. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#` --- This object, for chaining.

*** ** * ** ***

### `addExpiration(ttl)`

Adds the expiration for this action.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `ttl` | `Integer` | The duration of expiration to be set. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/update-inline-preview-action#` --- This object, for chaining.