Commit 690dfc0c authored by Paul Weingardt's avatar Paul Weingardt

added getNamespaceMembers method

parent cd037b61
......@@ -15,6 +15,7 @@ import org.gitlab.api.models.GitlabCommit;
import org.gitlab.api.models.GitlabIssue;
import org.gitlab.api.models.GitlabMergeRequest;
import org.gitlab.api.models.GitlabMilestone;
import org.gitlab.api.models.GitlabNamespace;
import org.gitlab.api.models.GitlabNote;
import org.gitlab.api.models.GitlabProject;
import org.gitlab.api.models.GitlabProjectHook;
......@@ -300,4 +301,25 @@ public class GitlabAPI {
String tailUrl = GitlabProject.URL + "/" + projectId + GitlabProjectMember.URL;
return Arrays.asList(retrieve().to(tailUrl, GitlabProjectMember[].class));
}
/**
* This will fail, if the given namespace is a user and not a group
* @param namespace
* @return
* @throws IOException
*/
public List<GitlabProjectMember> getNamespaceMembers(GitlabNamespace namespace) throws IOException {
return getNamespaceMembers(namespace.getId());
}
/**
* This will fail, if the given namespace is a user and not a group
* @param namespaceId
* @return
* @throws IOException
*/
public List<GitlabProjectMember> getNamespaceMembers(Integer namespaceId) throws IOException {
String tailUrl = GitlabNamespace.URL + "/" + namespaceId + GitlabProjectMember.URL;
return Arrays.asList(retrieve().to(tailUrl, GitlabProjectMember[].class));
}
}
......@@ -4,7 +4,8 @@ import java.util.Date;
import org.codehaus.jackson.annotate.JsonProperty;
public class GitlabNamespace {
public static final String URL = "/groups";
private Integer _id;
private String _name;
private String _path;
......
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