Commit 9dd64181 authored by Ben Boeckel's avatar Ben Boeckel Committed by Kitware Robot
Browse files

Merge topic 'gitlab-11.9'

2d5a4106

 types: update for 11.9
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Ben Boeckel's avatarBen Boeckel <ben.boeckel@kitware.com>
Merge-request: !144
parents eb4fba97 2d5a4106
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:03.757-04:00", "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6", "closed_at": null, "id": 69328, "subscribed": true, "title": "fix documentation warnings", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "_links": {"project": "https://gitlab.kitware.com/api/v4/projects/855", "self": "https://gitlab.kitware.com/api/v4/projects/855/issues/6", "notes": "https://gitlab.kitware.com/api/v4/projects/855/issues/6/notes", "award_emoji": "https://gitlab.kitware.com/api/v4/projects/855/issues/6/award_emoji"}, "upvotes": 0, "project_id": 855, "due_date": null, "description": "", "confidential": false, "iid": 6, "milestone": null, "discussion_locked": null, "closed_by": null, "created_at": "2016-10-30T14:54:28.954-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "assignees": [{"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}], "user_notes_count": 0}
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:03.757-04:00", "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "user_notes_count": 0, "closed_at": null, "id": 69328, "upvotes": 0, "subscribed": true, "title": "fix documentation warnings", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "_links": {"project": "https://gitlab.kitware.com/api/v4/projects/855", "self": "https://gitlab.kitware.com/api/v4/projects/855/issues/6", "notes": "https://gitlab.kitware.com/api/v4/projects/855/issues/6/notes", "award_emoji": "https://gitlab.kitware.com/api/v4/projects/855/issues/6/award_emoji"}, "merge_requests_count": 1, "project_id": 855, "due_date": null, "description": "", "confidential": false, "iid": 6, "milestone": null, "discussion_locked": null, "closed_by": null, "created_at": "2016-10-30T14:54:28.954-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "assignees": [{"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}], "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/6"}
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:05.370-04:00", "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5", "closed_at": null, "id": 69075, "title": "Add project hook APIs", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "upvotes": 0, "project_id": 855, "due_date": null, "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "confidential": false, "iid": 5, "milestone": null, "discussion_locked": null, "closed_by": null, "created_at": "2016-10-04T14:59:37.178-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "assignees": [{"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}], "user_notes_count": 0}
{"downvotes": 0, "labels": [], "updated_at": "2017-07-07T02:31:05.370-04:00", "assignee": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "user_notes_count": 0, "closed_at": null, "id": 69075, "upvotes": 0, "title": "Add project hook APIs", "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "state": "closed", "merge_requests_count": 1, "project_id": 855, "due_date": null, "description": "The workflow currently requires that the robot be able to register itself as a webhook for new projects. An API needs added for this.\n\nCc: @brad.king", "confidential": false, "iid": 5, "milestone": null, "discussion_locked": null, "closed_by": null, "created_at": "2016-10-04T14:59:37.178-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "assignees": [{"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}], "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/issues/5"}
{"target_project_id": 855, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35", "source_branch": "add_hook-api", "downvotes": 0, "labels": [], "updated_at": "2016-10-04T16:18:57.940-04:00", "work_in_progress": false, "assignee": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "user_notes_count": 3, "closed_at": null, "id": 20215, "force_remove_source_branch": true, "target_branch": "master", "merge_error": null, "subscribed": true, "title": "gitlab: expose hook addition API", "merge_commit_sha": null, "merge_when_pipeline_succeeds": false, "merged_at": "2016-10-04T16:18:57.914-04:00", "state": "merged", "upvotes": 0, "project_id": 855, "allow_collaboration": null, "description": "Fixes #5.", "squash": false, "iid": 35, "milestone": null, "discussion_locked": null, "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "diff_refs": {"start_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "base_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "head_sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2"}, "closed_by": null, "source_project_id": 856, "merge_status": "can_be_merged", "merged_by": null, "changes_count": "3", "should_remove_source_branch": null, "created_at": "2016-10-04T15:56:43.276-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2", "allow_maintainer_to_push": null}
{"target_project_id": 855, "web_url": "https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35", "source_branch": "add_hook-api", "downvotes": 0, "labels": [], "updated_at": "2016-10-04T16:18:57.940-04:00", "work_in_progress": false, "assignee": {"username": "brad.king", "web_url": "https://gitlab.kitware.com/brad.king", "name": "Brad King", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon", "id": 10}, "user_notes_count": 3, "closed_at": null, "id": 20215, "force_remove_source_branch": true, "target_branch": "master", "merge_error": null, "subscribed": true, "title": "gitlab: expose hook addition API", "merge_commit_sha": null, "merge_when_pipeline_succeeds": false, "merged_at": "2016-10-04T16:18:57.914-04:00", "state": "merged", "upvotes": 0, "project_id": 855, "allow_collaboration": null, "description": "Fixes #5.", "squash": false, "iid": 35, "user": {"can_merge": true}, "milestone": null, "discussion_locked": null, "time_stats": {"time_estimate": 0, "human_total_time_spent": null, "human_time_estimate": null, "total_time_spent": 0}, "diff_refs": {"start_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "base_sha": "981262b03fc0149c1677ca51ea47b570e30d6a90", "head_sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2"}, "closed_by": null, "source_project_id": 856, "merge_status": "can_be_merged", "merged_by": null, "changes_count": "3", "should_remove_source_branch": null, "created_at": "2016-10-04T15:56:43.276-04:00", "author": {"username": "ben.boeckel", "web_url": "https://gitlab.kitware.com/ben.boeckel", "name": "Ben Boeckel", "state": "active", "avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon", "id": 13}, "sha": "04e94ae667024a62a90179f395bfdc2b35f3efd2", "allow_maintainer_to_push": null}
......@@ -198,6 +198,7 @@ fn test_read_issue() {
}
assert_eq!(issue.subscribed, Some(true));
assert_eq!(issue.user_notes_count, 0);
assert_eq!(issue.merge_requests_count, 1);
assert_eq!(issue.upvotes, 0);
assert_eq!(issue.downvotes, 0);
assert_eq!(issue.due_date, None);
......@@ -267,6 +268,7 @@ fn test_read_issue_reference() {
assert_eq!(issue.time_stats.human_time_estimate, None);
assert_eq!(issue.time_stats.human_total_time_spent, None);
assert_eq!(issue.user_notes_count, 0);
assert_eq!(issue.merge_requests_count, 1);
assert_eq!(issue.upvotes, 0);
assert_eq!(issue.downvotes, 0);
assert_eq!(issue.due_date, None);
......@@ -394,6 +396,7 @@ fn test_read_merge_request() {
assert_eq!(merge_request.discussion_locked, None);
assert_eq!(merge_request.should_remove_source_branch, None);
assert_eq!(merge_request.force_remove_source_branch, Some(true));
assert_eq!(merge_request.user.can_merge, true);
assert_eq!(
merge_request.web_url,
"https://gitlab.kitware.com/utils/rust-gitlab/merge_requests/35",
......
......@@ -1366,6 +1366,8 @@ pub struct Issue {
pub time_stats: IssuableTimeStats,
/// The number of comments on the issue.
pub user_notes_count: u64,
/// The number of merge requests referencing the issue.
pub merge_requests_count: u64,
/// The number of upvotes for the issue.
pub upvotes: u64,
/// The number of downvotes against the issue.
......@@ -1415,6 +1417,7 @@ impl Issue {
human_total_time_spent: None,
},
user_notes_count: 0,
merge_requests_count: 0,
upvotes: 0,
downvotes: 0,
due_date: None,
......@@ -1584,6 +1587,14 @@ enum_serialize!(MergeRequestState -> "merge request state",
Locked => "locked",
);
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)]
/// Information about current user's access to the merge request.
pub struct MergeRequestUser {
/// Whether the current user can merge the MR.
pub can_merge: bool,
}
#[cfg_attr(feature = "strict", serde(deny_unknown_fields))]
#[derive(Serialize, Deserialize, Debug, Clone)]
/// A merge request.
......@@ -1677,6 +1688,8 @@ pub struct MergeRequest {
pub should_remove_source_branch: Option<bool>,
/// Whether the merge request should be deleted or not (set by the author).
pub force_remove_source_branch: Option<bool>,
/// Information about current user's access to the merge request.
pub user: MergeRequestUser,
/// The URL of the merge request.
pub web_url: String,
}
......@@ -1770,6 +1783,8 @@ pub struct MergeRequestChanges {
pub should_remove_source_branch: Option<bool>,
/// Whether the merge request should be deleted or not (set by the author).
pub force_remove_source_branch: Option<bool>,
/// Information about current user's access to the merge request.
pub user: MergeRequestUser,
/// The URL of the merge request.
pub web_url: String,
pub changes: Vec<RepoDiff>,
......@@ -1819,6 +1834,7 @@ impl From<MergeRequestChanges> for MergeRequest {
discussion_locked: mr.discussion_locked,
should_remove_source_branch: mr.should_remove_source_branch,
force_remove_source_branch: mr.force_remove_source_branch,
user: mr.user,
web_url: mr.web_url,
}
}
......
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