Class: Teams::Api::SearchResponse
- Inherits:
-
Object
- Object
- Teams::Api::SearchResponse
- Defined in:
- lib/teams/api/search.rb
Overview
Response body for application/search invokes (Adaptive Card dynamic typeahead Input.ChoiceSet queries). results accepts SearchInvokeResult objects or value: hashes.
Instance Method Summary collapse
-
#initialize(results, status_code: 200) ⇒ SearchResponse
constructor
A new instance of SearchResponse.
- #to_h ⇒ Object
Constructor Details
#initialize(results, status_code: 200) ⇒ SearchResponse
Returns a new instance of SearchResponse.
22 23 24 25 |
# File 'lib/teams/api/search.rb', line 22 def initialize(results, status_code: 200) @results = results @status_code = status_code end |
Instance Method Details
#to_h ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/teams/api/search.rb', line 27 def to_h { "statusCode" => @status_code, "type" => "application/vnd.microsoft.search.searchResponse", "value" => { "results" => Array(@results).map do |result| body = result.is_a?(Hash) ? result : result.to_h Common::Hashes.deep_stringify_keys(body) end } } end |