Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
佳 邓
Gitlab4j Api
Commits
72472908
Commit
72472908
authored
May 03, 2019
by
Greg Messner
Browse files
Added transferProject() (#311).
parent
a34185c0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/org/gitlab4j/api/GroupApi.java
View file @
72472908
...
@@ -1124,7 +1124,7 @@ public class GroupApi extends AbstractApi {
...
@@ -1124,7 +1124,7 @@ public class GroupApi extends AbstractApi {
/**
/**
* Deletes a group variable.
* Deletes a group variable.
*
*
* <pre><code>DELETE /groups/:id/variables/:key</code></pre>
* <pre><code>
GitLab Endpoint:
DELETE /groups/:id/variables/:key</code></pre>
*
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
* @param key the key of an existing variable, required
* @param key the key of an existing variable, required
...
@@ -1133,4 +1133,20 @@ public class GroupApi extends AbstractApi {
...
@@ -1133,4 +1133,20 @@ public class GroupApi extends AbstractApi {
public
void
deleteVariable
(
Object
groupIdOrPath
,
String
key
)
throws
GitLabApiException
{
public
void
deleteVariable
(
Object
groupIdOrPath
,
String
key
)
throws
GitLabApiException
{
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"variables"
,
key
);
delete
(
Response
.
Status
.
NO_CONTENT
,
null
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"variables"
,
key
);
}
}
/**
* Transfer a project to the Group namespace. Available only for admin users.
*
* <pre><code>GitLab Endpoint: POST /groups/:id/projects/:project_id</code></pre>
*
* @param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
* @param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
* @return the transfered Project instance
* @throws GitLabApiException if any exception occurs during execution
*/
public
Project
transferProject
(
Object
groupIdOrPath
,
Object
projectIdOrPath
)
throws
GitLabApiException
{
Response
response
=
post
(
Response
.
Status
.
CREATED
,
(
Form
)
null
,
"groups"
,
getGroupIdOrPath
(
groupIdOrPath
),
"projects"
,
getProjectIdOrPath
(
projectIdOrPath
));
return
(
response
.
readEntity
(
Project
.
class
));
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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