Class DiscussionsApi

    • Constructor Detail

      • DiscussionsApi

        public DiscussionsApi​(GitLabApi gitLabApi)
    • Method Detail

      • getIssueDiscussions

        public List<Discussion> getIssueDiscussions​(Object projectIdOrPath,
                                                    Integer issueIid)
                                             throws GitLabApiException
        Get a list of all discussions for the specified issue.
        GitLab Endpoint: GET /projects/:id/issues/:issue_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        issueIid - the internal ID of the issue
        Returns:
        a list containing all the discussions for the specified issue
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getIssueDiscussions

        public List<Discussion> getIssueDiscussions​(Object projectIdOrPath,
                                                    Integer issueIid,
                                                    int maxItems)
                                             throws GitLabApiException
        Get a list of discussions for the specified issue.
        GitLab Endpoint: GET /projects/:id/issues/:issue_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        issueIid - the internal ID of the issue
        maxItems - the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the issue
        Returns:
        a list containing the discussions for the specified issue
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getIssueDiscussionsPager

        public Pager<Discussion> getIssueDiscussionsPager​(Object projectIdOrPath,
                                                          Integer issueIid,
                                                          int itemsPerPage)
                                                   throws GitLabApiException
        Get a Pager of Discussion instances for the specified issue.
        GitLab Endpoint: GET /projects/:id/issues/:issue_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        issueIid - the internal ID of the issue
        itemsPerPage - the number of Discussion instances that will be fetched per page
        Returns:
        a Pager containing the Discussion instances for the specified issue
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getIssueDiscussionsStream

        public Stream<Discussion> getIssueDiscussionsStream​(Object projectIdOrPath,
                                                            Integer issueIid)
                                                     throws GitLabApiException
        Get a Stream of Discussion instances for the specified issue.
        GitLab Endpoint: GET /projects/:id/issues/:issue_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        issueIid - the internal ID of the issue
        Returns:
        a Stream instance containing the Discussion instances for the specified issue
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getSnippetDiscussions

        public List<Discussion> getSnippetDiscussions​(Object projectIdOrPath,
                                                      Integer snippetId)
                                               throws GitLabApiException
        Get a list of all discussions for the specified snippet.
        GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        snippetId - the ID of the snippet
        Returns:
        a list containing all the discussions for the specified snippet
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getSnippetDiscussions

        public List<Discussion> getSnippetDiscussions​(Object projectIdOrPath,
                                                      Integer snippetId,
                                                      int maxItems)
                                               throws GitLabApiException
        Get a list of discussions for the specified snippet.
        GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        snippetId - the ID of the snippet
        maxItems - the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the snippet
        Returns:
        a list containing the discussions for the specified snippet
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getSnippetDiscussionsPager

        public Pager<Discussion> getSnippetDiscussionsPager​(Object projectIdOrPath,
                                                            Integer snippetId,
                                                            int itemsPerPage)
                                                     throws GitLabApiException
        Get a Pager of Discussion instances for the specified snippet.
        GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        snippetId - the ID of the snippet
        itemsPerPage - the number of Discussion instances that will be fetched per page
        Returns:
        a Pager containing the Discussion instances for the specified snippet
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getSnippetDiscussionsStream

        public Stream<Discussion> getSnippetDiscussionsStream​(Object projectIdOrPath,
                                                              Integer snippetId)
                                                       throws GitLabApiException
        Get a Stream of Discussion instances for the specified snippet.
        GitLab Endpoint: GET /projects/:id/snippets/:snippet_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        snippetId - the ID of the snippet
        Returns:
        a Stream instance containing the Discussion instances for the specified snippet
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getEpicDiscussions

        public List<Discussion> getEpicDiscussions​(Object projectIdOrPath,
                                                   Integer epicId)
                                            throws GitLabApiException
        Get a list of all discussions for the specified epic.
        GitLab Endpoint: GET /projects/:id/epics/:epic_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        epicId - the internal ID of the epic
        Returns:
        a list containing all the discussions for the specified epic
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getEpicDiscussions

        public List<Discussion> getEpicDiscussions​(Object projectIdOrPath,
                                                   Integer epicId,
                                                   int maxItems)
                                            throws GitLabApiException
        Get a list of discussions for the specified epic.
        GitLab Endpoint: GET /projects/:id/epics/:epic_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        epicId - the internal ID of the epic
        maxItems - the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the epic
        Returns:
        a list containing the discussions for the specified epic
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getEpicDiscussionsPager

        public Pager<Discussion> getEpicDiscussionsPager​(Object projectIdOrPath,
                                                         Integer epicId,
                                                         int itemsPerPage)
                                                  throws GitLabApiException
        Get a Pager of Discussion instances for the specified epic.
        GitLab Endpoint: GET /projects/:id/epics/:epic_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        epicId - the internal ID of the epic
        itemsPerPage - the number of Discussion instances that will be fetched per page
        Returns:
        a Pager containing the Discussion instances for the specified epic
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getEpicDiscussionsStream

        public Stream<Discussion> getEpicDiscussionsStream​(Object projectIdOrPath,
                                                           Integer epicId)
                                                    throws GitLabApiException
        Get a Stream of Discussion instances for the specified epic.
        GitLab Endpoint: GET /projects/:id/epics/:epic_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        epicId - the internal ID of the epic
        Returns:
        a Stream instance containing the Discussion instances for the specified epic
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getMergeRequestDiscussions

        public List<Discussion> getMergeRequestDiscussions​(Object projectIdOrPath,
                                                           Integer mergeRequestIid)
                                                    throws GitLabApiException
        Get a list of all discussions for the specified merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a list containing all the discussions for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getMergeRequestDiscussions

        public List<Discussion> getMergeRequestDiscussions​(Object projectIdOrPath,
                                                           Integer mergeRequestIid,
                                                           int maxItems)
                                                    throws GitLabApiException
        Get a list of discussions for the specified merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        maxItems - the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the merge request
        Returns:
        a list containing the discussions for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getMergeRequestDiscussionsPager

        public Pager<Discussion> getMergeRequestDiscussionsPager​(Object projectIdOrPath,
                                                                 Integer mergeRequestIid,
                                                                 int itemsPerPage)
                                                          throws GitLabApiException
        Get a Pager of Discussion instances for the specified merge request.
        GitLab Endpoint: GET /projects/:id/merge_requests/:merge_request_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        itemsPerPage - the number of Discussion instances that will be fetched per page
        Returns:
        a Pager containing the Discussion instances for the specified merge request
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getMergeRequestDiscussionsStream

        public Stream<Discussion> getMergeRequestDiscussionsStream​(Object projectIdOrPath,
                                                                   Integer mergeRequestIid)
                                                            throws GitLabApiException
        Get a Stream of Discussion instances for the specified merge request.
        GitLab Endpoint: GET /projects/:id/issues/:issue_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - the internal ID of the merge request
        Returns:
        a Stream instance containing the Discussion instances for the specified issue
        Throws:
        GitLabApiException - if any exception occurs during execution
      • createMergeRequestDiscussion

        public Discussion createMergeRequestDiscussion​(Object projectIdOrPath,
                                                       Integer mergeRequestIid,
                                                       String body,
                                                       Date createdAt,
                                                       String positionHash,
                                                       Position position)
                                                throws GitLabApiException
        Creates a new discussion to a single project merge request. This is similar to creating a note but other comments (replies) can be added to it later.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - mergeRequestIid the internal ID of the merge request
        body - the content of a discussion
        createdAt - date the discussion was created (requires admin or project/group owner rights)
        positionHash - position when creating a diff note
        position - a Position instance holding the position attributes
        Returns:
        a Discussion instance containing the newly created discussion
        Throws:
        GitLabApiException - if any exception occurs during execution
      • resolveMergeRequestDiscussion

        public Discussion resolveMergeRequestDiscussion​(Object projectIdOrPath,
                                                        Integer mergeRequestIid,
                                                        Integer discussionId,
                                                        Boolean resolved)
                                                 throws GitLabApiException
        Resolve or unresolve whole discussion of a merge request.
        GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - mergeRequestIid the internal ID of the merge request
        discussionId - the ID of a discussion
        resolved - resolve/unresolve the discussion
        Returns:
        the updated DIscussion instance
        Throws:
        GitLabApiException - if any exception occurs during execution
      • deleteMergeRequestDiscussionNote

        public void deleteMergeRequestDiscussionNote​(Object projectIdOrPath,
                                                     Integer mergeRequestIid,
                                                     Integer discussionId,
                                                     Integer noteId)
                                              throws GitLabApiException
        Deletes an existing discussion note of a merge request.
        GitLab Endpoint: DELETE /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes/:note_id
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        mergeRequestIid - mergeRequestIid the internal ID of the merge request
        discussionId - the ID of a discussion
        noteId - the note ID to delete
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getCommitDiscussions

        public List<Discussion> getCommitDiscussions​(Object projectIdOrPath,
                                                     Integer commitId)
                                              throws GitLabApiException
        Get a list of all discussions for the specified commit.
        GitLab Endpoint: GET /projects/:id/commits/:commit_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        commitId - the internal ID of the commit
        Returns:
        a list containing all the discussions for the specified commit
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getCommitDiscussions

        public List<Discussion> getCommitDiscussions​(Object projectIdOrPath,
                                                     Integer commitId,
                                                     int maxItems)
                                              throws GitLabApiException
        Get a list of discussions for the specified commit.
        GitLab Endpoint: GET /projects/:id/commits/:commit_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        commitId - the internal ID of the commit
        maxItems - the maximum number of Discussion instances to get, if < 1 will fetch all Discussion instances for the commit
        Returns:
        a list containing the discussions for the specified commit
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getCommitDiscussionsPager

        public Pager<Discussion> getCommitDiscussionsPager​(Object projectIdOrPath,
                                                           Integer commitId,
                                                           int itemsPerPage)
                                                    throws GitLabApiException
        Get a Pager of Discussion instances for the specified commit.
        GitLab Endpoint: GET /projects/:id/commits/:commit_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        commitId - the internal ID of the commit
        itemsPerPage - the number of Discussion instances that will be fetched per page
        Returns:
        a Pager containing the Discussion instances for the specified commit
        Throws:
        GitLabApiException - if any exception occurs during execution
      • getCommitDiscussionsStream

        public Stream<Discussion> getCommitDiscussionsStream​(Object projectIdOrPath,
                                                             Integer commitId)
                                                      throws GitLabApiException
        Get a Stream of Discussion instances for the specified commit.
        GitLab Endpoint: GET /projects/:id/commits/:commit_id/discussions
        Parameters:
        projectIdOrPath - projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
        commitId - the internal ID of the commit
        Returns:
        a Stream instance containing the Discussion instances for the specified commit
        Throws:
        GitLabApiException - if any exception occurs during execution