Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
java-gitlab-api
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
沈俊林
java-gitlab-api
Commits
f377b902
Commit
f377b902
authored
Apr 11, 2014
by
Adam Retter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support for Getting Group Members from the API
parent
6b01ce8a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
14 deletions
+48
-14
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+23
-0
GitlabAbstractMember.java
...main/java/org/gitlab/api/models/GitlabAbstractMember.java
+20
-0
GitlabGroupMember.java
src/main/java/org/gitlab/api/models/GitlabGroupMember.java
+4
-0
GitlabProjectMember.java
src/main/java/org/gitlab/api/models/GitlabProjectMember.java
+1
-14
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
f377b902
...
@@ -87,6 +87,29 @@ public class GitlabAPI {
...
@@ -87,6 +87,29 @@ public class GitlabAPI {
return
retrieve
().
getAll
(
tailUrl
,
GitlabGroup
[].
class
);
return
retrieve
().
getAll
(
tailUrl
,
GitlabGroup
[].
class
);
}
}
/**
* Gets all members of a Group
*
* @param group The GitLab Group
*
* @return The Group Members
*/
public
List
<
GitlabGroupMember
>
getGroupMembers
(
GitlabGroup
group
)
throws
IOException
{
return
getGroupMembers
(
group
.
getId
());
}
/**
* Gets all members of a Group
*
* @param groupId The id of the GitLab Group
*
* @return The Group Members
*/
public
List
<
GitlabGroupMember
>
getGroupMembers
(
Integer
groupId
)
throws
IOException
{
String
tailUrl
=
GitlabGroup
.
URL
+
"/"
+
groupId
+
GitlabGroupMember
.
URL
;
return
Arrays
.
asList
(
retrieve
().
to
(
tailUrl
,
GitlabGroupMember
[].
class
));
}
/**
/**
* Creates a Group
* Creates a Group
*
*
...
...
src/main/java/org/gitlab/api/models/GitlabAbstractMember.java
0 → 100644
View file @
f377b902
package
org
.
gitlab
.
api
.
models
;
import
org.codehaus.jackson.annotate.JsonProperty
;
public
abstract
class
GitlabAbstractMember
extends
GitlabUser
{
public
static
final
String
URL
=
"/members"
;
@JsonProperty
(
"access_level"
)
private
int
_accessLevel
;
public
int
getAccessLevel
()
{
return
_accessLevel
;
}
public
void
setAccessLevel
(
int
accessLevel
)
{
_accessLevel
=
accessLevel
;
}
}
src/main/java/org/gitlab/api/models/GitlabGroupMember.java
0 → 100644
View file @
f377b902
package
org
.
gitlab
.
api
.
models
;
public
class
GitlabGroupMember
extends
GitlabAbstractMember
{
}
src/main/java/org/gitlab/api/models/GitlabProjectMember.java
View file @
f377b902
package
org
.
gitlab
.
api
.
models
;
package
org
.
gitlab
.
api
.
models
;
public
class
GitlabProjectMember
extends
GitlabUser
{
public
class
GitlabProjectMember
extends
GitlabAbstractMember
{
public
static
final
String
URL
=
"/members"
;
private
int
_accessLevel
;
public
int
getAccessLevel
()
{
return
_accessLevel
;
}
public
void
setAccessLevel
(
int
accessLevel
)
{
_accessLevel
=
accessLevel
;
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment