Class CardWithId

CardWithId

Un compilador para objetos CardWithId. Esta clase es un identificador único para una tarjeta en un mensaje cuando se envían varias tarjetas.

Solo está disponible para las apps de Google Chat. No está disponible para los complementos de 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étodos

MétodoTipo de datos que se muestraDescripción breve
setCard(card)CardWithIdEstablece la tarjeta de cardWithId.
setCardId(id)CardWithIdEstablece el ID de tarjeta único de cardWithId.

Documentación detallada

setCard(card)

Establece la tarjeta 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);

Parámetros

NombreTipoDescripción
cardCardEl Card que se debe usar.

Devolvedor

CardWithId: Este objeto se usa para encadenar.


setCardId(id)

Establece el ID de tarjeta único de cardWithId.

const cardWithId = CardService.newCardWithId();

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

Parámetros

NombreTipoDescripción
idStringEl texto que se usará.

Devolvedor

CardWithId: Este objeto se usa para encadenar.