Class ReleasesApi

  • All Implemented Interfaces:
    org.gitlab4j.models.Constants

    public class ReleasesApi
    extends AbstractApi
    This class provides an entry point to all the GitLab Releases API calls.
    See Also:
    Releases API at GitLab
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gitlab4j.models.Constants

        org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
    • Field Summary

      • Fields inherited from interface org.gitlab4j.models.Constants

        NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
    • Constructor Detail

      • ReleasesApi

        public ReleasesApi​(GitLabApi gitLabApi)
    • Method Detail

      • getReleases

        public java.util.List<org.gitlab4j.api.models.Release> getReleases​(java.lang.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<org.gitlab4j.api.models.Release> getReleases​(java.lang.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 java.util.stream.Stream<org.gitlab4j.api.models.Release> getReleasesStream​(java.lang.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 org.gitlab4j.api.models.Release getRelease​(java.lang.Object projectIdOrPath,
                                                          java.lang.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 java.util.Optional<org.gitlab4j.api.models.Release> getOptionalRelease​(java.lang.Object projectIdOrPath,
                                                                                      java.lang.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 org.gitlab4j.api.models.Release createRelease​(java.lang.Object projectIdOrPath,
                                                             org.gitlab4j.api.models.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 org.gitlab4j.api.models.Release updateRelease​(java.lang.Object projectIdOrPath,
                                                             org.gitlab4j.api.models.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​(java.lang.Object projectIdOrPath,
                                  java.lang.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