Class: Google::Apis::ChatV1::GoogleAppsCardV1OnClick

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

Represents the response to an onClick event.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAppsCardV1OnClick

Returns a new instance of GoogleAppsCardV1OnClick.



1784
1785
1786
# File 'lib/google/apis/chat_v1/classes.rb', line 1784

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

Instance Attribute Details

#actionGoogle::Apis::ChatV1::GoogleAppsCardV1Action

An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. Corresponds to the JSON property action



1744
1745
1746
# File 'lib/google/apis/chat_v1/classes.rb', line 1744

def action
  @action
end

#cardGoogle::Apis::ChatV1::GoogleAppsCardV1Card

Cards support a defined layout, interactive UI elements like buttons, and rich media like images. Use cards to present detailed information, gather information from users, and guide users to take a next step. In Google Chat, cards appear in several places: - As stand-alone messages. - Accompanying a text message, just beneath the text message. - As a dialog. The following example JSON creates a "contact card" that features: - A header with the contact's name, job title, avatar picture. - A section with the contact information, including formatted text. - Buttons that users can click to share the contact or see more or less info. Example contact card ` "cardsV2": [ ` "cardId": "unique-card-id", "card": ` "header": ` "title" : "Sasha", "subtitle": "Software Engineer", "imageUrl": "https://developers. google.com/chat/images/quickstart-app-avatar.png", "imageType": "CIRCLE", " imageAltText": "Avatar for Sasha", `, "sections": [ ` "header": "Contact Info", "collapsible": true, "uncollapsibleWidgetsCount": 1, "widgets": [ ` " decoratedText": ` "startIcon": ` "knownIcon": "EMAIL", `, "text": "sasha@ example.com", ` `, ` "decoratedText": ` "startIcon": ` "knownIcon": "PERSON", ` , "text": "Online", `, `, ` "decoratedText": ` "startIcon": ` "knownIcon": " PHONE", `, "text": "+1 (555) 555-1234", ` `, ` "buttonList": ` "buttons": [ ` " text": "Share", "onClick": ` "openLink": ` "url": "https://example.com/share", ` ` `, ` "text": "Edit", "onClick": ` "action": ` "function": "goToView", " parameters": [ ` "key": "viewType", "value": "EDIT", ` ], ` ` `, ], ` `, ], `, ], `, ` ], ` Corresponds to the JSON property card



1771
1772
1773
# File 'lib/google/apis/chat_v1/classes.rb', line 1771

def card
  @card
end

An action that describes the behavior when the form is submitted. For example, an Apps Script can be invoked to handle the form. Corresponds to the JSON property openDynamicLinkAction



1777
1778
1779
# File 'lib/google/apis/chat_v1/classes.rb', line 1777

def open_dynamic_link_action
  @open_dynamic_link_action
end

Represents an onClick event that opens a hyperlink. Corresponds to the JSON property openLink



1782
1783
1784
# File 'lib/google/apis/chat_v1/classes.rb', line 1782

def open_link
  @open_link
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1789
1790
1791
1792
1793
1794
# File 'lib/google/apis/chat_v1/classes.rb', line 1789

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