public SystemHook addSystemHook ( String url , String token , Boolean pushEvents , Boolean tagPushEvents , Boolean enablSsslVerification ) throws GitLabApiException { if ( url == null ) { throw new RuntimeException ( "url cannot be null" ) ; } GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "url" , url , true ) . withParam ( "token" , token ) . withParam ( "push_events" , pushEvents ) . withParam ( "tag_push_events" , tagPushEvents ) . withParam ( "enable_ssl_verification" , enablSsslVerification ) ; Response response = post ( Response . Status . CREATED , formData , "hooks" ) ; return ( response . readEntity ( SystemHook . class ) ) ; }
Add a new system hook . This method requires admin access .