Class ReleaseLinksApi

    • Constructor Detail

      • ReleaseLinksApi

        public ReleaseLinksApi​(GitLabApi gitLabApi)
    • Method Detail

      • getLinks

        public java.util.List<Link> getLinks​(java.lang.Object projectIdOrPath,
                                             java.lang.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​(java.lang.Object projectIdOrPath,
                                    java.lang.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 java.util.stream.Stream<Link> getLinksStream​(java.lang.Object projectIdOrPath,
                                                            java.lang.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​(java.lang.Object projectIdOrPath,
                            java.lang.String tagName,
                            java.lang.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 java.util.Optional<Link> getOptionalLink​(java.lang.Object projectIdOrPath,
                                                        java.lang.String tagName,
                                                        java.lang.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​(java.lang.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​(java.lang.Object projectIdOrPath,
                               java.lang.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​(java.lang.Object projectIdOrPath,
                               java.lang.String tagName,
                               java.lang.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