public MergeRequest approveMergeRequest ( Object projectIdOrPath , Integer mergeRequestIid , String sha ) throws GitLabApiException { if ( mergeRequestIid == null ) { throw new RuntimeException ( "mergeRequestIid cannot be null" ) ; } Form formData = new GitLabApiForm ( ) . withParam ( "sha" , sha ) ; Response response = post ( Response . Status . OK , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "approve" ) ; return ( response . readEntity ( MergeRequest . class ) ) ; }
Approve a merge request .