Class: LabClient::ProjectDeployments

Inherits:
Common
  • Object
show all
Includes:
ClassHelpers
Defined in:
lib/labclient/projects/deployments/list.rb,
lib/labclient/projects/deployments/show.rb,
lib/labclient/projects/deployments/client.rb,
lib/labclient/projects/deployments/create.rb,
lib/labclient/projects/deployments/update.rb,
lib/labclient/projects/deployments/merge_requests.rb

Overview

Specifics

Constant Summary

Constants included from AccessLevel

AccessLevel::HUMAN_ACCESS_LEVELS, AccessLevel::MACHINE_ACCESS_LEVELS

Instance Attribute Summary

Attributes inherited from Common

#client

Instance Method Summary collapse

Methods included from ClassHelpers

#has?, #keys, #raw

Methods inherited from Common

#api_methods, #api_methods_help, #format_id, #format_query_id, #format_query_ids, #format_time?, #group_name, #help, #initialize, #inspect, #klass, #protected_query_access_level, #query_access_level, #query_format_time

Methods included from Docs

#demo, #desc, #doc, docs, #example, #group_name, #help, json, #markdown, #navigation, #option, #result, #subtitle, #title

Methods included from AccessLevel

#human_access_level, #human_protected_access_level, #machine_access_level, #machine_protected_access_level

Constructor Details

This class inherits a constructor from LabClient::Common

Instance Method Details

#create(project_id, query) ⇒ Object



50
51
52
53
54
# File 'lib/labclient/projects/deployments/create.rb', line 50

def create(project_id, query)
  project_id = format_id(project_id)

  client.request(:post, "projects/#{project_id}/deployments", ProjectDeployment, query)
end

#list(project_id, query = {}) ⇒ Object



58
59
60
61
62
63
64
65
# File 'lib/labclient/projects/deployments/list.rb', line 58

def list(project_id, query = {})
  project_id = format_id(project_id)

  query[:updated_after] = query[:updated_after].to_time.iso8601 if format_time?(query[:updated_after])
  query[:updated_before] = query[:updated_before].to_time.iso8601 if format_time?(query[:updated_before])

  client.request(:get, "projects/#{project_id}/deployments", ProjectDeployment, query)
end

#merge_requests(project_id, deployment_id, query = {}) ⇒ Object



26
27
28
29
30
31
# File 'lib/labclient/projects/deployments/merge_requests.rb', line 26

def merge_requests(project_id, deployment_id, query = {})
  project_id = format_id(project_id)
  deployment_id = format_id(deployment_id)

  client.request(:get, "projects/#{project_id}/deployments/#{deployment_id}/merge_requests", MergeRequest, query)
end

#show(project_id, deployment_id) ⇒ Object



20
21
22
23
24
25
# File 'lib/labclient/projects/deployments/show.rb', line 20

def show(project_id, deployment_id)
  project_id = format_id(project_id)
  deployment_id = format_id(deployment_id)

  client.request(:get, "projects/#{project_id}/deployments/#{deployment_id}", ProjectDeployment)
end

#update(project_id, deployment_id, status) ⇒ Object



44
45
46
47
48
49
50
# File 'lib/labclient/projects/deployments/update.rb', line 44

def update(project_id, deployment_id, status)
  project_id = format_id(project_id)
  deployment_id = format_id(deployment_id)
  query = { status: status }

  client.request(:put, "projects/#{project_id}/deployments/#{deployment_id}", ProjectDeployment, query)
end