Class: Asimov::ApiV1::Models

Inherits:
Base
  • Object
show all
Defined in:
lib/asimov/api_v1/models.rb

Overview

Class interface for API methods in the “/models” URI subspace.

Constant Summary collapse

URI_PREFIX =
"/models".freeze

Instance Method Summary collapse

Methods inherited from Base

#check_for_api_error, #http_delete, #http_get, #http_streamed_download, #initialize, #json_post, #multipart_post, #wrap_response_with_error_handling

Constructor Details

This class inherits a constructor from Asimov::ApiV1::Base

Instance Method Details

#delete(model_id:) ⇒ Object



17
18
19
# File 'lib/asimov/api_v1/models.rb', line 17

def delete(model_id:)
  http_delete(path: "#{URI_PREFIX}/#{model_id}")
end

#listObject



9
10
11
# File 'lib/asimov/api_v1/models.rb', line 9

def list
  http_get(path: URI_PREFIX)
end

#retrieve(model_id:) ⇒ Object



13
14
15
# File 'lib/asimov/api_v1/models.rb', line 13

def retrieve(model_id:)
  http_get(path: "#{URI_PREFIX}/#{model_id}")
end