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,
sig/openlayer/resources/projects.rbs,
sig/openlayer/resources/projects/tests.rbs,
sig/openlayer/resources/projects/commits.rbs,
sig/openlayer/resources/projects/inference_pipelines.rbs
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:, data_retention_days: nil, description: nil, model_developer: nil, model_types: nil, purpose: nil, request_options: {}) ⇒ Openlayer::Models::ProjectCreateResponse
Some parameter documentations has been truncated, see Models::ProjectCreateParams for more details.
-
#delete(project_id, request_options: {}) ⇒ nil
Delete a project by its ID.
-
#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.
-
#update(project_id, data_retention_days: nil, description: nil, model_developer: nil, model_types: nil, name: nil, purpose: nil, request_options: {}) ⇒ Openlayer::Models::ProjectUpdateResponse
Some parameter documentations has been truncated, see Models::ProjectUpdateParams for more details.
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.
141 142 143 144 145 146 |
# File 'lib/openlayer/resources/projects.rb', line 141 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:, data_retention_days: nil, description: nil, model_developer: nil, model_types: nil, purpose: nil, request_options: {}) ⇒ Openlayer::Models::ProjectCreateResponse
Some parameter documentations has been truncated, see Models::ProjectCreateParams for more details.
Create a project in your workspace.
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/openlayer/resources/projects.rb', line 41 def create(params) parsed, = Openlayer::ProjectCreateParams.dump_request(params) @client.request( method: :post, path: "projects", body: parsed, model: Openlayer::Models::ProjectCreateResponse, options: ) end |
#delete(project_id, request_options: {}) ⇒ nil
Delete a project by its ID.
129 130 131 132 133 134 135 136 |
# File 'lib/openlayer/resources/projects.rb', line 129 def delete(project_id, params = {}) @client.request( method: :delete, path: ["projects/%1$s", project_id], model: NilClass, options: params[:request_options] ) end |
#list(name: nil, page: nil, per_page: nil, task_type: nil, request_options: {}) ⇒ Openlayer::Models::ProjectListResponse
List your workspace's projects.
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/openlayer/resources/projects.rb', line 106 def list(params = {}) parsed, = Openlayer::ProjectListParams.dump_request(params) query = Openlayer::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "projects", query: query.transform_keys(per_page: "perPage", task_type: "taskType"), model: Openlayer::Models::ProjectListResponse, options: ) end |
#update(project_id, data_retention_days: nil, description: nil, model_developer: nil, model_types: nil, name: nil, purpose: nil, request_options: {}) ⇒ Openlayer::Models::ProjectUpdateResponse
Some parameter documentations has been truncated, see Models::ProjectUpdateParams for more details.
Update a project's metadata.
78 79 80 81 82 83 84 85 86 87 |
# File 'lib/openlayer/resources/projects.rb', line 78 def update(project_id, params = {}) parsed, = Openlayer::ProjectUpdateParams.dump_request(params) @client.request( method: :patch, path: ["projects/%1$s", project_id], body: parsed, model: Openlayer::Models::ProjectUpdateResponse, options: ) end |