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
642e8abd
Commit
642e8abd
authored
May 24, 2017
by
David "novalis" Turner
Committed by
Tim Olshansky
May 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support creation of subgroups (#210)
... and every other group creation option that is presently documented.
parent
07dda996
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
0 deletions
+154
-0
GitlabAPI.java
src/main/java/org/gitlab/api/GitlabAPI.java
+29
-0
CreateGroupRequest.java
src/main/java/org/gitlab/api/models/CreateGroupRequest.java
+114
-0
GitlabGroup.java
src/main/java/org/gitlab/api/models/GitlabGroup.java
+11
-0
No files found.
src/main/java/org/gitlab/api/GitlabAPI.java
View file @
642e8abd
...
...
@@ -485,6 +485,35 @@ public class GitlabAPI {
}
/**
* Creates a Group
*
* @param request The project-creation request
* @param sudoUser The user to create the group on behalf of
*
* @return The GitLab Group
* @throws IOException on gitlab api call error
*/
public
GitlabGroup
createGroup
(
CreateGroupRequest
request
,
GitlabUser
sudoUser
)
throws
IOException
{
Query
query
=
new
Query
()
.
append
(
"name"
,
request
.
getName
())
.
append
(
"path"
,
request
.
getPath
())
.
appendIf
(
"ldap_cn"
,
request
.
getLdapCn
())
.
appendIf
(
"description"
,
request
.
getDescription
())
.
appendIf
(
"membershipLock"
,
request
.
getMembershipLock
())
.
appendIf
(
"share_with_group_lock"
,
request
.
getShareWithGroupLock
())
.
appendIf
(
"visibility"
,
request
.
getVisibility
())
.
appendIf
(
"lfs_enabled"
,
request
.
getLfsEnabled
())
.
appendIf
(
"request_access_enabled"
,
request
.
getRequestAccessEnabled
())
.
appendIf
(
"parent_id"
,
request
.
getParentId
())
.
appendIf
(
PARAM_SUDO
,
sudoUser
!=
null
?
sudoUser
.
getId
()
:
null
);
String
tailUrl
=
GitlabGroup
.
URL
+
query
.
toString
();
return
dispatch
().
to
(
tailUrl
,
GitlabGroup
.
class
);
}
/**
* Creates a Group
*
...
...
src/main/java/org/gitlab/api/models/CreateGroupRequest.java
0 → 100644
View file @
642e8abd
package
org
.
gitlab
.
api
.
models
;
public
class
CreateGroupRequest
{
public
CreateGroupRequest
(
String
name
)
{
this
(
name
,
name
);
}
public
CreateGroupRequest
(
String
name
,
String
path
)
{
this
.
name
=
name
;
this
.
path
=
path
;
}
private
String
name
;
private
String
path
;
private
String
ldapCn
;
private
String
description
;
private
Boolean
membershipLock
;
private
Boolean
shareWithGroupLock
;
private
Boolean
visibility
;
private
Boolean
lfsEnabled
;
private
Boolean
requestAccessEnabled
;
private
Integer
parentId
;
public
String
getName
()
{
return
name
;
}
public
CreateGroupRequest
setName
(
String
name
)
{
this
.
name
=
name
;
return
this
;
}
public
String
getPath
()
{
return
path
;
}
public
CreateGroupRequest
setPath
(
String
path
)
{
this
.
path
=
path
;
return
this
;
}
public
String
getLdapCn
()
{
return
ldapCn
;
}
public
CreateGroupRequest
setLdapCn
(
String
ldapCn
)
{
this
.
ldapCn
=
ldapCn
;
return
this
;
}
public
String
getDescription
()
{
return
description
;
}
public
CreateGroupRequest
setDescription
(
String
description
)
{
this
.
description
=
description
;
return
this
;
}
public
Boolean
getMembershipLock
()
{
return
membershipLock
;
}
public
CreateGroupRequest
setMembershipLock
(
Boolean
membershipLock
)
{
this
.
membershipLock
=
membershipLock
;
return
this
;
}
public
Boolean
getShareWithGroupLock
()
{
return
shareWithGroupLock
;
}
public
CreateGroupRequest
setShareWithGroupLock
(
Boolean
shareWithGroupLock
)
{
this
.
shareWithGroupLock
=
shareWithGroupLock
;
return
this
;
}
public
Boolean
getVisibility
()
{
return
visibility
;
}
public
CreateGroupRequest
setVisibility
(
Boolean
visibility
)
{
this
.
visibility
=
visibility
;
return
this
;
}
public
Boolean
getLfsEnabled
()
{
return
lfsEnabled
;
}
public
CreateGroupRequest
setLfsEnabled
(
Boolean
lfsEnabled
)
{
this
.
lfsEnabled
=
lfsEnabled
;
return
this
;
}
public
Boolean
getRequestAccessEnabled
()
{
return
requestAccessEnabled
;
}
public
CreateGroupRequest
setRequestAccessEnabled
(
Boolean
requestAccessEnabled
)
{
this
.
requestAccessEnabled
=
requestAccessEnabled
;
return
this
;
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
CreateGroupRequest
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
return
this
;
}
}
\ No newline at end of file
src/main/java/org/gitlab/api/models/GitlabGroup.java
View file @
642e8abd
...
...
@@ -24,14 +24,25 @@ public class GitlabGroup {
@JsonProperty
(
"web_url"
)
private
String
webUrl
;
@JsonProperty
(
"parent_id"
)
private
Integer
parentId
;
public
Integer
getId
()
{
return
id
;
}
public
Integer
getParentId
()
{
return
parentId
;
}
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
public
void
setParentId
(
Integer
parentId
)
{
this
.
parentId
=
parentId
;
}
public
String
getName
()
{
return
name
;
}
...
...
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