Class: FindAI::Resources::Searches
- Inherits:
-
Object
- Object
- FindAI::Resources::Searches
- Defined in:
- lib/find-ai/resources/searches.rb
Instance Method Summary collapse
-
#create(params = {}, opts = {}) ⇒ FindAI::Models::SearchCreateResponse
Starts a search.
-
#initialize(client:) ⇒ Searches
constructor
A new instance of Searches.
-
#retrieve(id, opts = {}) ⇒ Array<FindAI::Models::SearchRetrieveResponse::SearchRetrieveResponse>
The endpoint to poll to check the latest results of a search.
Constructor Details
#initialize(client:) ⇒ Searches
Returns a new instance of Searches.
6 7 8 |
# File 'lib/find-ai/resources/searches.rb', line 6 def initialize(client:) @client = client end |
Instance Method Details
#create(params = {}, opts = {}) ⇒ FindAI::Models::SearchCreateResponse
Starts a search.
21 22 23 24 25 26 27 28 |
# File 'lib/find-ai/resources/searches.rb', line 21 def create(params = {}, opts = {}) req = {} req[:method] = :post req[:path] = "/v1/searches" req[:body] = params req[:model] = FindAI::Models::SearchCreateResponse @client.request(req, opts) end |
#retrieve(id, opts = {}) ⇒ Array<FindAI::Models::SearchRetrieveResponse::SearchRetrieveResponse>
The endpoint to poll to check the latest results of a search.
36 37 38 39 40 41 42 |
# File 'lib/find-ai/resources/searches.rb', line 36 def retrieve(id, opts = {}) req = {} req[:method] = :get req[:path] = "/v1/searches/#{id}" req[:model] = FindAI::ArrayOf.new(FindAI::Models::SearchRetrieveResponse::SearchRetrieveResponse) @client.request(req, opts) end |