public MergeRequest cancelMergeRequest ( Object projectIdOrPath , Integer mergeRequestIid ) throws GitLabApiException { if ( mergeRequestIid == null ) { throw new RuntimeException ( "mergeRequestIid cannot be null" ) ; } Response response = put ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "cancel_merge_when_pipeline_succeeds" ) ; return ( response . readEntity ( MergeRequest . class ) ) ; }
Cancel merge when pipeline succeeds . If you don t have permissions to accept this merge request you ll get a 401 . If the merge request is already merged or closed you get 405 and error message Method Not Allowed . In case the merge request is not set to be merged when the pipeline succeeds you ll also get a 406 error .