idx
int64 0
41.2k
| question
stringlengths 83
4.15k
| target
stringlengths 5
715
|
|---|---|---|
34,500
|
public static String getContextStringProperty ( SensorContext context , String name , String def ) { String s = context . config ( ) . get ( name ) . orElse ( null ) ; if ( s == null || s . isEmpty ( ) ) { return def ; } return s ; }
|
Get string property from configuration . If the string is not set or empty return the default value .
|
34,501
|
public static String resolveFilename ( final String baseDir , final String filename ) { if ( filename != null ) { String normalizedPath = FilenameUtils . normalize ( filename ) ; if ( ( normalizedPath != null ) && ( new File ( normalizedPath ) . isAbsolute ( ) ) ) { return normalizedPath ; } normalizedPath = FilenameUtils . normalize ( baseDir + File . separator + filename ) ; if ( normalizedPath != null ) { return normalizedPath ; } } return null ; }
|
resolveFilename normalizes the report full path
|
34,502
|
protected void createMultiLocationViolation ( CxxReportIssue message ) { SourceFile sourceFile = getSourceFile ( ) ; Set < CxxReportIssue > messages = getMultiLocationCheckMessages ( sourceFile ) ; if ( messages == null ) { messages = new HashSet < > ( ) ; } messages . add ( message ) ; setMultiLocationViolation ( sourceFile , messages ) ; }
|
Add the given message to the current SourceFile object
|
34,503
|
public List < Epic > getEpics ( Object groupIdOrPath , Integer authorId , String labels , EpicOrderBy orderBy , SortOrder sortOrder , String search , int page , int perPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( page , perPage ) . withParam ( "author_id" , authorId ) . withParam ( "labels" , labels ) . withParam ( "order_by" , orderBy ) . withParam ( "sort" , sortOrder ) . withParam ( "search" , search ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" ) ; return ( response . readEntity ( new GenericType < List < Epic > > ( ) { } ) ) ; }
|
Gets all epics of the requested group and its subgroups using the specified page and per page setting .
|
34,504
|
public Epic getEpic ( Object groupIdOrPath , Integer epicIid ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid ) ; return ( response . readEntity ( Epic . class ) ) ; }
|
Get a single epic for the specified group .
|
34,505
|
public Optional < Epic > getOptionalEpic ( Object groupIdOrPath , Integer epicIid ) { try { return ( Optional . ofNullable ( getEpic ( groupIdOrPath , epicIid ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } }
|
Get an Optional instance with the value for the specific Epic .
|
34,506
|
public Epic createEpic ( Object groupIdOrPath , String title , String labels , String description , Date startDate , Date endDate ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "title" , title , true ) . withParam ( "labels" , labels ) . withParam ( "description" , description ) . withParam ( "start_date" , startDate ) . withParam ( "end_date" , endDate ) ; Response response = post ( Response . Status . CREATED , formData . asMap ( ) , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" ) ; return ( response . readEntity ( Epic . class ) ) ; }
|
Creates a new epic .
|
34,507
|
public Epic updateEpic ( Object groupIdOrPath , Integer epicIid , String title , String labels , String description , Date startDate , Date endDate ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "title" , title , true ) . withParam ( "labels" , labels ) . withParam ( "description" , description ) . withParam ( "start_date" , startDate ) . withParam ( "end_date" , endDate ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid ) ; return ( response . readEntity ( Epic . class ) ) ; }
|
Updates an existing epic .
|
34,508
|
public void deleteEpic ( Object groupIdOrPath , Integer epicIid ) throws GitLabApiException { delete ( Response . Status . NO_CONTENT , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid ) ; }
|
Deletes an epic .
|
34,509
|
public List < Epic > getEpicIssues ( Object groupIdOrPath , Integer epicIid ) throws GitLabApiException { return ( getEpicIssues ( groupIdOrPath , epicIid , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Gets all issues that are assigned to an epic and the authenticated user has access to .
|
34,510
|
public List < Epic > getEpicIssues ( Object groupIdOrPath , Integer epicIid , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid , "issues" ) ; return ( response . readEntity ( new GenericType < List < Epic > > ( ) { } ) ) ; }
|
Gets all issues that are assigned to an epic and the authenticated user has access to using the specified page and per page setting .
|
34,511
|
public Pager < Epic > getEpicIssues ( Object groupIdOrPath , Integer epicIid , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Epic > ( this , Epic . class , itemsPerPage , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid , "issues" ) ) ; }
|
Get a Pager of all issues that are assigned to an epic and the authenticated user has access to .
|
34,512
|
public Stream < Epic > getEpicIssuesStream ( Object groupIdOrPath , Integer epicIid ) throws GitLabApiException { return ( getEpicIssues ( groupIdOrPath , epicIid , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Gets all issues that are assigned to an epic and the authenticated user has access to as a Stream .
|
34,513
|
public EpicIssue assignIssue ( Object groupIdOrPath , Integer epicIid , Integer issueIid ) throws GitLabApiException { Response response = post ( Response . Status . CREATED , ( Form ) null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid , "issues" , issueIid ) ; return ( response . readEntity ( EpicIssue . class ) ) ; }
|
Creates an epic - issue association . If the issue in question belongs to another epic it is unassigned from that epic .
|
34,514
|
public EpicIssue removeIssue ( Object groupIdOrPath , Integer epicIid , Integer issueIid ) throws GitLabApiException { Response response = delete ( Response . Status . OK , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid , "issues" , issueIid ) ; return ( response . readEntity ( EpicIssue . class ) ) ; }
|
Remove an epic - issue association .
|
34,515
|
public EpicIssue updateIssue ( Object groupIdOrPath , Integer epicIid , Integer issueIid , Integer moveBeforeId , Integer moveAfterId ) throws GitLabApiException { GitLabApiForm form = new GitLabApiForm ( ) . withParam ( "move_before_id" , moveBeforeId ) . withParam ( "move_after_id" , moveAfterId ) ; Response response = post ( Response . Status . OK , form , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid , "issues" , issueIid ) ; return ( response . readEntity ( EpicIssue . class ) ) ; }
|
Updates an epic - issue association .
|
34,516
|
private String getHeaderValue ( Response response , String key ) throws GitLabApiException { String value = response . getHeaderString ( key ) ; value = ( value != null ? value . trim ( ) : null ) ; if ( value == null || value . length ( ) == 0 ) { return ( null ) ; } return ( value ) ; }
|
Get the specified header value from the Response instance .
|
34,517
|
private int getIntHeaderValue ( Response response , String key ) throws GitLabApiException { String value = getHeaderValue ( response , key ) ; if ( value == null ) { return - 1 ; } try { return ( Integer . parseInt ( value ) ) ; } catch ( NumberFormatException nfe ) { throw new GitLabApiException ( "Invalid '" + key + "' header value (" + value + ") from server" ) ; } }
|
Get the specified integer header value from the Response instance .
|
34,518
|
private void setPageParam ( int page ) { pageParam . set ( 0 , Integer . toString ( page ) ) ; queryParams . put ( PAGE_PARAM , pageParam ) ; }
|
Sets the page query parameter .
|
34,519
|
public List < T > page ( int pageNumber ) { if ( pageNumber > totalPages && pageNumber > kaminariNextPage ) { throw new NoSuchElementException ( ) ; } else if ( pageNumber < 1 ) { throw new NoSuchElementException ( ) ; } if ( currentPage == 0 && pageNumber == 1 ) { currentPage = 1 ; return ( currentItems ) ; } if ( currentPage == pageNumber ) { return ( currentItems ) ; } try { setPageParam ( pageNumber ) ; Response response = api . get ( Response . Status . OK , queryParams , pathArgs ) ; currentItems = mapper . readValue ( ( InputStream ) response . getEntity ( ) , javaType ) ; currentPage = pageNumber ; if ( kaminariNextPage > 0 ) { kaminariNextPage = getIntHeaderValue ( response , NEXT_PAGE_HEADER ) ; } return ( currentItems ) ; } catch ( GitLabApiException | IOException e ) { throw new RuntimeException ( e ) ; } }
|
Returns the specified page of List .
|
34,520
|
public List < T > all ( ) throws GitLabApiException { currentPage = 0 ; List < T > allItems = new ArrayList < > ( totalItems ) ; while ( hasNext ( ) ) { allItems . addAll ( next ( ) ) ; } return ( allItems ) ; }
|
Gets all the items from each page as a single List instance .
|
34,521
|
public Stream < T > stream ( ) throws GitLabApiException , IllegalStateException { if ( pagerStream == null ) { synchronized ( this ) { if ( pagerStream == null ) { currentPage = 0 ; Stream . Builder < T > streamBuilder = Stream . builder ( ) ; while ( hasNext ( ) ) { next ( ) . forEach ( streamBuilder ) ; } pagerStream = streamBuilder . build ( ) ; return ( pagerStream ) ; } } } throw new IllegalStateException ( "Stream already issued" ) ; }
|
Builds and returns a Stream instance which is pre - populated with all items from all pages .
|
34,522
|
public Stream < T > lazyStream ( ) throws IllegalStateException { if ( pagerStream == null ) { synchronized ( this ) { if ( pagerStream == null ) { currentPage = 0 ; pagerStream = StreamSupport . stream ( new PagerSpliterator < T > ( this ) , false ) ; return ( pagerStream ) ; } } } throw new IllegalStateException ( "Stream already issued" ) ; }
|
Creates a Stream instance for lazily streaming items from the GitLab server .
|
34,523
|
public void setMaskedHeaderNames ( final List < String > maskedHeaderNames ) { this . maskedHeaderNames . clear ( ) ; if ( maskedHeaderNames != null ) { maskedHeaderNames . forEach ( h -> { addMaskedHeaderName ( h ) ; } ) ; } }
|
Set the list of header names to mask values for . If null will clear the header names to mask .
|
34,524
|
public void addMaskedHeaderName ( String maskedHeaderName ) { if ( maskedHeaderName != null ) { maskedHeaderName = maskedHeaderName . trim ( ) ; if ( maskedHeaderName . length ( ) > 0 ) { maskedHeaderNames . add ( maskedHeaderName . toLowerCase ( ) ) ; } } }
|
Add a header name to the list of masked header names .
|
34,525
|
protected void printHeaders ( final StringBuilder sb , final long id , final String prefix , final MultivaluedMap < String , String > headers ) { getSortedHeaders ( headers . entrySet ( ) ) . forEach ( h -> { final List < ? > values = h . getValue ( ) ; final String header = h . getKey ( ) ; final boolean isMaskedHeader = maskedHeaderNames . contains ( header . toLowerCase ( ) ) ; if ( values . size ( ) == 1 ) { String value = ( isMaskedHeader ? "********" : values . get ( 0 ) . toString ( ) ) ; appendId ( sb , id ) . append ( prefix ) . append ( header ) . append ( ": " ) . append ( value ) . append ( '\n' ) ; } else { final StringBuilder headerBuf = new StringBuilder ( ) ; for ( final Object value : values ) { if ( headerBuf . length ( ) == 0 ) { headerBuf . append ( ", " ) ; } headerBuf . append ( isMaskedHeader ? "********" : value . toString ( ) ) ; } appendId ( sb , id ) . append ( prefix ) . append ( header ) . append ( ": " ) . append ( headerBuf . toString ( ) ) . append ( '\n' ) ; } } ) ; }
|
Logs each of the HTTP headers masking the value of the header if the header key is in the list of masked header names .
|
34,526
|
public List < Package > getPackages ( Object projectIdOrPath ) throws GitLabApiException { return ( getPackages ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of project packages . Both Maven and NPM packages are included in results . When accessed without authentication only packages of public projects are returned .
|
34,527
|
public List < Package > getPackages ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" ) ; return response . readEntity ( new GenericType < List < Package > > ( ) { } ) ; }
|
Get a list of project packages for the specified page . Both Maven and NPM packages are included in results . When accessed without authentication only packages of public projects are returned .
|
34,528
|
public Pager < Package > getPackages ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Package > ( this , Package . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" ) ) ; }
|
Get a Pager of project packages . Both Maven and NPM packages are included in results . When accessed without authentication only packages of public projects are returned .
|
34,529
|
public Stream < Package > getPackagesStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getPackages ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of project packages . Both Maven and NPM packages are included in results . When accessed without authentication only packages of public projects are returned .
|
34,530
|
public Package getPackage ( Object projectIdOrPath , Integer packageId ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" , packageId ) ; return ( response . readEntity ( Package . class ) ) ; }
|
Get a single project package .
|
34,531
|
public List < PackageFile > getPackageFiles ( Object projectIdOrPath , Integer packageId ) throws GitLabApiException { return ( getPackageFiles ( projectIdOrPath , packageId , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of package files of a single package .
|
34,532
|
public List < PackageFile > getPackageFiles ( Object projectIdOrPath , Integer packageId , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" , packageId , "package_files" ) ; return response . readEntity ( new GenericType < List < PackageFile > > ( ) { } ) ; }
|
Get a list of package files of a single package for the specified page .
|
34,533
|
public Pager < PackageFile > getPackageFiles ( Object projectIdOrPath , Integer packageId , int itemsPerPage ) throws GitLabApiException { return ( new Pager < PackageFile > ( this , PackageFile . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" , packageId , "package_files" ) ) ; }
|
Get a Pager of project package files .
|
34,534
|
public Stream < PackageFile > getPackagesStream ( Object projectIdOrPath , Integer packageId ) throws GitLabApiException { return ( getPackageFiles ( projectIdOrPath , packageId , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of project package files .
|
34,535
|
public void deletePackage ( Object projectIdOrPath , Integer packageId ) throws GitLabApiException { if ( packageId == null ) { throw new RuntimeException ( "packageId cannot be null" ) ; } delete ( Response . Status . NO_CONTENT , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "packages" , packageId ) ; }
|
Deletes a project package .
|
34,536
|
public List < Namespace > getNamespaces ( int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "namespaces" ) ; return ( response . readEntity ( new GenericType < List < Namespace > > ( ) { } ) ) ; }
|
Get a list of the namespaces of the authenticated user . If the user is an administrator a list of all namespaces in the GitLab instance is returned .
|
34,537
|
public Pager < Namespace > getNamespaces ( int itemsPerPage ) throws GitLabApiException { return ( new Pager < Namespace > ( this , Namespace . class , itemsPerPage , null , "namespaces" ) ) ; }
|
Get a Pager of the namespaces of the authenticated user . If the user is an administrator a Pager of all namespaces in the GitLab instance is returned .
|
34,538
|
public List < Namespace > findNamespaces ( String query ) throws GitLabApiException { return ( findNamespaces ( query , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get all namespaces that match a string in their name or path .
|
34,539
|
public List < Namespace > findNamespaces ( String query , int page , int perPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "search" , query , true ) . withParam ( PAGE_PARAM , page ) . withParam ( PER_PAGE_PARAM , perPage ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "namespaces" ) ; return ( response . readEntity ( new GenericType < List < Namespace > > ( ) { } ) ) ; }
|
Get all namespaces that match a string in their name or path in the specified page range .
|
34,540
|
public Pager < Namespace > findNamespaces ( String query , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "search" , query , true ) ; return ( new Pager < Namespace > ( this , Namespace . class , itemsPerPage , formData . asMap ( ) , "namespaces" ) ) ; }
|
Get a Pager of all namespaces that match a string in their name or path .
|
34,541
|
public Stream < Namespace > findNamespacesStream ( String query ) throws GitLabApiException { return ( findNamespaces ( query , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get all namespaces that match a string in their name or path as a Stream .
|
34,542
|
public void handleEvent ( HttpServletRequest request ) throws GitLabApiException { String eventName = request . getHeader ( "X-Gitlab-Event" ) ; if ( eventName == null || eventName . trim ( ) . isEmpty ( ) ) { LOGGER . warning ( "X-Gitlab-Event header is missing!" ) ; return ; } if ( ! isValidSecretToken ( request ) ) { String message = "X-Gitlab-Token mismatch!" ; LOGGER . warning ( message ) ; throw new GitLabApiException ( message ) ; } LOGGER . info ( "handleEvent: X-Gitlab-Event=" + eventName ) ; switch ( eventName ) { case BuildEvent . BUILD_HOOK_X_GITLAB_EVENT : case BuildEvent . JOB_HOOK_X_GITLAB_EVENT : case IssueEvent . X_GITLAB_EVENT : case MergeRequestEvent . X_GITLAB_EVENT : case NoteEvent . X_GITLAB_EVENT : case PipelineEvent . X_GITLAB_EVENT : case PushEvent . X_GITLAB_EVENT : case TagPushEvent . X_GITLAB_EVENT : case WikiPageEvent . X_GITLAB_EVENT : break ; default : String message = "Unsupported X-Gitlab-Event, event Name=" + eventName ; LOGGER . warning ( message ) ; throw new GitLabApiException ( message ) ; } try { Event event ; if ( LOGGER . isLoggable ( Level . FINE ) ) { LOGGER . fine ( HttpRequestUtils . getShortRequestDump ( eventName + " webhook" , true , request ) ) ; String postData = HttpRequestUtils . getPostDataAsString ( request ) ; LOGGER . fine ( "Raw POST data:\n" + postData ) ; event = jacksonJson . unmarshal ( Event . class , postData ) ; LOGGER . fine ( event . getObjectKind ( ) + " event:\n" + jacksonJson . marshal ( event ) + "\n" ) ; } else { InputStreamReader reader = new InputStreamReader ( request . getInputStream ( ) ) ; event = jacksonJson . unmarshal ( Event . class , reader ) ; } event . setRequestUrl ( request . getRequestURL ( ) . toString ( ) ) ; event . setRequestQueryString ( request . getQueryString ( ) ) ; fireEvent ( event ) ; } catch ( Exception e ) { LOGGER . warning ( "Error parsing JSON data, exception=" + e . getClass ( ) . getSimpleName ( ) + ", error=" + e . getMessage ( ) ) ; throw new GitLabApiException ( e ) ; } }
|
Parses and verifies an Event instance from the HTTP request and fires it off to the registered listeners .
|
34,543
|
public List < Event > getAuthenticatedUserEvents ( ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getAuthenticatedUserEvents ( action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of events for the authenticated user .
|
34,544
|
public Stream < Event > getAuthenticatedUserEventsStream ( ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getAuthenticatedUserEvents ( action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of events for the authenticated user .
|
34,545
|
public List < Event > getUserEvents ( Object userIdOrUsername , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getUserEvents ( userIdOrUsername , action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of events for the specified user .
|
34,546
|
public Pager < Event > getUserEvents ( Object userIdOrUsername , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "action" , action ) . withParam ( "target_type" , targetType != null ? targetType . toValue ( ) . toLowerCase ( ) : null ) . withParam ( "before" , before ) . withParam ( "after" , after ) . withParam ( "sort" , sortOrder ) ; return ( new Pager < Event > ( this , Event . class , itemsPerPage , formData . asMap ( ) , "users" , getUserIdOrUsername ( userIdOrUsername ) , "events" ) ) ; }
|
Get a list of events for the specified user and in the specified page range .
|
34,547
|
public Stream < Event > getUserEventsStream ( Object userIdOrUsername , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getUserEvents ( userIdOrUsername , action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of events for the specified user .
|
34,548
|
public List < Event > getProjectEvents ( Object projectIdOrPath , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getProjectEvents ( projectIdOrPath , action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of events for the specified project .
|
34,549
|
public List < Event > getProjectEvents ( Integer projectIdOrPath , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder , int page , int perPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "action" , action ) . withParam ( "target_type" , targetType != null ? targetType . toValue ( ) . toLowerCase ( ) : null ) . withParam ( "before" , before ) . withParam ( "after" , after ) . withParam ( "sort" , sortOrder ) . withParam ( PAGE_PARAM , page ) . withParam ( PER_PAGE_PARAM , perPage ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "events" ) ; return ( response . readEntity ( new GenericType < List < Event > > ( ) { } ) ) ; }
|
Get a list of events for the specified project and in the specified page range .
|
34,550
|
public Stream < Event > getProjectEventsStream ( Object projectIdOrPath , ActionType action , TargetType targetType , Date before , Date after , SortOrder sortOrder ) throws GitLabApiException { return ( getProjectEvents ( projectIdOrPath , action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of events for the specified project .
|
34,551
|
public Pager < Project > getProjects ( int itemsPerPage ) throws GitLabApiException { return ( new Pager < Project > ( this , Project . class , itemsPerPage , null , "projects" ) ) ; }
|
Get a Pager instance of projects accessible by the authenticated user .
|
34,552
|
public Pager < Project > getProjects ( Boolean archived , Visibility visibility , ProjectOrderBy orderBy , SortOrder sort , String search , Boolean simple , Boolean owned , Boolean membership , Boolean starred , Boolean statistics , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "archived" , archived ) . withParam ( "visibility" , visibility ) . withParam ( "order_by" , orderBy ) . withParam ( "sort" , sort ) . withParam ( "search" , search ) . withParam ( "simple" , simple ) . withParam ( "owned" , owned ) . withParam ( "membership" , membership ) . withParam ( "starred" , starred ) . withParam ( "statistics" , statistics ) ; return ( new Pager < Project > ( this , Project . class , itemsPerPage , formData . asMap ( ) , "projects" ) ) ; }
|
Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters . All filter parameters are optional .
|
34,553
|
public List < Project > getProjects ( String search ) throws GitLabApiException { return ( getProjects ( search , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of projects accessible by the authenticated user that match the provided search string .
|
34,554
|
public Pager < Project > getProjects ( String search , int itemsPerPage ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "search" , search ) ; return ( new Pager < Project > ( this , Project . class , itemsPerPage , formData . asMap ( ) , "projects" ) ) ; }
|
Get a Pager of projects accessible by the authenticated user that match the provided search string .
|
34,555
|
public Stream < Project > getProjectsStream ( String search ) throws GitLabApiException { return ( getProjects ( search , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of projects accessible by the authenticated user that match the provided search string .
|
34,556
|
public Pager < Project > getMemberProjects ( int itemsPerPage ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "membership" , true ) ; return ( new Pager < Project > ( this , Project . class , itemsPerPage , formData . asMap ( ) , "projects" ) ) ; }
|
Get a Pager of projects that the authenticated user is a member of .
|
34,557
|
public List < Project > getStarredProjects ( int page , int perPage ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "starred" , true ) . withParam ( PAGE_PARAM , page ) . withParam ( PER_PAGE_PARAM , perPage ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "projects" ) ; return ( response . readEntity ( new GenericType < List < Project > > ( ) { } ) ) ; }
|
Get a list of projects starred by the authenticated user in the specified page range .
|
34,558
|
public Pager < Project > getStarredProjects ( int itemsPerPage ) throws GitLabApiException { Form formData = new GitLabApiForm ( ) . withParam ( "starred" , true ) . withParam ( PER_PAGE_PARAM , getDefaultPerPage ( ) ) ; return ( new Pager < Project > ( this , Project . class , itemsPerPage , formData . asMap ( ) , "projects" ) ) ; }
|
Get a Pager of projects starred by the authenticated user .
|
34,559
|
public List < Project > getUserProjects ( Object userIdOrUsername , ProjectFilter filter ) throws GitLabApiException { return ( getUserProjects ( userIdOrUsername , filter , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of visible projects owned by the given user .
|
34,560
|
public List < Project > getUserProjects ( Object userIdOrUsername , ProjectFilter filter , int page , int perPage ) throws GitLabApiException { GitLabApiForm formData = filter . getQueryParams ( page , perPage ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "users" , getUserIdOrUsername ( userIdOrUsername ) , "projects" ) ; return ( response . readEntity ( new GenericType < List < Project > > ( ) { } ) ) ; }
|
Get a list of visible projects owned by the given user in the specified page range .
|
34,561
|
public Pager < Project > getUserProjects ( Object userIdOrUsername , ProjectFilter filter , int itemsPerPage ) throws GitLabApiException { GitLabApiForm formData = filter . getQueryParams ( ) ; return ( new Pager < Project > ( this , Project . class , itemsPerPage , formData . asMap ( ) , "users" , getUserIdOrUsername ( userIdOrUsername ) , "projects" ) ) ; }
|
Get a Pager of visible projects owned by the given user .
|
34,562
|
public Stream < Project > getUserProjectsStream ( Object userIdOrUsername , ProjectFilter filter ) throws GitLabApiException { return ( getUserProjects ( userIdOrUsername , filter , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of visible projects owned by the given user .
|
34,563
|
public Project createProject ( Integer groupId , String projectName ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "namespace_id" , groupId ) . withParam ( "name" , projectName , true ) ; Response response = post ( Response . Status . CREATED , formData , "projects" ) ; return ( response . readEntity ( Project . class ) ) ; }
|
Create a new project in the specified group .
|
34,564
|
public Project forkProject ( Object projectIdOrPath , String namespace ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "namespace" , namespace , true ) ; Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . CREATED ) ; Response response = post ( expectedStatus , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "fork" ) ; return ( response . readEntity ( Project . class ) ) ; }
|
Forks a project into the user namespace of the authenticated user or the one provided . The forking operation for a project is asynchronous and is completed in a background job . The request will return immediately .
|
34,565
|
public List < Member > getMembers ( Object projectIdOrPath ) throws GitLabApiException { return ( getMembers ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of project team members .
|
34,566
|
public List < Member > getMembers ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "members" ) ; return ( response . readEntity ( new GenericType < List < Member > > ( ) { } ) ) ; }
|
Get a list of project team members in the specified page range .
|
34,567
|
public Pager < Member > getMembers ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Member > ( this , Member . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "members" ) ) ; }
|
Get a Pager of project team members .
|
34,568
|
public Stream < Member > getMembersStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getMembers ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of project team members .
|
34,569
|
public Member addMember ( Object projectIdOrPath , Integer userId , Integer accessLevel ) throws GitLabApiException { return ( addMember ( projectIdOrPath , userId , accessLevel , null ) ) ; }
|
Adds a user to a project team . This is an idempotent method and can be called multiple times with the same parameters . Adding team membership to a user that is already a member does not affect the existing membership .
|
34,570
|
public Member updateMember ( Object projectIdOrPath , Integer userId , Integer accessLevel , Date expiresAt ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "access_level" , accessLevel , true ) . withParam ( "expires_at" , expiresAt , false ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "members" , userId ) ; return ( response . readEntity ( Member . class ) ) ; }
|
Updates a member of a project .
|
34,571
|
public void removeMember ( Object projectIdOrPath , Integer userId ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "members" , userId ) ; }
|
Removes user from project team .
|
34,572
|
public List < ProjectUser > getProjectUsers ( Object projectIdOrPath ) throws GitLabApiException { return ( getProjectUsers ( projectIdOrPath , null , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of project users . This list includes all project members and all users assigned to project parent groups .
|
34,573
|
public Pager < ProjectUser > getProjectUsers ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( getProjectUsers ( projectIdOrPath , null , itemsPerPage ) ) ; }
|
Get a Pager of project users . This Pager includes all project members and all users assigned to project parent groups .
|
34,574
|
public Stream < ProjectUser > getProjectUsersStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getProjectUsers ( projectIdOrPath , null , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of project users . This Stream includes all project members and all users assigned to project parent groups .
|
34,575
|
public List < ProjectUser > getProjectUsers ( Object projectIdOrPath , String search ) throws GitLabApiException { return ( getProjectUsers ( projectIdOrPath , search , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of project users matching the specified search string . This list includes all project members and all users assigned to project parent groups .
|
34,576
|
public Pager < ProjectUser > getProjectUsers ( Object projectIdOrPath , String search , int itemsPerPage ) throws GitLabApiException { MultivaluedMap < String , String > params = ( search != null ? new GitLabApiForm ( ) . withParam ( "search" , search ) . asMap ( ) : null ) ; return ( new Pager < ProjectUser > ( this , ProjectUser . class , itemsPerPage , params , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "users" ) ) ; }
|
Get a Pager of project users matching the specified search string . This Pager includes all project members and all users assigned to project parent groups .
|
34,577
|
public Stream < ProjectUser > getProjectUsersStream ( Object projectIdOrPath , String search ) throws GitLabApiException { return ( getProjectUsers ( projectIdOrPath , search , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of project users matching the specified search string . This Stream includes all project members and all users assigned to project parent groups .
|
34,578
|
public List < Event > getProjectEvents ( Object projectIdOrPath ) throws GitLabApiException { return ( getProjectEvents ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get the project events for specific project . Sorted from newest to latest .
|
34,579
|
public List < Event > getProjectEvents ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "events" ) ; return ( response . readEntity ( new GenericType < List < Event > > ( ) { } ) ) ; }
|
Get the project events for specific project . Sorted from newest to latest in the specified page range .
|
34,580
|
public Pager < Event > getProjectEvents ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Event > ( this , Event . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "events" ) ) ; }
|
Get a Pager of project events for specific project . Sorted from newest to latest .
|
34,581
|
public Stream < Event > getProjectEventsStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getProjectEvents ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of the project events for specific project . Sorted from newest to latest .
|
34,582
|
public List < ProjectHook > getHooks ( Object projectIdOrPath ) throws GitLabApiException { return ( getHooks ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of the project hooks for the specified project .
|
34,583
|
public List < ProjectHook > getHooks ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "hooks" ) ; return ( response . readEntity ( new GenericType < List < ProjectHook > > ( ) { } ) ) ; }
|
Get list of project hooks in the specified page range .
|
34,584
|
public Pager < ProjectHook > getHooks ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < ProjectHook > ( this , ProjectHook . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "hooks" ) ) ; }
|
Get Pager of project hooks .
|
34,585
|
public Stream < ProjectHook > getHooksStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getHooks ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of the project hooks for the specified project .
|
34,586
|
public ProjectHook getHook ( Object projectIdOrPath , Integer hookId ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "hooks" , hookId ) ; return ( response . readEntity ( ProjectHook . class ) ) ; }
|
Get a specific hook for project .
|
34,587
|
public Optional < ProjectHook > getOptionalHook ( Object projectIdOrPath , Integer hookId ) { try { return ( Optional . ofNullable ( getHook ( projectIdOrPath , hookId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } }
|
Get a specific hook for project as an Optional instance .
|
34,588
|
public void deleteHook ( Object projectIdOrPath , Integer hookId ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "hooks" , hookId ) ; }
|
Deletes a hook from the project .
|
34,589
|
public ProjectHook modifyHook ( ProjectHook hook ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "url" , hook . getUrl ( ) , true ) . withParam ( "push_events" , hook . getPushEvents ( ) , false ) . withParam ( "issues_events" , hook . getIssuesEvents ( ) , false ) . withParam ( "merge_requests_events" , hook . getMergeRequestsEvents ( ) , false ) . withParam ( "tag_push_events" , hook . getTagPushEvents ( ) , false ) . withParam ( "note_events" , hook . getNoteEvents ( ) , false ) . withParam ( "job_events" , hook . getJobEvents ( ) , false ) . withParam ( "pipeline_events" , hook . getPipelineEvents ( ) , false ) . withParam ( "wiki_events" , hook . getWikiPageEvents ( ) , false ) . withParam ( "enable_ssl_verification" , hook . getEnableSslVerification ( ) , false ) . withParam ( "token" , hook . getToken ( ) , false ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , hook . getProjectId ( ) , "hooks" , hook . getId ( ) ) ; return ( response . readEntity ( ProjectHook . class ) ) ; }
|
Modifies a hook for project .
|
34,590
|
public List < Issue > getIssues ( Object projectIdOrPath ) throws GitLabApiException { return ( getIssues ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of the project s issues .
|
34,591
|
public Stream < Issue > getIssuesStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getIssues ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of the project s issues .
|
34,592
|
public void deleteIssue ( Object projectIdOrPath , Integer issueId ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , getDefaultPerPageParam ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "issues" , issueId ) ; }
|
Delete a project issue .
|
34,593
|
public List < Snippet > getSnippets ( Object projectIdOrPath ) throws GitLabApiException { return ( getSnippets ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; }
|
Get a list of the project snippets .
|
34,594
|
public List < Snippet > getSnippets ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" ) ; return ( response . readEntity ( new GenericType < List < Snippet > > ( ) { } ) ) ; }
|
Get a list of project snippets .
|
34,595
|
public Pager < Snippet > getSnippets ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Snippet > ( this , Snippet . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" ) ) ; }
|
Get a Pager of project s snippets .
|
34,596
|
public Stream < Snippet > getSnippetsStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getSnippets ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; }
|
Get a Stream of the project snippets .
|
34,597
|
public Snippet getSnippet ( Object projectIdOrPath , Integer snippetId ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" , snippetId ) ; return ( response . readEntity ( Snippet . class ) ) ; }
|
Get a single of project snippet .
|
34,598
|
public Optional < Snippet > getOptionalSnippet ( Object projectIdOrPath , Integer snippetId ) { try { return ( Optional . ofNullable ( getSnippet ( projectIdOrPath , snippetId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } }
|
Get a single of project snippet as an Optional instance .
|
34,599
|
public Snippet createSnippet ( Object projectIdOrPath , String title , String filename , String description , String code , Visibility visibility ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "title" , title , true ) . withParam ( "file_name" , filename , true ) . withParam ( "description" , description ) . withParam ( "code" , code , true ) . withParam ( "visibility" , visibility , true ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" ) ; return ( response . readEntity ( Snippet . class ) ) ; }
|
Creates a new project snippet . The user must have permission to create new snippets .
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.