Class CardBuilder

CardBuilder

A builder for Card objects.

Methods

MethodReturn typeBrief description
addCardAction(cardAction)CardBuilderAdds a CardAction to this Card.
addSection(section)CardBuilderAdds a section to this card.
build()CardBuilds the current card and validates it.
setHeader(cardHeader)CardBuilderSets the header for this card.
setName(name)CardBuilderSets the name for this card.

Detailed documentation

addCardAction(cardAction)

Adds a CardAction to this Card.

Parameters

NameTypeDescription
cardActionCardActionthe CardAction to use.

Return

CardBuilder — this object, for chaining.


addSection(section)

Adds a section to this card.

Parameters

NameTypeDescription
sectionCardSectionthe CardSection to use.

Return

CardBuilder — this object, for chaining.


build()

Builds the current card and validates it.

Return

Card — a validated card.


setHeader(cardHeader)

Sets the header for this card.

Parameters

NameTypeDescription
cardHeaderCardHeaderthe CardHeader to use.

Return

CardBuilder — this object, for chaining.


setName(name)

Sets the name for this card. The name can be used for navigation.

Parameters

NameTypeDescription
nameStringthe name.

Return

CardBuilder — this object, for chaining.

Send feedback about...

Apps Script
Apps Script