Commit 7134adce authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'label-counts-optional'

4bbbe235

 gitlab: add function to get labels with counts
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !163
parents 306faaa7 4bbbe235
......@@ -727,6 +727,11 @@ impl Gitlab {
self.get_paged(&format!("projects/{}/labels", project))
}
/// Get the labels with open/closed/merge requests count
pub fn labels_with_counts(&self, project: ProjectId) -> Result<Vec<Label>> {
self.get_paged_with_param(&format!("projects/{}/labels", project), vec![("with_counts", "true")])
}
/// Get label by ID.
pub fn label(&self, project: ProjectId, label: LabelId) -> Result<Label> {
self.get(&format!("projects/{}/labels/{}", project, label))
......
......@@ -1308,11 +1308,11 @@ pub struct Label {
/// The description of the label.
pub description: Option<String>,
/// The number of opened issues associated with the label.
pub open_issues_count: u64,
pub open_issues_count: Option<u64>,
/// the number of closed issues associated with the label.
pub closed_issues_count: u64,
pub closed_issues_count: Option<u64>,
/// The number of open merge request associated with the label.
pub open_merge_requests_count: u64,
pub open_merge_requests_count: Option<u64>,
/// Whether or not the account connecting has subscribed to the label.
pub subscribed: bool,
/// The priority of the label.
......@@ -1328,9 +1328,9 @@ impl Label {
name: name,
color: color,
description: None,
open_issues_count: 0,
closed_issues_count: 0,
open_merge_requests_count: 0,
open_issues_count: None,
closed_issues_count: None,
open_merge_requests_count: None,
subscribed: false,
priority: None,
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment