Class ProjectApi

    • Constructor Detail

      • ProjectApi

        public ProjectApi​(GitLabApi gitLabApi)
    • Method Detail

      • getProjects

        public List<Project> getProjects()
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user.
        GET /projects
        Returns:
        a list of projects accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user and in the specified page range.
        GET /projects
        Parameters:
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public Pager<Project> getProjects​(int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager instance of projects accessible by the authenticated user.
        GET /projects
        Parameters:
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager instance of projects accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectsStream

        public Stream<Project> getProjectsStream()
                                          throws GitLabApiException
        Get a Stream of projects accessible by the authenticated user.
        GET /projects
        Returns:
        a Stream of projects accessible by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        @Deprecated
        public List<Project> getProjects​(Boolean archived,
                                         Visibility visibility,
                                         String orderBy,
                                         String sort,
                                         String search,
                                         Boolean simple,
                                         Boolean owned,
                                         Boolean membership,
                                         Boolean starred,
                                         Boolean statistics)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.
        GET /projects
        Parameters:
        archived - limit by archived status
        visibility - limit by visibility public, internal, or private
        orderBy - return projects ordered by id, name, path, created_at, updated_at, or last_activity_at fields, default is created_at
        sort - return projects sorted in asc or desc order. Default is desc
        search - return list of projects matching the search criteria
        simple - return only the ID, URL, name, and path of each project
        owned - limit by projects owned by the current user
        membership - limit by projects that the current user is a member of
        starred - limit by projects starred by the current user
        statistics - include project statistics
        Returns:
        a list of projects accessible by the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(Boolean archived,
                                         Visibility visibility,
                                         Constants.ProjectOrderBy orderBy,
                                         Constants.SortOrder sort,
                                         String search,
                                         Boolean simple,
                                         Boolean owned,
                                         Boolean membership,
                                         Boolean starred,
                                         Boolean statistics)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.
        GET /projects
        Parameters:
        archived - limit by archived status
        visibility - limit by visibility public, internal, or private
        orderBy - return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_AT
        sort - return projects sorted in asc or desc order. Default is desc
        search - return list of projects matching the search criteria
        simple - return only the ID, URL, name, and path of each project
        owned - limit by projects owned by the current user
        membership - limit by projects that the current user is a member of
        starred - limit by projects starred by the current user
        statistics - include project statistics
        Returns:
        a list of projects accessible by the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(Boolean archived,
                                         Visibility visibility,
                                         Constants.ProjectOrderBy orderBy,
                                         Constants.SortOrder sort,
                                         String search,
                                         Boolean simple,
                                         Boolean owned,
                                         Boolean membership,
                                         Boolean starred,
                                         Boolean statistics,
                                         int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.
        GET /projects
        Parameters:
        archived - limit by archived status
        visibility - limit by visibility public, internal, or private
        orderBy - return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_AT
        sort - return projects sorted in asc or desc order. Default is desc
        search - return list of projects matching the search criteria
        simple - return only the ID, URL, name, and path of each project
        owned - limit by projects owned by the current user
        membership - limit by projects that the current user is a member of
        starred - limit by projects starred by the current user
        statistics - include project statistics
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects accessible by the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public Pager<Project> getProjects​(Boolean archived,
                                          Visibility visibility,
                                          Constants.ProjectOrderBy orderBy,
                                          Constants.SortOrder sort,
                                          String search,
                                          Boolean simple,
                                          Boolean owned,
                                          Boolean membership,
                                          Boolean starred,
                                          Boolean statistics,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager of projects accessible by the authenticated user and matching the supplied filter parameters. All filter parameters are optional.
        GET /projects
        Parameters:
        archived - limit by archived status
        visibility - limit by visibility public, internal, or private
        orderBy - return projects ordered by ID, NAME, PATH, CREATED_AT, UPDATED_AT, or LAST_ACTIVITY_AT fields, default is CREATED_AT
        sort - return projects sorted in asc or desc order. Default is desc
        search - return list of projects matching the search criteria
        simple - return only the ID, URL, name, and path of each project
        owned - limit by projects owned by the current user
        membership - limit by projects that the current user is a member of
        starred - limit by projects starred by the current user
        statistics - include project statistics
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of projects accessible by the authenticated user and matching the supplied parameters
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(String search)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user that match the provided search string.
        GET /projects?search=search
        Parameters:
        search - the project name search criteria
        Returns:
        a list of projects accessible by the authenticated user that match the provided search string
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public List<Project> getProjects​(String search,
                                         int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of projects accessible by the authenticated user that match the provided search string.
        GET /projects?search=search
        Parameters:
        search - the project name search criteria
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects accessible by the authenticated user that match the provided search string
        Throws:
        GitLabApiException - if any exception occurs
      • getProjects

        public Pager<Project> getProjects​(String search,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager of projects accessible by the authenticated user that match the provided search string.
        GET /projects?search=search
        Parameters:
        search - the project name search criteria
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of projects accessible by the authenticated user that match the provided search string
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectsStream

        public Stream<Project> getProjectsStream​(String search)
                                          throws GitLabApiException
        Get a Stream of projects accessible by the authenticated user that match the provided search string.
        GET /projects?search=search
        Parameters:
        search - the project name search criteria
        Returns:
        a Stream of projects accessible by the authenticated user that match the provided search string
        Throws:
        GitLabApiException - if any exception occurs
      • getMemberProjects

        public List<Project> getMemberProjects()
                                        throws GitLabApiException
        Get a list of projects that the authenticated user is a member of.
        GET /projects?membership=true
        Returns:
        a list of projects that the authenticated user is a member of
        Throws:
        GitLabApiException - if any exception occurs
      • getMemberProjects

        public List<Project> getMemberProjects​(int page,
                                               int perPage)
                                        throws GitLabApiException
        Get a list of projects that the authenticated user is a member of in the specified page range.
        GET /projects?membership=true
        Parameters:
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects that the authenticated user is a member of
        Throws:
        GitLabApiException - if any exception occurs
      • getMemberProjects

        public Pager<Project> getMemberProjects​(int itemsPerPage)
                                         throws GitLabApiException
        Get a Pager of projects that the authenticated user is a member of.
        GET /projects?membership=true
        Parameters:
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager o Project instances that the authenticated user is a member of
        Throws:
        GitLabApiException - if any exception occurs
      • getMemberProjectsStream

        public Stream<Project> getMemberProjectsStream()
                                                throws GitLabApiException
        Get a Stream of projects that the authenticated user is a member of.
        GET /projects?membership=true
        Returns:
        a list of projects that the authenticated user is a member of
        Throws:
        GitLabApiException - if any exception occurs
      • getOwnedProjects

        public List<Project> getOwnedProjects()
                                       throws GitLabApiException
        Get a list of projects owned by the authenticated user.
        GET /projects?owned=true
        Returns:
        a list of projects owned by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getOwnedProjects

        public List<Project> getOwnedProjects​(int page,
                                              int perPage)
                                       throws GitLabApiException
        Get a list of projects owned by the authenticated user in the specified page range.
        GET /projects?owned=true
        Parameters:
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects owned by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getOwnedProjects

        public Pager<Project> getOwnedProjects​(int itemsPerPage)
                                        throws GitLabApiException
        Get a Pager of projects owned by the authenticated user.
        GET /projects?owned=true
        Parameters:
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a list of projects owned by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getOwnedProjectsStream

        public Stream<Project> getOwnedProjectsStream()
                                               throws GitLabApiException
        Get a Stream of projects owned by the authenticated user.
        GET /projects?owned=true
        Returns:
        a Stream of projects owned by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getStarredProjects

        public List<Project> getStarredProjects()
                                         throws GitLabApiException
        Get a list of projects starred by the authenticated user.
        GET /projects?starred=true
        Returns:
        a list of projects starred by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getStarredProjects

        public List<Project> getStarredProjects​(int page,
                                                int perPage)
                                         throws GitLabApiException
        Get a list of projects starred by the authenticated user in the specified page range.
        GET /projects?starred=true
        Parameters:
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of projects starred by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getStarredProjects

        public Pager<Project> getStarredProjects​(int itemsPerPage)
                                          throws GitLabApiException
        Get a Pager of projects starred by the authenticated user.
        GET /projects?starred=true
        Parameters:
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of projects starred by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getStarredProjectsStream

        public Stream<Project> getStarredProjectsStream()
                                                 throws GitLabApiException
        Get a Stream of projects starred by the authenticated user.
        GET /projects?starred=true
        Returns:
        a Stream of projects starred by the authenticated user
        Throws:
        GitLabApiException - if any exception occurs
      • getUserProjects

        public List<Project> getUserProjects​(Object userIdOrUsername,
                                             ProjectFilter filter)
                                      throws GitLabApiException
        Get a list of visible projects owned by the given user.
        GET /users/:user_id/projects
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        filter - the ProjectFilter instance holding the filter values for the query
        Returns:
        a list of visible projects owned by the given use
        Throws:
        GitLabApiException - if any exception occurs
      • getUserProjects

        public List<Project> getUserProjects​(Object userIdOrUsername,
                                             ProjectFilter filter,
                                             int page,
                                             int perPage)
                                      throws GitLabApiException
        Get a list of visible projects owned by the given user in the specified page range.
        GET /users/:user_id/projects
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        filter - the ProjectFilter instance holding the filter values for the query
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a list of visible projects owned by the given use
        Throws:
        GitLabApiException - if any exception occurs
      • getUserProjects

        public Pager<Project> getUserProjects​(Object userIdOrUsername,
                                              ProjectFilter filter,
                                              int itemsPerPage)
                                       throws GitLabApiException
        Get a Pager of visible projects owned by the given user.
        GET /users/:user_id/projects
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        filter - the ProjectFilter instance holding the filter values for the query
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of visible projects owned by the given use
        Throws:
        GitLabApiException - if any exception occurs
      • getUserProjectsStream

        public Stream<Project> getUserProjectsStream​(Object userIdOrUsername,
                                                     ProjectFilter filter)
                                              throws GitLabApiException
        Get a Stream of visible projects owned by the given user.
        GET /users/:user_id/projects
        Parameters:
        userIdOrUsername - the user ID, username of the user, or a User instance holding the user ID or username
        filter - the ProjectFilter instance holding the filter values for the query
        Returns:
        a Stream of visible projects owned by the given use
        Throws:
        GitLabApiException - if any exception occurs
      • getProject

        public Project getProject​(Object projectIdOrPath)
                           throws GitLabApiException
        Get a specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalProject

        public Optional<Project> getOptionalProject​(Object projectIdOrPath)
        Get an Optional instance with the value for the specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        an Optional instance with the specified project as a value
      • getProject

        public Project getProject​(Object projectIdOrPath,
                                  Boolean includeStatistics)
                           throws GitLabApiException
        Get a specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        includeStatistics - include project statistics
        Returns:
        the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalProject

        public Optional<Project> getOptionalProject​(Object projectIdOrPath,
                                                    Boolean includeStatistics)
        Get an Optional instance with the value for the specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        includeStatistics - include project statistics
        Returns:
        an Optional instance with the specified project as a value
      • getProject

        public Project getProject​(String namespace,
                                  String project)
                           throws GitLabApiException
        Get a specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        namespace - the name of the project namespace or group
        project - the name of the project to get
        Returns:
        the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalProject

        public Optional<Project> getOptionalProject​(String namespace,
                                                    String project)
        Get an Optional instance with the value for the specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        namespace - the name of the project namespace or group
        project - the name of the project
        Returns:
        an Optional instance with the specified project as a value
      • getProject

        public Project getProject​(String namespace,
                                  String project,
                                  Boolean includeStatistics)
                           throws GitLabApiException
        Get a specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        namespace - the name of the project namespace or group
        project - the name of the project to get
        includeStatistics - include project statistics
        Returns:
        the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalProject

        public Optional<Project> getOptionalProject​(String namespace,
                                                    String project,
                                                    Boolean includeStatistics)
        Get an Optional instance with the value for the specific project, which is owned by the authentication user.
        GET /projects/:id
        Parameters:
        namespace - the name of the project namespace or group
        project - the name of the project
        includeStatistics - include project statistics
        Returns:
        an Optional instance with the specified project as a value
      • createProject

        public Project createProject​(Integer groupId,
                                     String projectName)
                              throws GitLabApiException
        Create a new project in the specified group.
        Parameters:
        groupId - the group ID to create the project under
        projectName - the name of the project top create
        Returns:
        the created project
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        public Project createProject​(String projectName)
                              throws GitLabApiException
        Create a new project with the current user's namespace.
        Parameters:
        projectName - the name of the project top create
        Returns:
        the created project
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        public Project createProject​(Project project)
                              throws GitLabApiException
        Creates new project owned by the current user.
        Parameters:
        project - the Project instance with the configuration for the new project
        Returns:
        a Project instance with the newly created project info
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        public Project createProject​(Project project,
                                     String importUrl)
                              throws GitLabApiException
        Creates new project owned by the current user. The following properties on the Project instance are utilized in the creation of the project: name (name or path are required) - new project name path (name or path are required) - new project path defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private visibilityLevel (optional) issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lLfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push initialize_with_readme (optional) - Initialize project with README file packagesEnabled (optional) - Enable or disable mvn packages repository feature
        Parameters:
        project - the Project instance with the configuration for the new project
        importUrl - the URL to import the repository from
        Returns:
        a Project instance with the newly created project info
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        public Project createProject​(String name,
                                     Integer namespaceId,
                                     String description,
                                     Boolean issuesEnabled,
                                     Boolean mergeRequestsEnabled,
                                     Boolean wikiEnabled,
                                     Boolean snippetsEnabled,
                                     Visibility visibility,
                                     Integer visibilityLevel,
                                     String importUrl)
                              throws GitLabApiException
        Creates a Project
        Parameters:
        name - The name of the project
        namespaceId - The Namespace for the new project, otherwise null indicates to use the GitLab default (user)
        description - A description for the project, null otherwise
        issuesEnabled - Whether Issues should be enabled, otherwise null indicates to use GitLab default
        mergeRequestsEnabled - Whether Merge Requests should be enabled, otherwise null indicates to use GitLab default
        wikiEnabled - Whether a Wiki should be enabled, otherwise null indicates to use GitLab default
        snippetsEnabled - Whether Snippets should be enabled, otherwise null indicates to use GitLab default
        visibility - The visibility of the project, otherwise null indicates to use GitLab default
        visibilityLevel - The visibility level of the project, otherwise null indicates to use GitLab default
        importUrl - The Import URL for the project, otherwise null
        Returns:
        the GitLab Project
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        public Project createProject​(String name,
                                     Integer namespaceId,
                                     String description,
                                     Boolean issuesEnabled,
                                     Boolean mergeRequestsEnabled,
                                     Boolean wikiEnabled,
                                     Boolean snippetsEnabled,
                                     Visibility visibility,
                                     Integer visibilityLevel,
                                     Boolean printingMergeRequestLinkEnabled,
                                     String importUrl)
                              throws GitLabApiException
        Creates a Project
        Parameters:
        name - The name of the project
        namespaceId - The Namespace for the new project, otherwise null indicates to use the GitLab default (user)
        description - A description for the project, null otherwise
        issuesEnabled - Whether Issues should be enabled, otherwise null indicates to use GitLab default
        mergeRequestsEnabled - Whether Merge Requests should be enabled, otherwise null indicates to use GitLab default
        wikiEnabled - Whether a Wiki should be enabled, otherwise null indicates to use GitLab default
        snippetsEnabled - Whether Snippets should be enabled, otherwise null indicates to use GitLab default
        visibility - The visibility of the project, otherwise null indicates to use GitLab default
        visibilityLevel - The visibility level of the project, otherwise null indicates to use GitLab default
        printingMergeRequestLinkEnabled - Show link to create/view merge request when pushing from the command line
        importUrl - The Import URL for the project, otherwise null
        Returns:
        the GitLab Project
        Throws:
        GitLabApiException - if any exception occurs
      • createProject

        @Deprecated
        public Project createProject​(String name,
                                     Integer namespaceId,
                                     String description,
                                     Boolean issuesEnabled,
                                     Boolean mergeRequestsEnabled,
                                     Boolean wikiEnabled,
                                     Boolean snippetsEnabled,
                                     Boolean isPublic,
                                     Integer visibilityLevel,
                                     String importUrl)
                              throws GitLabApiException
        Creates a Project
        Parameters:
        name - The name of the project
        namespaceId - The Namespace for the new project, otherwise null indicates to use the GitLab default (user)
        description - A description for the project, null otherwise
        issuesEnabled - Whether Issues should be enabled, otherwise null indicates to use GitLab default
        mergeRequestsEnabled - Whether Merge Requests should be enabled, otherwise null indicates to use GitLab default
        wikiEnabled - Whether a Wiki should be enabled, otherwise null indicates to use GitLab default
        snippetsEnabled - Whether Snippets should be enabled, otherwise null indicates to use GitLab default
        isPublic - Whether the project is public or private, if true same as setting visibilityLevel = 20, otherwise null indicates to use GitLab default
        visibilityLevel - The visibility level of the project, otherwise null indicates to use GitLab default
        importUrl - The Import URL for the project, otherwise null
        Returns:
        the GitLab Project
        Throws:
        GitLabApiException - if any exception occurs
      • updateProject

        public Project updateProject​(Project project)
                              throws GitLabApiException
        Updates a project. The following properties on the Project instance are utilized in the edit of the project, null values are not updated: id (required) - existing project id, either id or path must be provided name (optional) - project name path (optional) - project path, either id or path must be provided defaultBranch (optional) - master by default description (optional) - short project description visibility (optional) - Limit by visibility public, internal, or private issuesEnabled (optional) - Enable issues for this project mergeMethod (optional) - Set the merge method used mergeRequestsEnabled (optional) - Enable merge requests for this project wikiEnabled (optional) - Enable wiki for this project snippetsEnabled (optional) - Enable snippets for this project jobsEnabled (optional) - Enable jobs for this project containerRegistryEnabled (optional) - Enable container registry for this project sharedRunnersEnabled (optional) - Enable shared runners for this project publicJobs (optional) - If true, jobs can be viewed by non-project-members onlyAllowMergeIfPipelineSucceeds (optional) - Set whether merge requests can only be merged with successful jobs onlyAllowMergeIfAllDiscussionsAreResolved (optional) - Set whether merge requests can only be merged when all the discussions are resolved lLfsEnabled (optional) - Enable LFS requestAccessEnabled (optional) - Allow users to request member access repositoryStorage (optional) - Which storage shard the repository is on. Available only to admins approvalsBeforeMerge (optional) - How many approvers should approve merge request by default printingMergeRequestLinkEnabled (optional) - Show link to create/view merge request when pushing from the command line resolveOutdatedDiffDiscussions (optional) - Automatically resolve merge request diffs discussions on lines changed with a push packagesEnabled (optional) - Enable or disable mvn packages repository feature NOTE: The following parameters specified by the GitLab API edit project are not supported: import_url tag_list array avatar ci_config_path initialize_with_readme
        Parameters:
        project - the Project instance with the configuration for the new project
        Returns:
        a Project instance with the newly updated project info
        Throws:
        GitLabApiException - if any exception occurs
      • deleteProject

        public void deleteProject​(Object projectIdOrPath)
                           throws GitLabApiException
        Removes project with all resources(issues, merge requests etc).
        DELETE /projects/:id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • forkProject

        public Project forkProject​(Object projectIdOrPath,
                                   String namespace)
                            throws GitLabApiException
        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.
        POST /projects/:id/fork
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        namespace - path of the namespace that the project will be forked to
        Returns:
        the newly forked Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • forkProject

        public Project forkProject​(Object projectIdOrPath,
                                   Integer namespaceId)
                            throws GitLabApiException
        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.
        POST /projects/:id/fork
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        namespaceId - ID of the namespace that the project will be forked to
        Returns:
        the newly forked Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • createForkedFromRelationship

        public Project createForkedFromRelationship​(Object projectIdOrPath,
                                                    Integer forkedFromId)
                                             throws GitLabApiException
        Create a forked from/to relation between existing projects.
        POST /projects/:id/fork/:forkFromId
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        forkedFromId - the ID of the project that was forked from
        Returns:
        the updated Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteForkedFromRelationship

        public void deleteForkedFromRelationship​(Object projectIdOrPath)
                                          throws GitLabApiException
        Delete an existing forked from relationship.
        DELETE /projects/:id/fork
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public List<Member> getMembers​(Object projectIdOrPath)
                                throws GitLabApiException
        Get a list of project team members.
        GET /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the members belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public List<Member> getMembers​(Object projectIdOrPath,
                                       int page,
                                       int perPage)
                                throws GitLabApiException
        Get a list of project team members in the specified page range.
        GET /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of Member instances per page
        Returns:
        the members belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMembers

        public Pager<Member> getMembers​(Object projectIdOrPath,
                                        int itemsPerPage)
                                 throws GitLabApiException
        Get a Pager of project team members.
        GET /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the members belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getMembersStream

        public Stream<Member> getMembersStream​(Object projectIdOrPath)
                                        throws GitLabApiException
        Get a Stream of project team members.
        GET /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream of the members belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembers

        public List<Member> getAllMembers​(Object projectIdOrPath)
                                   throws GitLabApiException
        Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.
        GET /projects/:id/members/all
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        the project members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembers

        public List<Member> getAllMembers​(Object projectIdOrPath,
                                          int page,
                                          int perPage)
                                   throws GitLabApiException
        Gets a list of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.
        GET /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        page - the page to get
        perPage - the number of Member instances per page
        Returns:
        the project members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembers

        public Pager<Member> getAllMembers​(Object projectIdOrPath,
                                           int itemsPerPage)
                                    throws GitLabApiException
        Gets a Pager of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.
        GET /projects/:id/members/all
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of the project members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getAllMembersStream

        public Stream<Member> getAllMembersStream​(Object projectIdOrPath)
                                           throws GitLabApiException
        Gets a Stream of project members viewable by the authenticated user, including inherited members through ancestor groups. Returns multiple times the same user (with different member attributes) when the user is a member of the project/group and of one or more ancestor group.
        GET /projects/:id/members/all
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        Returns:
        a Stream of the project members viewable by the authenticated user, including inherited members through ancestor groups
        Throws:
        GitLabApiException - if any exception occurs
      • getMember

        public Member getMember​(Object projectIdOrPath,
                                Integer userId)
                         throws GitLabApiException
        Gets a project team member.
        GET /projects/:id/members/:user_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member
        Returns:
        the member specified by the project ID/user ID pair
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalMember

        public Optional<Member> getOptionalMember​(Object projectIdOrPath,
                                                  Integer userId)
        Gets a project team member.
        GET /projects/:id/members/:user_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member
        Returns:
        the member specified by the project ID/user ID pair
      • addMember

        public Member addMember​(Object projectIdOrPath,
                                Integer userId,
                                Integer accessLevel)
                         throws GitLabApiException
        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.
        POST /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        Returns:
        the added member
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object projectIdOrPath,
                                Integer userId,
                                AccessLevel accessLevel)
                         throws GitLabApiException
        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.
        POST /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to add, required
        accessLevel - the access level for the new member, required
        Returns:
        the added member
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object projectIdOrPath,
                                Integer userId,
                                AccessLevel accessLevel,
                                Date expiresAt)
                         throws GitLabApiException
        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.
        POST /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to add
        accessLevel - the access level for the new member
        expiresAt - the date the membership in the group will expire
        Returns:
        the added member
        Throws:
        GitLabApiException - if any exception occurs
      • addMember

        public Member addMember​(Object projectIdOrPath,
                                Integer userId,
                                Integer accessLevel,
                                Date expiresAt)
                         throws GitLabApiException
        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.
        POST /projects/:id/members
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to add
        accessLevel - the access level for the new member
        expiresAt - the date the membership in the group will expire
        Returns:
        the added member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object projectIdOrPath,
                                   Integer userId,
                                   Integer accessLevel)
                            throws GitLabApiException
        Updates a member of a project.
        PUT /projects/:projectId/members/:userId
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object projectIdOrPath,
                                   Integer userId,
                                   AccessLevel accessLevel)
                            throws GitLabApiException
        Updates a member of a project.
        PUT /projects/:projectId/members/:userId
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object projectIdOrPath,
                                   Integer userId,
                                   AccessLevel accessLevel,
                                   Date expiresAt)
                            throws GitLabApiException
        Updates a member of a project.
        PUT /projects/:projectId/members/:userId
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • updateMember

        public Member updateMember​(Object projectIdOrPath,
                                   Integer userId,
                                   Integer accessLevel,
                                   Date expiresAt)
                            throws GitLabApiException
        Updates a member of a project.
        PUT /projects/:projectId/members/:userId
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        userId - the user ID of the member to update, required
        accessLevel - the new access level for the member, required
        expiresAt - the date the membership in the group will expire, optional
        Returns:
        the updated member
        Throws:
        GitLabApiException - if any exception occurs
      • removeMember

        public void removeMember​(Object projectIdOrPath,
                                 Integer userId)
                          throws GitLabApiException
        Removes user from project team.
        DELETE /projects/:id/members/:user_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        userId - the user ID of the member to remove
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsers

        public List<ProjectUser> getProjectUsers​(Object projectIdOrPath)
                                          throws GitLabApiException
        Get a list of project users. This list includes all project members and all users assigned to project parent groups.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the users belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsers

        public Pager<ProjectUser> getProjectUsers​(Object projectIdOrPath,
                                                  int itemsPerPage)
                                           throws GitLabApiException
        Get a Pager of project users. This Pager includes all project members and all users assigned to project parent groups.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of the users matching the search string and belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsersStream

        public Stream<ProjectUser> getProjectUsersStream​(Object projectIdOrPath)
                                                  throws GitLabApiException
        Get a Stream of project users. This Stream includes all project members and all users assigned to project parent groups.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of the users belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsers

        public List<ProjectUser> getProjectUsers​(Object projectIdOrPath,
                                                 String search)
                                          throws GitLabApiException
        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.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        search - the string to match specific users
        Returns:
        the users matching the search string and belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsers

        public Pager<ProjectUser> getProjectUsers​(Object projectIdOrPath,
                                                  String search,
                                                  int itemsPerPage)
                                           throws GitLabApiException
        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.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
        search - the string to match specific users
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of the users matching the search string and belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectUsersStream

        public Stream<ProjectUser> getProjectUsersStream​(Object projectIdOrPath,
                                                         String search)
                                                  throws GitLabApiException
        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.
        GET /projects/:id/users
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        search - the string to match specific users
        Returns:
        a Stream of the users matching the search string and belonging to the specified project and its parent groups
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public List<Event> getProjectEvents​(Object projectIdOrPath)
                                     throws GitLabApiException
        Get the project events for specific project. Sorted from newest to latest.
        GET /projects/:id/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the project events for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public List<Event> getProjectEvents​(Object projectIdOrPath,
                                            int page,
                                            int perPage)
                                     throws GitLabApiException
        Get the project events for specific project. Sorted from newest to latest in the specified page range.
        GET /projects/:id/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of Event instances per page
        Returns:
        the project events for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEvents

        public Pager<Event> getProjectEvents​(Object projectIdOrPath,
                                             int itemsPerPage)
                                      throws GitLabApiException
        Get a Pager of project events for specific project. Sorted from newest to latest.
        GET /projects/:id/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of project events for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectEventsStream

        public Stream<Event> getProjectEventsStream​(Object projectIdOrPath)
                                             throws GitLabApiException
        Get a Stream of the project events for specific project. Sorted from newest to latest.
        GET /projects/:id/events
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of the project events for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getHooks

        public List<ProjectHook> getHooks​(Object projectIdOrPath)
                                   throws GitLabApiException
        Get a list of the project hooks for the specified project.
        GET /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a list of project hooks for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getHooks

        public List<ProjectHook> getHooks​(Object projectIdOrPath,
                                          int page,
                                          int perPage)
                                   throws GitLabApiException
        Get list of project hooks in the specified page range.
        GET /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of ProjectHook instances per page
        Returns:
        a list of project hooks for the specified project in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getHooks

        public Pager<ProjectHook> getHooks​(Object projectIdOrPath,
                                           int itemsPerPage)
                                    throws GitLabApiException
        Get Pager of project hooks.
        GET /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of project hooks for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getHooksStream

        public Stream<ProjectHook> getHooksStream​(Object projectIdOrPath)
                                           throws GitLabApiException
        Get a Stream of the project hooks for the specified project.
        GET /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of project hooks for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getHook

        public ProjectHook getHook​(Object projectIdOrPath,
                                   Integer hookId)
                            throws GitLabApiException
        Get a specific hook for project.
        GET /projects/:id/hooks/:hook_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        hookId - the ID of the hook to get
        Returns:
        the project hook for the specified project ID/hook ID pair
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalHook

        public Optional<ProjectHook> getOptionalHook​(Object projectIdOrPath,
                                                     Integer hookId)
        Get a specific hook for project as an Optional instance.
        GET /projects/:id/hooks/:hook_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        hookId - the ID of the hook to get
        Returns:
        the project hook for the specified project ID/hook ID pair as an Optional instance
      • addHook

        public ProjectHook addHook​(String projectName,
                                   String url,
                                   ProjectHook enabledHooks,
                                   boolean enableSslVerification,
                                   String secretToken)
                            throws GitLabApiException
        Adds a hook to project.
        POST /projects/:id/hooks
        Parameters:
        projectName - the name of the project
        url - the callback URL for the hook
        enabledHooks - a ProjectHook instance specifying which hooks to enable
        enableSslVerification - enable SSL verification
        secretToken - the secret token to pass back to the hook
        Returns:
        the added ProjectHook instance
        Throws:
        GitLabApiException - if any exception occurs
      • addHook

        public ProjectHook addHook​(Object projectIdOrPath,
                                   String url,
                                   ProjectHook enabledHooks,
                                   boolean enableSslVerification,
                                   String secretToken)
                            throws GitLabApiException
        Adds a hook to project.
        POST /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        url - the callback URL for the hook
        enabledHooks - a ProjectHook instance specifying which hooks to enable
        enableSslVerification - enable SSL verification
        secretToken - the secret token to pass back to the hook
        Returns:
        the added ProjectHook instance
        Throws:
        GitLabApiException - if any exception occurs
      • addHook

        public ProjectHook addHook​(Object projectIdOrPath,
                                   String url,
                                   boolean doPushEvents,
                                   boolean doIssuesEvents,
                                   boolean doMergeRequestsEvents)
                            throws GitLabApiException
        Adds a hook to project.
        POST /projects/:id/hooks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        url - the callback URL for the hook
        doPushEvents - flag specifying whether to do push events
        doIssuesEvents - flag specifying whether to do issues events
        doMergeRequestsEvents - flag specifying whether to do merge requests events
        Returns:
        the added ProjectHook instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteHook

        public void deleteHook​(Object projectIdOrPath,
                               Integer hookId)
                        throws GitLabApiException
        Deletes a hook from the project.
        DELETE /projects/:id/hooks/:hook_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        hookId - the project hook ID to delete
        Throws:
        GitLabApiException - if any exception occurs
      • deleteHook

        public void deleteHook​(ProjectHook hook)
                        throws GitLabApiException
        Deletes a hook from the project.
        DELETE /projects/:id/hooks/:hook_id
        Parameters:
        hook - the ProjectHook instance to remove
        Throws:
        GitLabApiException - if any exception occurs
      • modifyHook

        public ProjectHook modifyHook​(ProjectHook hook)
                               throws GitLabApiException
        Modifies a hook for project.
        PUT /projects/:id/hooks/:hook_id
        Parameters:
        hook - the ProjectHook instance that contains the project hook info to modify
        Returns:
        the modified project hook
        Throws:
        GitLabApiException - if any exception occurs
      • getIssues

        @Deprecated
        public List<Issue> getIssues​(Object projectIdOrPath)
                              throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.getIssues(Object)
        Get a list of the project's issues.
        GET /projects/:id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a list of project's issues
        Throws:
        GitLabApiException - if any exception occurs
      • getIssues

        @Deprecated
        public List<Issue> getIssues​(Object projectIdOrPath,
                                     int page,
                                     int perPage)
                              throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.getIssues(Object, int, int)
        Get a list of project's issues using the specified page and per page settings.
        GET /projects/:id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of issues per page
        Returns:
        the list of issues in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getIssues

        @Deprecated
        public Pager<Issue> getIssues​(Object projectIdOrPath,
                                      int itemsPerPage)
                               throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.getIssues(Object, int)
        Get a Pager of project's issues.
        GET /projects/:id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of issues per page
        Returns:
        the list of issues in the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getIssuesStream

        @Deprecated
        public Stream<Issue> getIssuesStream​(Object projectIdOrPath)
                                      throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.getIssues(Object)
        Get a Stream of the project's issues.
        GET /projects/:id/issues
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of the project's issues
        Throws:
        GitLabApiException - if any exception occurs
      • getIssue

        @Deprecated
        public Issue getIssue​(Object projectIdOrPath,
                              Integer issueId)
                       throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.getIssue(Object, Integer)
        Get a single project issue.
        GET /projects/:id/issues/:issue_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        issueId - the internal ID of a project's issue
        Returns:
        the specified Issue instance
        Throws:
        GitLabApiException - if any exception occurs
      • deleteIssue

        @Deprecated
        public void deleteIssue​(Object projectIdOrPath,
                                Integer issueId)
                         throws GitLabApiException
        Deprecated.
        Will be removed in version 5.0, replaced by IssuesApi.deleteIssue(Object, Integer)
        Delete a project issue.
        DELETE /projects/:id/issues/:issue_iid
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        issueId - the internal ID of a project's issue
        Throws:
        GitLabApiException - if any exception occurs
      • getSnippets

        public List<Snippet> getSnippets​(Object projectIdOrPath)
                                  throws GitLabApiException
        Get a list of the project snippets.
        GET /projects/:id/snippets
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a list of the project's snippets
        Throws:
        GitLabApiException - if any exception occurs
      • getSnippets

        public List<Snippet> getSnippets​(Object projectIdOrPath,
                                         int page,
                                         int perPage)
                                  throws GitLabApiException
        Get a list of project snippets.
        GET /projects/:id/snippets
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of snippets per page
        Returns:
        a list of project's snippets for the specified range
        Throws:
        GitLabApiException - if any exception occurs
      • getSnippets

        public Pager<Snippet> getSnippets​(Object projectIdOrPath,
                                          int itemsPerPage)
                                   throws GitLabApiException
        Get a Pager of project's snippets.
        GET /projects/:id/snippets
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of snippets per page
        Returns:
        the Pager of snippets
        Throws:
        GitLabApiException - if any exception occurs
      • getSnippetsStream

        public Stream<Snippet> getSnippetsStream​(Object projectIdOrPath)
                                          throws GitLabApiException
        Get a Stream of the project snippets.
        GET /projects/:id/snippets
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of the project's snippets
        Throws:
        GitLabApiException - if any exception occurs
      • getSnippet

        public Snippet getSnippet​(Object projectIdOrPath,
                                  Integer snippetId)
                           throws GitLabApiException
        Get a single of project snippet.
        GET /projects/:id/snippets/:snippet_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        snippetId - the ID of the project's snippet
        Returns:
        the specified project Snippet
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalSnippet

        public Optional<Snippet> getOptionalSnippet​(Object projectIdOrPath,
                                                    Integer snippetId)
        Get a single of project snippet as an Optional instance.
        GET /projects/:id/snippets/:snippet_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        snippetId - the ID of the project's snippet
        Returns:
        the specified project Snippet as an Optional instance
      • createSnippet

        public Snippet createSnippet​(Object projectIdOrPath,
                                     String title,
                                     String filename,
                                     String description,
                                     String code,
                                     Visibility visibility)
                              throws GitLabApiException
        Creates a new project snippet. The user must have permission to create new snippets.
        POST /projects/:id/snippets
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        title - the title of a snippet, required
        filename - the name of a snippet file, required
        description - the description of a snippet, optional
        code - the content of a snippet, required
        visibility - the snippet's visibility, required
        Returns:
        a Snippet instance with info on the created snippet
        Throws:
        GitLabApiException - if any exception occurs
      • updateSnippet

        public Snippet updateSnippet​(Object projectIdOrPath,
                                     Integer snippetId,
                                     String title,
                                     String filename,
                                     String description,
                                     String code,
                                     Visibility visibility)
                              throws GitLabApiException
        Updates an existing project snippet. The user must have permission to change an existing snippet.
        PUT /projects/:id/snippets/:snippet_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        snippetId - the ID of a project's snippet, required
        title - the title of a snippet, optional
        filename - the name of a snippet file, optional
        description - the description of a snippet, optioptionalonal
        code - the content of a snippet, optional
        visibility - the snippet's visibility, reqoptionaluired
        Returns:
        a Snippet instance with info on the updated snippet
        Throws:
        GitLabApiException - if any exception occurs
      • getRawSnippetContent

        public String getRawSnippetContent​(Object projectIdOrPath,
                                           Integer snippetId)
                                    throws GitLabApiException
        Get the raw project snippet as plain text.
        GET /projects/:id/snippets/:snippet_id/raw
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        snippetId - the ID of the project's snippet
        Returns:
        the raw project snippet plain text as an Optional instance
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalRawSnippetContent

        public Optional<String> getOptionalRawSnippetContent​(Object projectIdOrPath,
                                                             Integer snippetId)
        Get the raw project snippet plain text as an Optional instance.
        GET /projects/:id/snippets/:snippet_id/raw
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        snippetId - the ID of the project's snippet
        Returns:
        the raw project snippet plain text as an Optional instance
      • shareProject

        public void shareProject​(Object projectIdOrPath,
                                 Integer groupId,
                                 AccessLevel accessLevel,
                                 Date expiresAt)
                          throws GitLabApiException
        Share a project with the specified group.
        POST /projects/:id/share
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        groupId - the ID of the group to share with, required
        accessLevel - the permissions level to grant the group, required
        expiresAt - the share expiration date, optional
        Throws:
        GitLabApiException - if any exception occurs
      • unshareProject

        public void unshareProject​(Object projectIdOrPath,
                                   Integer groupId)
                            throws GitLabApiException
        Unshare the project from the group.
        DELETE /projects/:id/share/:group_id
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        groupId - the ID of the group to unshare, required
        Throws:
        GitLabApiException - if any exception occurs
      • archiveProject

        public Project archiveProject​(Object projectIdOrPath)
                               throws GitLabApiException
        Archive a project
        POST /projects/:id/archive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the archived GitLab Project
        Throws:
        GitLabApiException - if any exception occurs
      • unarchiveProject

        public Project unarchiveProject​(Object projectIdOrPath)
                                 throws GitLabApiException
        Unarchive a project
        POST /projects/:id/unarchive
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the unarchived GitLab Project
        Throws:
        GitLabApiException - if any exception occurs
      • uploadFile

        public FileUpload uploadFile​(Object projectIdOrPath,
                                     File fileToUpload)
                              throws GitLabApiException
        Uploads a file to the specified project to be used in an issue or merge request description, or a comment.
        POST /projects/:id/uploads
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        fileToUpload - the File instance of the file to upload, required
        Returns:
        a FileUpload instance with information on the just uploaded file
        Throws:
        GitLabApiException - if any exception occurs
      • uploadFile

        public FileUpload uploadFile​(Object projectIdOrPath,
                                     File fileToUpload,
                                     String mediaType)
                              throws GitLabApiException
        Uploads a file to the specified project to be used in an issue or merge request description, or a comment.
        POST /projects/:id/uploads
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        fileToUpload - the File instance of the file to upload, required
        mediaType - the media type of the file to upload, optional
        Returns:
        a FileUpload instance with information on the just uploaded file
        Throws:
        GitLabApiException - if any exception occurs
      • getPushRules

        public PushRules getPushRules​(Object projectIdOrPath)
                               throws GitLabApiException
        Get the project's push rules.
        GET /projects/:id/push_rule
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        the push rules for the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • createPushRules

        public PushRules createPushRules​(Object projectIdOrPath,
                                         PushRules pushRule)
                                  throws GitLabApiException
        Adds a push rule to a specified project.
        POST /projects/:id/push_rule
        The following properties on the PushRules instance are utilized in the creation of the push rule: denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        pushRule - the PushRule instance containing the push rule configuration to add
        Returns:
        a PushRules instance with the newly created push rule info
        Throws:
        GitLabApiException - if any exception occurs
      • updatePushRules

        public PushRules updatePushRules​(Object projectIdOrPath,
                                         PushRules pushRule)
                                  throws GitLabApiException
        Updates a push rule for the specified project.
        PUT /projects/:id/push_rule/:push_rule_id
        The following properties on the PushRules instance are utilized when updating the push rule: denyDeleteTag (optional) - Deny deleting a tag memberCheck (optional) - Restrict commits by author (email) to existing GitLab users preventSecrets (optional) - GitLab will reject any files that are likely to contain secrets commitMessageRegex (optional) - All commit messages must match this, e.g. Fixed \d+\..* branchNameRegex (optional) - All branch names must match this, e.g. `(feature authorEmailRegex (optional) - All commit author emails must match this, e.g. @my-company.com$ fileNameRegex (optional) - All committed filenames must not match this, e.g. `(jar maxFileSize (optional) - Maximum file size (MB
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        pushRule - the PushRules instance containing the push rule configuration to update
        Returns:
        a PushRules instance with the newly created push rule info
        Throws:
        GitLabApiException - if any exception occurs
      • deletePushRules

        public void deletePushRules​(Object projectIdOrPath)
                             throws GitLabApiException
        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.
        DELETE /projects/:id/push_rule
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Throws:
        GitLabApiException - if any exception occurs
      • getForks

        public List<Project> getForks​(Object projectIdOrPath)
                               throws GitLabApiException
        Get a list of projects that were forked from the specified project.
        GET /projects/:id/forks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a List of forked projects
        Throws:
        GitLabApiException - if any exception occurs
      • getForks

        public List<Project> getForks​(Object projectIdOrPath,
                                      int page,
                                      int perPage)
                               throws GitLabApiException
        Get a list of projects that were forked from the specified project and in the specified page range.
        GET /projects/:id/forks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of projects per page
        Returns:
        a List of forked projects
        Throws:
        GitLabApiException - if any exception occurs
      • getForks

        public Pager<Project> getForks​(Object projectIdOrPath,
                                       int itemsPerPage)
                                throws GitLabApiException
        Get a Pager of projects that were forked from the specified project.
        GET /projects/:id/forks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        a Pager of projects
        Throws:
        GitLabApiException - if any exception occurs
      • getForksStream

        public Stream<Project> getForksStream​(Object projectIdOrPath)
                                       throws GitLabApiException
        Get a Stream of projects that were forked from the specified project.
        GET /projects/:id/forks
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of forked projects
        Throws:
        GitLabApiException - if any exception occurs
      • starProject

        public Project starProject​(Object projectIdOrPath)
                            throws GitLabApiException
        Star a project.
        POST /projects/:id/star
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Project instance with the new project info
        Throws:
        GitLabApiException - if any exception occurs
      • unstarProject

        public Project unstarProject​(Object projectIdOrPath)
                              throws GitLabApiException
        Unstar a project.
        POST /projects/:id/unstar
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Project instance with the new project info
        Throws:
        GitLabApiException - if any exception occurs
      • getProjectLanguages

        public Map<String,​Float> getProjectLanguages​(Object projectIdOrPath)
                                                    throws GitLabApiException
        Get languages used in a project with percentage value.
        GET /projects/:id/languages
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Map instance with the language as the key and the percentage as the value
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 10.8
      • transferProject

        public Project transferProject​(Object projectIdOrPath,
                                       String namespace)
                                throws GitLabApiException
        Transfer a project to a new namespace. This was added in GitLab 11.1
        PUT /projects/:id/transfer.
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        namespace - the namespace to transfer the project to
        Returns:
        the updated Project
        Throws:
        GitLabApiException - if any exception occurs
      • setProjectAvatar

        public Project setProjectAvatar​(Object projectIdOrPath,
                                        File avatarFile)
                                 throws GitLabApiException
        Uploads and sets the project avatar for the specified project.
        PUT /projects/:id/uploads
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        avatarFile - the File instance of the avatar file to upload
        Returns:
        the updated Project instance
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public List<Variable> getVariables​(Object projectIdOrPath)
                                    throws GitLabApiException
        Get list of a project's variables.
        GitLab Endpoint: GET /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a list of variables belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public List<Variable> getVariables​(Object projectIdOrPath,
                                           int page,
                                           int perPage)
                                    throws GitLabApiException
        Get a list of variables for the specified project in the specified page range.
        GitLab Endpoint: GET /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        page - the page to get
        perPage - the number of Variable instances per page
        Returns:
        a list of variables belonging to the specified project in the specified page range
        Throws:
        GitLabApiException - if any exception occurs
      • getVariables

        public Pager<Variable> getVariables​(Object projectIdOrPath,
                                            int itemsPerPage)
                                     throws GitLabApiException
        Get a Pager of variables belonging to the specified project.
        GitLab Endpoint: GET /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        itemsPerPage - the number of Variable instances that will be fetched per page
        Returns:
        a Pager of variables belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getVariablesStream

        public Stream<Variable> getVariablesStream​(Object projectIdOrPath)
                                            throws GitLabApiException
        Get a Stream of variables belonging to the specified project.
        GitLab Endpoint: GET /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        Returns:
        a Stream of variables belonging to the specified project
        Throws:
        GitLabApiException - if any exception occurs
      • getVariable

        public Variable getVariable​(Object projectIdOrPath,
                                    String key)
                             throws GitLabApiException
        Get the details of a project variable.
        GitLab Endpoint: GET /projects/:id/variables/:key
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of an existing variable, required
        Returns:
        the Variable instance for the specified variable
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalVariable

        public Optional<Variable> getOptionalVariable​(Object projectIdOrPath,
                                                      String key)
        Get the details of a variable as an Optional instance.
        GitLab Endpoint: GET /projects/:id/variables/:key
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of an existing variable, required
        Returns:
        the Variable for the specified variable as an Optional instance
      • createVariable

        public Variable createVariable​(Object projectIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected)
                                throws GitLabApiException
        Create a new project variable.
        GitLab Endpoint: POST /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        Returns:
        a Variable instance with the newly created variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • createVariable

        public Variable createVariable​(Object projectIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected,
                                       String environmentScope)
                                throws GitLabApiException
        Create a new project variable.

        NOTE: Setting the environmentScope is only available on GitLab EE.

        GitLab Endpoint: POST /projects/:id/variables
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of a variable; must have no more than 255 characters; only A-Z, a-z, 0-9, and _ are allowed, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        environmentScope - the environment_scope of the variable, optional
        Returns:
        a Variable instance with the newly created variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • updateVariable

        public Variable updateVariable​(Object projectIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected)
                                throws GitLabApiException
        Update a project variable.
        GitLab Endpoint: PUT /projects/:id/variables/:key
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of an existing variable, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        Returns:
        a Variable instance with the updated variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • updateVariable

        public Variable updateVariable​(Object projectIdOrPath,
                                       String key,
                                       String value,
                                       Boolean isProtected,
                                       String environmentScope)
                                throws GitLabApiException
        Update a project variable.

        NOTE: Updating the environmentScope is only available on GitLab EE.

        GitLab Endpoint: PUT /projects/:id/variables/:key
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of an existing variable, required
        value - the value for the variable, required
        isProtected - whether the variable is protected, optional
        environmentScope - the environment_scope of the variable, optional.
        Returns:
        a Variable instance with the updated variable
        Throws:
        GitLabApiException - if any exception occurs during execution
      • deleteVariable

        public void deleteVariable​(Object projectIdOrPath,
                                   String key)
                            throws GitLabApiException
        Deletes a project variable.
        DELETE /projects/:id/variables/:key
        Parameters:
        projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
        key - the key of an existing variable, required
        Throws:
        GitLabApiException - if any exception occurs