Class: Exa::Services::Websets::CancelSearch
- Inherits:
-
Object
- Object
- Exa::Services::Websets::CancelSearch
- Defined in:
- lib/exa/services/websets/cancel_search.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(connection, webset_id:, id:) ⇒ CancelSearch
constructor
A new instance of CancelSearch.
Constructor Details
#initialize(connection, webset_id:, id:) ⇒ CancelSearch
Returns a new instance of CancelSearch.
7 8 9 10 11 |
# File 'lib/exa/services/websets/cancel_search.rb', line 7 def initialize(connection, webset_id:, id:) @connection = connection @webset_id = webset_id @id = id end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/exa/services/websets/cancel_search.rb', line 13 def call response = @connection.post( "/websets/v0/websets/#{@webset_id}/searches/#{@id}/cancel", {} ) body = response.body Resources::WebsetSearch.new( id: body["id"], object: body["object"], status: body["status"], webset_id: body["websetId"], query: body["query"], entity: body["entity"], criteria: body["criteria"], count: body["count"], behavior: body["behavior"], exclude: body["exclude"], scope: body["scope"], progress: body["progress"], recall: body["recall"], metadata: body["metadata"], canceled_at: body["canceledAt"], canceled_reason: body["canceledReason"], created_at: body["createdAt"], updated_at: body["updatedAt"] ) end |