Commit a939de59 authored by Brad King's avatar Brad King 💬 Committed by Kitware Robot
Browse files

Merge topic 'group-access-methods'

588218b9 gitlab: don't use Option<T>
b9c52d23 gitlab: rename project membership methods
b927d288

 gitlab: add methods for group membership
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Reviewed-by: Brad King's avatarBrad King <brad.king@kitware.com>
Merge-request: !32
parents 8f532419 588218b9
......@@ -134,13 +134,23 @@ impl Gitlab {
self._get(&format!("projects/{}/hooks/{}", project, hook))
}
/// Get the team members of a group.
pub fn group_members(&self, group: GroupId) -> GitlabResult<Vec<Member>> {
self._get_paged(&format!("groups/{}/members", group))
}
/// Get a team member of a group.
pub fn group_member(&self, group: GroupId, user: UserId) -> GitlabResult<Member> {
self._get(&format!("groups/{}/members/{}", group, user))
}
/// Get the team members of a project.
pub fn members(&self, project: ProjectId) -> GitlabResult<Vec<Member>> {
pub fn project_members(&self, project: ProjectId) -> GitlabResult<Vec<Member>> {
self._get_paged(&format!("projects/{}/members", project))
}
/// Get a team member of a project.
pub fn member(&self, project: ProjectId, user: UserId) -> GitlabResult<Option<Member>> {
pub fn project_member(&self, project: ProjectId, user: UserId) -> GitlabResult<Member> {
self._get(&format!("projects/{}/members/{}", project, user))
}
......
Supports Markdown
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