Class: LeonardoAI::Models
- Inherits:
-
Object
- Object
- LeonardoAI::Models
- Defined in:
- lib/leonardoai/models.rb
Instance Method Summary collapse
- #delete_3d_model(id:) ⇒ Object
- #delete_models_by_id(id:) ⇒ Object
- #get_3d_models_by_id(id:, offset: 0, limit: 10) ⇒ Object
- #get_3d_models_by_user_id(user_id:, offset: 0, limit: 10) ⇒ Object
- #get_custom_models_by_id(id:) ⇒ Object
- #get_platform_models(offset: 0, limit: 10) ⇒ Object
-
#initialize(client: nil) ⇒ Models
constructor
A new instance of Models.
- #train(parameters: {}) ⇒ Object
- #upload_3d_model(parameters: {}) ⇒ Object
Constructor Details
#initialize(client: nil) ⇒ Models
Returns a new instance of Models.
3 4 5 |
# File 'lib/leonardoai/models.rb', line 3 def initialize(client: nil) @client = client end |
Instance Method Details
#delete_3d_model(id:) ⇒ Object
19 20 21 |
# File 'lib/leonardoai/models.rb', line 19 def delete_3d_model(id:) @client.delete(path: "/models-3d/#{id}") end |
#delete_models_by_id(id:) ⇒ Object
31 32 33 |
# File 'lib/leonardoai/models.rb', line 31 def delete_models_by_id(id:) @client.delete(path: "/models/#{id}") end |
#get_3d_models_by_id(id:, offset: 0, limit: 10) ⇒ Object
15 16 17 |
# File 'lib/leonardoai/models.rb', line 15 def get_3d_models_by_id(id:, offset: 0, limit: 10) @client.get(path: "/models-3d/#{id}?offset=#{offset}&limit=#{limit}") end |
#get_3d_models_by_user_id(user_id:, offset: 0, limit: 10) ⇒ Object
11 12 13 |
# File 'lib/leonardoai/models.rb', line 11 def get_3d_models_by_user_id(user_id:, offset: 0, limit: 10) @client.get(path: "/models-3d/user/#{user_id}?offset=#{offset}&limit=#{limit}") end |
#get_custom_models_by_id(id:) ⇒ Object
27 28 29 |
# File 'lib/leonardoai/models.rb', line 27 def get_custom_models_by_id(id:) @client.get(path: "/models/#{id}") end |
#get_platform_models(offset: 0, limit: 10) ⇒ Object
35 36 37 |
# File 'lib/leonardoai/models.rb', line 35 def get_platform_models(offset: 0, limit: 10) @client.get(path: "/platformModels?offset=#{offset}&limit=#{limit}") end |
#train(parameters: {}) ⇒ Object
23 24 25 |
# File 'lib/leonardoai/models.rb', line 23 def train(parameters: {}) @client.json_post(path: "/models", parameters: parameters) end |
#upload_3d_model(parameters: {}) ⇒ Object
7 8 9 |
# File 'lib/leonardoai/models.rb', line 7 def upload_3d_model(parameters: {}) @client.json_post(path: "/models-3d/upload", parameters: parameters) end |