Class: Openlayer::Resources::Projects::Commits

Inherits:
Object
  • Object
show all
Defined in:
lib/openlayer/resources/projects/commits.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Commits

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 Commits.

Parameters:



66
67
68
# File 'lib/openlayer/resources/projects/commits.rb', line 66

def initialize(client:)
  @client = client
end

Instance Method Details

#create(project_id, commit: , storage_uri: , archived: nil, deployment_status: nil, request_options: {}) ⇒ Openlayer::Models::Projects::CommitCreateResponse

Create a new commit (project version) in a project.

Parameters:

  • project_id (String)

    The project id.

  • commit (Openlayer::Models::Projects::CommitCreateParams::Commit)

    The details of a commit (project version).

  • storage_uri (String)

    The storage URI where the commit bundle is stored.

  • archived (Boolean, nil)

    Whether the commit is archived.

  • deployment_status (String)

    The deployment status associated with the commit’s model.

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

Returns:

See Also:



26
27
28
29
30
31
32
33
34
35
# File 'lib/openlayer/resources/projects/commits.rb', line 26

def create(project_id, params)
  parsed, options = Openlayer::Projects::CommitCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["projects/%1$s/versions", project_id],
    body: parsed,
    model: Openlayer::Models::Projects::CommitCreateResponse,
    options: options
  )
end

#list(project_id, page: nil, per_page: nil, request_options: {}) ⇒ Openlayer::Models::Projects::CommitListResponse

List the commits (project versions) in a project.

Parameters:

  • project_id (String)

    The project id.

  • page (Integer)

    The page to return in a paginated query.

  • per_page (Integer)

    Maximum number of items to return per page.

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

Returns:

See Also:



52
53
54
55
56
57
58
59
60
61
# File 'lib/openlayer/resources/projects/commits.rb', line 52

def list(project_id, params = {})
  parsed, options = Openlayer::Projects::CommitListParams.dump_request(params)
  @client.request(
    method: :get,
    path: ["projects/%1$s/versions", project_id],
    query: parsed.transform_keys(per_page: "perPage"),
    model: Openlayer::Models::Projects::CommitListResponse,
    options: options
  )
end