Class: Teams::Api::MessagingExtensionResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/teams/api/message_extension.rb

Overview

Response for the query-style message extension invokes (query, selectItem, queryLink, querySettingUrl, setting).

Instance Method Summary collapse

Constructor Details

#initialize(compose_extension, cache_info: nil) ⇒ MessagingExtensionResponse

Returns a new instance of MessagingExtensionResponse.



72
73
74
75
# File 'lib/teams/api/message_extension.rb', line 72

def initialize(compose_extension, cache_info: nil)
  @compose_extension = compose_extension
  @cache_info = cache_info
end

Instance Method Details

#to_hObject



77
78
79
80
81
82
83
84
85
# File 'lib/teams/api/message_extension.rb', line 77

def to_h
  body = {}
  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