idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
157,900 | 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 . | 68 | 12 |
157,901 | 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 ( ' ' ) ; } 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 ( ' ' ) ; } } ) ; } | Logs each of the HTTP headers masking the value of the header if the header key is in the list of masked header names . | 296 | 27 |
157,902 | 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 . | 47 | 31 |
157,903 | 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 . | 95 | 35 |
157,904 | 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 . | 72 | 32 |
157,905 | 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 . | 48 | 31 |
157,906 | 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 . | 73 | 6 |
157,907 | 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 . | 55 | 11 |
157,908 | 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 . | 110 | 15 |
157,909 | 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 . | 88 | 9 |
157,910 | public Stream < PackageFile > getPackagesStream ( Object projectIdOrPath , Integer packageId ) throws GitLabApiException { return ( getPackageFiles ( projectIdOrPath , packageId , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of project package files . | 56 | 8 |
157,911 | 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 . | 83 | 6 |
157,912 | 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 . | 78 | 32 |
157,913 | 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 . | 54 | 34 |
157,914 | 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 . | 42 | 14 |
157,915 | 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 . | 132 | 19 |
157,916 | 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 . | 92 | 18 |
157,917 | 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 . | 43 | 17 |
157,918 | 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 . | 617 | 22 |
157,919 | 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 . | 72 | 10 |
157,920 | 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 . | 73 | 10 |
157,921 | 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 . | 81 | 10 |
157,922 | 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 . | 190 | 16 |
157,923 | 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 . | 82 | 10 |
157,924 | 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 . | 79 | 10 |
157,925 | 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 . | 228 | 16 |
157,926 | 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 . | 80 | 10 |
157,927 | 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 . | 50 | 13 |
157,928 | 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 . | 216 | 24 |
157,929 | 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 . | 41 | 17 |
157,930 | 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 . | 82 | 18 |
157,931 | 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 . | 42 | 17 |
157,932 | 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 . | 81 | 15 |
157,933 | 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 . | 123 | 16 |
157,934 | 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 . | 101 | 12 |
157,935 | 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 . | 57 | 12 |
157,936 | 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 . | 122 | 17 |
157,937 | 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 . | 103 | 13 |
157,938 | 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 . | 58 | 12 |
157,939 | 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 . | 98 | 9 |
157,940 | 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 . | 131 | 40 |
157,941 | public List < Member > getMembers ( Object projectIdOrPath ) throws GitLabApiException { return ( getMembers ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get a list of project team members . | 45 | 8 |
157,942 | 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 . | 96 | 13 |
157,943 | 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 . | 71 | 9 |
157,944 | public Stream < Member > getMembersStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getMembers ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of project team members . | 46 | 8 |
157,945 | 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 . | 47 | 45 |
157,946 | 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 . | 135 | 8 |
157,947 | 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 . | 90 | 7 |
157,948 | 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 . | 50 | 22 |
157,949 | 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 . | 49 | 24 |
157,950 | 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 . | 51 | 22 |
157,951 | 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 . | 53 | 27 |
157,952 | 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 . | 121 | 29 |
157,953 | 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 . | 54 | 27 |
157,954 | 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 . | 47 | 15 |
157,955 | 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 . | 97 | 20 |
157,956 | 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 . | 72 | 18 |
157,957 | 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 . | 48 | 18 |
157,958 | public List < ProjectHook > getHooks ( Object projectIdOrPath ) throws GitLabApiException { return ( getHooks ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get a list of the project hooks for the specified project . | 49 | 12 |
157,959 | 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 . | 102 | 11 |
157,960 | 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 . | 79 | 7 |
157,961 | public Stream < ProjectHook > getHooksStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getHooks ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of the project hooks for the specified project . | 50 | 12 |
157,962 | 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 . | 79 | 7 |
157,963 | 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 . | 79 | 11 |
157,964 | 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 . | 92 | 8 |
157,965 | 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 . | 333 | 7 |
157,966 | @ Deprecated public List < Issue > getIssues ( Object projectIdOrPath ) throws GitLabApiException { return ( getIssues ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get a list of the project s issues . | 50 | 9 |
157,967 | @ Deprecated public Stream < Issue > getIssuesStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getIssues ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of the project s issues . | 51 | 9 |
157,968 | @ Deprecated 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 . | 99 | 5 |
157,969 | public List < Snippet > getSnippets ( Object projectIdOrPath ) throws GitLabApiException { return ( getSnippets ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get a list of the project snippets . | 51 | 8 |
157,970 | 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 . | 104 | 7 |
157,971 | 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 . | 81 | 9 |
157,972 | public Stream < Snippet > getSnippetsStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getSnippets ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of the project snippets . | 52 | 8 |
157,973 | 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 . | 81 | 7 |
157,974 | 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 . | 81 | 11 |
157,975 | 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 . | 170 | 17 |
157,976 | public Snippet updateSnippet ( Object projectIdOrPath , Integer snippetId , String title , String filename , String description , String code , Visibility visibility ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "title" , title ) . withParam ( "file_name" , filename ) . withParam ( "description" , description ) . withParam ( "code" , code ) . withParam ( "visibility" , visibility ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" , snippetId ) ; return ( response . readEntity ( Snippet . class ) ) ; } | Updates an existing project snippet . The user must have permission to change an existing snippet . | 173 | 18 |
157,977 | public String getRawSnippetContent ( Object projectIdOrPath , Integer snippetId ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "snippets" , snippetId , "raw" ) ; return ( response . readEntity ( String . class ) ) ; } | Get the raw project snippet as plain text . | 83 | 9 |
157,978 | public Optional < String > getOptionalRawSnippetContent ( Object projectIdOrPath , Integer snippetId ) { try { return ( Optional . ofNullable ( getRawSnippetContent ( projectIdOrPath , snippetId ) ) ) ; } catch ( GitLabApiException glae ) { return ( GitLabApi . createOptionalFromException ( glae ) ) ; } } | Get the raw project snippet plain text as an Optional instance . | 83 | 12 |
157,979 | public void shareProject ( Object projectIdOrPath , Integer groupId , AccessLevel accessLevel , Date expiresAt ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "group_id" , groupId , true ) . withParam ( "group_access" , accessLevel , true ) . withParam ( "expires_at" , expiresAt ) ; post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "share" ) ; } | Share a project with the specified group . | 126 | 8 |
157,980 | public void unshareProject ( Object projectIdOrPath , Integer groupId ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . NO_CONTENT ) ; delete ( expectedStatus , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "share" , groupId ) ; } | Unshare the project from the group . | 91 | 8 |
157,981 | public Project archiveProject ( Object projectIdOrPath ) throws GitLabApiException { Response response = post ( Response . Status . CREATED , ( new GitLabApiForm ( ) ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "archive" ) ; return ( response . readEntity ( Project . class ) ) ; } | Archive a project | 76 | 4 |
157,982 | public PushRules getPushRules ( Object projectIdOrPath ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; return ( response . readEntity ( PushRules . class ) ) ; } | Get the project s push rules . | 71 | 7 |
157,983 | public PushRules createPushRules ( Object projectIdOrPath , PushRules pushRule ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "deny_delete_tag" , pushRule . getDenyDeleteTag ( ) ) . withParam ( "member_check" , pushRule . getMemberCheck ( ) ) . withParam ( "prevent_secrets" , pushRule . getPreventSecrets ( ) ) . withParam ( "commit_message_regex" , pushRule . getCommitMessageRegex ( ) ) . withParam ( "branch_name_regex" , pushRule . getBranchNameRegex ( ) ) . withParam ( "author_email_regex" , pushRule . getAuthorEmailRegex ( ) ) . withParam ( "file_name_regex" , pushRule . getFileNameRegex ( ) ) . withParam ( "max_file_size" , pushRule . getMaxFileSize ( ) ) ; Response response = post ( Response . Status . CREATED , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; return ( response . readEntity ( PushRules . class ) ) ; } | Adds a push rule to a specified project . | 282 | 9 |
157,984 | public PushRules updatePushRules ( Object projectIdOrPath , PushRules pushRule ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "deny_delete_tag" , pushRule . getDenyDeleteTag ( ) ) . withParam ( "member_check" , pushRule . getMemberCheck ( ) ) . withParam ( "prevent_secrets" , pushRule . getPreventSecrets ( ) ) . withParam ( "commit_message_regex" , pushRule . getCommitMessageRegex ( ) ) . withParam ( "branch_name_regex" , pushRule . getBranchNameRegex ( ) ) . withParam ( "author_email_regex" , pushRule . getAuthorEmailRegex ( ) ) . withParam ( "file_name_regex" , pushRule . getFileNameRegex ( ) ) . withParam ( "max_file_size" , pushRule . getMaxFileSize ( ) ) ; final Response response = putWithFormData ( Response . Status . OK , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; return ( response . readEntity ( PushRules . class ) ) ; } | Updates a push rule for the specified project . | 285 | 10 |
157,985 | public void deletePushRules ( Object projectIdOrPath ) throws GitLabApiException { delete ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "push_rule" ) ; } | Removes a push rule from a project . This is an idempotent method and can be called multiple times . Either the push rule is available or not . | 53 | 33 |
157,986 | public List < Project > getForks ( Object projectIdOrPath ) throws GitLabApiException { return ( getForks ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get a list of projects that were forked from the specified project . | 47 | 14 |
157,987 | public List < Project > getForks ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "forks" ) ; return ( response . readEntity ( new GenericType < List < Project > > ( ) { } ) ) ; } | Get a list of projects that were forked from the specified project and in the specified page range . | 98 | 20 |
157,988 | public Pager < Project > getForks ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return new Pager < Project > ( this , Project . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "forks" ) ; } | Get a Pager of projects that were forked from the specified project . | 71 | 15 |
157,989 | public Stream < Project > getForksStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getForks ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of projects that were forked from the specified project . | 48 | 14 |
157,990 | public Project starProject ( Object projectIdOrPath ) throws GitLabApiException { Response . Status expectedStatus = ( isApiVersion ( ApiVersion . V3 ) ? Response . Status . OK : Response . Status . CREATED ) ; Response response = post ( expectedStatus , ( Form ) null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "star" ) ; return ( response . readEntity ( Project . class ) ) ; } | Star a project . | 100 | 4 |
157,991 | public Map < String , Float > getProjectLanguages ( Object projectIdOrPath ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "languages" ) ; return ( response . readEntity ( new GenericType < Map < String , Float > > ( ) { } ) ) ; } | Get languages used in a project with percentage value . | 86 | 10 |
157,992 | public Project transferProject ( Object projectIdOrPath , String namespace ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "namespace" , namespace , true ) ; Response response = put ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "transfer" ) ; return ( response . readEntity ( Project . class ) ) ; } | Transfer a project to a new namespace . This was added in GitLab 11 . 1 | 105 | 17 |
157,993 | public Project setProjectAvatar ( Object projectIdOrPath , File avatarFile ) throws GitLabApiException { Response response = putUpload ( Response . Status . OK , "avatar" , avatarFile , "projects" , getProjectIdOrPath ( projectIdOrPath ) ) ; return ( response . readEntity ( Project . class ) ) ; } | Uploads and sets the project avatar for the specified project . | 75 | 12 |
157,994 | public List < Variable > getVariables ( Object projectIdOrPath ) throws GitLabApiException { return ( getVariables ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ; } | Get list of a project s variables . | 47 | 8 |
157,995 | public List < Variable > getVariables ( Object projectIdOrPath , int page , int perPage ) throws GitLabApiException { Response response = get ( Response . Status . OK , getPageQueryParams ( page , perPage ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "variables" ) ; return ( response . readEntity ( new GenericType < List < Variable > > ( ) { } ) ) ; } | Get a list of variables for the specified project in the specified page range . | 98 | 15 |
157,996 | public Pager < Variable > getVariables ( Object projectIdOrPath , int itemsPerPage ) throws GitLabApiException { return ( new Pager < Variable > ( this , Variable . class , itemsPerPage , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "variables" ) ) ; } | Get a Pager of variables belonging to the specified project . | 73 | 12 |
157,997 | public Stream < Variable > getVariablesStream ( Object projectIdOrPath ) throws GitLabApiException { return ( getVariables ( projectIdOrPath , getDefaultPerPage ( ) ) . stream ( ) ) ; } | Get a Stream of variables belonging to the specified project . | 48 | 11 |
157,998 | public Variable getVariable ( Object projectIdOrPath , String key ) throws GitLabApiException { Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "variables" , key ) ; return ( response . readEntity ( Variable . class ) ) ; } | Get the details of a project variable . | 72 | 8 |
157,999 | public Variable updateVariable ( Object projectIdOrPath , String key , String value , Boolean isProtected , String environmentScope ) throws GitLabApiException { GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "value" , value , true ) . withParam ( "protected" , isProtected ) . withParam ( "environment_scope" , environmentScope ) ; Response response = putWithFormData ( Response . Status . OK , formData , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "variables" , key ) ; return ( response . readEntity ( Variable . class ) ) ; } | Update a project variable . | 142 | 5 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.