Class: Google::Apis::ChatV1::CardWithId

Inherits:
Object
  • Object
show all
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

Widgets for Chat apps to specify.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ CardWithId

Returns a new instance of CardWithId.



409
410
411
# File 'lib/google/apis/chat_v1/classes.rb', line 409

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#cardGoogle::Apis::ChatV1::GoogleAppsCardV1Card

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" ` Corresponds to the JSON property card



401
402
403
# File 'lib/google/apis/chat_v1/classes.rb', line 401

def card
  @card
end

#card_idString

Required for cardsV2 messages. Chat app-specified identifier for this widget. Scoped within a message. Corresponds to the JSON property cardId

Returns:

  • (String)


407
408
409
# File 'lib/google/apis/chat_v1/classes.rb', line 407

def card_id
  @card_id
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



414
415
416
417
# File 'lib/google/apis/chat_v1/classes.rb', line 414

def update!(**args)
  @card = args[:card] if args.key?(:card)
  @card_id = args[:card_id] if args.key?(:card_id)
end