Module: Gitlab::Client::GroupBadges
- Included in:
- Gitlab::Client
- Defined in:
- lib/gitlab/client/group_badges.rb
Overview
Defines methods related to group badges.
Instance Method Summary collapse
-
#add_group_badge(group, options = {}) ⇒ Gitlab::ObjectifiedHash
Adds a badge to a group.
-
#edit_group_badge(group, badge_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a badge of a group.
-
#group_badge(group, badge_id) ⇒ Gitlab::ObjectifiedHash
Gets a badge of a group.
-
#group_badges(group, name = nil) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of a groups badges.
-
#preview_group_badge(group, link_url, image_url) ⇒ Gitlab::ObjectifiedHash
Preview a badge from a group.
-
#remove_group_badge(group, badge_id) ⇒ nil
Removes a badge from a group.
Instance Method Details
#add_group_badge(group, options = {}) ⇒ Gitlab::ObjectifiedHash
Adds a badge to a group.
43 44 45 |
# File 'lib/gitlab/client/group_badges.rb', line 43 def add_group_badge(group, = {}) post("/groups/#{url_encode group}/badges", body: ) end |
#edit_group_badge(group, badge_id, options = {}) ⇒ Gitlab::ObjectifiedHash
Updates a badge of a group.
58 59 60 |
# File 'lib/gitlab/client/group_badges.rb', line 58 def edit_group_badge(group, badge_id, = {}) put("/groups/#{url_encode group}/badges/#{badge_id}", body: ) end |
#group_badge(group, badge_id) ⇒ Gitlab::ObjectifiedHash
Gets a badge of a group.
29 30 31 |
# File 'lib/gitlab/client/group_badges.rb', line 29 def group_badge(group, badge_id) get("/groups/#{url_encode group}/badges/#{badge_id}") end |
#group_badges(group, name = nil) ⇒ Array<Gitlab::ObjectifiedHash>
Gets a list of a groups badges.
16 17 18 19 |
# File 'lib/gitlab/client/group_badges.rb', line 16 def group_badges(group, name = nil) query = { name: name } if name get("/groups/#{url_encode group}/badges", query: query) end |
#preview_group_badge(group, link_url, image_url) ⇒ Gitlab::ObjectifiedHash
Preview a badge from a group.
83 84 85 86 |
# File 'lib/gitlab/client/group_badges.rb', line 83 def preview_group_badge(group, link_url, image_url) query = { link_url: link_url, image_url: image_url } get("/groups/#{url_encode group}/badges/render", query: query) end |
#remove_group_badge(group, badge_id) ⇒ nil
Removes a badge from a group.
70 71 72 |
# File 'lib/gitlab/client/group_badges.rb', line 70 def remove_group_badge(group, badge_id) delete("/groups/#{url_encode group}/badges/#{badge_id}") end |