Class: LeonardoAI::Generations
- Inherits:
-
Object
- Object
- LeonardoAI::Generations
- Defined in:
- lib/leonardoai/generations.rb
Instance Method Summary collapse
- #delete_generation(id:) ⇒ Object
- #delete_texture_generation(id:) ⇒ Object
- #generate(parameters: {}) ⇒ Object
- #generate_texture_generation(parameters: {}) ⇒ Object
- #get_generation(id:) ⇒ Object
- #get_texture_generation_by_id(id:) ⇒ Object
- #get_texture_generation_by_model_id(model_id:) ⇒ Object
- #get_user_generations(user_id:) ⇒ Object
-
#initialize(client: nil) ⇒ Generations
constructor
A new instance of Generations.
Constructor Details
#initialize(client: nil) ⇒ Generations
Returns a new instance of Generations.
3 4 5 |
# File 'lib/leonardoai/generations.rb', line 3 def initialize(client: nil) @client = client end |
Instance Method Details
#delete_generation(id:) ⇒ Object
15 16 17 |
# File 'lib/leonardoai/generations.rb', line 15 def delete_generation(id:) @client.delete(path: "/generations/#{id}") end |
#delete_texture_generation(id:) ⇒ Object
35 36 37 |
# File 'lib/leonardoai/generations.rb', line 35 def delete_texture_generation(id:) @client.delete(path: "/generations-texture/#{id}") end |
#generate(parameters: {}) ⇒ Object
7 8 9 |
# File 'lib/leonardoai/generations.rb', line 7 def generate(parameters: {}) @client.json_post(path: "/generations", parameters: parameters) end |
#generate_texture_generation(parameters: {}) ⇒ Object
23 24 25 |
# File 'lib/leonardoai/generations.rb', line 23 def generate_texture_generation(parameters: {}) @client.json_post(path: "/generations-texture", parameters: parameters) end |
#get_generation(id:) ⇒ Object
11 12 13 |
# File 'lib/leonardoai/generations.rb', line 11 def get_generation(id:) @client.get(path: "/generations/#{id}") end |
#get_texture_generation_by_id(id:) ⇒ Object
31 32 33 |
# File 'lib/leonardoai/generations.rb', line 31 def get_texture_generation_by_id(id:) @client.get(path: "/generations-texture/model/#{id}") end |
#get_texture_generation_by_model_id(model_id:) ⇒ Object
27 28 29 |
# File 'lib/leonardoai/generations.rb', line 27 def get_texture_generation_by_model_id(model_id:) @client.get(path: "/generations-texture/model/#{model_id}") end |
#get_user_generations(user_id:) ⇒ Object
19 20 21 |
# File 'lib/leonardoai/generations.rb', line 19 def get_user_generations(user_id:) @client.get(path: "/generations/user/#{user_id}") end |