Class Card.Builder (0.1.0)

public static final class Card.Builder extends GeneratedMessageV3.Builder<Card.Builder> implements CardOrBuilder

A card interface displayed in a Google Chat message or Google Workspace Add-on.

Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step.

Card builder

To learn how to build cards, see the following documentation:

  • For Google Chat apps, see Design dynamic, interactive, and consistent UIs with cards.
  • For Google Workspace Add-ons, see Card-based interfaces.

    Example: Card message for a Google Chat app

    !Example contact card

    To create the sample card message in Google Chat, use the following JSON:

    <code><code> { "cardsV2": [ { "cardId": "unique-card-id", "card": { "header": { "title": "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers.google.com/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", "imageAltText": "Avatar for Sasha", }, "sections": [ { "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ { "decoratedText": { "startIcon": { "knownIcon": "EMAIL", }, "text": "sasha&#64;example.com", } }, { "decoratedText": { "startIcon": { "knownIcon": "PERSON", }, "text": "&lt;font color=&#92;"#80e27e&#92;"&gt;Online&lt;/font&gt;", }, }, { "decoratedText": { "startIcon": { "knownIcon": "PHONE", }, "text": "+1 (555) 555-1234", } }, { "buttonList": { "buttons": [ { "text": "Share", "onClick": { "openLink": { "url": "https://example.com/share", } } }, { "text": "Edit", "onClick": { "action": { "function": "goToView", "parameters": [ { "key": "viewType", "value": "EDIT", } ], } } }, ], } }, ], }, ], }, } ], } </code></code>

Protobuf type google.apps.card.v1.Card

Implements

CardOrBuilder

Static Methods

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

Methods

addAllCardActions(Iterable<? extends Card.CardAction> values)

public Card.Builder addAllCardActions(Iterable<? extends Card.CardAction> values)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
valuesIterable<? extends com.google.apps.card.v1.Card.CardAction>
Returns
TypeDescription
Card.Builder

addAllSections(Iterable<? extends Card.Section> values)

public Card.Builder addAllSections(Iterable<? extends Card.Section> values)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
valuesIterable<? extends com.google.apps.card.v1.Card.Section>
Returns
TypeDescription
Card.Builder

addCardActions(Card.CardAction value)

public Card.Builder addCardActions(Card.CardAction value)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
valueCard.CardAction
Returns
TypeDescription
Card.Builder

addCardActions(Card.CardAction.Builder builderForValue)

public Card.Builder addCardActions(Card.CardAction.Builder builderForValue)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
builderForValueCard.CardAction.Builder
Returns
TypeDescription
Card.Builder

addCardActions(int index, Card.CardAction value)

public Card.Builder addCardActions(int index, Card.CardAction value)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameters
NameDescription
indexint
valueCard.CardAction
Returns
TypeDescription
Card.Builder

addCardActions(int index, Card.CardAction.Builder builderForValue)

public Card.Builder addCardActions(int index, Card.CardAction.Builder builderForValue)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameters
NameDescription
indexint
builderForValueCard.CardAction.Builder
Returns
TypeDescription
Card.Builder

addCardActionsBuilder()

public Card.CardAction.Builder addCardActionsBuilder()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
Card.CardAction.Builder

addCardActionsBuilder(int index)

public Card.CardAction.Builder addCardActionsBuilder(int index)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.CardAction.Builder

addRepeatedField(Descriptors.FieldDescriptor field, Object value)

public Card.Builder addRepeatedField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Card.Builder
Overrides

addSections(Card.Section value)

public Card.Builder addSections(Card.Section value)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
valueCard.Section
Returns
TypeDescription
Card.Builder

addSections(Card.Section.Builder builderForValue)

public Card.Builder addSections(Card.Section.Builder builderForValue)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
builderForValueCard.Section.Builder
Returns
TypeDescription
Card.Builder

addSections(int index, Card.Section value)

public Card.Builder addSections(int index, Card.Section value)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameters
NameDescription
indexint
valueCard.Section
Returns
TypeDescription
Card.Builder

addSections(int index, Card.Section.Builder builderForValue)

public Card.Builder addSections(int index, Card.Section.Builder builderForValue)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameters
NameDescription
indexint
builderForValueCard.Section.Builder
Returns
TypeDescription
Card.Builder

addSectionsBuilder()

public Card.Section.Builder addSectionsBuilder()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
Card.Section.Builder

addSectionsBuilder(int index)

public Card.Section.Builder addSectionsBuilder(int index)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Section.Builder

build()

public Card build()
Returns
TypeDescription
Card

buildPartial()

public Card buildPartial()
Returns
TypeDescription
Card

clear()

public Card.Builder clear()
Returns
TypeDescription
Card.Builder
Overrides

clearCardActions()

public Card.Builder clearCardActions()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
Card.Builder

clearDisplayStyle()

public Card.Builder clearDisplayStyle()

In Google Workspace Add-ons, sets the display properties of the peekCardHeader.

Google Workspace Add-ons:

.google.apps.card.v1.Card.DisplayStyle display_style = 6;

Returns
TypeDescription
Card.Builder

This builder for chaining.

clearField(Descriptors.FieldDescriptor field)

public Card.Builder clearField(Descriptors.FieldDescriptor field)
Parameter
NameDescription
fieldFieldDescriptor
Returns
TypeDescription
Card.Builder
Overrides

clearFixedFooter()

public Card.Builder clearFixedFooter()

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Returns
TypeDescription
Card.Builder

clearHeader()

public Card.Builder clearHeader()

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Returns
TypeDescription
Card.Builder

clearName()

public Card.Builder clearName()

Name of the card. Used as a card identifier in card navigation.

Google Workspace Add-ons:

string name = 4;

Returns
TypeDescription
Card.Builder

This builder for chaining.

clearOneof(Descriptors.OneofDescriptor oneof)

public Card.Builder clearOneof(Descriptors.OneofDescriptor oneof)
Parameter
NameDescription
oneofOneofDescriptor
Returns
TypeDescription
Card.Builder
Overrides

clearPeekCardHeader()

public Card.Builder clearPeekCardHeader()

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Returns
TypeDescription
Card.Builder

clearSectionDividerStyle()

public Card.Builder clearSectionDividerStyle()

The divider style between sections.

.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;

Returns
TypeDescription
Card.Builder

This builder for chaining.

clearSections()

public Card.Builder clearSections()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
Card.Builder

clone()

public Card.Builder clone()
Returns
TypeDescription
Card.Builder
Overrides

getCardActions(int index)

public Card.CardAction getCardActions(int index)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.CardAction

getCardActionsBuilder(int index)

public Card.CardAction.Builder getCardActionsBuilder(int index)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.CardAction.Builder

getCardActionsBuilderList()

public List<Card.CardAction.Builder> getCardActionsBuilderList()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
List<Builder>

getCardActionsCount()

public int getCardActionsCount()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
int

getCardActionsList()

public List<Card.CardAction> getCardActionsList()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
List<CardAction>

getCardActionsOrBuilder(int index)

public Card.CardActionOrBuilder getCardActionsOrBuilder(int index)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.CardActionOrBuilder

getCardActionsOrBuilderList()

public List<? extends Card.CardActionOrBuilder> getCardActionsOrBuilderList()

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Returns
TypeDescription
List<? extends com.google.apps.card.v1.Card.CardActionOrBuilder>

getDefaultInstanceForType()

public Card getDefaultInstanceForType()
Returns
TypeDescription
Card

getDescriptorForType()

public Descriptors.Descriptor getDescriptorForType()
Returns
TypeDescription
Descriptor
Overrides

getDisplayStyle()

public Card.DisplayStyle getDisplayStyle()

In Google Workspace Add-ons, sets the display properties of the peekCardHeader.

Google Workspace Add-ons:

.google.apps.card.v1.Card.DisplayStyle display_style = 6;

Returns
TypeDescription
Card.DisplayStyle

The displayStyle.

getDisplayStyleValue()

public int getDisplayStyleValue()

In Google Workspace Add-ons, sets the display properties of the peekCardHeader.

Google Workspace Add-ons:

.google.apps.card.v1.Card.DisplayStyle display_style = 6;

Returns
TypeDescription
int

The enum numeric value on the wire for displayStyle.

getFixedFooter()

public Card.CardFixedFooter getFixedFooter()

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Returns
TypeDescription
Card.CardFixedFooter

The fixedFooter.

getFixedFooterBuilder()

public Card.CardFixedFooter.Builder getFixedFooterBuilder()

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Returns
TypeDescription
Card.CardFixedFooter.Builder

getFixedFooterOrBuilder()

public Card.CardFixedFooterOrBuilder getFixedFooterOrBuilder()

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Returns
TypeDescription
Card.CardFixedFooterOrBuilder

getHeader()

public Card.CardHeader getHeader()

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Returns
TypeDescription
Card.CardHeader

The header.

getHeaderBuilder()

public Card.CardHeader.Builder getHeaderBuilder()

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Returns
TypeDescription
Card.CardHeader.Builder

getHeaderOrBuilder()

public Card.CardHeaderOrBuilder getHeaderOrBuilder()

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Returns
TypeDescription
Card.CardHeaderOrBuilder

getName()

public String getName()

Name of the card. Used as a card identifier in card navigation.

Google Workspace Add-ons:

string name = 4;

Returns
TypeDescription
String

The name.

getNameBytes()

public ByteString getNameBytes()

Name of the card. Used as a card identifier in card navigation.

Google Workspace Add-ons:

string name = 4;

Returns
TypeDescription
ByteString

The bytes for name.

getPeekCardHeader()

public Card.CardHeader getPeekCardHeader()

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Returns
TypeDescription
Card.CardHeader

The peekCardHeader.

getPeekCardHeaderBuilder()

public Card.CardHeader.Builder getPeekCardHeaderBuilder()

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Returns
TypeDescription
Card.CardHeader.Builder

getPeekCardHeaderOrBuilder()

public Card.CardHeaderOrBuilder getPeekCardHeaderOrBuilder()

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Returns
TypeDescription
Card.CardHeaderOrBuilder

getSectionDividerStyle()

public Card.DividerStyle getSectionDividerStyle()

The divider style between sections.

.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;

Returns
TypeDescription
Card.DividerStyle

The sectionDividerStyle.

getSectionDividerStyleValue()

public int getSectionDividerStyleValue()

The divider style between sections.

.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;

Returns
TypeDescription
int

The enum numeric value on the wire for sectionDividerStyle.

getSections(int index)

public Card.Section getSections(int index)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Section

getSectionsBuilder(int index)

public Card.Section.Builder getSectionsBuilder(int index)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Section.Builder

getSectionsBuilderList()

public List<Card.Section.Builder> getSectionsBuilderList()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
List<Builder>

getSectionsCount()

public int getSectionsCount()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
int

getSectionsList()

public List<Card.Section> getSectionsList()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
List<Section>

getSectionsOrBuilder(int index)

public Card.SectionOrBuilder getSectionsOrBuilder(int index)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.SectionOrBuilder

getSectionsOrBuilderList()

public List<? extends Card.SectionOrBuilder> getSectionsOrBuilderList()

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Returns
TypeDescription
List<? extends com.google.apps.card.v1.Card.SectionOrBuilder>

hasFixedFooter()

public boolean hasFixedFooter()

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Returns
TypeDescription
boolean

Whether the fixedFooter field is set.

hasHeader()

public boolean hasHeader()

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Returns
TypeDescription
boolean

Whether the header field is set.

hasPeekCardHeader()

public boolean hasPeekCardHeader()

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Returns
TypeDescription
boolean

Whether the peekCardHeader field is set.

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

mergeFixedFooter(Card.CardFixedFooter value)

public Card.Builder mergeFixedFooter(Card.CardFixedFooter value)

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Parameter
NameDescription
valueCard.CardFixedFooter
Returns
TypeDescription
Card.Builder

mergeFrom(Card other)

public Card.Builder mergeFrom(Card other)
Parameter
NameDescription
otherCard
Returns
TypeDescription
Card.Builder

mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public Card.Builder mergeFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
Card.Builder
Overrides
Exceptions
TypeDescription
IOException

mergeFrom(Message other)

public Card.Builder mergeFrom(Message other)
Parameter
NameDescription
otherMessage
Returns
TypeDescription
Card.Builder
Overrides

mergeHeader(Card.CardHeader value)

public Card.Builder mergeHeader(Card.CardHeader value)

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Parameter
NameDescription
valueCard.CardHeader
Returns
TypeDescription
Card.Builder

mergePeekCardHeader(Card.CardHeader value)

public Card.Builder mergePeekCardHeader(Card.CardHeader value)

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Parameter
NameDescription
valueCard.CardHeader
Returns
TypeDescription
Card.Builder

mergeUnknownFields(UnknownFieldSet unknownFields)

public final Card.Builder mergeUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Card.Builder
Overrides

removeCardActions(int index)

public Card.Builder removeCardActions(int index)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Builder

removeSections(int index)

public Card.Builder removeSections(int index)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameter
NameDescription
indexint
Returns
TypeDescription
Card.Builder

setCardActions(int index, Card.CardAction value)

public Card.Builder setCardActions(int index, Card.CardAction value)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameters
NameDescription
indexint
valueCard.CardAction
Returns
TypeDescription
Card.Builder

setCardActions(int index, Card.CardAction.Builder builderForValue)

public Card.Builder setCardActions(int index, Card.CardAction.Builder builderForValue)

The card's actions. Actions are added to the card's toolbar menu.

Google Workspace Add-ons:

For example, the following JSON constructs a card action menu with Settings and Send Feedback options:

<code><code> "card_actions": [ { "actionLabel": "Settings", "onClick": { "action": { "functionName": "goToView", "parameters": [ { "key": "viewType", "value": "SETTING" } ], "loadIndicator": "LoadIndicator.SPINNER" } } }, { "actionLabel": "Send Feedback", "onClick": { "openLink": { "url": "https://example.com/feedback" } } } ] </code></code>

repeated .google.apps.card.v1.Card.CardAction card_actions = 3;

Parameters
NameDescription
indexint
builderForValueCard.CardAction.Builder
Returns
TypeDescription
Card.Builder

setDisplayStyle(Card.DisplayStyle value)

public Card.Builder setDisplayStyle(Card.DisplayStyle value)

In Google Workspace Add-ons, sets the display properties of the peekCardHeader.

Google Workspace Add-ons:

.google.apps.card.v1.Card.DisplayStyle display_style = 6;

Parameter
NameDescription
valueCard.DisplayStyle

The displayStyle to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setDisplayStyleValue(int value)

public Card.Builder setDisplayStyleValue(int value)

In Google Workspace Add-ons, sets the display properties of the peekCardHeader.

Google Workspace Add-ons:

.google.apps.card.v1.Card.DisplayStyle display_style = 6;

Parameter
NameDescription
valueint

The enum numeric value on the wire for displayStyle to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setField(Descriptors.FieldDescriptor field, Object value)

public Card.Builder setField(Descriptors.FieldDescriptor field, Object value)
Parameters
NameDescription
fieldFieldDescriptor
valueObject
Returns
TypeDescription
Card.Builder
Overrides

setFixedFooter(Card.CardFixedFooter value)

public Card.Builder setFixedFooter(Card.CardFixedFooter value)

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Parameter
NameDescription
valueCard.CardFixedFooter
Returns
TypeDescription
Card.Builder

setFixedFooter(Card.CardFixedFooter.Builder builderForValue)

public Card.Builder setFixedFooter(Card.CardFixedFooter.Builder builderForValue)

The fixed footer shown at the bottom of this card.

Setting fixedFooter without specifying a primaryButton or a secondaryButton causes an error. For Chat apps, you can use fixed footers in dialogs, but not card messages.

Google Workspace Add-ons and Chat apps:

.google.apps.card.v1.Card.CardFixedFooter fixed_footer = 5;

Parameter
NameDescription
builderForValueCard.CardFixedFooter.Builder
Returns
TypeDescription
Card.Builder

setHeader(Card.CardHeader value)

public Card.Builder setHeader(Card.CardHeader value)

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Parameter
NameDescription
valueCard.CardHeader
Returns
TypeDescription
Card.Builder

setHeader(Card.CardHeader.Builder builderForValue)

public Card.Builder setHeader(Card.CardHeader.Builder builderForValue)

The header of the card. A header usually contains a leading image and a title. Headers always appear at the top of a card.

.google.apps.card.v1.Card.CardHeader header = 1;

Parameter
NameDescription
builderForValueCard.CardHeader.Builder
Returns
TypeDescription
Card.Builder

setName(String value)

public Card.Builder setName(String value)

Name of the card. Used as a card identifier in card navigation.

Google Workspace Add-ons:

string name = 4;

Parameter
NameDescription
valueString

The name to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setNameBytes(ByteString value)

public Card.Builder setNameBytes(ByteString value)

Name of the card. Used as a card identifier in card navigation.

Google Workspace Add-ons:

string name = 4;

Parameter
NameDescription
valueByteString

The bytes for name to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setPeekCardHeader(Card.CardHeader value)

public Card.Builder setPeekCardHeader(Card.CardHeader value)

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Parameter
NameDescription
valueCard.CardHeader
Returns
TypeDescription
Card.Builder

setPeekCardHeader(Card.CardHeader.Builder builderForValue)

public Card.Builder setPeekCardHeader(Card.CardHeader.Builder builderForValue)

When displaying contextual content, the peek card header acts as a placeholder so that the user can navigate forward between the homepage cards and the contextual cards.

Google Workspace Add-ons:

.google.apps.card.v1.Card.CardHeader peek_card_header = 7;

Parameter
NameDescription
builderForValueCard.CardHeader.Builder
Returns
TypeDescription
Card.Builder

setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)

public Card.Builder setRepeatedField(Descriptors.FieldDescriptor field, int index, Object value)
Parameters
NameDescription
fieldFieldDescriptor
indexint
valueObject
Returns
TypeDescription
Card.Builder
Overrides

setSectionDividerStyle(Card.DividerStyle value)

public Card.Builder setSectionDividerStyle(Card.DividerStyle value)

The divider style between sections.

.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;

Parameter
NameDescription
valueCard.DividerStyle

The sectionDividerStyle to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setSectionDividerStyleValue(int value)

public Card.Builder setSectionDividerStyleValue(int value)

The divider style between sections.

.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;

Parameter
NameDescription
valueint

The enum numeric value on the wire for sectionDividerStyle to set.

Returns
TypeDescription
Card.Builder

This builder for chaining.

setSections(int index, Card.Section value)

public Card.Builder setSections(int index, Card.Section value)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameters
NameDescription
indexint
valueCard.Section
Returns
TypeDescription
Card.Builder

setSections(int index, Card.Section.Builder builderForValue)

public Card.Builder setSections(int index, Card.Section.Builder builderForValue)

Contains a collection of widgets. Each section has its own, optional header. Sections are visually separated by a line divider. For an example in Google Chat apps, see Card section.

repeated .google.apps.card.v1.Card.Section sections = 2;

Parameters
NameDescription
indexint
builderForValueCard.Section.Builder
Returns
TypeDescription
Card.Builder

setUnknownFields(UnknownFieldSet unknownFields)

public final Card.Builder setUnknownFields(UnknownFieldSet unknownFields)
Parameter
NameDescription
unknownFieldsUnknownFieldSet
Returns
TypeDescription
Card.Builder
Overrides