Class TagsApi

    • Constructor Detail

      • TagsApi

        public TagsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getTags

        public java.util.List<Tag> getTags​(java.lang.Object projectIdOrPath)
                                    throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        public java.util.List<Tag> getTags​(java.lang.Object projectIdOrPath,
                                           int page,
                                           int perPage)
                                    throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        page - the page to get
        perPage - the number of Tag instances per page
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        public Pager<Tag> getTags​(java.lang.Object projectIdOrPath,
                                  int itemsPerPage)
                           throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the Pager of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTagsStream

        public java.util.stream.Stream<Tag> getTagsStream​(java.lang.Object projectIdOrPath)
                                                   throws GitLabApiException
        Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Stream of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getTags

        public java.util.List<Tag> getTags​(java.lang.Object projectIdOrPath,
                                           Constants.TagOrderBy orderBy,
                                           Constants.SortOrder sortOrder,
                                           java.lang.String search)
                                    throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        orderBy - return tags ordered by name or updated fields. Default is updated
        sortOrder - return tags sorted in asc or desc order. Default is desc
        search - return list of tags matching the search criteria
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 11.8
      • getTags

        public java.util.List<Tag> getTags​(java.lang.Object projectIdOrPath,
                                           Constants.TagOrderBy orderBy,
                                           Constants.SortOrder sortOrder,
                                           java.lang.String search,
                                           int page,
                                           int perPage)
                                    throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order and in the specified page range.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        orderBy - return tags ordered by name or updated fields. Default is updated
        sortOrder - return tags sorted in asc or desc order. Default is desc
        search - return list of tags matching the search criteria
        page - the page to get
        perPage - the number of Tag instances per page
        Returns:
        the list of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 11.8
      • getTags

        public Pager<Tag> getTags​(java.lang.Object projectIdOrPath,
                                  Constants.TagOrderBy orderBy,
                                  Constants.SortOrder sortOrder,
                                  java.lang.String search,
                                  int itemsPerPage)
                           throws GitLabApiException
        Get a list of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        orderBy - return tags ordered by name or updated fields. Default is updated
        sortOrder - return tags sorted in asc or desc order. Default is desc
        search - return list of tags matching the search criteria
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the Pager of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 11.8
      • getTagsStream

        public java.util.stream.Stream<Tag> getTagsStream​(java.lang.Object projectIdOrPath,
                                                          Constants.TagOrderBy orderBy,
                                                          Constants.SortOrder sortOrder,
                                                          java.lang.String search)
                                                   throws GitLabApiException
        Get a Stream of repository tags from a project, sorted by name in reverse alphabetical order.
        GitLab Endpoint: GET /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        orderBy - return tags ordered by name or updated fields. Default is updated
        sortOrder - return tags sorted in asc or desc order. Default is desc
        search - return list of tags matching the search criteria
        Returns:
        a Stream of tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
        Since:
        GitLab 11.8
      • getTag

        public Tag getTag​(java.lang.Object projectIdOrPath,
                          java.lang.String tagName)
                   throws GitLabApiException
        Get a specific repository tag determined by its name.
        GitLab Endpoint: GET /projects/:id/repository/tags/: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 info for
        Returns:
        a Tag instance with info on the specified tag
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalTag

        public java.util.Optional<Tag> getOptionalTag​(java.lang.Object projectIdOrPath,
                                                      java.lang.String tagName)
                                               throws GitLabApiException
        Get an Optional instance holding a Tag instance of a specific repository tag determined by its name.
        GitLab Endpoint: GET /projects/:id/repository/tags/: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 info for
        Returns:
        an Optional instance with the specified project tag as the value
        Throws:
        GitLabApiException - if any exception occurs
      • createTag

        public Tag createTag​(java.lang.Object projectIdOrPath,
                             java.lang.String tagName,
                             java.lang.String ref)
                      throws GitLabApiException
        Creates a tag on a particular ref of the given project.
        GitLab Endpoint: POST /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - The name of the tag Must be unique for the project
        ref - the git ref to place the tag on
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • createTag

        public Tag createTag​(java.lang.Object projectIdOrPath,
                             java.lang.String tagName,
                             java.lang.String ref,
                             java.lang.String message,
                             java.lang.String releaseNotes)
                      throws GitLabApiException
        Creates a tag on a particular ref of the given project with optional message and release notes.
        GitLab Endpoint: POST /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - The name of the tag Must be unique for the project
        ref - the git ref to place the tag on
        message - the message to included with the tag (optional)
        releaseNotes - the release notes for the tag (optional)
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • createTag

        public Tag createTag​(java.lang.Object projectIdOrPath,
                             java.lang.String tagName,
                             java.lang.String ref,
                             java.lang.String message,
                             java.io.File releaseNotesFile)
                      throws GitLabApiException
        Creates a tag on a particular ref of a given project. A message and a File instance containing the release notes are optional. This method is the same as createTag(Object, String, String, String, String), but instead allows the release notes to be supplied in a file.
        GitLab Endpoint: POST /projects/:id/repository/tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - the name of the tag, must be unique for the project
        ref - the git ref to place the tag on
        message - the message to included with the tag (optional)
        releaseNotesFile - a whose contents are the release notes (optional)
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • deleteTag

        public void deleteTag​(java.lang.Object projectIdOrPath,
                              java.lang.String tagName)
                       throws GitLabApiException
        Deletes the tag from a project with the specified tag name.
        GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - The name of the tag to delete
        Throws:
        GitLabApiException - if any exception occurs
      • createRelease

        public Release createRelease​(java.lang.Object projectIdOrPath,
                                     java.lang.String tagName,
                                     java.lang.String releaseNotes)
                              throws GitLabApiException
        Add release notes to the existing git tag.
        GitLab Endpoint: POST /projects/:id/repository/tags/:tagName/release
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - the name of a tag
        releaseNotes - release notes with markdown support
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • updateRelease

        public Release updateRelease​(java.lang.Object projectIdOrPath,
                                     java.lang.String tagName,
                                     java.lang.String releaseNotes)
                              throws GitLabApiException
        Updates the release notes of a given release.
        GitLab Endpoint: PUT /projects/:id/repository/tags/:tagName/release
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        tagName - the name of a tag
        releaseNotes - release notes with markdown support
        Returns:
        a Tag instance containing info on the newly created tag
        Throws:
        GitLabApiException - if any exception occurs
      • getProtectedTags

        public java.util.List<ProtectedTag> getProtectedTags​(java.lang.Object projectIdOrPath)
                                                      throws GitLabApiException
        Gets a list of protected tags from a project.
        GitLab Endpoint: GET /projects/:id/protected_tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a List of protected tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getProtectedTags

        public java.util.List<ProtectedTag> getProtectedTags​(java.lang.Object projectIdOrPath,
                                                             int page,
                                                             int perPage)
                                                      throws GitLabApiException
        Gets a list of protected tags from a project and in the specified page range.
        GitLab Endpoint: GET /projects/:id/protected_tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        page - the page to get
        perPage - the number of Tag instances per page
        Returns:
        a List of tags for the specified project ID and page range
        Throws:
        GitLabApiException - if any exception occurs
      • getProtectedTags

        public Pager<ProtectedTag> getProtectedTags​(java.lang.Object projectIdOrPath,
                                                    int itemsPerPage)
                                             throws GitLabApiException
        Get a Pager of protected tags for a project.
        GitLab Endpoint: GET /projects/:id/protected_tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        itemsPerPage - the number of Project instances that will be fetched per page
        Returns:
        the Pager of protected tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getProtectedTagsStream

        public java.util.stream.Stream<ProtectedTag> getProtectedTagsStream​(java.lang.Object projectIdOrPath)
                                                                     throws GitLabApiException
        Get a Stream of protected tags for a project.
        GitLab Endpoint: GET /projects/:id/protected_tags/:name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        Returns:
        a Stream of protected tags for the specified project ID
        Throws:
        GitLabApiException - if any exception occurs
      • getProtectedTag

        public ProtectedTag getProtectedTag​(java.lang.Object projectIdOrPath,
                                            java.lang.String name)
                                     throws GitLabApiException
        Gets a single protected tag or wildcard protected tag
        GitLab Endpoint: GET /projects/:id/protected_tags/:name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        name - the name of the tag or wildcard
        Returns:
        a ProtectedTag instance with info on the specified protected tag
        Throws:
        GitLabApiException - if any exception occurs
      • getOptionalProtectedTag

        public java.util.Optional<ProtectedTag> getOptionalProtectedTag​(java.lang.Object projectIdOrPath,
                                                                        java.lang.String name)
                                                                 throws GitLabApiException
        Get an Optional instance holding a protected tag or wildcard protected tag.
        GitLab Endpoint: GET /projects/:id/protected_tags/:name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        name - the name of the tag or wildcard
        Returns:
        an Optional instance with the specified protected tag as the value
        Throws:
        GitLabApiException - if any exception occurs
      • protectTag

        public ProtectedTag protectTag​(java.lang.Object projectIdOrPath,
                                       java.lang.String name,
                                       AccessLevel createAccessLevel)
                                throws GitLabApiException
        Protects a single repository tag or several project repository tags using a wildcard protected tag.
        GitLab Endpoint: POST /projects/:id/protected_tags
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        name - the name of the tag or wildcard
        createAccessLevel - the access level allowed to create
        Returns:
        a ProtectedTag instance
        Throws:
        GitLabApiException - if any exception occurs
      • unprotectTag

        public void unprotectTag​(java.lang.Object projectIdOrPath,
                                 java.lang.String name)
                          throws GitLabApiException
        Unprotects the given protected tag or wildcard protected tag.
        GitLab Endpoint: GET /projects/:id/protected_tags/:name
        Parameters:
        projectIdOrPath - id, path of the project, or a Project instance holding the project ID or path
        name - the name of the tag or wildcard
        Throws:
        GitLabApiException - if any exception occurs