@@ -841,10 +841,11 @@ public void deleteProject(Project project) throws GitLabApiException {
841841 * @param namespace path of the namespace that the project will be forked to
842842 * @throws GitLabApiException if any exception occurs
843843 */
844- public void forkProject (Integer id , String namespace ) throws GitLabApiException {
844+ public Project forkProject (Integer id , String namespace ) throws GitLabApiException {
845845 GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespace , true );
846- Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
847- post (expectedStatus , formData , "projects" , id , "fork" );
846+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
847+ Response response = post (expectedStatus , formData , "projects" , id , "fork" );
848+ return (response .readEntity (Project .class ));
848849 }
849850
850851 /**
@@ -858,8 +859,8 @@ public void forkProject(Integer id, String namespace) throws GitLabApiException
858859 * @param namespace path of the namespace that the project will be forked to
859860 * @throws GitLabApiException if any exception occurs
860861 */
861- public void forkProject (Project project , String namespace ) throws GitLabApiException {
862- forkProject (project .getId (), namespace );
862+ public Project forkProject (Project project , String namespace ) throws GitLabApiException {
863+ return ( forkProject (project .getId (), namespace ) );
863864 }
864865
865866 /**
@@ -873,10 +874,11 @@ public void forkProject(Project project, String namespace) throws GitLabApiExcep
873874 * @param namespaceId ID of the namespace that the project will be forked to
874875 * @throws GitLabApiException if any exception occurs
875876 */
876- public void forkProject (Integer id , Integer namespaceId ) throws GitLabApiException {
877+ public Project forkProject (Integer id , Integer namespaceId ) throws GitLabApiException {
877878 GitLabApiForm formData = new GitLabApiForm ().withParam ("namespace" , namespaceId , true );
878- Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .NO_CONTENT );
879- post (expectedStatus , formData , "projects" , id , "fork" );
879+ Response .Status expectedStatus = (isApiVersion (ApiVersion .V3 ) ? Response .Status .OK : Response .Status .CREATED );
880+ Response response = post (expectedStatus , formData , "projects" , id , "fork" );
881+ return (response .readEntity (Project .class ));
880882 }
881883
882884 /**
@@ -890,8 +892,8 @@ public void forkProject(Integer id, Integer namespaceId) throws GitLabApiExcepti
890892 * @param namespaceId ID of the namespace that the project will be forked to
891893 * @throws GitLabApiException if any exception occurs
892894 */
893- public void forkProject (Project project , Integer namespaceId ) throws GitLabApiException {
894- forkProject (project .getId (), namespaceId );
895+ public Project forkProject (Project project , Integer namespaceId ) throws GitLabApiException {
896+ return ( forkProject (project .getId (), namespaceId ) );
895897 }
896898
897899 /**
0 commit comments