Class: Teams::Api::MessagingExtensionActionResponse
- Inherits:
-
Object
- Object
- Teams::Api::MessagingExtensionActionResponse
- Defined in:
- lib/teams/api/message_extension.rb
Overview
Response for the action-style invokes (submitAction, fetchTask): either a dialog via task: (a TaskModuleContinueResponse / TaskModuleMessageResponse) or a result via compose_extension:.
Instance Method Summary collapse
-
#initialize(task: nil, compose_extension: nil, cache_info: nil) ⇒ MessagingExtensionActionResponse
constructor
A new instance of MessagingExtensionActionResponse.
- #to_h ⇒ Object
Constructor Details
#initialize(task: nil, compose_extension: nil, cache_info: nil) ⇒ MessagingExtensionActionResponse
Returns a new instance of MessagingExtensionActionResponse.
92 93 94 95 96 |
# File 'lib/teams/api/message_extension.rb', line 92 def initialize(task: nil, compose_extension: nil, cache_info: nil) @task = task @compose_extension = compose_extension @cache_info = cache_info end |
Instance Method Details
#to_h ⇒ Object
98 99 100 101 102 103 104 105 106 107 |
# File 'lib/teams/api/message_extension.rb', line 98 def to_h body = {} body["task"] = @task.respond_to?(:to_h) ? @task.to_h : @task if @task if @compose_extension body["composeExtension"] = @compose_extension.respond_to?(:to_h) ? @compose_extension.to_h : @compose_extension end body["cacheInfo"] = Common::Hashes.deep_stringify_keys(@cache_info) if @cache_info body end |