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.

Throws

Error — if the constructed card isn't valid.


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.

发送以下问题的反馈:

此网页
Apps Script
Apps Script
需要帮助?请访问我们的支持页面