idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
158,200 | public void enableRequestResponseLogging ( Logger logger , Level level , int maxEntitySize ) { enableRequestResponseLogging ( logger , level , maxEntitySize , MaskingLoggingFilter . DEFAULT_MASKED_HEADER_NAMES ) ; } | Enable the logging of the requests to and the responses from the GitLab server API using the specified logger . Logging will mask PRIVATE - TOKEN and Authorization headers . | 56 | 35 |
158,201 | public void enableRequestResponseLogging ( Level level , int maxEntitySize , List < String > maskedHeaderNames ) { apiClient . enableRequestResponseLogging ( LOGGER , level , maxEntitySize , maskedHeaderNames ) ; } | Enable the logging of the requests to and the responses from the GitLab server API using the GitLab4J shared Logger instance . | 49 | 27 |
158,202 | public void enableRequestResponseLogging ( Logger logger , Level level , int maxEntitySize , List < String > maskedHeaderNames ) { apiClient . enableRequestResponseLogging ( logger , level , maxEntitySize , maskedHeaderNames ) ; } | Enable the logging of the requests to and the responses from the GitLab server API using the specified logger . | 52 | 21 |
158,203 | public Version getVersion ( ) throws GitLabApiException { class VersionApi extends AbstractApi { VersionApi ( GitLabApi gitlabApi ) { super ( gitlabApi ) ; } } Response response = new VersionApi ( this ) . get ( Response . Status . OK , null , "version" ) ; return ( response . readEntity ( Version . class ) ) ; } | Get the version info for the GitLab server using the GitLab Version API . | 86 | 16 |
158,204 | protected static final < T > Optional < T > createOptionalFromException ( GitLabApiException glae ) { Optional < T > optional = Optional . empty ( ) ; optionalExceptionMap . put ( System . identityHashCode ( optional ) , glae ) ; return ( optional ) ; } | Create and return an Optional instance associated with a GitLabApiException . | 61 | 15 |
158,205 | public static final < T > T orElseThrow ( Optional < T > optional ) throws GitLabApiException { GitLabApiException glea = getOptionalException ( optional ) ; if ( glea != null ) { throw ( glea ) ; } return ( optional . get ( ) ) ; } | Return the Optional instances contained value if present otherwise throw the exception that is associated with the Optional instance . | 64 | 20 |
158,206 | public List < AwardEmoji > getNoteAwardEmojis ( Object projectIdOrPath , Integer issueIid , Integer noteId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( 1 , getDefaultPerPage ( ) ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "notes" , noteId , "award_emoji" ) ; return response . readEntity ( new GenericType < List < AwardEmoji > > ( ) { } ) ; } | Get a list of award emoji for the specified note . | 131 | 11 |
158,207 | public AwardEmoji getIssueAwardEmoji ( Object projectIdOrPath , Integer issueIid , Integer awardId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( 1 , getDefaultPerPage ( ) ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "award_emoji" , awardId ) ; return ( response . readEntity ( AwardEmoji . class ) ) ; } | Get the specified award emoji for the specified issue . | 115 | 10 |
158,208 | public AwardEmoji getMergeRequestAwardEmoji ( Object projectIdOrPath , Integer mergeRequestIid , Integer awardId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( 1 , getDefaultPerPage ( ) ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "award_emoji" , awardId ) ; return ( response . readEntity ( AwardEmoji . class ) ) ; } | Get the specified award emoji for the specified merge request . | 123 | 11 |
158,209 | public AwardEmoji getSnippetAwardEmoji ( Object projectIdOrPath , Integer snippetId , Integer awardId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( 1 , getDefaultPerPage ( ) ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" , snippetId , "award_emoji" , awardId ) ; return ( response . readEntity ( AwardEmoji . class ) ) ; } | Get the specified award emoji for the specified snippet . | 117 | 10 |
158,210 | public AwardEmoji addNoteAwardEmoji ( Object projectIdOrPath , Integer issueIid , Integer noteId , String name ) throws GitLabApiException { GitLabApiForm form = new GitLabApiForm ( ) . withParam ( "name" , name , true ) ; Response response = post ( Response . Status . CREATED , form . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "notes" , noteId , "award_emoji" ) ; return ( response . readEntity ( AwardEmoji . class ) ) ; } | Add an award emoji for the specified note . | 142 | 9 |
158,211 | public void deleteIssueAwardEmoji ( Object projectIdOrPath , Integer issueIid , Integer awardId ) throws GitLabApiException { delete ( Response . Status . NO_CONTENT , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "award_emoji" , awardId ) ; } | Delete an award emoji from the specified issue . | 82 | 9 |
158,212 | public void deleteMergeRequestAwardEmoji ( Object projectIdOrPath , Integer mergeRequestIid , Integer awardId ) throws GitLabApiException { delete ( Response . Status . NO_CONTENT , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "award_emoji" , awardId ) ; } | Delete an award emoji from the specified merge request . | 90 | 10 |
158,213 | public void deleteSnippetAwardEmoji ( Object projectIdOrPath , Integer snippetId , Integer awardId ) throws GitLabApiException { delete ( Response . Status . NO_CONTENT , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" , snippetId , "award_emoji" , awardId ) ; } | Delete an award emoji from the specified snippet . | 84 | 9 |
158,214 | public Pager < Branch > getBranches ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Branch > ( this , Branch . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" ) ) ; } | Get a Pager of repository branches from a project sorted by name alphabetically . | 79 | 16 |
158,215 | public Stream < Branch > getBranchesStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getBranches ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of repository branches from a project sorted by name alphabetically . | 48 | 15 |
158,216 | public Branch getBranch ( Object projectIdOrPath , String branchName ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" , urlEncode ( branchName ) ) ; return ( response . readEntity ( Branch . class ) ) ; } | Get a single project repository branch . | 86 | 7 |
158,217 | public Optional < Branch > getOptionalBranch ( Object projectIdOrPath , String branchName ) throws GitLabApiException { try { return ( Optional . ofNullable ( getBranch ( projectIdOrPath , branchName ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } } | Get an Optional instance with the value for the specific repository branch . | 83 | 13 |
158,218 | public Branch createBranch ( Object projectIdOrPath , String branchName , String ref ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( isApiVersion ( ApiVersion . V3 ) ? "branch_name" : "branch" , branchName , true ) . withParam ( "ref" , ref , true ) ; Response response = post ( Response . Status . CREATED , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" ) ; return ( response . readEntity ( Branch . class ) ) ; } | Creates a branch for the project . Support as of version 6 . 8 . x | 147 | 17 |
158,219 | public void deleteBranch ( Object projectIdOrPath , String branchName ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" , urlEncode ( branchName ) ) ; } | Delete a single project repository branch . | 103 | 7 |
158,220 | public Branch protectBranch ( Object projectIdOrPath , String branchName ) throws GitLabApiException { Response response = put ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "branches" , urlEncode ( branchName ) , "protect" ) ; return ( response . readEntity ( Branch . class ) ) ; } | Protects a single project repository branch . This is an idempotent function protecting an already protected repository branch will not produce an error . | 90 | 28 |
158,221 | public Tag createTag ( Object projectIdOrPath , String tagName , String ref , String message , String releaseNotes ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "tag_name" , tagName , true ) . withParam ( "ref" , ref , true ) . withParam ( "message" , message , false ) . withParam ( "release_description" , releaseNotes , false ) ; Response response = post ( Response . Status . CREATED , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "tags" ) ; return ( response . readEntity ( Tag . class ) ) ; } | Creates a tag on a particular ref of the given project . A message and release notes are optional . | 160 | 21 |
158,222 | public void deleteTag ( Object projectIdOrPath , String tagName ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "tags" , tagName ) ; } | Deletes the tag from a project with the specified tag name . | 96 | 13 |
158,223 | public List < Contributor > getContributors ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "contributors" ) ; return ( response . readEntity ( new GenericType < List < Contributor > > ( ) { } ) ) ; } | Get a list of contributors from a project and in the specified page range . | 107 | 15 |
158,224 | public Pager < Contributor > getContributors ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return new Pager < Contributor > ( this , Contributor . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "repository" , "contributors" ) ; } | Get a Pager of contributors from a project . | 81 | 10 |
158,225 | public Object getProjectIdOrPath ( Object obj ) throws GitLabApiException { if ( obj == null ) { throw ( new RuntimeException ( "Cannot determine ID or path from null object" ) ) ; } else if ( obj instanceof Integer ) { return ( obj ) ; } else if ( obj instanceof String ) { return ( urlEncode ( ( ( String ) obj ) . trim ( ) ) ) ; } else if ( obj instanceof Project ) { Integer id = ( ( Project ) obj ) . getId ( ) ; if ( id != null && id . intValue ( ) > 0 ) { return ( id ) ; } String path = ( ( Project ) obj ) . getPathWithNamespace ( ) ; if ( path != null && path . trim ( ) . length ( ) > 0 ) { return ( urlEncode ( path . trim ( ) ) ) ; } throw ( new RuntimeException ( "Cannot determine ID or path from provided Project instance" ) ) ; } else { throw ( new RuntimeException ( "Cannot determine ID or path from provided " + obj . getClass ( ) . getSimpleName ( ) + " instance, must be Integer, String, or a Project instance" ) ) ; } } | Returns the project ID or path from the provided Integer String or Project instance . | 261 | 15 |
158,226 | public Object getGroupIdOrPath ( Object obj ) throws GitLabApiException { if ( obj == null ) { throw ( new RuntimeException ( "Cannot determine ID or path from null object" ) ) ; } else if ( obj instanceof Integer ) { return ( obj ) ; } else if ( obj instanceof String ) { return ( urlEncode ( ( ( String ) obj ) . trim ( ) ) ) ; } else if ( obj instanceof Group ) { Integer id = ( ( Group ) obj ) . getId ( ) ; if ( id != null && id . intValue ( ) > 0 ) { return ( id ) ; } String path = ( ( Group ) obj ) . getFullPath ( ) ; if ( path != null && path . trim ( ) . length ( ) > 0 ) { return ( urlEncode ( path . trim ( ) ) ) ; } throw ( new RuntimeException ( "Cannot determine ID or path from provided Group instance" ) ) ; } else { throw ( new RuntimeException ( "Cannot determine ID or path from provided " + obj . getClass ( ) . getSimpleName ( ) + " instance, must be Integer, String, or a Group instance" ) ) ; } } | Returns the group ID or path from the provided Integer String or Group instance . | 259 | 15 |
158,227 | public Object getUserIdOrUsername ( Object obj ) throws GitLabApiException { if ( obj == null ) { throw ( new RuntimeException ( "Cannot determine ID or username from null object" ) ) ; } else if ( obj instanceof Integer ) { return ( obj ) ; } else if ( obj instanceof String ) { return ( urlEncode ( ( ( String ) obj ) . trim ( ) ) ) ; } else if ( obj instanceof User ) { Integer id = ( ( User ) obj ) . getId ( ) ; if ( id != null && id . intValue ( ) > 0 ) { return ( id ) ; } String username = ( ( User ) obj ) . getUsername ( ) ; if ( username != null && username . trim ( ) . length ( ) > 0 ) { return ( urlEncode ( username . trim ( ) ) ) ; } throw ( new RuntimeException ( "Cannot determine ID or username from provided User instance" ) ) ; } else { throw ( new RuntimeException ( "Cannot determine ID or username from provided " + obj . getClass ( ) . getSimpleName ( ) + " instance, must be Integer, String, or a User instance" ) ) ; } } | Returns the user ID or path from the provided Integer String or User instance . | 260 | 15 |
158,228 | protected String urlEncode ( String s ) throws GitLabApiException { try { String encoded = URLEncoder . encode ( s , "UTF-8" ) ; // Since the encode method encodes plus signs as %2B, // we can simply replace the encoded spaces with the correct encoding here encoded = encoded . replace ( "+" , "%20" ) ; encoded = encoded . replace ( "." , "%2E" ) ; encoded = encoded . replace ( "-" , "%2D" ) ; encoded = encoded . replace ( "_" , "%5F" ) ; return ( encoded ) ; } catch ( Exception e ) { throw new GitLabApiException ( e ) ; } } | Encode a string to be used as in - path argument for a gitlab api request . | 148 | 19 |
158,229 | protected Response post ( Response . Status expectedStatus , StreamingOutput stream , String mediaType , Object ... pathArgs ) throws GitLabApiException { try { return validate ( getApiClient ( ) . post ( stream , mediaType , pathArgs ) , expectedStatus ) ; } catch ( Exception e ) { throw handle ( e ) ; } } | Perform an HTTP POST call with the specified payload object and path objects returning a ClientResponse instance with the data returned from the endpoint . | 72 | 27 |
158,230 | protected Response upload ( Response . Status expectedStatus , String name , File fileToUpload , String mediaType , URL url ) throws GitLabApiException { try { return validate ( getApiClient ( ) . upload ( name , fileToUpload , mediaType , url ) , expectedStatus ) ; } catch ( Exception e ) { throw handle ( e ) ; } } | Perform a file upload with the specified File instance and path objects returning a ClientResponse instance with the data returned from the endpoint . | 77 | 26 |
158,231 | protected Response put ( Response . Status expectedStatus , MultivaluedMap < String , String > queryParams , Object ... pathArgs ) throws GitLabApiException { try { return validate ( getApiClient ( ) . put ( queryParams , pathArgs ) , expectedStatus ) ; } catch ( Exception e ) { throw handle ( e ) ; } } | Perform an HTTP PUT call with the specified form data and path objects returning a ClientResponse instance with the data returned from the endpoint . | 76 | 28 |
158,232 | protected Response putUpload ( Response . Status expectedStatus , String name , File fileToUpload , Object ... pathArgs ) throws GitLabApiException { try { return validate ( getApiClient ( ) . putUpload ( name , fileToUpload , pathArgs ) , expectedStatus ) ; } catch ( Exception e ) { throw handle ( e ) ; } } | Perform a file upload using the HTTP PUT method with the specified File instance and path objects returning a ClientResponse instance with the data returned from the endpoint . | 75 | 32 |
158,233 | protected Response validate ( Response response , Response . Status expected ) throws GitLabApiException { int responseCode = response . getStatus ( ) ; int expectedResponseCode = expected . getStatusCode ( ) ; if ( responseCode != expectedResponseCode ) { // If the expected code is 200-204 and the response code is 200-204 it is OK. We do this because // GitLab is constantly changing the expected code in the 200 to 204 range if ( expectedResponseCode > 204 || responseCode > 204 || expectedResponseCode < 200 || responseCode < 200 ) throw new GitLabApiException ( response ) ; } if ( ! getApiClient ( ) . validateSecretToken ( response ) ) { throw new GitLabApiException ( new NotAuthorizedException ( "Invalid secret token in response." ) ) ; } return ( response ) ; } | Validates response the response from the server against the expected HTTP status and the returned secret token if either is not correct will throw a GitLabApiException . | 178 | 32 |
158,234 | protected GitLabApiException handle ( Exception thrown ) { if ( thrown instanceof GitLabApiException ) { return ( ( GitLabApiException ) thrown ) ; } return ( new GitLabApiException ( thrown ) ) ; } | Wraps an exception in a GitLabApiException if needed . | 51 | 14 |
158,235 | protected MultivaluedMap < String , String > getPerPageQueryParam ( int perPage ) { return ( new GitLabApiForm ( ) . withParam ( PER_PAGE_PARAM , perPage ) . asMap ( ) ) ; } | Creates a MultivaluedMap instance containing the per_page param . | 54 | 15 |
158,236 | protected MultivaluedMap < String , String > getDefaultPerPageParam ( boolean customAttributesEnabled ) { GitLabApiForm form = new GitLabApiForm ( ) . withParam ( PER_PAGE_PARAM , getDefaultPerPage ( ) ) ; if ( customAttributesEnabled ) return ( form . withParam ( "with_custom_attributes" , true ) . asMap ( ) ) ; return ( form . asMap ( ) ) ; } | Creates a MultivaluedMap instance containing the per_page param with the default value . | 99 | 19 |
158,237 | void enableRequestResponseLogging ( Logger logger , Level level , int maxEntityLength , List < String > maskedHeaderNames ) { MaskingLoggingFilter loggingFilter = new MaskingLoggingFilter ( logger , level , maxEntityLength , maskedHeaderNames ) ; clientConfig . register ( loggingFilter ) ; // Recreate the Client instance if already created. if ( apiClient != null ) { createApiClient ( ) ; } } | Enable the logging of the requests to and the responses from the GitLab server API . | 92 | 17 |
158,238 | protected URL getApiUrl ( Object ... pathArgs ) throws IOException { String url = appendPathArgs ( this . hostUrl , pathArgs ) ; return ( new URL ( url ) ) ; } | Construct a REST URL with the specified path arguments . | 42 | 10 |
158,239 | protected URL getUrlWithBase ( Object ... pathArgs ) throws IOException { String url = appendPathArgs ( this . baseUrl , pathArgs ) ; return ( new URL ( url ) ) ; } | Construct a REST URL with the specified path arguments using Gitlab base url . | 42 | 15 |
158,240 | protected Response getWithAccepts ( MultivaluedMap < String , String > queryParams , String accepts , Object ... pathArgs ) throws IOException { URL url = getApiUrl ( pathArgs ) ; return ( getWithAccepts ( queryParams , url , accepts ) ) ; } | Perform an HTTP GET call with the specified query parameters and path objects returning a ClientResponse instance with the data returned from the endpoint . | 62 | 27 |
158,241 | protected Response head ( MultivaluedMap < String , String > queryParams , Object ... pathArgs ) throws IOException { URL url = getApiUrl ( pathArgs ) ; return ( head ( queryParams , url ) ) ; } | Perform an HTTP HEAD call with the specified query parameters and path objects returning a ClientResponse instance with the data returned from the endpoint . | 51 | 27 |
158,242 | protected Response head ( MultivaluedMap < String , String > queryParams , URL url ) { return ( invocation ( url , queryParams ) . head ( ) ) ; } | Perform an HTTP HEAD call with the specified query parameters and URL returning a ClientResponse instance with the data returned from the endpoint . | 38 | 26 |
158,243 | protected Response post ( Object payload , Object ... pathArgs ) throws IOException { URL url = getApiUrl ( pathArgs ) ; Entity < ? > entity = Entity . entity ( payload , MediaType . APPLICATION_JSON ) ; return ( invocation ( url , null ) . post ( entity ) ) ; } | Perform an HTTP POST call with the specified payload object and URL returning a ClientResponse instance with the data returned from the endpoint . | 65 | 26 |
158,244 | protected Response post ( StreamingOutput stream , String mediaType , Object ... pathArgs ) throws IOException { URL url = getApiUrl ( pathArgs ) ; return ( invocation ( url , null ) . post ( Entity . entity ( stream , mediaType ) ) ) ; } | Perform an HTTP POST call with the specified StreamingOutput MediaType and path objects returning a ClientResponse instance with the data returned from the endpoint . | 57 | 29 |
158,245 | protected Response upload ( String name , File fileToUpload , String mediaTypeString , Object ... pathArgs ) throws IOException { URL url = getApiUrl ( pathArgs ) ; return ( upload ( name , fileToUpload , mediaTypeString , null , url ) ) ; } | Perform a file upload using the specified media type returning a ClientResponse instance with the data returned from the endpoint . | 59 | 23 |
158,246 | protected Response delete ( MultivaluedMap < String , String > queryParams , Object ... pathArgs ) throws IOException { return ( delete ( queryParams , getApiUrl ( pathArgs ) ) ) ; } | Perform an HTTP DELETE call with the specified form data and path objects returning a Response instance with the data returned from the endpoint . | 46 | 28 |
158,247 | protected Response delete ( MultivaluedMap < String , String > queryParams , URL url ) { return ( invocation ( url , queryParams ) . delete ( ) ) ; } | Perform an HTTP DELETE call with the specified form data and URL returning a Response instance with the data returned from the endpoint . | 38 | 27 |
158,248 | public void setIgnoreCertificateErrors ( boolean ignoreCertificateErrors ) { if ( this . ignoreCertificateErrors == ignoreCertificateErrors ) { return ; } if ( ! ignoreCertificateErrors ) { this . ignoreCertificateErrors = false ; openSslContext = null ; openHostnameVerifier = null ; apiClient = null ; } else { if ( setupIgnoreCertificateErrors ( ) ) { this . ignoreCertificateErrors = true ; apiClient = null ; } else { this . ignoreCertificateErrors = false ; apiClient = null ; throw new RuntimeException ( "Unable to ignore certificate errors." ) ; } } } | Sets up the Jersey system ignore SSL certificate errors or not . | 145 | 13 |
158,249 | private boolean setupIgnoreCertificateErrors ( ) { // Create a TrustManager that trusts all certificates TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509ExtendedTrustManager ( ) { @ Override public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType , Socket socket ) throws CertificateException { } @ Override public void checkClientTrusted ( X509Certificate [ ] chain , String authType , SSLEngine engine ) throws CertificateException { } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType , Socket socket ) throws CertificateException { } @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType , SSLEngine engine ) throws CertificateException { } } } ; // Ignore differences between given hostname and certificate hostname HostnameVerifier hostnameVerifier = new HostnameVerifier ( ) { public boolean verify ( String hostname , SSLSession session ) { return true ; } } ; try { SSLContext sslContext = SSLContext . getInstance ( "TLS" ) ; sslContext . init ( null , trustAllCerts , new SecureRandom ( ) ) ; openSslContext = sslContext ; openHostnameVerifier = hostnameVerifier ; } catch ( GeneralSecurityException ex ) { openSslContext = null ; openHostnameVerifier = null ; return ( false ) ; } return ( true ) ; } | Sets up Jersey client to ignore certificate errors . | 395 | 10 |
158,250 | public List < Job > getJobs ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" ) ; return ( response . readEntity ( new GenericType < List < Job > > ( ) { } ) ) ; } | Get a list of jobs in a project in the specified page range . | 97 | 14 |
158,251 | public Pager < Job > getJobs ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Job > ( this , Job . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" ) ) ; } | Get a Pager of jobs in a project . | 72 | 10 |
158,252 | public Stream < Job > getJobsStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getJobs ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of jobs in a project . | 48 | 9 |
158,253 | public Job getJob ( Object projectIdOrPath , int jobId ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , jobId ) ; return ( response . readEntity ( Job . class ) ) ; } | Get single job in a project . | 73 | 7 |
158,254 | public Optional < Job > getOptionalJob ( Object projectIdOrPath , int jobId ) { try { return ( Optional . ofNullable ( getJob ( projectIdOrPath , jobId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } } | Get single job in a project as an Optional instance . | 75 | 11 |
158,255 | public InputStream downloadArtifactsFile ( Object projectIdOrPath , String ref , String jobName ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "job" , jobName , true ) ; Response response = getWithAccepts ( Response . Status . OK , formData . asMap ( ) , MediaType . MEDIA_TYPE_WILDCARD , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , "artifacts" , ref , "download" ) ; return ( response . readEntity ( InputStream . class ) ) ; } | Get an InputStream pointing to the artifacts file from the given reference name and job provided the job finished successfully . The file will be saved to the specified directory . If the file already exists in the directory it will be overwritten . | 135 | 46 |
158,256 | public InputStream downloadArtifactsFile ( Object projectIdOrPath , Integer jobId ) throws GitLabApiException { Response response = getWithAccepts ( Response . Status . OK , null , MediaType . MEDIA_TYPE_WILDCARD , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , jobId , "artifacts" ) ; return ( response . readEntity ( InputStream . class ) ) ; } | Get an InputStream pointing to the job artifacts file for the specified job ID . | 97 | 16 |
158,257 | public String getTrace ( Object projectIdOrPath , int jobId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , jobId , "trace" ) ; return ( response . readEntity ( String . class ) ) ; } | Get a trace of a specific job of a project | 84 | 10 |
158,258 | public Job playJob ( Object projectIdOrPath , int jobId ) throws GitLabApiException { GitLabApiForm formData = null ; Response response = post ( Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "jobs" , jobId , "play" ) ; return ( response . readEntity ( Job . class ) ) ; } | Play specified job in a project . | 87 | 7 |
158,259 | public JsonNode readTree ( String postData ) throws JsonParseException , JsonMappingException , IOException { return ( objectMapper . readTree ( postData ) ) ; } | Reads and parses the String containing JSON data and returns a JsonNode tree representation . | 42 | 19 |
158,260 | public JsonNode readTree ( Reader reader ) throws JsonParseException , JsonMappingException , IOException { return ( objectMapper . readTree ( reader ) ) ; } | Reads and parses the JSON data on the specified Reader instance to a JsonNode tree representation . | 40 | 21 |
158,261 | public < T > T unmarshal ( Class < T > returnType , Reader reader ) throws JsonParseException , JsonMappingException , IOException { ObjectMapper objectMapper = getContext ( returnType ) ; return ( objectMapper . readValue ( reader , returnType ) ) ; } | Unmarshal the JSON data on the specified Reader instance to an instance of the provided class . | 66 | 20 |
158,262 | public < T > T unmarshal ( Class < T > returnType , String postData ) throws JsonParseException , JsonMappingException , IOException { ObjectMapper objectMapper = getContext ( returnType ) ; return ( objectMapper . readValue ( postData , returnType ) ) ; } | Unmarshal the JSON data contained by the string and populate an instance of the provided returnType class . | 68 | 22 |
158,263 | public < T > List < T > unmarshalList ( Class < T > returnType , Reader reader ) throws JsonParseException , JsonMappingException , IOException { ObjectMapper objectMapper = getContext ( null ) ; CollectionType javaType = objectMapper . getTypeFactory ( ) . constructCollectionType ( List . class , returnType ) ; return ( objectMapper . readValue ( reader , javaType ) ) ; } | Unmarshal the JSON data on the specified Reader instance and populate a List of instances of the provided returnType class . | 96 | 25 |
158,264 | public < T > Map < String , T > unmarshalMap ( Class < T > returnType , Reader reader ) throws JsonParseException , JsonMappingException , IOException { ObjectMapper objectMapper = getContext ( null ) ; return ( objectMapper . readValue ( reader , new TypeReference < Map < String , T > > ( ) { } ) ) ; } | Unmarshal the JSON data on the specified Reader instance and populate a Map of String keys and values of the provided returnType class . | 84 | 28 |
158,265 | public < T > String marshal ( final T object ) { if ( object == null ) { throw new IllegalArgumentException ( "object parameter is null" ) ; } ObjectWriter writer = objectMapper . writer ( ) . withDefaultPrettyPrinter ( ) ; String results = null ; try { results = writer . writeValueAsString ( object ) ; } catch ( JsonGenerationException e ) { System . err . println ( "JsonGenerationException, message=" + e . getMessage ( ) ) ; } catch ( JsonMappingException e ) { e . printStackTrace ( ) ; System . err . println ( "JsonMappingException, message=" + e . getMessage ( ) ) ; } catch ( IOException e ) { System . err . println ( "IOException, message=" + e . getMessage ( ) ) ; } return ( results ) ; } | Marshals the supplied object out as a formatted JSON string . | 190 | 12 |
158,266 | public static JsonNode toJsonNode ( String jsonString ) throws IOException { return ( JacksonJsonSingletonHelper . JACKSON_JSON . objectMapper . readTree ( jsonString ) ) ; } | Parse the provided String into a JsonNode instance . | 45 | 12 |
158,267 | public List < LicenseTemplate > getAllLicenseTemplates ( ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "licenses" ) ; return ( response . readEntity ( new GenericType < List < LicenseTemplate > > ( ) { } ) ) ; } | Get all license templates . | 64 | 5 |
158,268 | public List < LicenseTemplate > getPopularLicenseTemplates ( ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "popular" , true , true ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "licenses" ) ; return ( response . readEntity ( new GenericType < List < LicenseTemplate > > ( ) { } ) ) ; } | Get popular license templates . | 96 | 5 |
158,269 | public LicenseTemplate getSingleLicenseTemplate ( String key ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "licenses" , key ) ; return ( response . readEntity ( LicenseTemplate . class ) ) ; } | Get a single license template . | 54 | 6 |
158,270 | public HealthCheckInfo getLiveness ( String token ) throws GitLabApiException { try { URL livenessUrl = getApiClient ( ) . getUrlWithBase ( "-" , "liveness" ) ; GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , false ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , livenessUrl ) ; return ( response . readEntity ( HealthCheckInfo . class ) ) ; } catch ( IOException ioe ) { throw ( new GitLabApiException ( ioe ) ) ; } } | Get Health Checks from the liveness endpoint . | 139 | 9 |
158,271 | public void setGitLabCI ( Object projectIdOrPath , String token , String projectCIUrl ) throws GitLabApiException { final Form formData = new Form ( ) ; formData . param ( "token" , token ) ; formData . param ( "project_url" , projectCIUrl ) ; put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "gitlab-ci" ) ; } | Activates the gitlab - ci service for a project . | 112 | 13 |
158,272 | public void deleteGitLabCI ( Object projectIdOrPath ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "gitlab-ci" ) ; } | Deletes the gitlab - ci service for a project . | 93 | 13 |
158,273 | public HipChatService getHipChatService ( Object projectIdOrPath ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "hipchat" ) ; return ( response . readEntity ( HipChatService . class ) ) ; } | Get the HipChatService notification configuration for a project . | 78 | 11 |
158,274 | public HipChatService updateHipChatService ( Object projectIdOrPath , HipChatService hipChat ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "push_events" , hipChat . getPushEvents ( ) ) . withParam ( "issues_events" , hipChat . getIssuesEvents ( ) ) . withParam ( "confidential_issues_events" , hipChat . getConfidentialIssuesEvents ( ) ) . withParam ( "merge_requests_events" , hipChat . getMergeRequestsEvents ( ) ) . withParam ( "tag_push_events" , hipChat . getTagPushEvents ( ) ) . withParam ( "note_events" , hipChat . getNoteEvents ( ) ) . withParam ( "confidential_note_events" , hipChat . getConfidentialNoteEvents ( ) ) . withParam ( "pipeline_events" , hipChat . getPipelineEvents ( ) ) . withParam ( "token" , hipChat . getToken ( ) , true ) . withParam ( "color" , hipChat . getColor ( ) ) . withParam ( "notify" , hipChat . getNotify ( ) ) . withParam ( "room" , hipChat . getRoom ( ) ) . withParam ( "api_version" , hipChat . getApiVersion ( ) ) . withParam ( "server" , hipChat . getServer ( ) ) . withParam ( "notify_only_broken_pipelines" , hipChat . getNotifyOnlyBrokenPipelines ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "hipchat" ) ; return ( response . readEntity ( HipChatService . class ) ) ; } | Updates the HipChatService notification settings for a project . | 421 | 12 |
158,275 | public void setHipChat ( Object projectIdOrPath , String token , String room , String server ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token ) . withParam ( "room" , room ) . withParam ( "server" , server ) ; put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "hipchat" ) ; } | Activates HipChatService notifications . | 119 | 7 |
158,276 | public SlackService getSlackService ( Object projectIdOrPath ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "slack" ) ; return ( response . readEntity ( SlackService . class ) ) ; } | Get the Slack notification settings for a project . | 75 | 9 |
158,277 | public SlackService updateSlackService ( Object projectIdOrPath , SlackService slackNotifications ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "webhook" , slackNotifications . getWebhook ( ) , true ) . withParam ( "username" , slackNotifications . getUsername ( ) ) . withParam ( "channel" , slackNotifications . getDefaultChannel ( ) ) . withParam ( "notify_only_broken_pipelines" , slackNotifications . getNotifyOnlyBrokenPipelines ( ) ) . withParam ( "notify_only_default_branch" , slackNotifications . getNotifyOnlyDefaultBranch ( ) ) . withParam ( "push_events" , slackNotifications . getPushEvents ( ) ) . withParam ( "issues_events" , slackNotifications . getIssuesEvents ( ) ) . withParam ( "confidential_issues_events" , slackNotifications . getConfidentialIssuesEvents ( ) ) . withParam ( "merge_requests_events" , slackNotifications . getMergeRequestsEvents ( ) ) . withParam ( "tag_push_events" , slackNotifications . getTagPushEvents ( ) ) . withParam ( "note_events" , slackNotifications . getNoteEvents ( ) ) . withParam ( "confidential_note_events" , slackNotifications . getConfidentialNoteEvents ( ) ) . withParam ( "pipeline_events" , slackNotifications . getPipelineEvents ( ) ) . withParam ( "wiki_page_events" , slackNotifications . getWikiPageEvents ( ) ) . withParam ( "push_channel" , slackNotifications . getPushChannel ( ) ) . withParam ( "issue_channel" , slackNotifications . getIssueChannel ( ) ) . withParam ( "confidential_issue_channel" , slackNotifications . getConfidentialIssueChannel ( ) ) . withParam ( "merge_request_channel" , slackNotifications . getMergeRequestChannel ( ) ) . withParam ( "note_channel" , slackNotifications . getNoteChannel ( ) ) . withParam ( "confidential_note_channel" , slackNotifications . getConfidentialNoteChannel ( ) ) . withParam ( "tag_push_channel" , slackNotifications . getTagPushChannel ( ) ) . withParam ( "pipeline_channel" , slackNotifications . getPipelineChannel ( ) ) . withParam ( "wiki_page_channel" , slackNotifications . getWikiPageChannel ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "slack" ) ; return ( response . readEntity ( SlackService . class ) ) ; } | Updates the Slack notification settings for a project . | 638 | 10 |
158,278 | public JiraService updateJiraService ( Object projectIdOrPath , JiraService jira ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "merge_requests_events" , jira . getMergeRequestsEvents ( ) ) . withParam ( "commit_events" , jira . getCommitEvents ( ) ) . withParam ( "url" , jira . getUrl ( ) , true ) . withParam ( "api_url" , jira . getApiUrl ( ) ) . withParam ( "project_key" , jira . getProjectKey ( ) ) . withParam ( "username" , jira . getUsername ( ) , true ) . withParam ( "password" , jira . getPassword ( ) , true ) . withParam ( "jira_issue_transition_id" , jira . getJiraIssueTransitionId ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "jira" ) ; return ( response . readEntity ( JiraService . class ) ) ; } | Updates the JIRA service settings for a project . | 275 | 12 |
158,279 | public ExternalWikiService updateExternalWikiService ( Object projectIdOrPath , ExternalWikiService externalWiki ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "external_wiki_url" , externalWiki . getExternalWikiUrl ( ) ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "services" , "external-wiki" ) ; return ( response . readEntity ( ExternalWikiService . class ) ) ; } | Updates the ExternalWikiService service settings for a project . | 129 | 12 |
158,280 | public Stream < Runner > getRunnersStream ( Runner . RunnerStatus scope ) throws GitLabApiException { return ( getRunners ( scope , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of all available runners available to the user with pagination support . | 45 | 16 |
158,281 | public Pager < Runner > getRunners ( Runner . RunnerStatus scope , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "scope" , scope , false ) ; return ( new Pager <> ( this , Runner . class , itemsPerPage , formData . asMap ( ) , "runners" ) ) ; } | Get a list of specific runners available to the user . | 90 | 11 |
158,282 | public RunnerDetail getRunnerDetail ( Integer runnerId ) throws GitLabApiException { if ( runnerId == null ) { throw new RuntimeException ( "runnerId cannot be null" ) ; } Response response = get ( Response . Status . OK , null , "runners" , runnerId ) ; return ( response . readEntity ( RunnerDetail . class ) ) ; } | Get details of a runner . | 80 | 6 |
158,283 | public RunnerDetail updateRunner ( Integer runnerId , String description , Boolean active , List < String > tagList , Boolean runUntagged , Boolean locked , RunnerDetail . RunnerAccessLevel accessLevel ) throws GitLabApiException { if ( runnerId == null ) { throw new RuntimeException ( "runnerId cannot be null" ) ; } GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "description" , description , false ) . withParam ( "active" , active , false ) . withParam ( "tag_list" , tagList , false ) . withParam ( "run_untagged" , runUntagged , false ) . withParam ( "locked" , locked , false ) . withParam ( "access_level" , accessLevel , false ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "runners" , runnerId ) ; return ( response . readEntity ( RunnerDetail . class ) ) ; } | Update details of a runner . | 215 | 6 |
158,284 | public void removeRunner ( Integer runnerId ) throws GitLabApiException { if ( runnerId == null ) { throw new RuntimeException ( "runnerId cannot be null" ) ; } delete ( Response . Status . NO_CONTENT , null , "runners" , runnerId ) ; } | Remove a runner . | 61 | 4 |
158,285 | public Runner enableRunner ( Object projectIdOrPath , Integer runnerId ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "runner_id" , runnerId , true ) ; Response response = post ( Response . Status . CREATED , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "runners" ) ; return ( response . readEntity ( Runner . class ) ) ; } | Enable an available specific runner in the project . | 109 | 9 |
158,286 | public RunnerDetail registerRunner ( String token , String description , Boolean active , List < String > tagList , Boolean runUntagged , Boolean locked , Integer maximumTimeout ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , true ) . withParam ( "description" , description , false ) . withParam ( "active" , active , false ) . withParam ( "locked" , locked , false ) . withParam ( "run_untagged" , runUntagged , false ) . withParam ( "tag_list" , tagList , false ) . withParam ( "maximum_timeout" , maximumTimeout , false ) ; Response response = post ( Response . Status . CREATED , formData . asMap ( ) , "runners" ) ; return ( response . readEntity ( RunnerDetail . class ) ) ; } | Register a new runner for the gitlab instance . | 195 | 10 |
158,287 | public void deleteRunner ( String token ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , true ) ; delete ( Response . Status . NO_CONTENT , formData . asMap ( ) , "runners" ) ; } | Deletes a registered Runner . | 69 | 6 |
158,288 | public boolean isValidSecretToken ( String secretToken ) { return ( this . secretToken == null || this . secretToken . equals ( secretToken ) ? true : false ) ; } | Validate the provided secret token against the reference secret token . Returns true if the secret token is valid or there is no reference secret token to validate against otherwise returns false . | 38 | 34 |
158,289 | public boolean isValidSecretToken ( HttpServletRequest request ) { if ( this . secretToken != null ) { String secretToken = request . getHeader ( "X-Gitlab-Token" ) ; return ( isValidSecretToken ( secretToken ) ) ; } return ( true ) ; } | Validate the provided secret token found in the HTTP header against the reference secret token . Returns true if the secret token is valid or there is no reference secret token to validate against otherwise returns false . | 64 | 39 |
158,290 | public List < Note > getIssueNotes ( Object projectIdOrPath , Integer issueIid , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "notes" ) ; return ( response . readEntity ( new GenericType < List < Note > > ( ) { } ) ) ; } | Get a list of the issue s notes using the specified page and per page settings . | 110 | 17 |
158,291 | public Stream < Note > getIssueNotesStream ( Object projectIdOrPath , Integer issueIid ) throws GitLabApiException { return ( getIssueNotes ( projectIdOrPath , issueIid , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of the issues s notes . | 57 | 9 |
158,292 | public Note getIssueNote ( Object projectIdOrPath , Integer issueIid , Integer noteId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "notes" , noteId ) ; return ( response . readEntity ( Note . class ) ) ; } | Get the specified issues s note . | 93 | 7 |
158,293 | public Note updateIssueNote ( Object projectIdOrPath , Integer issueIid , Integer noteId , String body ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "body" , body , true ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "notes" , noteId ) ; return ( response . readEntity ( Note . class ) ) ; } | Update the specified issues s note . | 125 | 7 |
158,294 | public List < Note > getMergeRequestNotes ( Object projectIdOrPath , Integer mergeRequestIid ) throws GitLabApiException { return ( getMergeRequestNotes ( projectIdOrPath , mergeRequestIid , null , null , getDefaultPerPage ( ) ) . all ( ) ) ; } | Gets a list of all notes for a single merge request | 66 | 12 |
158,295 | public List < Note > getMergeRequestNotes ( Object projectIdOrPath , Integer mergeRequestIid , SortOrder sortOrder , Note . OrderBy orderBy ) throws GitLabApiException { return ( getMergeRequestNotes ( projectIdOrPath , mergeRequestIid , sortOrder , orderBy , getDefaultPerPage ( ) ) . all ( ) ) ; } | Gets a list of all notes for a single merge request . | 80 | 13 |
158,296 | public Stream < Note > getMergeRequestNotesStream ( Object projectIdOrPath , Integer mergeRequestIid ) throws GitLabApiException { return ( getMergeRequestNotes ( projectIdOrPath , mergeRequestIid , null , null , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Gets a Stream of all notes for a single merge request | 67 | 12 |
158,297 | public Stream < Note > getMergeRequestNotesStream ( Object projectIdOrPath , Integer mergeRequestIid , SortOrder sortOrder , Note . OrderBy orderBy ) throws GitLabApiException { return ( getMergeRequestNotes ( projectIdOrPath , mergeRequestIid , sortOrder , orderBy , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Gets a Stream of all notes for a single merge request . | 81 | 13 |
158,298 | public Note getMergeRequestNote ( Object projectIdOrPath , Integer mergeRequestIid , Integer noteId ) throws GitLabApiException { Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "notes" , noteId ) ; return ( response . readEntity ( Note . class ) ) ; } | Get the specified merge request s note . | 101 | 8 |
158,299 | public Note createMergeRequestNote ( Object projectIdOrPath , Integer mergeRequestIid , String body ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "body" , body , true ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "merge_requests" , mergeRequestIid , "notes" ) ; return ( response . readEntity ( Note . class ) ) ; } | Create a merge request s note . | 122 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.