Class: Google::Apis::ChatV1::GoogleAppsCardV1Card

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

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

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1Card

Returns a new instance of GoogleAppsCardV1Card.



1005
1006
1007
# File 'lib/google/apis/chat_v1/classes.rb', line 1005

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

Instance Attribute Details

#card_actionsArray<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



970
971
972
# File 'lib/google/apis/chat_v1/classes.rb', line 970

def card_actions
  @card_actions
end

#display_styleString

The display style for peekCardHeader. Corresponds to the JSON property displayStyle

Returns:

  • (String)


975
976
977
# File 'lib/google/apis/chat_v1/classes.rb', line 975

def display_style
  @display_style
end

A persistent (sticky) footer that is added to the bottom of the card. Corresponds to the JSON property fixedFooter



980
981
982
# File 'lib/google/apis/chat_v1/classes.rb', line 980

def fixed_footer
  @fixed_footer
end

#headerGoogle::Apis::ChatV1::GoogleAppsCardV1CardHeader

The header of the card. A header usually contains a title and an image. Corresponds to the JSON property header



985
986
987
# File 'lib/google/apis/chat_v1/classes.rb', line 985

def header
  @header
end

#nameString

Name of the card, which is used as a identifier for the card in card navigation. Corresponds to the JSON property name

Returns:

  • (String)


991
992
993
# File 'lib/google/apis/chat_v1/classes.rb', line 991

def name
  @name
end

#peek_card_headerGoogle::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



998
999
1000
# File 'lib/google/apis/chat_v1/classes.rb', line 998

def peek_card_header
  @peek_card_header
end

#sectionsArray<Google::Apis::ChatV1::GoogleAppsCardV1Section>

Sections are separated by a line divider. Corresponds to the JSON property sections



1003
1004
1005
# File 'lib/google/apis/chat_v1/classes.rb', line 1003

def sections
  @sections
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1010
1011
1012
1013
1014
1015
1016
1017
1018
# File 'lib/google/apis/chat_v1/classes.rb', line 1010

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