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 card's actions.
-
#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
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.
1183 1184 1185 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1183 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
1151 1152 1153 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1151 def card_actions @card_actions end |
#display_style ⇒ String
The display style for peekCardHeader.
Corresponds to the JSON property displayStyle
1156 1157 1158 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1156 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
1161 1162 1163 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1161 def @fixed_footer end |
#header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
Corresponds to the JSON property header
1166 1167 1168 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1166 def header @header end |
#name ⇒ String
Name of the card. Used as a card identifier in card navigation.
Corresponds to the JSON property name
1171 1172 1173 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1171 def name @name end |
#peek_card_header ⇒ Google::Apis::ChatV1::GoogleAppsCardV1CardHeader
Represents a card header.
Corresponds to the JSON property peekCardHeader
1176 1177 1178 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1176 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
1181 1182 1183 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1181 def sections @sections end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
1188 1189 1190 1191 1192 1193 1194 1195 1196 |
# File 'lib/google/apis/chat_v1/classes.rb', line 1188 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 |