Interface CardOrBuilder (2.38.0)

public interface CardOrBuilder extends MessageOrBuilder

Implements

MessageOrBuilder

Methods

getCardActions(int index)

public abstract 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
Name Description
index int
Returns
Type Description
Card.CardAction

getCardActionsCount()

public abstract 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
Type Description
int

getCardActionsList()

public abstract 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
Type Description
List<CardAction>

getCardActionsOrBuilder(int index)

public abstract 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
Name Description
index int
Returns
Type Description
Card.CardActionOrBuilder

getCardActionsOrBuilderList()

public abstract 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
Type Description
List<? extends com.google.apps.card.v1.Card.CardActionOrBuilder>

getDisplayStyle()

public abstract 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
Type Description
Card.DisplayStyle

The displayStyle.

getDisplayStyleValue()

public abstract 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
Type Description
int

The enum numeric value on the wire for displayStyle.

getFixedFooter()

public abstract 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
Type Description
Card.CardFixedFooter

The fixedFooter.

getFixedFooterOrBuilder()

public abstract 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
Type Description
Card.CardFixedFooterOrBuilder

getHeader()

public abstract 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
Type Description
Card.CardHeader

The header.

getHeaderOrBuilder()

public abstract 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
Type Description
Card.CardHeaderOrBuilder

getName()

public abstract String getName()

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

Google Workspace Add-ons:

string name = 4;

Returns
Type Description
String

The name.

getNameBytes()

public abstract ByteString getNameBytes()

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

Google Workspace Add-ons:

string name = 4;

Returns
Type Description
ByteString

The bytes for name.

getPeekCardHeader()

public abstract 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
Type Description
Card.CardHeader

The peekCardHeader.

getPeekCardHeaderOrBuilder()

public abstract 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
Type Description
Card.CardHeaderOrBuilder

getSectionDividerStyle()

public abstract Card.DividerStyle getSectionDividerStyle()

The divider style between sections.

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

Returns
Type Description
Card.DividerStyle

The sectionDividerStyle.

getSectionDividerStyleValue()

public abstract int getSectionDividerStyleValue()

The divider style between sections.

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

Returns
Type Description
int

The enum numeric value on the wire for sectionDividerStyle.

getSections(int index)

public abstract 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 Define a section of a card.

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

Parameter
Name Description
index int
Returns
Type Description
Card.Section

getSectionsCount()

public abstract 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 Define a section of a card.

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

Returns
Type Description
int

getSectionsList()

public abstract 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 Define a section of a card.

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

Returns
Type Description
List<Section>

getSectionsOrBuilder(int index)

public abstract 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 Define a section of a card.

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

Parameter
Name Description
index int
Returns
Type Description
Card.SectionOrBuilder

getSectionsOrBuilderList()

public abstract 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 Define a section of a card.

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

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

hasFixedFooter()

public abstract 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
Type Description
boolean

Whether the fixedFooter field is set.

hasHeader()

public abstract 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
Type Description
boolean

Whether the header field is set.

hasPeekCardHeader()

public abstract 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
Type Description
boolean

Whether the peekCardHeader field is set.