Package com.google.apps.card.v1
Class Card
java.lang.Object
com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessage
com.google.protobuf.GeneratedMessageV3
com.google.apps.card.v1.Card
- All Implemented Interfaces:
CardOrBuilder,com.google.protobuf.Message,com.google.protobuf.MessageLite,com.google.protobuf.MessageLiteOrBuilder,com.google.protobuf.MessageOrBuilder,Serializable
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](https://addons.gsuite.google.com/uikit/builder)
To learn how
to build cards, see the following documentation:
* For Google Chat apps, see [Design the components of a card or
dialog](https://developers.google.com/workspace/chat/design-components-card-dialog).
* For Google Workspace Add-ons, see [Card-based
interfaces](https://developers.google.com/apps-script/add-ons/concepts/cards).
**Example: Card message for a Google Chat app**

To create the sample card message in Google Chat, use the following JSON:
```
{
"cardsV2": [
{
"cardId": "unique-card-id",
"card": {
"header": {
"title": "Sasha",
"subtitle": "Software Engineer",
"imageUrl":
"https://developers.google.com/workspace/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@example.com"
}
},
{
"decoratedText": {
"startIcon": {
"knownIcon": "PERSON"
},
"text": "<font color=\"#80e27e\">Online</font>"
}
},
{
"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"
}
]
}
}
}
]
}
}
]
}
]
}
}
]
}
```
Protobuf type google.apps.card.v1.Card- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA card interface displayed in a Google Chat message or Google Workspace Add-on.static final classA card action is the action associated with the card.static interfacestatic final classA persistent (sticky) footer that that appears at the bottom of the card.static interfacestatic final classRepresents a card header.static interfacestatic enumIn Google Workspace Add-ons, determines how a card is displayed.static enumThe divider style of a card.static final classA section contains a collection of widgets that are rendered vertically in the order that they're specified.static interfaceNested classes/interfaces inherited from class com.google.protobuf.GeneratedMessageV3
com.google.protobuf.GeneratedMessageV3.BuilderParent, com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>,BuilderT extends com.google.protobuf.GeneratedMessageV3.ExtendableBuilder<MessageT, BuilderT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.ExtendableMessageOrBuilder<MessageT extends com.google.protobuf.GeneratedMessageV3.ExtendableMessage<MessageT>>, com.google.protobuf.GeneratedMessageV3.FieldAccessorTable, com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter Nested classes/interfaces inherited from class com.google.protobuf.AbstractMessageLite
com.google.protobuf.AbstractMessageLite.InternalOneOfEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class com.google.protobuf.GeneratedMessageV3
alwaysUseFieldBuilders, unknownFieldsFields inherited from class com.google.protobuf.AbstractMessage
memoizedSizeFields inherited from class com.google.protobuf.AbstractMessageLite
memoizedHashCode -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCardActions(int index) The card's actions.intThe card's actions.The card's actions.getCardActionsOrBuilder(int index) The card's actions.List<? extends Card.CardActionOrBuilder>The card's actions.static Cardstatic final com.google.protobuf.Descriptors.DescriptorIn Google Workspace Add-ons, sets the display properties of the `peekCardHeader`.intIn Google Workspace Add-ons, sets the display properties of the `peekCardHeader`.The fixed footer shown at the bottom of this card.The fixed footer shown at the bottom of this card.The header of the card.The header of the card.getName()Name of the card.com.google.protobuf.ByteStringName of the card.com.google.protobuf.Parser<Card>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.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.The divider style between sections.intThe divider style between sections.getSections(int index) Contains a collection of widgets.intContains a collection of widgets.Contains a collection of widgets.getSectionsOrBuilder(int index) Contains a collection of widgets.List<? extends Card.SectionOrBuilder>Contains a collection of widgets.intbooleanThe fixed footer shown at the bottom of this card.inthashCode()booleanThe header of the card.booleanWhen 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.protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTablefinal booleanstatic Card.Builderstatic Card.BuildernewBuilder(Card prototype) protected Card.BuildernewBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) protected ObjectnewInstance(com.google.protobuf.GeneratedMessageV3.UnusedPrivateParameter unused) static CardparseDelimitedFrom(InputStream input) static CardparseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static CardparseFrom(byte[] data) static CardparseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static CardparseFrom(com.google.protobuf.ByteString data) static CardparseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static CardparseFrom(com.google.protobuf.CodedInputStream input) static CardparseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static CardparseFrom(InputStream input) static CardparseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static CardparseFrom(ByteBuffer data) static CardparseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) static com.google.protobuf.Parser<Card>parser()voidwriteTo(com.google.protobuf.CodedOutputStream output) Methods inherited from class com.google.protobuf.GeneratedMessageV3
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof, internalGetMapField, internalGetMapFieldReflection, isStringEmpty, makeExtensionsImmutable, makeMutableCopy, makeMutableCopy, mergeFromAndMakeImmutableInternal, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagMethods inherited from class com.google.protobuf.AbstractMessage
findInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringMethods inherited from class com.google.protobuf.AbstractMessageLite
addAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.google.protobuf.MessageLite
toByteArray, toByteString, writeDelimitedTo, writeToMethods inherited from interface com.google.protobuf.MessageOrBuilder
findInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, getUnknownFields, hasField, hasOneof
-
Field Details
-
HEADER_FIELD_NUMBER
public static final int HEADER_FIELD_NUMBER- See Also:
-
SECTIONS_FIELD_NUMBER
public static final int SECTIONS_FIELD_NUMBER- See Also:
-
SECTION_DIVIDER_STYLE_FIELD_NUMBER
public static final int SECTION_DIVIDER_STYLE_FIELD_NUMBER- See Also:
-
CARD_ACTIONS_FIELD_NUMBER
public static final int CARD_ACTIONS_FIELD_NUMBER- See Also:
-
NAME_FIELD_NUMBER
public static final int NAME_FIELD_NUMBER- See Also:
-
FIXED_FOOTER_FIELD_NUMBER
public static final int FIXED_FOOTER_FIELD_NUMBER- See Also:
-
DISPLAY_STYLE_FIELD_NUMBER
public static final int DISPLAY_STYLE_FIELD_NUMBER- See Also:
-
PEEK_CARD_HEADER_FIELD_NUMBER
public static final int PEEK_CARD_HEADER_FIELD_NUMBER- See Also:
-
-
Method Details
-
newInstance
- Overrides:
newInstancein classcom.google.protobuf.GeneratedMessageV3
-
getDescriptor
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() -
internalGetFieldAccessorTable
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()- Specified by:
internalGetFieldAccessorTablein classcom.google.protobuf.GeneratedMessageV3
-
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;- Specified by:
hasHeaderin interfaceCardOrBuilder- Returns:
- Whether the header field is set.
-
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;- Specified by:
getHeaderin interfaceCardOrBuilder- Returns:
- The header.
-
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;- Specified by:
getHeaderOrBuilderin interfaceCardOrBuilder
-
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](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
repeated .google.apps.card.v1.Card.Section sections = 2;- Specified by:
getSectionsListin interfaceCardOrBuilder
-
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](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
repeated .google.apps.card.v1.Card.Section sections = 2;- Specified by:
getSectionsOrBuilderListin interfaceCardOrBuilder
-
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 [Define a section of a card](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
repeated .google.apps.card.v1.Card.Section sections = 2;- Specified by:
getSectionsCountin interfaceCardOrBuilder
-
getSections
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](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
repeated .google.apps.card.v1.Card.Section sections = 2;- Specified by:
getSectionsin interfaceCardOrBuilder
-
getSectionsOrBuilder
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](https://developers.google.com/workspace/chat/design-components-card-dialog#define_a_section_of_a_card).
repeated .google.apps.card.v1.Card.Section sections = 2;- Specified by:
getSectionsOrBuilderin interfaceCardOrBuilder
-
getSectionDividerStyleValue
public int getSectionDividerStyleValue()The divider style between sections.
.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;- Specified by:
getSectionDividerStyleValuein interfaceCardOrBuilder- Returns:
- The enum numeric value on the wire for sectionDividerStyle.
-
getSectionDividerStyle
The divider style between sections.
.google.apps.card.v1.Card.DividerStyle section_divider_style = 9;- Specified by:
getSectionDividerStylein interfaceCardOrBuilder- Returns:
- The sectionDividerStyle.
-
getCardActionsList
The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "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" } } } ] ```repeated .google.apps.card.v1.Card.CardAction card_actions = 3;- Specified by:
getCardActionsListin interfaceCardOrBuilder
-
getCardActionsOrBuilderList
The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "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" } } } ] ```repeated .google.apps.card.v1.Card.CardAction card_actions = 3;- Specified by:
getCardActionsOrBuilderListin interfaceCardOrBuilder
-
getCardActionsCount
public int getCardActionsCount()The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "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" } } } ] ```repeated .google.apps.card.v1.Card.CardAction card_actions = 3;- Specified by:
getCardActionsCountin interfaceCardOrBuilder
-
getCardActions
The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "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" } } } ] ```repeated .google.apps.card.v1.Card.CardAction card_actions = 3;- Specified by:
getCardActionsin interfaceCardOrBuilder
-
getCardActionsOrBuilder
The card's actions. Actions are added to the card's toolbar menu. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons): For example, the following JSON constructs a card action menu with `Settings` and `Send Feedback` options: ``` "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" } } } ] ```repeated .google.apps.card.v1.Card.CardAction card_actions = 3;- Specified by:
getCardActionsOrBuilderin interfaceCardOrBuilder
-
getName
Name of the card. Used as a card identifier in card navigation. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):
string name = 4;- Specified by:
getNamein interfaceCardOrBuilder- Returns:
- The name.
-
getNameBytes
public com.google.protobuf.ByteString getNameBytes()Name of the card. Used as a card identifier in card navigation. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):
string name = 4;- Specified by:
getNameBytesin interfaceCardOrBuilder- Returns:
- The bytes for name.
-
getDisplayStyleValue
public int getDisplayStyleValue()In Google Workspace Add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):
.google.apps.card.v1.Card.DisplayStyle display_style = 6;- Specified by:
getDisplayStyleValuein interfaceCardOrBuilder- Returns:
- The enum numeric value on the wire for displayStyle.
-
getDisplayStyle
In Google Workspace Add-ons, sets the display properties of the `peekCardHeader`. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):
.google.apps.card.v1.Card.DisplayStyle display_style = 6;- Specified by:
getDisplayStylein interfaceCardOrBuilder- Returns:
- The displayStyle.
-
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](https://developers.google.com/workspace/add-ons):
.google.apps.card.v1.Card.CardHeader peek_card_header = 7;- Specified by:
hasPeekCardHeaderin interfaceCardOrBuilder- Returns:
- Whether the peekCardHeader field is set.
-
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](https://developers.google.com/workspace/add-ons):
.google.apps.card.v1.Card.CardHeader peek_card_header = 7;- Specified by:
getPeekCardHeaderin interfaceCardOrBuilder- Returns:
- The peekCardHeader.
-
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](https://developers.google.com/workspace/add-ons):
.google.apps.card.v1.Card.CardHeader peek_card_header = 7;- Specified by:
getPeekCardHeaderOrBuilderin interfaceCardOrBuilder
-
isInitialized
public final boolean isInitialized()- Specified by:
isInitializedin interfacecom.google.protobuf.MessageLiteOrBuilder- Overrides:
isInitializedin classcom.google.protobuf.GeneratedMessageV3
-
writeTo
- Specified by:
writeToin interfacecom.google.protobuf.MessageLite- Overrides:
writeToin classcom.google.protobuf.GeneratedMessageV3- Throws:
IOException
-
getSerializedSize
public int getSerializedSize()- Specified by:
getSerializedSizein interfacecom.google.protobuf.MessageLite- Overrides:
getSerializedSizein classcom.google.protobuf.GeneratedMessageV3
-
equals
- Specified by:
equalsin interfacecom.google.protobuf.Message- Overrides:
equalsin classcom.google.protobuf.AbstractMessage
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacecom.google.protobuf.Message- Overrides:
hashCodein classcom.google.protobuf.AbstractMessage
-
parseFrom
public static Card parseFrom(ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Card parseFrom(ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Card parseFrom(com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Card parseFrom(com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
public static Card parseFrom(byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException - Throws:
com.google.protobuf.InvalidProtocolBufferException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Card parseFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseDelimitedFrom
- Throws:
IOException
-
parseDelimitedFrom
public static Card parseDelimitedFrom(InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
parseFrom
- Throws:
IOException
-
parseFrom
public static Card parseFrom(com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws IOException - Throws:
IOException
-
newBuilderForType
- Specified by:
newBuilderForTypein interfacecom.google.protobuf.Message- Specified by:
newBuilderForTypein interfacecom.google.protobuf.MessageLite
-
newBuilder
-
newBuilder
-
toBuilder
- Specified by:
toBuilderin interfacecom.google.protobuf.Message- Specified by:
toBuilderin interfacecom.google.protobuf.MessageLite
-
newBuilderForType
protected Card.Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) - Specified by:
newBuilderForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstance
-
parser
-
getParserForType
- Specified by:
getParserForTypein interfacecom.google.protobuf.Message- Specified by:
getParserForTypein interfacecom.google.protobuf.MessageLite- Overrides:
getParserForTypein classcom.google.protobuf.GeneratedMessageV3
-
getDefaultInstanceForType
- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageLiteOrBuilder- Specified by:
getDefaultInstanceForTypein interfacecom.google.protobuf.MessageOrBuilder
-