Class: LabClient::ProjectLabels
- Inherits:
-
Common
- Object
- Common
- LabClient::ProjectLabels
show all
- Includes:
- ClassHelpers
- Defined in:
- lib/labclient/projects/labels/list.rb,
lib/labclient/projects/labels/show.rb,
lib/labclient/projects/labels/client.rb,
lib/labclient/projects/labels/create.rb,
lib/labclient/projects/labels/delete.rb,
lib/labclient/projects/labels/update.rb,
lib/labclient/projects/labels/promote.rb,
lib/labclient/projects/labels/subscribe.rb,
lib/labclient/projects/labels/unsubscribe.rb
Overview
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
-
#create(project_id, query) ⇒ Object
-
#delete(project_id, label_id) ⇒ Object
-
#list(project_id, query = {}) ⇒ Object
-
#promote(project_id, label_id) ⇒ Object
-
#show(project_id, label_id, query = {}) ⇒ Object
-
#subscribe(project_id, label_id) ⇒ Object
-
#unsubscribe(project_id, label_id) ⇒ Object
-
#update(project_id, label_id, query) ⇒ Object
#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
#human_access_level, #human_protected_access_level, #machine_access_level, #machine_protected_access_level
Instance Method Details
#create(project_id, query) ⇒ Object
33
34
35
36
37
|
# File 'lib/labclient/projects/labels/create.rb', line 33
def create(project_id, query)
project_id = format_id(project_id)
client.request(:post, "projects/#{project_id}/labels", ProjectLabel, query)
end
|
#delete(project_id, label_id) ⇒ Object
26
27
28
29
30
31
|
# File 'lib/labclient/projects/labels/delete.rb', line 26
def delete(project_id, label_id)
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:delete, "projects/#{project_id}/labels/#{label_id}", ProjectLabel)
end
|
#list(project_id, query = {}) ⇒ Object
29
30
31
32
33
|
# File 'lib/labclient/projects/labels/list.rb', line 29
def list(project_id, query = {})
project_id = format_id(project_id)
client.request(:get, "projects/#{project_id}/labels", ProjectLabel, query)
end
|
28
29
30
31
32
33
|
# File 'lib/labclient/projects/labels/promote.rb', line 28
def promote(project_id, label_id)
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:put, "projects/#{project_id}/labels/#{label_id}/promote", ProjectLabel)
end
|
#show(project_id, label_id, query = {}) ⇒ Object
27
28
29
30
31
32
|
# File 'lib/labclient/projects/labels/show.rb', line 27
def show(project_id, label_id, query = {})
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:get, "projects/#{project_id}/labels/#{label_id}", ProjectLabel, query)
end
|
#subscribe(project_id, label_id) ⇒ Object
28
29
30
31
32
33
|
# File 'lib/labclient/projects/labels/subscribe.rb', line 28
def subscribe(project_id, label_id)
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:post, "projects/#{project_id}/labels/#{label_id}/subscribe", ProjectLabel)
end
|
#unsubscribe(project_id, label_id) ⇒ Object
28
29
30
31
32
33
|
# File 'lib/labclient/projects/labels/unsubscribe.rb', line 28
def unsubscribe(project_id, label_id)
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:post, "projects/#{project_id}/labels/#{label_id}/unsubscribe", ProjectLabel)
end
|
#update(project_id, label_id, query) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/labclient/projects/labels/update.rb', line 39
def update(project_id, label_id, query)
project_id = format_id(project_id)
label_id = format_id(label_id)
client.request(:put, "projects/#{project_id}/labels/#{label_id}", ProjectLabel, query)
end
|