Class ReleasesApi

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

public class ReleasesApi extends AbstractApi
This class provides an entry point to all the GitLab Releases API calls.
See Also:
  • Constructor Details

    • ReleasesApi

      public ReleasesApi(GitLabApi gitLabApi)
  • Method Details

    • getReleases

      public List<Release> getReleases(Object projectIdOrPath) throws GitLabApiException
      Get a list of releases for a project, sorted by release date.
      GitLab Endpoint: GET /projects/:id/releases
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      Returns:
      the list of releases for the specified project
      Throws:
      GitLabApiException - if any exception occurs
    • getReleases

      public Pager<Release> getReleases(Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
      Get a Pager of releases for a project, sorted by release date.
      GitLab Endpoint: GET /projects/:id/releases
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      itemsPerPage - the number of Release instances that will be fetched per page
      Returns:
      the Pager of Release instances for the specified project ID
      Throws:
      GitLabApiException - if any exception occurs
    • getReleasesStream

      public Stream<Release> getReleasesStream(Object projectIdOrPath) throws GitLabApiException
      Get a Stream of releases for a project, sorted by release date.
      GitLab Endpoint: GET /projects/:id/releases
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      Returns:
      a Stream of Release instances for the specified project ID
      Throws:
      GitLabApiException - if any exception occurs
    • getRelease

      public Release getRelease(Object projectIdOrPath, String tagName) throws GitLabApiException
      Get a Release for the given tag name.
      GitLab Endpoint: GET /projects/:id/releases/:tagName
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      tagName - the name of the tag to fetch the Release for
      Returns:
      a Releases instance with info on the specified tag
      Throws:
      GitLabApiException - if any exception occurs
    • getOptionalRelease

      public Optional<Release> getOptionalRelease(Object projectIdOrPath, String tagName) throws GitLabApiException
      Get an Optional instance holding a Release instance for the specific tag name.
      GitLab Endpoint: GET /projects/:id/releases/:tagName
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      tagName - the name of the tag to fetch the Release for
      Returns:
      an Optional instance with the specified Release as the value
      Throws:
      GitLabApiException - if any exception occurs
    • createRelease

      public Release createRelease(Object projectIdOrPath, ReleaseParams params) throws GitLabApiException
      Create a Release. You need push access to the repository to create a Release.
      GitLab Endpoint: POST /projects/:id/releases
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      params - a ReleaseParams instance holding the parameters for the release
      Returns:
      a Release instance containing the newly created Release info
      Throws:
      GitLabApiException - if any exception occurs
    • updateRelease

      public Release updateRelease(Object projectIdOrPath, ReleaseParams params) throws GitLabApiException
      Updates the release notes of a given release.
      GitLab Endpoint: PUT /projects/:id/releases/:tag_name
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      params - a ReleaseParams instance holding the parameters for the release
      Returns:
      a Release instance containing info on the updated Release
      Throws:
      GitLabApiException - if any exception occurs
    • deleteRelease

      public void deleteRelease(Object projectIdOrPath, String tagName) throws GitLabApiException
      Delete a Release. Deleting a Release will not delete the associated tag.
      GitLab Endpoint: DELETE /projects/:id/releases/:tag_name
      Parameters:
      projectIdOrPath - the project in the form of an Long(ID), String(path), or Project instance
      tagName - the tag name that the release was created from
      Throws:
      GitLabApiException - if any exception occurs