Module: Gitlab::Client::GroupLabels
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/group_labels.rb
Overview
Note:
Requires GitLab 11.8+
Defines methods related to group labels.
Instance Method Summary collapse
-
#create_group_label(group, name, color, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new group label.
-
#delete_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Deletes a group label.
-
#edit_group_label(group, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a group label.
-
#group_labels(group, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of group’s labels.
-
#subscribe_to_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Subscribes the user to a group label to receive notifications.
-
#unsubscribe_from_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Unsubscribes the user from a group label to not receive notifications from it.
Instance Method Details
#create_group_label(group, name, color, options = {}) ⇒ Gitlab::ObjectifiedHash
Creates a new group label.
31 32 33 |
# File 'lib/gitlab/client/group_labels.rb', line 31 def create_group_label(group, name, color, = {}) post("/groups/#{url_encode group}/labels", body: .merge(name: name, color: color)) end |
#delete_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Deletes a group label.
60 61 62 |
# File 'lib/gitlab/client/group_labels.rb', line 60 def delete_group_label(group, name) delete("/groups/#{url_encode group}/labels/#{name}") end |
#edit_group_label(group, name, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a group label.
48 49 50 |
# File 'lib/gitlab/client/group_labels.rb', line 48 def edit_group_label(group, name, = {}) put("/groups/#{url_encode group}/labels", body: .merge(name: name)) end |
#group_labels(group, options = {}) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of group’s labels.
16 17 18 |
# File 'lib/gitlab/client/group_labels.rb', line 16 def group_labels(group, = {}) get("/groups/#{url_encode group}/labels", query: ) end |
#subscribe_to_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Subscribes the user to a group label to receive notifications
72 73 74 |
# File 'lib/gitlab/client/group_labels.rb', line 72 def subscribe_to_group_label(group, name) post("/groups/#{url_encode group}/labels/#{url_encode name}/subscribe") end |
#unsubscribe_from_group_label(group, name) ⇒ Gitlab::ObjectifiedHash
Unsubscribes the user from a group label to not receive notifications from it
84 85 86 |
# File 'lib/gitlab/client/group_labels.rb', line 84 def unsubscribe_from_group_label(group, name) post("/groups/#{url_encode group}/labels/#{url_encode name}/unsubscribe") end |