Class: Teams::Api::MessagingExtensionResult
- Inherits:
-
Object
- Object
- Teams::Api::MessagingExtensionResult
- Defined in:
- lib/teams/api/message_extension.rb
Overview
type: "result", "auth", "config", "message", "botMessagePreview", or "silentAuth"; attachment_layout: "list" or "grid".
Instance Method Summary collapse
-
#initialize(type: nil, attachment_layout: nil, attachments: nil, suggested_actions: nil, text: nil, activity_preview: nil) ⇒ MessagingExtensionResult
constructor
A new instance of MessagingExtensionResult.
- #to_h ⇒ Object
Constructor Details
#initialize(type: nil, attachment_layout: nil, attachments: nil, suggested_actions: nil, text: nil, activity_preview: nil) ⇒ MessagingExtensionResult
Returns a new instance of MessagingExtensionResult.
40 41 42 43 44 45 46 47 48 |
# File 'lib/teams/api/message_extension.rb', line 40 def initialize(type: nil, attachment_layout: nil, attachments: nil, suggested_actions: nil, text: nil, activity_preview: nil) @type = type @attachment_layout = @attachments = @suggested_actions = suggested_actions @text = text @activity_preview = activity_preview end |
Instance Method Details
#to_h ⇒ Object
50 51 52 53 54 55 56 57 58 59 |
# File 'lib/teams/api/message_extension.rb', line 50 def to_h body = {} body["type"] = @type if @type body["attachmentLayout"] = @attachment_layout if @attachment_layout body["attachments"] = @attachments.map { || serialize() } if @attachments body["suggestedActions"] = serialize(@suggested_actions) if @suggested_actions body["text"] = @text if @text body["activityPreview"] = serialize(@activity_preview) if @activity_preview body end |