Module: Gitlab::Client::Labels
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/labels.rb
Overview
Defines methods related to labels.
Instance Method Summary collapse
-
#create_label(project, name, color, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new label.
-
#delete_label(project, name) ⇒ Gitlab::ObjectifiedHash
Deletes a label.
-
#edit_label(project, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a label.
-
#labels(project) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project’s labels.
-
#subscribe_to_label(project, name) ⇒ Gitlab::ObjectifiedHash
Subscribes the user to a label to receive notifications.
-
#unsubscribe_from_label(project, name) ⇒ Gitlab::ObjectifiedHash
Unsubscribes the user from a label to not receive notifications from it.
Instance Method Details
#create_label(project, name, color, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new label.
28 29 30 |
# File 'lib/gitlab/client/labels.rb', line 28 def create_label(project, name, color, = {}) post("/projects/#{url_encode project}/labels", body: .merge(name: name, color: color)) end |
#delete_label(project, name) ⇒ Gitlab::ObjectifiedHash
Deletes a label.
58 59 60 |
# File 'lib/gitlab/client/labels.rb', line 58 def delete_label(project, name) delete("/projects/#{url_encode project}/labels", body: { name: name }) end |
#edit_label(project, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a label.
46 47 48 |
# File 'lib/gitlab/client/labels.rb', line 46 def edit_label(project, name, ={}) put("/projects/#{url_encode project}/labels", body: .merge(name: name)) end |
#labels(project) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project’s labels.
12 13 14 |
# File 'lib/gitlab/client/labels.rb', line 12 def labels(project) get("/projects/#{url_encode project}/labels") end |
#subscribe_to_label(project, name) ⇒ Gitlab::ObjectifiedHash
Subscribes the user to a label to receive notifications
70 71 72 |
# File 'lib/gitlab/client/labels.rb', line 70 def subscribe_to_label(project, name) post("/projects/#{url_encode project}/labels/#{url_encode name}/subscribe") end |
#unsubscribe_from_label(project, name) ⇒ Gitlab::ObjectifiedHash
Unsubscribes the user from a label to not receive notifications from it
82 83 84 |
# File 'lib/gitlab/client/labels.rb', line 82 def unsubscribe_from_label(project, name) post("/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe") end |