diff --git a/src/main/java/org/gitlab4j/api/GroupApi.java b/src/main/java/org/gitlab4j/api/GroupApi.java index 0f388bbc92d2f9946b4f24056e31ca03f136a768..ce5f7e15d1950168c2f0f0f64bcef7109d6a4f26 100644 --- a/src/main/java/org/gitlab4j/api/GroupApi.java +++ b/src/main/java/org/gitlab4j/api/GroupApi.java @@ -1124,7 +1124,7 @@ public class GroupApi extends AbstractApi { /** * Deletes a group variable. * - *
DELETE /groups/:id/variables/:key
+ *
GitLab Endpoint: DELETE /groups/:id/variables/:key
* * @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 @@ -1133,4 +1133,20 @@ public class GroupApi extends AbstractApi { public void deleteVariable(Object groupIdOrPath, String key) throws GitLabApiException { delete(Response.Status.NO_CONTENT, null, "groups", getGroupIdOrPath(groupIdOrPath), "variables", key); } + + /** + * Transfer a project to the Group namespace. Available only for admin users. + * + *
GitLab Endpoint: POST /groups/:id/projects/:project_id
+ * + * @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)); + } }