Class: Google::Apis::ChatV1::GoogleAppsCardV1Card
- Inherits:
-
Object
- Object
- Google::Apis::ChatV1::GoogleAppsCardV1Card
- Includes:
- Google::Apis::Core::Hashable, Google::Apis::Core::JsonObjectSupport
- Defined in:
- lib/google/apis/chat_v1/classes.rb,
lib/google/apis/chat_v1/representations.rb,
lib/google/apis/chat_v1/representations.rb
Overview
A card is a UI element that can contain UI widgets such as text and images.
For more information, see Cards . For example, the following JSON creates a
card that has a header with the name, position, icons, and link for a contact,
followed by a section with contact information like email and phone number.
` "header": ` "title": "Heba Salam", "subtitle": "Software Engineer", "
imageStyle": "ImageStyle.AVATAR", "imageUrl": "https://example.com/heba_salam.
png", "imageAltText": "Avatar for Heba Salam" `, "sections" : [ ` "header": "
Contact Info", "widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "
EMAIL" `, "content": "heba.salam@example.com" ` `, ` "decoratedText": ` "icon":
` "knownIcon": "PERSON" `, "content": "Online" ` `, ` "decoratedText": ` "
icon": ` "knownIcon": "PHONE" `, "content": "+1 (555) 555-1234" ` `, ` "
buttons": [ ` "textButton": ` "text": "Share", `, "onClick": ` "openLink": ` "
url": "https://example.com/share" ` ` `, ` "textButton": ` "text": "Edit", `, "
onClick": ` "action": ` "function": "goToView", "parameters": [ ` "key": "
viewType", "value": "EDIT" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` ` `
] ` ], "collapsible": true, "uncollapsibleWidgetsCount": 3 ` ], "cardActions":
[ ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https://
example.com/feedback" ` ` ` ], "name": "contact-card-K3wB6arF2H9L" `
Instance Attribute Summary collapse
-
#card_actions ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1CardAction>
The actions of this card.
-
#display_style ⇒ String
The display style for peekCardHeader.
-
#fixed_footer ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardFixedFooter
A persistent (sticky) footer that is added to the bottom of the card.
-
#header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
The header of the card.
-
#name ⇒ String
Name of the card, which is used as a identifier for the card in card navigation.
-
#peek_card_header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
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.
-
#sections ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1Section>
Sections are separated by a line divider.
Instance Method Summary collapse
-
#initialize(**args) ⇒ GoogleAppsCardV1Card
constructor
A new instance of GoogleAppsCardV1Card.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ GoogleAppsCardV1Card
Returns a new instance of GoogleAppsCardV1Card.
1137 1138 1139 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1137 def initialize(**args) update!(**args) end |
Instance Attribute Details
#card_actions ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1CardAction>
The actions of this card. They are added to a card's generated toolbar menu.
For example, the following JSON constructs a card action menu with Settings
and Send Feedback options: "card_actions": [ ` "actionLabel": "Setting", "
onClick": ` "action": ` "functionName": "goToView", "parameters": [ ` "key": "
viewType", "value": "SETTING" ` ], "loadIndicator": "LoadIndicator.SPINNER" ` `
`, ` "actionLabel": "Send Feedback", "onClick": ` "openLink": ` "url": "https:
//example.com/feedback" ` ` ` ]
Corresponds to the JSON property cardActions
1102 1103 1104 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1102 def card_actions @card_actions end |
#display_style ⇒ String
The display style for peekCardHeader.
Corresponds to the JSON property displayStyle
1107 1108 1109 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1107 def display_style @display_style end |
#fixed_footer ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardFixedFooter
A persistent (sticky) footer that is added to the bottom of the card.
Corresponds to the JSON property fixedFooter
1112 1113 1114 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1112 def @fixed_footer end |
#header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
The header of the card. A header usually contains a title and an image.
Corresponds to the JSON property header
1117 1118 1119 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1117 def header @header end |
#name ⇒ String
Name of the card, which is used as a identifier for the card in card
navigation.
Corresponds to the JSON property name
1123 1124 1125 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1123 def name @name end |
#peek_card_header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
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.
Corresponds to the JSON property peekCardHeader
1130 1131 1132 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1130 def peek_card_header @peek_card_header end |
#sections ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1Section>
Sections are separated by a line divider.
Corresponds to the JSON property sections
1135 1136 1137 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1135 def sections @sections end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1142 1143 1144 1145 1146 1147 1148 1149 1150 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1142 def update!(**args) @card_actions = args[:card_actions] if args.key?(:card_actions) @display_style = args[:display_style] if args.key?(:display_style) @fixed_footer = args[:fixed_footer] if args.key?(:fixed_footer) @header = args[:header] if args.key?(:header) @name = args[:name] if args.key?(:name) @peek_card_header = args[:peek_card_header] if args.key?(:peek_card_header) @sections = args[:sections] if args.key?(:sections) end |