Class: Openlayer::Resources::Projects

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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.

Parameters:



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

#commitsOpenlayer::Resources::Projects::Commits (readonly)



7
8
9
# File 'lib/openlayer/resources/projects.rb', line 7

def commits
  @commits
end

#inference_pipelinesOpenlayer::Resources::Projects::InferencePipelines (readonly)



10
11
12
# File 'lib/openlayer/resources/projects.rb', line 10

def inference_pipelines
  @inference_pipelines
end

#testsOpenlayer::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.

Parameters:

Returns:

See Also:



30
31
32
33
34
35
36
37
38
39
# File 'lib/openlayer/resources/projects.rb', line 30

def create(params)
  parsed, options = Openlayer::ProjectCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "projects",
    body: parsed,
    model: Openlayer::Models::ProjectCreateResponse,
    options: options
  )
end

#list(name: nil, page: nil, per_page: nil, task_type: nil, request_options: {}) ⇒ Openlayer::Models::ProjectListResponse

List your workspace’s projects.

Parameters:

  • name (String)

    Filter list of items by project name.

  • page (Integer)

    The page to return in a paginated query.

  • per_page (Integer)

    Maximum number of items to return per page.

  • task_type (Symbol, Openlayer::Models::ProjectListParams::TaskType)

    Filter list of items by task type.

  • request_options (Openlayer::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



58
59
60
61
62
63
64
65
66
67
# File 'lib/openlayer/resources/projects.rb', line 58

def list(params = {})
  parsed, options = 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: options
  )
end