Package org.gitlab4j.api
Class PackagesApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.PackagesApi
-
- All Implemented Interfaces:
org.gitlab4j.models.Constants
public class PackagesApi extends AbstractApi
This class implements the client side API for the GitLab Packages API. See Packages API at GitLab for more information.
NOTE: This API is not available in the Community edition of 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 class org.gitlab4j.api.AbstractApi
gitLabApi
-
-
Constructor Summary
Constructors Constructor Description PackagesApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deletePackage(java.lang.Object projectIdOrPath, java.lang.Long packageId)
Deletes a project package.org.gitlab4j.api.models.Package
getPackage(java.lang.Object projectIdOrPath, java.lang.Long packageId)
Get a single project package.java.util.List<org.gitlab4j.api.models.PackageFile>
getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId)
Get a list of package files of a single package.Pager<org.gitlab4j.api.models.PackageFile>
getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId, int itemsPerPage)
Get a Pager of project package files.java.util.List<org.gitlab4j.api.models.PackageFile>
getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId, int page, int perPage)
Get a list of package files of a single package for the specified page.java.util.List<org.gitlab4j.api.models.Package>
getPackages(java.lang.Object projectIdOrPath)
Get a list of project packages.Pager<org.gitlab4j.api.models.Package>
getPackages(java.lang.Object projectIdOrPath, int itemsPerPage)
Get a Pager of project packages.java.util.List<org.gitlab4j.api.models.Package>
getPackages(java.lang.Object projectIdOrPath, int page, int perPage)
Get a list of project packages for the specified page.Pager<org.gitlab4j.api.models.Package>
getPackages(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PackageFilter filter, int itemsPerPage)
Get a Pager of project packages.java.util.stream.Stream<org.gitlab4j.api.models.Package>
getPackagesStream(java.lang.Object projectIdOrPath)
Get a Stream of project packages.java.util.stream.Stream<org.gitlab4j.api.models.PackageFile>
getPackagesStream(java.lang.Object projectIdOrPath, java.lang.Long packageId)
Get a Stream of project package files.java.util.stream.Stream<org.gitlab4j.api.models.Package>
getPackagesStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PackageFilter filter)
Get a Stream of project packages.-
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, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
PackagesApi
public PackagesApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getPackages
public java.util.List<org.gitlab4j.api.models.Package> getPackages(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a list of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a list of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public java.util.List<org.gitlab4j.api.models.Package> getPackages(java.lang.Object projectIdOrPath, int page, int perPage) throws GitLabApiException
Get a list of project packages for the specified page. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepage
- the page to getperPage
- the number of Package instances per page- Returns:
- a list of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public Pager<org.gitlab4j.api.models.Package> getPackages(java.lang.Object projectIdOrPath, int itemsPerPage) throws GitLabApiException
Get a Pager of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instanceitemsPerPage
- the number of Package instances per page- Returns:
- a Pager of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackages
public Pager<org.gitlab4j.api.models.Package> getPackages(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PackageFilter filter, int itemsPerPage) throws GitLabApiException
Get a Pager of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
- the PackageFilter instance holding the filter values for the queryitemsPerPage
- the number of Package instances per page- Returns:
- a Pager of project packages for the specified range
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
public java.util.stream.Stream<org.gitlab4j.api.models.Package> getPackagesStream(java.lang.Object projectIdOrPath) throws GitLabApiException
Get a Stream of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instance- Returns:
- a Stream of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
public java.util.stream.Stream<org.gitlab4j.api.models.Package> getPackagesStream(java.lang.Object projectIdOrPath, org.gitlab4j.api.models.PackageFilter filter) throws GitLabApiException
Get a Stream of project packages. Both Maven and NPM packages are included in results. When accessed without authentication, only packages of public projects are returned.GitLab Endpoint: GET /projects/:id/packages
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancefilter
- the PackageFilter instance holding the filter values for the query- Returns:
- a Stream of pages in the project's packages
- Throws:
GitLabApiException
- if any exception occurs
-
getPackage
public org.gitlab4j.api.models.Package getPackage(java.lang.Object projectIdOrPath, java.lang.Long packageId) throws GitLabApiException
Get a single project package.GitLab Endpoint: GET /projects/:id/packages/:package_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get- Returns:
- a Package instance for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public java.util.List<org.gitlab4j.api.models.PackageFile> getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId) throws GitLabApiException
Get a list of package files of a single package.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files for- Returns:
- a list of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public java.util.List<org.gitlab4j.api.models.PackageFile> getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId, int page, int perPage) throws GitLabApiException
Get a list of package files of a single package for the specified page.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files forpage
- the page to getperPage
- the number of PackageFile instances per page- Returns:
- a list of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackageFiles
public Pager<org.gitlab4j.api.models.PackageFile> getPackageFiles(java.lang.Object projectIdOrPath, java.lang.Long packageId, int itemsPerPage) throws GitLabApiException
Get a Pager of project package files.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files foritemsPerPage
- the number of PackageFile instances per page- Returns:
- a Pager of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
getPackagesStream
public java.util.stream.Stream<org.gitlab4j.api.models.PackageFile> getPackagesStream(java.lang.Object projectIdOrPath, java.lang.Long packageId) throws GitLabApiException
Get a Stream of project package files.GitLab Endpoint: GET /projects/:id/packages/:package_id/package_files
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to get the package files for- Returns:
- a Stream of PackageFile instances for the specified package ID
- Throws:
GitLabApiException
- if any exception occurs
-
deletePackage
public void deletePackage(java.lang.Object projectIdOrPath, java.lang.Long packageId) throws GitLabApiException
Deletes a project package.GitLab Endpoint: DELETE /projects/:id/packages/:package_id
- Parameters:
projectIdOrPath
- the project in the form of an Long(ID), String(path), or Project instancepackageId
- the ID of the package to delete- Throws:
GitLabApiException
- if any exception occurs
-
-