idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
158,500 | public Milestone updateMilestone ( Object projectIdOrPath , Integer milestoneId , String title , String description , Date dueDate , Date startDate , MilestoneState milestoneState ) throws GitLabApiException { if ( milestoneId == null ) { throw new RuntimeException ( "milestoneId cannot be null" ) ; } GitLabApiForm for... | Update the specified milestone . |
158,501 | public List < Issue > getIssues ( int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "issues" ) ; return ( response . readEntity ( new GenericType < List < Issue > > ( ) { } ) ) ; } | Get all issues the authenticated user has access to using the specified page and per page setting . Only returns issues created by the current user . |
158,502 | public Pager < Issue > getIssues ( int itemsPerPage ) throws GitLabApiException { return ( new Pager < Issue > ( this , Issue . class , itemsPerPage , null , "issues" ) ) ; } | Get a Pager of all issues the authenticated user has access to . Only returns issues created by the current user . |
158,503 | public Pager < Issue > getIssues ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Issue > ( this , Issue . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" ) ) ; } | Get a Pager of project s issues . |
158,504 | public Pager < Issue > getIssues ( IssueFilter filter , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = filter . getQueryParams ( ) ; return ( new Pager < Issue > ( this , Issue . class , itemsPerPage , formData . asMap ( ) , "issues" ) ) ; } | Get all issues the authenticated user has access to . By default it returns only issues created by the current user . |
158,505 | public Issue getIssue ( Object projectIdOrPath , Integer issueIid ) throws GitLabApiException { Response response = get ( Response . Status . OK , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid ) ; return ( response . readEntity ( Issue . class ) ) ; } | Get a single project issue . |
158,506 | public Optional < Issue > getOptionalIssue ( Object projectIdOrPath , Integer issueIid ) { try { return ( Optional . ofNullable ( getIssue ( projectIdOrPath , issueIid ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } } | Get a single project issue as an Optional instance . |
158,507 | public Issue closeIssue ( Object projectIdOrPath , Integer issueIid ) throws GitLabApiException { if ( issueIid == null ) { throw new RuntimeException ( "issue IID cannot be null" ) ; } GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "state_event" , StateEvent . CLOSE ) ; Response response = put ( Response... | Closes an existing project issue . |
158,508 | public Issue updateIssue ( Object projectIdOrPath , Integer issueIid , String title , String description , Boolean confidential , List < Integer > assigneeIds , Integer milestoneId , String labels , StateEvent stateEvent , Date updatedAt , Date dueDate ) throws GitLabApiException { if ( issueIid == null ) { throw new R... | Updates an existing project issue . This call can also be used to mark an issue as closed . |
158,509 | public void deleteIssue ( Object projectIdOrPath , Integer issueIid ) throws GitLabApiException { if ( issueIid == null ) { throw new RuntimeException ( "issue IID cannot be null" ) ; } Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; de... | Delete an issue . |
158,510 | public TimeStats resetSpentTime ( Object projectIdOrPath , Integer issueIid ) throws GitLabApiException { if ( issueIid == null ) { throw new RuntimeException ( "issue IID cannot be null" ) ; } Response response = post ( Response . Status . OK , new GitLabApiForm ( ) . asMap ( ) , "projects" , getProjectIdOrPath ( proj... | Resets the total spent time for this issue to 0 seconds . |
158,511 | public Optional < TimeStats > getOptionalTimeTrackingStats ( Object projectIdOrPath , Integer issueIid ) { try { return ( Optional . ofNullable ( getTimeTrackingStats ( projectIdOrPath , issueIid ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } } | Get time tracking stats as an Optional instance |
158,512 | public Pager < MergeRequest > getClosedByMergeRequests ( Object projectIdOrPath , Integer issueIid , int itemsPerPage ) throws GitLabApiException { return new Pager < MergeRequest > ( this , MergeRequest . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueIid , "closed_... | Get a Pager containing all the merge requests that will close issue when merged . |
158,513 | public final GitLabApi duplicate ( ) { Integer sudoUserId = this . getSudoAsId ( ) ; GitLabApi gitLabApi = new GitLabApi ( apiVersion , gitLabServerUrl , getTokenType ( ) , getAuthToken ( ) , getSecretToken ( ) , clientConfigProperties ) ; if ( sudoUserId != null ) { gitLabApi . apiClient . setSudoAsId ( sudoUserId ) ;... | Create a new GitLabApi instance that is logically a duplicate of this instance with the exception off sudo state . |
158,514 | 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 . |
158,515 | 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 . |
158,516 | 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 . |
158,517 | 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 . |
158,518 | 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 . |
158,519 | 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 . |
158,520 | 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 , "note... | Get a list of award emoji for the specified note . |
158,521 | 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"... | Get the specified award emoji for the specified issue . |
158,522 | 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" , me... | Get the specified award emoji for the specified merge request . |
158,523 | 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_... | Get the specified award emoji for the specified snippet . |
158,524 | 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" , getProje... | Add an award emoji for the specified note . |
158,525 | 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 . |
158,526 | 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 . |
158,527 | 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 . |
158,528 | 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 . |
158,529 | 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 . |
158,530 | 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 . |
158,531 | 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 . |
158,532 | 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 ( Respons... | Creates a branch for the project . Support as of version 6 . 8 . x |
158,533 | 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 ) , "... | Delete a single project repository branch . |
158,534 | 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 ( Bra... | Protects a single project repository branch . This is an idempotent function protecting an already protected repository branch will not produce an error . |
158,535 | 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 ( ... | Creates a tag on a particular ref of the given project . A message and release notes are optional . |
158,536 | 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 ) , "reposi... | Deletes the tag from a project with the specified tag name . |
158,537 | 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... | Get a list of contributors from a project and in the specified page range . |
158,538 | 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 . |
158,539 | 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 ) . tri... | Returns the project ID or path from the provided Integer String or Project instance . |
158,540 | 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 ... | Returns the group ID or path from the provided Integer String or Group instance . |
158,541 | 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 ) ... | Returns the user ID or path from the provided Integer String or User instance . |
158,542 | protected String urlEncode ( String s ) throws GitLabApiException { try { String encoded = URLEncoder . encode ( s , "UTF-8" ) ; encoded = encoded . replace ( "+" , "%20" ) ; encoded = encoded . replace ( "." , "%2E" ) ; encoded = encoded . replace ( "-" , "%2D" ) ; encoded = encoded . replace ( "_" , "%5F" ) ; return ... | Encode a string to be used as in - path argument for a gitlab api request . |
158,543 | 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 . |
158,544 | 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 . |
158,545 | 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 . |
158,546 | 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 . |
158,547 | protected Response validate ( Response response , Response . Status expected ) throws GitLabApiException { int responseCode = response . getStatus ( ) ; int expectedResponseCode = expected . getStatusCode ( ) ; if ( responseCode != expectedResponseCode ) { if ( expectedResponseCode > 204 || responseCode > 204 || expect... | 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 . |
158,548 | protected GitLabApiException handle ( Exception thrown ) { if ( thrown instanceof GitLabApiException ) { return ( ( GitLabApiException ) thrown ) ; } return ( new GitLabApiException ( thrown ) ) ; } | Wraps an exception in a GitLabApiException if needed . |
158,549 | 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 . |
158,550 | 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 ( ) ) ; retur... | Creates a MultivaluedMap instance containing the per_page param with the default value . |
158,551 | void enableRequestResponseLogging ( Logger logger , Level level , int maxEntityLength , List < String > maskedHeaderNames ) { MaskingLoggingFilter loggingFilter = new MaskingLoggingFilter ( logger , level , maxEntityLength , maskedHeaderNames ) ; clientConfig . register ( loggingFilter ) ; if ( apiClient != null ) { cr... | Enable the logging of the requests to and the responses from the GitLab server API . |
158,552 | 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 . |
158,553 | 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 . |
158,554 | 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 . |
158,555 | 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 . |
158,556 | 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 . |
158,557 | 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 . |
158,558 | 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 . |
158,559 | 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 . |
158,560 | 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 . |
158,561 | 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 . |
158,562 | public void setIgnoreCertificateErrors ( boolean ignoreCertificateErrors ) { if ( this . ignoreCertificateErrors == ignoreCertificateErrors ) { return ; } if ( ! ignoreCertificateErrors ) { this . ignoreCertificateErrors = false ; openSslContext = null ; openHostnameVerifier = null ; apiClient = null ; } else { if ( se... | Sets up the Jersey system ignore SSL certificate errors or not . |
158,563 | private boolean setupIgnoreCertificateErrors ( ) { TrustManager [ ] trustAllCerts = new TrustManager [ ] { new X509ExtendedTrustManager ( ) { public X509Certificate [ ] getAcceptedIssuers ( ) { return null ; } public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { }... | Sets up Jersey client to ignore certificate errors . |
158,564 | 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 ... | Get a list of jobs in a project in the specified page range . |
158,565 | 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 . |
158,566 | public Stream < Job > getJobsStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getJobs ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of jobs in a project . |
158,567 | 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 . |
158,568 | 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 . |
158,569 | 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_WILDCAR... | 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 . |
158,570 | 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 ... | Get an InputStream pointing to the job artifacts file for the specified job ID . |
158,571 | 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 |
158,572 | 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 . |
158,573 | 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 . |
158,574 | 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 . |
158,575 | 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 . |
158,576 | 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 . |
158,577 | 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... | Unmarshal the JSON data on the specified Reader instance and populate a List of instances of the provided returnType class . |
158,578 | 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 . |
158,579 | 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 ( JsonG... | Marshals the supplied object out as a formatted JSON string . |
158,580 | public static JsonNode toJsonNode ( String jsonString ) throws IOException { return ( JacksonJsonSingletonHelper . JACKSON_JSON . objectMapper . readTree ( jsonString ) ) ; } | Parse the provided String into a JsonNode instance . |
158,581 | 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 . |
158,582 | 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 < Li... | Get popular license templates . |
158,583 | 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 . |
158,584 | 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 ( ... | Get Health Checks from the liveness endpoint . |
158,585 | 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" , getProjec... | Activates the gitlab - ci service for a project . |
158,586 | 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" , "gitla... | Deletes the gitlab - ci service for a project . |
158,587 | 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 . |
158,588 | public HipChatService updateHipChatService ( Object projectIdOrPath , HipChatService hipChat ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "push_events" , hipChat . getPushEvents ( ) ) . withParam ( "issues_events" , hipChat . getIssuesEvents ( ) ) . withParam ( "confidentia... | Updates the HipChatService notification settings for a project . |
158,589 | 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 ( ) ... | Activates HipChatService notifications . |
158,590 | 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 . |
158,591 | public SlackService updateSlackService ( Object projectIdOrPath , SlackService slackNotifications ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "webhook" , slackNotifications . getWebhook ( ) , true ) . withParam ( "username" , slackNotifications . getUsername ( ) ) . withPa... | Updates the Slack notification settings for a project . |
158,592 | 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" , jir... | Updates the JIRA service settings for a project . |
158,593 | 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 , f... | Updates the ExternalWikiService service settings for a project . |
158,594 | public void handleEvent ( HttpServletRequest request ) throws GitLabApiException { String eventName = request . getHeader ( "X-Gitlab-Event" ) ; if ( eventName == null || eventName . trim ( ) . isEmpty ( ) ) { String message = "X-Gitlab-Event header is missing!" ; LOGGER . warning ( message ) ; return ; } if ( ! isVali... | Parses and verifies an SystemHookEvent instance from the HTTP request and fires it off to the registered listeners . |
158,595 | 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 . |
158,596 | 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 . |
158,597 | 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 . |
158,598 | 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" ) ; } G... | Update details of a runner . |
158,599 | 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 . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.