Packages

final case class Card(header: Option[CardHeader] = _root_.scala.None, sections: Seq[Section] = _root_.scala.Seq.empty, sectionDividerStyle: DividerStyle = com.google.apps.card.v1.card.Card.DividerStyle.DIVIDER_STYLE_UNSPECIFIED, cardActions: Seq[CardAction] = _root_.scala.Seq.empty, name: String = "", fixedFooter: Option[CardFixedFooter] = _root_.scala.None, displayStyle: DisplayStyle = com.google.apps.card.v1.card.Card.DisplayStyle.DISPLAY_STYLE_UNSPECIFIED, peekCardHeader: Option[CardHeader] = _root_.scala.None, unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty) extends GeneratedMessage with Updatable[Card] with Product with 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**

![Example contact card](https://developers.google.com/workspace/chat/images/card_api_reference.png)

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=&92;"#80e27e&92;">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" } ] } } } ] } } ] } ] } } ] }

header

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

sections

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).

sectionDividerStyle

The divider style between sections.

cardActions

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" } } } ]

name

Name of the card. Used as a card identifier in card navigation. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):

fixedFooter

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](https://developers.google.com/workspace/chat/dialogs), but not [card messages](https://developers.google.com/workspace/chat/create-messages#create). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend):

displayStyle

In Google Workspace Add-ons, sets the display properties of the peekCardHeader. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):

peekCardHeader

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):

Annotations
@SerialVersionUID()
Source
Card.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Card
  2. Updatable
  3. GeneratedMessage
  4. Serializable
  5. Product
  6. Equals
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Card(header: Option[CardHeader] = _root_.scala.None, sections: Seq[Section] = _root_.scala.Seq.empty, sectionDividerStyle: DividerStyle = com.google.apps.card.v1.card.Card.DividerStyle.DIVIDER_STYLE_UNSPECIFIED, cardActions: Seq[CardAction] = _root_.scala.Seq.empty, name: String = "", fixedFooter: Option[CardFixedFooter] = _root_.scala.None, displayStyle: DisplayStyle = com.google.apps.card.v1.card.Card.DisplayStyle.DISPLAY_STYLE_UNSPECIFIED, peekCardHeader: Option[CardHeader] = _root_.scala.None, unknownFields: UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty)

    header

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

    sections

    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).

    sectionDividerStyle

    The divider style between sections.

    cardActions

    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" } } } ]

    name

    Name of the card. Used as a card identifier in card navigation. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):

    fixedFooter

    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](https://developers.google.com/workspace/chat/dialogs), but not [card messages](https://developers.google.com/workspace/chat/create-messages#create). [Google Workspace Add-ons and Chat apps](https://developers.google.com/workspace/extend):

    displayStyle

    In Google Workspace Add-ons, sets the display properties of the peekCardHeader. [Google Workspace Add-ons](https://developers.google.com/workspace/add-ons):

    peekCardHeader

    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):

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addAllCardActions(__vs: Iterable[CardAction]): Card
  5. def addAllSections(__vs: Iterable[Section]): Card
  6. def addCardActions(__vs: CardAction*): Card
  7. def addSections(__vs: Section*): Card
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. val cardActions: Seq[CardAction]
  10. def clearCardActions: Card
  11. def clearFixedFooter: Card
  12. def clearHeader: Card
  13. def clearPeekCardHeader: Card
  14. def clearSections: Card
  15. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @HotSpotIntrinsicCandidate() @native()
  16. def companion: Card.type
    Definition Classes
    Card → GeneratedMessage
  17. def discardUnknownFields: Card
  18. val displayStyle: DisplayStyle
  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. val fixedFooter: Option[CardFixedFooter]
  21. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  22. def getField(__field: FieldDescriptor): PValue
    Definition Classes
    Card → GeneratedMessage
  23. def getFieldByNumber(__fieldNumber: Int): Any
    Definition Classes
    Card → GeneratedMessage
  24. def getFixedFooter: CardFixedFooter
  25. def getHeader: CardHeader
  26. def getPeekCardHeader: CardHeader
  27. val header: Option[CardHeader]
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. val name: String
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @native()
  33. val peekCardHeader: Option[CardHeader]
  34. def productElementNames: Iterator[String]
    Definition Classes
    Product
  35. val sectionDividerStyle: DividerStyle
  36. val sections: Seq[Section]
  37. def serializedSize: Int
    Definition Classes
    Card → GeneratedMessage
  38. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  39. final def toByteArray: Array[Byte]
    Definition Classes
    GeneratedMessage
  40. final def toByteString: ByteString
    Definition Classes
    GeneratedMessage
  41. final def toPMessage: PMessage
    Definition Classes
    GeneratedMessage
  42. def toProtoString: String
    Definition Classes
    Card → GeneratedMessage
  43. val unknownFields: UnknownFieldSet
  44. def update(ms: (Lens[Card, Card]) => Mutation[Card]*): Card
    Definition Classes
    Updatable
  45. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  46. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  48. def withCardActions(__v: Seq[CardAction]): Card
  49. def withDisplayStyle(__v: DisplayStyle): Card
  50. def withFixedFooter(__v: CardFixedFooter): Card
  51. def withHeader(__v: CardHeader): Card
  52. def withName(__v: String): Card
  53. def withPeekCardHeader(__v: CardHeader): Card
  54. def withSectionDividerStyle(__v: DividerStyle): Card
  55. def withSections(__v: Seq[Section]): Card
  56. def withUnknownFields(__v: UnknownFieldSet): Card
  57. final def writeDelimitedTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage
  58. def writeTo(_output__: CodedOutputStream): Unit
    Definition Classes
    Card → GeneratedMessage
  59. final def writeTo(output: OutputStream): Unit
    Definition Classes
    GeneratedMessage

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

    (Since version 9)

Inherited from Updatable[Card]

Inherited from GeneratedMessage

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped