Class ProjectApi

java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.ProjectApi
All Implemented Interfaces:
Constants

public class ProjectApi extends AbstractApi implements Constants
This class provides an entry point to all the GitLab API project calls.
See Also:
  • Constructor Details

    • ProjectApi

      public ProjectApi(GitLabApi gitLabApi)
  • Method Details

    • getProjectStatistics

      public ProjectFetches getProjectStatistics(Object projectIdOrPath) throws GitLabApiException
      Get the project fetch statistics for the last 30 days. Retrieving the statistics requires write access to the repository. Currently only HTTP fetches statistics are returned. Fetches statistics includes both clones and pulls count and are HTTP only, SSH fetches are not included.
      GitLab Endpoint: GET /project/:id/statistics
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      Returns:
      a ProjectFetches instance with the project fetch statistics for the last 30 days
      Throws:
      GitLabApiException - if any exception occurs during execution
    • getOptionalProjectStatistics

      public Optional<ProjectFetches> getOptionalProjectStatistics(Object projectIdOrPath)
      Get an Optional instance with the value for the project fetch statistics for the last 30 days.
      GitLab Endpoint: GET /project/:id/statistics
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      Returns:
      an Optional instance with the value for the project fetch statistics for the last 30 day
    • getProjects

      public List<Project> getProjects() throws GitLabApiException

      Get a list of projects accessible by the authenticated user.

      WARNING: Do not use this method to fetch projects from https://gitlab.com, gitlab.com has many 100,000's of public projects and it will take hours to fetch all of them. Instead use getProjects(int itemsPerPage) which will return a Pager of Project instances.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: GET /projects?starred=true
      Returns:
      a Stream of projects starred by the authenticated user
      Throws:
      GitLabApiException - if any exception occurs
    • getProjects

      public List<Project> getProjects(ProjectFilter filter) throws GitLabApiException
      Get a list of all visible projects across GitLab for the authenticated user using the provided filter.
      GitLab Endpoint: GET /projects
      Parameters:
      filter - the ProjectFilter instance holding the filter values for the query
      Returns:
      a list of all visible projects across GitLab for the authenticated use
      Throws:
      GitLabApiException - if any exception occurs
    • getProjects

      public List<Project> getProjects(ProjectFilter filter, int page, int perPage) throws GitLabApiException
      Get a list of all visible projects across GitLab for the authenticated user in the specified page range using the provided filter.
      GitLab Endpoint: GET /projects
      Parameters:
      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 all visible projects across GitLab for the authenticated use
      Throws:
      GitLabApiException - if any exception occurs
    • getProjects

      public Pager<Project> getProjects(ProjectFilter filter, int itemsPerPage) throws GitLabApiException
      Get a Pager of all visible projects across GitLab for the authenticated user using the provided filter.
      GitLab Endpoint: GET /projects
      Parameters:
      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 all visible projects across GitLab for the authenticated use
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectsStream

      public Stream<Project> getProjectsStream(ProjectFilter filter) throws GitLabApiException
      Get a Stream of all visible projects across GitLab for the authenticated user using the provided filter.
      GitLab Endpoint: GET /projects
      Parameters:
      filter - the ProjectFilter instance holding the filter values for the query
      Returns:
      a Stream of all visible projects across GitLab for the authenticated use
      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.
      GitLab Endpoint: 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 user
      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.
      GitLab Endpoint: 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 user
      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.
      GitLab Endpoint: 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 user
      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.
      GitLab Endpoint: 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 user
      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.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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(Object projectIdOrPath, Boolean includeStatistics, Boolean includeLicense, Boolean withCustomAttributes) throws GitLabApiException
      Get a specific project, which is owned by the authentication user.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      includeStatistics - include project statistics
      includeLicense - include project license data
      withCustomAttributes - include custom attributes in response (admins only)
      Returns:
      the specified project
      Throws:
      GitLabApiException - if any exception occurs
    • getOptionalProject

      public Optional<Project> getOptionalProject(Object projectIdOrPath, Boolean includeStatistics, Boolean includeLicense, Boolean withCustomAttributes)
      Get an Optional instance with the value for the specific project, which is owned by the authentication user.
      GitLab Endpoint: GET /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      includeStatistics - include project statistics
      includeLicense - include project license data
      withCustomAttributes - include custom attributes in response (admins only)
      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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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(Long namespaceId, String projectName) throws GitLabApiException
      Create a new project belonging to the namespace ID. A namespace ID is either a user or group ID.
      Parameters:
      namespaceId - the namespace 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(Long namespaceId, Project project) throws GitLabApiException
      Create a new project belonging to the namespace ID and project configuration. A namespace ID is either a user or group ID.
      Parameters:
      namespaceId - the namespace ID to create the project under
      project - the Project instance holding the new project configuration
      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(String name, String path) throws GitLabApiException
      Creates a new project owned by the authenticated user.
      Parameters:
      name - the name of the project top create. Equals path if not provided.
      path - repository name for new project. Generated based on name if not provided (generated lowercased with dashes).
      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 lfsEnabled (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 buildGitStrategy (optional) - set the build git strategy buildCoverageRegex (optional) - set build coverage regex ciConfigPath (optional) - Set path to CI configuration file squashOption (optional) - set squash option for merge requests
      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, Long 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, Long 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, Long 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
    • createProjectFromTemplate

      public Project createProjectFromTemplate(Integer namespaceId, String projectName, Integer groupWithProjectTemplatesId, String templateName, Visibility visibility) throws GitLabApiException
      Create a new project from a template, belonging to the namespace ID. A namespace ID is either a user or group ID.
      Parameters:
      namespaceId - the namespace ID to create the project under
      projectName - the name of the project top create
      groupWithProjectTemplatesId - Id of the Gitlab Group, which contains the relevant templates.
      templateName - name of the template to use
      visibility - Visibility of the new create project
      Returns:
      the created 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 lfsEnabled (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 buildGitStrategy (optional) - set the build git strategy buildCoverageRegex (optional) - set build coverage regex ciConfigPath (optional) - Set path to CI configuration file ciForwardDeploymentEnabled (optional) - When a new deployment job starts, skip older deployment jobs that are still pending squashOption (optional) - set squash option for merge requests NOTE: The following parameters specified by the GitLab API edit project are not supported: import_url tag_list array avatar 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).
      GitLab Endpoint: DELETE /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: POST /projects/:id/fork
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long 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.
      GitLab Endpoint: POST /projects/:id/fork
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
    • forkProject

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

      public Project createForkedFromRelationship(Object projectIdOrPath, Long forkedFromId) throws GitLabApiException
      Create a forked from/to relation between existing projects.
      GitLab Endpoint: POST /projects/:id/fork/:forkFromId
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: DELETE /projects/:id/fork
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(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

      @Deprecated public List<Member> getAllMembers(Object projectIdOrPath, int page, int perPage) throws GitLabApiException
      Deprecated.
      Will be removed in version 6.0
      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.
      GitLab Endpoint: GET /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
    • getAllMembers

      public List<Member> getAllMembers(Object projectIdOrPath, String query, List<Long> userIds) 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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      query - a query string to search for members
      userIds - filter the results on the given user IDs
      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, String query, List<Long> userIds, 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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      query - a query string to search for members
      userIds - filter the results on the given user IDs
      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, String query, List<Long> userIds) 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.
      GitLab Endpoint: GET /projects/:id/members/all
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      query - a query string to search for members
      userIds - filter the results on the given user IDs
      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, Long userId) throws GitLabApiException
      Gets a project team member.
      GitLab Endpoint: GET /projects/:id/members/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId)
      Gets a project team member.
      GitLab Endpoint: GET /projects/:id/members/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      userId - the user ID of the member
      Returns:
      the member specified by the project ID/user ID pair
    • getMember

      public Member getMember(Object projectIdOrPath, Long userId, Boolean includeInherited) throws GitLabApiException
      Gets a project team member, optionally including inherited member.
      GitLab Endpoint: GET /projects/:id/members/all/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      userId - the user ID of the member
      includeInherited - if true will the member even if inherited thru an ancestor group
      Returns:
      the member specified by the project ID/user ID pair
      Throws:
      GitLabApiException - if any exception occurs
    • getOptionalMember

      public Optional<Member> getOptionalMember(Object projectIdOrPath, Long userId, Boolean includeInherited)
      Gets a project team member, optionally including inherited member.
      GitLab Endpoint: GET /projects/:id/members/all/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      userId - the user ID of the member
      includeInherited - if true will the member even if inherited thru an ancestor group
      Returns:
      the member specified by the project ID/user ID pair as the value of an Optional
    • addMember

      public Member addMember(Object projectIdOrPath, Long 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.
      GitLab Endpoint: POST /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long 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.
      GitLab Endpoint: POST /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long 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.
      GitLab Endpoint: POST /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long 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.
      GitLab Endpoint: POST /projects/:id/members
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId, Integer accessLevel) throws GitLabApiException
      Updates a member of a project.
      GitLab Endpoint: PUT /projects/:projectId/members/:userId
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId, AccessLevel accessLevel) throws GitLabApiException
      Updates a member of a project.
      GitLab Endpoint: PUT /projects/:projectId/members/:userId
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
      Updates a member of a project.
      GitLab Endpoint: PUT /projects/:projectId/members/:userId
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId, Integer accessLevel, Date expiresAt) throws GitLabApiException
      Updates a member of a project.
      GitLab Endpoint: PUT /projects/:projectId/members/:userId
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long userId) throws GitLabApiException
      Removes user from project team.
      GitLab Endpoint: DELETE /projects/:id/members/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/users
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
    • getProjectGroups

      public List<ProjectGroup> getProjectGroups(Object projectIdOrPath) throws GitLabApiException
      Get a list of the ancestor groups for a given project.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      Returns:
      the ancestor groups for a given project
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectGroups

      public Pager<ProjectGroup> getProjectGroups(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of the ancestor groups for a given project.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      itemsPerPage - the number of Project instances that will be fetched per page
      Returns:
      a Pager of the ancestor groups for a given project
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectGroupsStream

      public Stream<ProjectGroup> getProjectGroupsStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of the ancestor groups for a given project.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      Returns:
      a Stream of the ancestor groups for a given project
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectGroups

      public List<ProjectGroup> getProjectGroups(Object projectIdOrPath, ProjectGroupsFilter filter) throws GitLabApiException
      Get a list of the ancestor groups for a given project matching the specified filter.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      filter - the ProjectGroupsFilter to match against
      Returns:
      the ancestor groups for a given project
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectGroups

      public Pager<ProjectGroup> getProjectGroups(Object projectIdOrPath, ProjectGroupsFilter filter, int itemsPerPage) throws GitLabApiException
      Get a Pager of the ancestor groups for a given project matching the specified filter.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      filter - the ProjectGroupsFilter to match against
      itemsPerPage - the number of Project instances that will be fetched per page
      Returns:
      a Pager of the ancestor groups for a given project
      Throws:
      GitLabApiException - if any exception occurs
    • getProjectGroupsStream

      public Stream<ProjectGroup> getProjectGroupsStream(Object projectIdOrPath, ProjectGroupsFilter filter) throws GitLabApiException
      Get a Stream of the ancestor groups for a given project matching the specified filter.
      GitLab Endpoint: GET /projects/:id/groups
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      filter - the ProjectGroupsFilter to match against
      Returns:
      a Stream of the ancestor groups for a given project
      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.
      GitLab Endpoint: GET /projects/:id/events
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/events
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/events
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/events
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long hookId) throws GitLabApiException
      Get a specific hook for project.
      GitLab Endpoint: GET /projects/:id/hooks/:hook_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long hookId)
      Get a specific hook for project as an Optional instance.
      GitLab Endpoint: GET /projects/:id/hooks/:hook_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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(Object projectIdOrPath, String url, ProjectHook enabledHooks, boolean enableSslVerification, String secretToken) throws GitLabApiException
      Adds a hook to project.
      GitLab Endpoint: POST /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: POST /projects/:id/hooks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long hookId) throws GitLabApiException
      Deletes a hook from the project.
      GitLab Endpoint: DELETE /projects/:id/hooks/:hook_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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 6.0, replaced by IssuesApi.getIssues(Object)
      Get a list of the project's issues.
      GitLab Endpoint: GET /projects/:id/issues
      Parameters:
      projectIdOrPath - the project in the form of an Long(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 6.0, replaced by IssuesApi.getIssues(Object, int, int)
      Get a list of project's issues using the specified page and per page settings.
      GitLab Endpoint: GET /projects/:id/issues
      Parameters:
      projectIdOrPath - the project in the form of an Long(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 6.0, replaced by IssuesApi.getIssues(Object, int)
      Get a Pager of project's issues.
      GitLab Endpoint: GET /projects/:id/issues
      Parameters:
      projectIdOrPath - the project in the form of an Long(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 6.0, replaced by IssuesApi.getIssues(Object)
      Get a Stream of the project's issues.
      GitLab Endpoint: GET /projects/:id/issues
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long issueId) throws GitLabApiException
      Deprecated.
      Will be removed in version 6.0, replaced by IssuesApi.getIssue(Object, Long)
      Get a single project issue.
      GitLab Endpoint: GET /projects/:id/issues/:issue_iid
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long issueId) throws GitLabApiException
      Deprecated.
      Will be removed in version 6.0, replaced by IssuesApi.deleteIssue(Object, Long)
      Delete a project issue.
      GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/snippets
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/snippets
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/snippets
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/snippets
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long snippetId) throws GitLabApiException
      Get a single of project snippet.
      GitLab Endpoint: GET /projects/:id/snippets/:snippet_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long snippetId)
      Get a single of project snippet as an Optional instance.
      GitLab Endpoint: GET /projects/:id/snippets/:snippet_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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 content, Visibility visibility) throws GitLabApiException
      Creates a new project snippet. The user must have permission to create new snippets.
      GitLab Endpoint: POST /projects/:id/snippets
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
      content - 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, Long 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.
      GitLab Endpoint: PUT /projects/:id/snippets/:snippet_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
    • deleteSnippet

      public void deleteSnippet(Object projectIdOrPath, Long snippetId) throws GitLabApiException
      Throws:
      GitLabApiException
    • getRawSnippetContent

      public String getRawSnippetContent(Object projectIdOrPath, Long snippetId) throws GitLabApiException
      Get the raw project snippet as plain text.
      GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/raw
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long snippetId)
      Get the raw project snippet plain text as an Optional instance.
      GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/raw
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long groupId, AccessLevel accessLevel, Date expiresAt) throws GitLabApiException
      Share a project with the specified group.
      GitLab Endpoint: POST /projects/:id/share
      Parameters:
      projectIdOrPath - the project in the form of an Long(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, Long groupId) throws GitLabApiException
      Unshare the project from the group.
      GitLab Endpoint: DELETE /projects/:id/share/:group_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
      GitLab Endpoint: POST /projects/:id/archive
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
      GitLab Endpoint: POST /projects/:id/unarchive
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: POST /projects/:id/uploads
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: POST /projects/:id/uploads
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      fileToUpload - the File instance of the file to upload, required
      mediaType - unused; will be removed in the next major version
      Returns:
      a FileUpload instance with information on the just uploaded file
      Throws:
      GitLabApiException - if any exception occurs
    • uploadFile

      public FileUpload uploadFile(Object projectIdOrPath, InputStream inputStream, String filename, String mediaType) throws GitLabApiException
      Uploads some data in an InputStream to the specified project, to be used in an issue or merge request description, or a comment.
      GitLab Endpoint: POST /projects/:id/uploads
      Parameters:
      projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance, required
      inputStream - the data to upload, required
      filename - The filename of the file to upload
      mediaType - unused; will be removed in the next major version
      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.
      GitLab Endpoint: GET /projects/:id/push_rule
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: 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+\..* commitMessageNegativeRegex (optional) - No commit message is allowed to match this, e.g. ssh\:\/\/ 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) commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: 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+\..* commitMessageNegativeRegex (optional) - No commit message is allowed to match this, e.g. ssh\:\/\/ 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) commitCommitterCheck (optional) - Users can only push commits to this repository that were committed with one of their own verified emails. rejectUnsignedCommits (optional) - Reject commit when it is not signed through GPG
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: DELETE /projects/:id/push_rule
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/forks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/forks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/forks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: GET /projects/:id/forks
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: 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.
      GitLab Endpoint: 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.
      GitLab Endpoint: GET /projects/:id/languages
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
      GitLab Endpoint: PUT /projects/:id/transfer.
      Parameters:
      projectIdOrPath - the project in the form of an Long(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.
      GitLab Endpoint: PUT /projects/:id
      Parameters:
      projectIdOrPath - the project in the form of an Long(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
    • getAuditEvents

      public List<AuditEvent> getAuditEvents(Object projectIdOrPath, Date created_after, Date created_before) throws GitLabApiException
      Get a List of the project audit events viewable by Maintainer or an Owner of the group.
      GET /projects/:id/audit_events
      Parameters:
      projectIdOrPath - the project ID, path of the project, or a project instance holding the project ID or path
      created_after - Project audit events created on or after the given time.
      created_before - Project audit events created on or before the given time.
      Returns:
      a List of project Audit events
      Throws:
      GitLabApiException - if any exception occurs
    • getAuditEvents

      public Pager<AuditEvent> getAuditEvents(Object projectIdOrPath, Date created_after, Date created_before, int itemsPerPage) throws GitLabApiException
      Get a Pager of the group audit events viewable by Maintainer or an Owner of the group.
      GET /projects/:id/audit_events
      Parameters:
      projectIdOrPath - the project ID, path of the project, or a Project instance holding the project ID or path
      created_after - Project audit events created on or after the given time.
      created_before - Project audit events created on or before the given time.
      itemsPerPage - the number of Audit Event instances that will be fetched per page
      Returns:
      a Pager of project Audit events
      Throws:
      GitLabApiException - if any exception occurs
    • getAuditEventsStream

      public Stream<AuditEvent> getAuditEventsStream(Object projectIdOrPath, Date created_after, Date created_before) throws GitLabApiException
      Get a Stream of the group audit events viewable by Maintainer or an Owner of the group.
      GET /projects/:id/audit_events
      Parameters:
      projectIdOrPath - the project ID, path of the project, or a Project instance holding the project ID or path
      created_after - Project audit events created on or after the given time.
      created_before - Project audit events created on or before the given time.
      Returns:
      a Stream of project Audit events
      Throws:
      GitLabApiException - if any exception occurs
    • getAuditEvent

      public AuditEvent getAuditEvent(Object projectIdOrPath, Long auditEventId) throws GitLabApiException
      Get a specific audit event of a project.
      GitLab Endpoint: GET /projects/:id/audit_events/:id_audit_event
      Parameters:
      projectIdOrPath - the project ID, path of the project, or a Project instance holding the project ID or path
      auditEventId - the auditEventId, required
      Returns:
      the project Audit event
      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 Long(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 Long(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 Long(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 Long(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 Long(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 Long(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 Long(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 Long(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
    • createVariable

      public Variable createVariable(Object projectIdOrPath, String key, String value, Variable.Type variableType, Boolean isProtected, Boolean isMasked) 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 Long(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
      variableType - the type of variable. Available types are: env_var (default) and file
      isProtected - whether the variable is protected, optional
      isMasked - whether the variable is masked, 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, Variable.Type variableType, Boolean isProtected, Boolean isMasked, 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 Long(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
      variableType - the type of variable. Available types are: env_var (default) and file
      isProtected - whether the variable is protected, optional
      isMasked - whether the variable is masked, 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 Long(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 Long(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
    • updateVariable

      public Variable updateVariable(Object projectIdOrPath, String key, String value, Variable.Type variableType, Boolean isProtected, Boolean masked) 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 Long(ID), String(path), or Project instance, required
      key - the key of an existing variable, required
      value - the value for the variable, required
      variableType - the type of variable. Available types are: env_var (default) and file
      isProtected - whether the variable is protected, optional
      masked - whether the variable is masked, 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, Variable.Type variableType, Boolean isProtected, Boolean masked, 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 Long(ID), String(path), or Project instance, required
      key - the key of an existing variable, required
      value - the value for the variable, required
      variableType - the type of variable. Available types are: env_var (default) and file
      isProtected - whether the variable is protected, optional
      masked - whether the variable is masked, 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.
      GitLab Endpoint: DELETE /projects/:id/variables/:key
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      key - the key of an existing variable, required
      Throws:
      GitLabApiException - if any exception occurs
    • getAccessRequests

      public List<AccessRequest> getAccessRequests(Object projectIdOrPath) throws GitLabApiException
      Get a List of the project access requests viewable by the authenticated user.
      GitLab Endpoint: GET /projects/:id/access_requests
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a List of project AccessRequest instances accessible by the authenticated user
      Throws:
      GitLabApiException - if any exception occurs
    • getAccessRequests

      public Pager<AccessRequest> getAccessRequests(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of the project access requests viewable by the authenticated user.
      GitLab Endpoint: GET /projects/:id/access_requests
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      itemsPerPage - the number of AccessRequest instances that will be fetched per page
      Returns:
      a Pager of project AccessRequest instances accessible by the authenticated user
      Throws:
      GitLabApiException - if any exception occurs
    • getAccessRequestsStream

      public Stream<AccessRequest> getAccessRequestsStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of the project access requests viewable by the authenticated user.
      GitLab Endpoint: GET /projects/:id/access_requests
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a Stream of project AccessRequest instances accessible by the authenticated user
      Throws:
      GitLabApiException - if any exception occurs
    • requestAccess

      public AccessRequest requestAccess(Object projectIdOrPath) throws GitLabApiException
      Requests access for the authenticated user to the specified project.
      GitLab Endpoint: POST /projects/:id/access_requests
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      the created AccessRequest instance
      Throws:
      GitLabApiException - if any exception occurs
    • approveAccessRequest

      public AccessRequest approveAccessRequest(Object projectIdOrPath, Long userId, AccessLevel accessLevel) throws GitLabApiException
      Approve access for the specified user to the specified project.
      GitLab Endpoint: PUT /projects/:id/access_requests/:user_id/approve
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      userId - the user ID to approve access for
      accessLevel - the access level the user is approved for, if null will be developer (30)
      Returns:
      the approved AccessRequest instance
      Throws:
      GitLabApiException - if any exception occurs
    • denyAccessRequest

      public void denyAccessRequest(Object projectIdOrPath, Long userId) throws GitLabApiException
      Deny access for the specified user to the specified project.
      GitLab Endpoint: DELETE /projects/:id/access_requests/:user_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      userId - the user ID to deny access for
      Throws:
      GitLabApiException - if any exception occurs
    • triggerHousekeeping

      public void triggerHousekeeping(Object projectIdOrPath) throws GitLabApiException
      Start the Housekeeping task for a project.
      GitLab Endpoint: POST /projects/:id/housekeeping
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Throws:
      GitLabApiException - if any exception occurs
    • getBadges

      public List<Badge> getBadges(Object projectIdOrPath) throws GitLabApiException
      Gets a list of a project’s badges and its group badges.
      GitLab Endpoint: GET /projects/:id/badges
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a List of Badge instances for the specified project
      Throws:
      GitLabApiException - if any exception occurs
    • getBadges

      public List<Badge> getBadges(Object projectIdOrPath, String bagdeName) throws GitLabApiException
      Gets a list of a project’s badges and its group badges, case-sensitively filtered on bagdeName if non-null.
      GitLab Endpoint: GET /projects/:id/badges?name=:name
      Parameters:
      projectIdOrPath - the project in the form of a Long(ID), String(path), or Project instance
      bagdeName - The name to filter on (case-sensitive), ignored if null.
      Returns:
      All badges of the GitLab item, case insensitively filtered on name.
      Throws:
      GitLabApiException - If any problem is encountered
    • getBadge

      public Badge getBadge(Object projectIdOrPath, Long badgeId) throws GitLabApiException
      Gets a badge of a project.
      GitLab Endpoint: GET /projects/:id/badges/:badge_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      badgeId - the ID of the badge to get
      Returns:
      a Badge instance for the specified project/badge ID pair
      Throws:
      GitLabApiException - if any exception occurs
    • getOptionalBadge

      public Optional<Badge> getOptionalBadge(Object projectIdOrPath, Long badgeId)
      Get an Optional instance with the value for the specified badge.
      GitLab Endpoint: GET /projects/:id/badges/:badge_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      badgeId - the ID of the badge to get
      Returns:
      an Optional instance with the specified badge as the value
    • addBadge

      public Badge addBadge(Object projectIdOrPath, String linkUrl, String imageUrl) throws GitLabApiException
      Add a badge to a project.
      GitLab Endpoint: POST /projects/:id/badges
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      linkUrl - the URL of the badge link
      imageUrl - the URL of the image link
      Returns:
      a Badge instance for the added badge
      Throws:
      GitLabApiException - if any exception occurs
    • addBadge

      public Badge addBadge(Object projectIdOrPath, String name, String linkUrl, String imageUrl) throws GitLabApiException
      Add a badge to a project.
      GitLab Endpoint: POST /projects/:id/badges
      Parameters:
      projectIdOrPath - the project in the form of a Long(ID), String(path), or Project instance
      name - The name to give the badge (may be null)
      linkUrl - the URL of the badge link
      imageUrl - the URL of the image link
      Returns:
      A Badge instance for the added badge
      Throws:
      GitLabApiException - if any exception occurs
    • editBadge

      public Badge editBadge(Object projectIdOrPath, Long badgeId, String linkUrl, String imageUrl) throws GitLabApiException
      Edit a badge of a project.
      GitLab Endpoint: PUT /projects/:id/badges
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      badgeId - the ID of the badge to get
      linkUrl - the URL of the badge link
      imageUrl - the URL of the image link
      Returns:
      a Badge instance for the editted badge
      Throws:
      GitLabApiException - if any exception occurs
    • editBadge

      public Badge editBadge(Object projectIdOrPath, Long badgeId, String name, String linkUrl, String imageUrl) throws GitLabApiException
      Edit a badge of a project.
      GitLab Endpoint: PUT /projects/:id/badges
      Parameters:
      projectIdOrPath - the project in the form of a Long(ID), String(path), or Project instance
      badgeId - the ID of the badge to edit
      name - The name of the badge to edit (may be null)
      linkUrl - the URL of the badge link
      imageUrl - the URL of the image link
      Returns:
      a Badge instance for the editted badge
      Throws:
      GitLabApiException - if any exception occurs
    • removeBadge

      public void removeBadge(Object projectIdOrPath, Long badgeId) throws GitLabApiException
      Remove a badge from a project.
      GitLab Endpoint: DELETE /projects/:id/badges/:badge_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      badgeId - the ID of the badge to remove
      Throws:
      GitLabApiException - if any exception occurs
    • previewBadge

      public Badge previewBadge(Object projectIdOrPath, String linkUrl, String imageUrl) throws GitLabApiException
      Returns how the link_url and image_url final URLs would be after resolving the placeholder interpolation.
      GitLab Endpoint: GET /projects/:id/badges/render
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      linkUrl - the URL of the badge link
      imageUrl - the URL of the image link
      Returns:
      a Badge instance for the rendered badge
      Throws:
      GitLabApiException - if any exception occurs
    • getApprovalsConfiguration

      public ProjectApprovalsConfig getApprovalsConfiguration(Object projectIdOrPath) throws GitLabApiException
      Get the project's approval information. Note: This API endpoint is only available on 10.6 Starter and above.
      GitLab Endpoint: GET /projects/:id/approvals
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a ProjectApprovalsConfig instance with the project's approvals configuration
      Throws:
      GitLabApiException - if any exception occurs
    • setApprovalsConfiguration

      public ProjectApprovalsConfig setApprovalsConfiguration(Object projectIdOrPath, ProjectApprovalsConfig config) throws GitLabApiException
      Set the project's approvals configuration. Note: This API endpoint is only available on 10.6 Starter and above.
      GitLab Endpoint: POST /projects/:id/approvals
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      config - a ProjectApprovalsConfig instance with the approval configuration
      Returns:
      a ProjectApprovalsConfig instance with the project's approvals configuration
      Throws:
      GitLabApiException - if any exception occurs
    • getApprovalRules

      public List<ApprovalRule> getApprovalRules(Object projectIdOrPath) throws GitLabApiException
      Get a list of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: GET /projects/:id/approval_rules
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a List of ApprovalRuke instances for the specified project.
      Throws:
      GitLabApiException - if any exception occurs
    • getApprovalRules

      public Pager<ApprovalRule> getApprovalRules(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: GET /projects/:id/approval_rules
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      itemsPerPage - the number of ApprovalRule instances that will be fetched per page
      Returns:
      a Pager of ApprovalRuke instances for the specified project.
      Throws:
      GitLabApiException - if any exception occurs
    • getApprovalRulesStream

      public Stream<ApprovalRule> getApprovalRulesStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of the project-level approval rules. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: GET /projects/:id/approval_rules
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a Stream of ApprovalRule instances for the specified project.
      Throws:
      GitLabApiException - if any exception occurs
    • createApprovalRule

      public ApprovalRule createApprovalRule(Object projectIdOrPath, ApprovalRuleParams params) throws GitLabApiException
      Create a project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: POST /projects/:id/approval_rules
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      params - the ApprovalRuleParams instance holding the parameters for the approval rule
      Returns:
      a ApprovalRule instance with approval configuration
      Throws:
      GitLabApiException - if any exception occurs
    • updateApprovalRule

      public ApprovalRule updateApprovalRule(Object projectIdOrPath, Long approvalRuleId, ApprovalRuleParams params) throws GitLabApiException
      Update the specified the project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: PUT /projects/:id/approval_rules/:approval_rule_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      approvalRuleId - the ID of the approval rule
      params - the ApprovalRuleParams instance holding the parameters for the approval rule update
      Returns:
      a ApprovalRule instance with approval configuration
      Throws:
      GitLabApiException - if any exception occurs
    • deleteApprovalRule

      public void deleteApprovalRule(Object projectIdOrPath, Long approvalRuleId) throws GitLabApiException
      Delete the specified the project-level approval rule. Note: This API endpoint is only available on 12.3 Starter and above.
      GitLab Endpoint: DELETE /projects/:id/approval_rules/:approval_rule_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      approvalRuleId - the ID of the approval rule
      Throws:
      GitLabApiException - if any exception occurs
    • getCustomAttributes

      public List<CustomAttribute> getCustomAttributes(Object projectIdOrPath) throws GitLabApiException
      Get all custom attributes for the specified project.
      GitLab Endpoint: GET /projects/:id/custom_attributes
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a list of project's CustomAttributes
      Throws:
      GitLabApiException - if any exception occurs
    • getCustomAttributes

      public Pager<CustomAttribute> getCustomAttributes(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of custom attributes for the specified project.
      GitLab Endpoint: GET /projects/:id/custom_attributes
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      itemsPerPage - the number of items per page
      Returns:
      a Pager of project's custom attributes
      Throws:
      GitLabApiException - if any exception occurs
    • getCustomAttributesStream

      public Stream<CustomAttribute> getCustomAttributesStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of all custom attributes for the specified project.
      GitLab Endpoint: GET /projects/:id/custom_attributes
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a Stream of project's custom attributes
      Throws:
      GitLabApiException - if any exception occurs
    • getCustomAttribute

      public CustomAttribute getCustomAttribute(Object projectIdOrPath, String key) throws GitLabApiException
      Get a single custom attribute for the specified project.
      GitLab Endpoint: GET /projects/:id/custom_attributes/:key
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      key - the key for the custom attribute
      Returns:
      a CustomAttribute instance for the specified key
      Throws:
      GitLabApiException - if any exception occurs
    • geOptionalCustomAttribute

      public Optional<CustomAttribute> geOptionalCustomAttribute(Object projectIdOrPath, String key)
      Get an Optional instance with the value for a single custom attribute for the specified project.
      GitLab Endpoint: GET /projects/:id/custom_attributes/:key
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance, required
      key - the key for the custom attribute, required
      Returns:
      an Optional instance with the value for a single custom attribute for the specified project
    • setCustomAttribute

      public CustomAttribute setCustomAttribute(Object projectIdOrPath, String key, String value) throws GitLabApiException
      Set a custom attribute for the specified project. The attribute will be updated if it already exists, or newly created otherwise.
      GitLab Endpoint: PUT /projects/:id/custom_attributes/:key
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      key - the key for the custom attribute
      value - the value for the customAttribute
      Returns:
      a CustomAttribute instance for the updated or created custom attribute
      Throws:
      GitLabApiException - if any exception occurs
    • deleteCustomAttribute

      public void deleteCustomAttribute(Object projectIdOrPath, String key) throws GitLabApiException
      Delete a custom attribute for the specified project.
      GitLab Endpoint: DELETE /projects/:id/custom_attributes/:key
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      key - the key of the custom attribute to delete
      Throws:
      GitLabApiException - if any exception occurs
    • getRemoteMirrors

      public List<RemoteMirror> getRemoteMirrors(Object projectIdOrPath) throws GitLabApiException
      Get all remote mirrors and their statuses for the specified project.
      GitLab Endpoint: GET /projects/:id/remote_mirrors
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a list of project's remote mirrors
      Throws:
      GitLabApiException - if any exception occurs
    • getRemoteMirrors

      public Pager<RemoteMirror> getRemoteMirrors(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of remote mirrors and their statuses for the specified project.
      GitLab Endpoint: GET /projects/:id/remote_mirrors
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      itemsPerPage - the number of items per page
      Returns:
      a Pager of project's remote mirrors
      Throws:
      GitLabApiException - if any exception occurs
    • getRemoteMirrorsStream

      public Stream<RemoteMirror> getRemoteMirrorsStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of all remote mirrors and their statuses for the specified project.
      GitLab Endpoint: GET /projects/:id/remote_mirrors
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      Returns:
      a Stream of project's remote mirrors
      Throws:
      GitLabApiException - if any exception occurs
    • createRemoteMirror

      public RemoteMirror createRemoteMirror(Object projectIdOrPath, String url, Boolean enabled, Boolean onlyProtectedBranches, Boolean keepDivergentRefs) throws GitLabApiException
      Create a remote mirror for a project.
      GitLab Endpoint: POST /projects/:id/remote_mirrors
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      url - the URL of the remote repository to be mirrored
      enabled - determines if the mirror is enabled
      onlyProtectedBranches - determines if only protected branches are mirrored
      keepDivergentRefs - determines if divergent refs are skipped
      Returns:
      a RemoteMirror instance with remote mirror configuration
      Throws:
      GitLabApiException - if any exception occurs
    • updateRemoteMirror

      public RemoteMirror updateRemoteMirror(Object projectIdOrPath, Long mirrorId, Boolean enabled, Boolean onlyProtectedBranches, Boolean keepDivergentRefs) throws GitLabApiException
      Toggle a remote mirror on or off, or change which types of branches are mirrored.
      GitLab Endpoint: PUT /projects/:id/remote_mirrors/:mirror_id
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      mirrorId - the ID of the remote mirror
      enabled - determines if the mirror is enabled
      onlyProtectedBranches - determines if only protected branches are mirrored
      keepDivergentRefs - determines if divergent refs are skipped
      Returns:
      a RemoteMirror instance with the updated remote mirror configuration
      Throws:
      GitLabApiException - if any exception occurs