Package org.gitlab4j.api
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:
- Releases API at GitLab
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.gitlab4j.api.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.ContributorOrderBy, Constants.DefaultBranchProtectionLevel, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.EventScope, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PackageOrderBy, Constants.PackageStatus, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectAccessTokenScope, Constants.ProjectCreationLevel, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.SubgroupCreationLevel, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
Fields inherited from interface org.gitlab4j.api.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
-
-
Constructor Summary
Constructors Constructor Description ReleasesApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Release
createRelease(java.lang.Object projectIdOrPath, ReleaseParams params)
Create a Release.void
deleteRelease(java.lang.Object projectIdOrPath, java.lang.String tagName)
Delete a Release.java.util.Optional<Release>
getOptionalRelease(java.lang.Object projectIdOrPath, java.lang.String tagName)
Get an Optional instance holding a Release instance for the specific tag name.Release
getRelease(java.lang.Object projectIdOrPath, java.lang.String tagName)
Get a Release for the given tag name.java.util.List<Release>
getReleases(java.lang.Object projectIdOrPath)
Get a list of releases for a project, sorted by release date.Pager<Release>
getReleases(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of releases for a project, sorted by release date.java.util.stream.Stream<Release>
getReleasesStream(java.lang.Object projectIdOrPath)
Get a Stream of releases for a project, sorted by release date.Release
updateRelease(java.lang.Object projectIdOrPath, ReleaseParams params)
Updates the release notes of a given release.-
Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getNamespaceIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
ReleasesApi
public ReleasesApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getReleases
public java.util.List<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<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 pathitemsPerPage
- 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<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 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 pathtagName
- 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<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 pathtagName
- 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(java.lang.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 pathparams
- 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(java.lang.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 pathparams
- 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 instancetagName
- the tag name that the release was created from- Throws:
GitLabApiException
- if any exception occurs
-
-