Class: Openlayer::Resources::Projects
- Inherits:
-
Object
- Object
- Openlayer::Resources::Projects
- Defined in:
- lib/openlayer/resources/projects.rb,
lib/openlayer/resources/projects/tests.rb,
lib/openlayer/resources/projects/commits.rb,
lib/openlayer/resources/projects/inference_pipelines.rb
Defined Under Namespace
Classes: Commits, InferencePipelines, Tests
Instance Attribute Summary collapse
- #commits ⇒ Openlayer::Resources::Projects::Commits readonly
- #inference_pipelines ⇒ Openlayer::Resources::Projects::InferencePipelines readonly
- #tests ⇒ Openlayer::Resources::Projects::Tests readonly
Instance Method Summary collapse
-
#create(name: , task_type: , description: nil, request_options: {}) ⇒ Openlayer::Models::ProjectCreateResponse
Create a project in your workspace.
-
#initialize(client:) ⇒ Projects
constructor
private
A new instance of Projects.
-
#list(name: nil, page: nil, per_page: nil, task_type: nil, request_options: {}) ⇒ Openlayer::Models::ProjectListResponse
List your workspace’s projects.
Constructor Details
#initialize(client:) ⇒ Projects
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Projects.
72 73 74 75 76 77 |
# File 'lib/openlayer/resources/projects.rb', line 72 def initialize(client:) @client = client @commits = Openlayer::Resources::Projects::Commits.new(client: client) @inference_pipelines = Openlayer::Resources::Projects::InferencePipelines.new(client: client) @tests = Openlayer::Resources::Projects::Tests.new(client: client) end |
Instance Attribute Details
#commits ⇒ Openlayer::Resources::Projects::Commits (readonly)
7 8 9 |
# File 'lib/openlayer/resources/projects.rb', line 7 def commits @commits end |
#inference_pipelines ⇒ Openlayer::Resources::Projects::InferencePipelines (readonly)
10 11 12 |
# File 'lib/openlayer/resources/projects.rb', line 10 def inference_pipelines @inference_pipelines end |
#tests ⇒ Openlayer::Resources::Projects::Tests (readonly)
13 14 15 |
# File 'lib/openlayer/resources/projects.rb', line 13 def tests @tests end |
Instance Method Details
#create(name: , task_type: , description: nil, request_options: {}) ⇒ Openlayer::Models::ProjectCreateResponse
Create a project in your workspace.
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/openlayer/resources/projects.rb', line 30 def create(params) parsed, = Openlayer::ProjectCreateParams.dump_request(params) @client.request( method: :post, path: "projects", body: parsed, model: Openlayer::Models::ProjectCreateResponse, options: ) end |
#list(name: nil, page: nil, per_page: nil, task_type: nil, request_options: {}) ⇒ Openlayer::Models::ProjectListResponse
List your workspace’s projects.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/openlayer/resources/projects.rb', line 58 def list(params = {}) parsed, = Openlayer::ProjectListParams.dump_request(params) @client.request( method: :get, path: "projects", query: parsed.transform_keys(per_page: "perPage", task_type: "taskType"), model: Openlayer::Models::ProjectListResponse, options: ) end |