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": "Sasha", "subtitle": "Software Engineer", "imageStyle":
"ImageStyle.AVATAR", "imageUrl": "https://example.com/sasha.png", "
imageAltText": "Avatar for Sasha" `, "sections" : [ ` "header": "Contact Info",
"widgets": [ ` "decorated_text": ` "icon": ` "knownIcon": "EMAIL" `, "content"
: "sasha@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 card's actions.
-
#display_style ⇒ String
The
peekCardHeaderdisplay style for. -
#fixed_footer ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardFixedFooter
A persistent (sticky) footer that is added to the bottom of the card.
-
#header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
-
#name ⇒ String
Name of the card.
-
#peek_card_header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
-
#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.
1233 1234 1235 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1233 def initialize(**args) update!(**args) end |
Instance Attribute Details
#card_actions ⇒ Array<Google::Apis::ChatV1::GoogleAppsCardV1CardAction>
The card's actions. Actions are added to the card's generated toolbar menu.
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" ` ` ` ]
Corresponds to the JSON property cardActions
1201 1202 1203 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1201 def card_actions @card_actions end |
#display_style ⇒ String
The peekCardHeader display style for. Not supported by Google Chat apps.
Corresponds to the JSON property displayStyle
1206 1207 1208 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1206 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
1211 1212 1213 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1211 def @fixed_footer end |
#header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
Corresponds to the JSON property header
1216 1217 1218 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1216 def header @header end |
#name ⇒ String
Name of the card. Used as a card identifier in card navigation.
Corresponds to the JSON property name
1221 1222 1223 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1221 def name @name end |
#peek_card_header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
Corresponds to the JSON property peekCardHeader
1226 1227 1228 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1226 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
1231 1232 1233 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1231 def sections @sections end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1238 1239 1240 1241 1242 1243 1244 1245 1246 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1238 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 |