Commit 4a609d81 authored by Brad King's avatar Brad King
Browse files

types: update for 11.11

The merge requests field for multiple assignees now includes an entry
for a single assignee.  Namespaces of projects gained fields for a URL
and an avatar.
parent b053a5a4
......@@ -9,6 +9,16 @@
"username": "brad.king",
"web_url": "https://gitlab.kitware.com/brad.king"
},
"assignees": [
{
"avatar_url": "https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon",
"id": 10,
"name": "Brad King",
"state": "active",
"username": "brad.king",
"web_url": "https://gitlab.kitware.com/brad.king"
}
],
"author": {
"avatar_url": "https://secure.gravatar.com/avatar/2f5f7e99190174edb5a2f66b8653b0b2?s=80&d=identicon",
"id": 13,
......
......@@ -31,12 +31,14 @@
"name": "rust-gitlab",
"name_with_namespace": "Utils / rust-gitlab",
"namespace": {
"avatar_url": null,
"full_path": "utils",
"id": 498,
"kind": "group",
"name": "Utils",
"parent_id": null,
"path": "utils"
"path": "utils",
"web_url": "https://gitlab.kitware.com/groups/utils"
},
"only_allow_merge_if_all_discussions_are_resolved": null,
"only_allow_merge_if_pipeline_succeeds": false,
......
......@@ -357,6 +357,19 @@ fn test_read_merge_request() {
} else {
panic!("expected to have an assignee for the merge request");
}
if let Some(ref assignees) = merge_request.assignees {
assert_eq!(assignees.len(), 1);
let assignee = &assignees[0];
assert_eq!(assignee.username, "brad.king");
assert_eq!(assignee.web_url, "https://gitlab.kitware.com/brad.king");
assert_eq!(assignee.name, "Brad King");
assert_eq!(assignee.state, UserState::Active);
assert_eq!(assignee.avatar_url,
Some("https://secure.gravatar.com/avatar/0617392a2f9fd505720d0c42cefc1a10?s=80&d=identicon".to_string()));
assert_eq!(assignee.id, UserId::new(10));
} else {
panic!("expected to have assignees for the merge request");
}
assert_eq!(merge_request.source_project_id, ProjectId::new(856));
assert_eq!(merge_request.target_project_id, ProjectId::new(855));
assert!(merge_request.labels.is_empty());
......@@ -502,6 +515,8 @@ fn test_read_project() {
);
assert_eq!(project.namespace.kind, NamespaceKind::Group);
assert_eq!(project.namespace.full_path, "utils");
assert_eq!(project.namespace.avatar_url, None);
assert_eq!(project.namespace.web_url, "https://gitlab.kitware.com/groups/utils");
assert!(project.namespace.members_count_with_descendants.is_none());
assert!(project.forked_from_project.is_none());
assert_eq!(project.avatar_url, None);
......
......@@ -2346,6 +2346,10 @@ pub struct Namespace {
///
/// Only available when talking to GitLab as a user that can admin the namespace.
pub members_count_with_descendants: Option<u64>,
/// The URL of the user's avatar if namespace is a user.
pub avatar_url: Option<String>,
/// The URL to the namespace page (user or group).
pub web_url: String,
}
impl Namespace {
......
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