Class ReleaseLinksApi

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

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

    • ReleaseLinksApi

      public ReleaseLinksApi(GitLabApi gitLabApi)
  • Method Details

    • getLinks

      public List<Link> getLinks(Object projectIdOrPath, String tagName) throws GitLabApiException
      Get assets as Links from a Release.
      GitLab Endpoint: GET /projects/:id/releases/:tagName/assets/links
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      tagName - the tag name that the release was created from
      Returns:
      the list of assets for the specified release
      Throws:
      GitLabApiException - if any exception occurs
    • getLinks

      public Pager<Link> getLinks(Object projectIdOrPath, String tagName, int itemsPerPage) throws GitLabApiException
      Get assets as Links from a Release.
      GitLab Endpoint: GET /projects/:id/releases/:tagName/assets/links
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      tagName - the tag name that the release was created from
      itemsPerPage - the number of Link instances that will be fetched per page
      Returns:
      the Pager of Link instances for the specified project ID
      Throws:
      GitLabApiException - if any exception occurs
    • getLinksStream

      public Stream<Link> getLinksStream(Object projectIdOrPath, String tagName) throws GitLabApiException
      Get a Stream of assets as Links from a Release.
      GitLab Endpoint: GET /projects/:id/releases/:tagName/assets/links
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      tagName - the tag name that the release was created from
      Returns:
      a Stream of Link instances for the specified project ID
      Throws:
      GitLabApiException - if any exception occurs
    • getLink

      public Link getLink(Object projectIdOrPath, String tagName, Integer linkId) throws GitLabApiException
      Get a Link for the given tag name and link id.
      GitLab Endpoint: GET /projects/:id/releases/:tagName/assets/links/:linkId
      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 Link for
      linkId - the id of the Link to fetch for
      Returns:
      a Link instance with info on the specified tag and id
      Throws:
      GitLabApiException - if any exception occurs
    • getOptionalLink

      public Optional<Link> getOptionalLink(Object projectIdOrPath, String tagName, Integer linkId) throws GitLabApiException
      Get an Optional instance holding a Link instance for the specific tag name and link id.
      GitLab Endpoint: GET /projects/:id/releases/:tagName/assets/links/:linkId
      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 Link for
      linkId - the id of the Link to fetch for
      Returns:
      an Optional instance with the specified Link as the value
      Throws:
      GitLabApiException - if any exception occurs
    • createLink

      public Link createLink(Object projectIdOrPath, ReleaseLinkParams params) throws GitLabApiException
      Create a Link. You need push access to the repository to create a Link.
      GitLab Endpoint: POST /projects/:id/releases/:tagName/assets/links
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      params - a ReleaseLinksParams instance holding the parameters for the link
      Returns:
      a Link instance containing the newly created Link info
      Throws:
      GitLabApiException - if any exception occurs
    • updateLink

      public Link updateLink(Object projectIdOrPath, Integer linkId, ReleaseLinkParams params) throws GitLabApiException
      Updates the attributes of a given Link.
      GitLab Endpoint: PUT /projects/:id/releases/:tagName/assets/links/:linkId
      Parameters:
      projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
      linkId - the id of the Link to fetch for
      params - a ReleaseLinksParams instance holding the parameters for the Link
      Returns:
      a Link instance containing info on the updated Link
      Throws:
      GitLabApiException - if any exception occurs
    • deleteLink

      public void deleteLink(Object projectIdOrPath, String tagName, Integer linkId) throws GitLabApiException
      Delete a Link.
      GitLab Endpoint: DELETE /projects/:id/releases/:tagName/assets/links/:linkId
      Parameters:
      projectIdOrPath - the project in the form of an Integer(ID), String(path), or Project instance
      tagName - the tag name that the link was created from
      linkId - the id of the Link to delete
      Throws:
      GitLabApiException - if any exception occurs