Module: Gitlab::Client::Labels
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/labels.rb
Overview
Defines methods related to project 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, options = {}) ⇒ 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.
30 31 32 |
# File 'lib/gitlab/client/labels.rb', line 30 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.
60 61 62 |
# File 'lib/gitlab/client/labels.rb', line 60 def delete_label(project, name) delete("/projects/#{url_encode project}/labels/#{name}") end |
#edit_label(project, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a label.
48 49 50 |
# File 'lib/gitlab/client/labels.rb', line 48 def edit_label(project, name, = {}) put("/projects/#{url_encode project}/labels", body: .merge(name: name)) end |
#labels(project, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of project’s labels.
14 15 16 |
# File 'lib/gitlab/client/labels.rb', line 14 def labels(project, = {}) get("/projects/#{url_encode project}/labels", query: ) end |
#subscribe_to_label(project, name) ⇒ Gitlab::ObjectifiedHash
Subscribes the user to a label to receive notifications
72 73 74 |
# File 'lib/gitlab/client/labels.rb', line 72 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
84 85 86 |
# File 'lib/gitlab/client/labels.rb', line 84 def unsubscribe_from_label(project, name) post("/projects/#{url_encode project}/labels/#{url_encode name}/unsubscribe") end |