Package org.gitlab4j.api
Class DiscussionsApi
java.lang.Object
org.gitlab4j.api.AbstractApi
org.gitlab4j.api.DiscussionsApi
- All Implemented Interfaces:
Constants
public class DiscussionsApi extends AbstractApi
This class implements the client side API for the GitLab Discussions API.
See Discussions API at GitLab for more information.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gitlab4j.api.Constants
Constants.ActionType, Constants.ApplicationScope, Constants.ArchiveFormat, Constants.AutoDevopsDeployStrategy, Constants.BuildGitStrategy, Constants.CommitBuildState, Constants.DeploymentOrderBy, Constants.DeploymentStatus, Constants.DeployTokenScope, Constants.Encoding, Constants.EpicOrderBy, Constants.GroupOrderBy, Constants.GroupSearchScope, Constants.ImpersonationState, Constants.IssueOrderBy, Constants.IssueScope, Constants.IssueState, Constants.JobScope, Constants.LineType, Constants.MergeRequestOrderBy, Constants.MergeRequestScope, Constants.MergeRequestSearchIn, Constants.MergeRequestState, Constants.MilestoneState, Constants.PipelineOrderBy, Constants.PipelineScope, Constants.ProjectOrderBy, Constants.ProjectSearchScope, Constants.SearchScope, Constants.SortOrder, Constants.SquashOption, Constants.StateEvent, Constants.TagOrderBy, Constants.TargetType, Constants.TodoAction, Constants.TodoState, Constants.TodoType, Constants.TokenType
-
Field Summary
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
Fields inherited from interface org.gitlab4j.api.Constants
NEXT_PAGE_HEADER, PAGE_HEADER, PAGE_PARAM, PER_PAGE, PER_PAGE_PARAM, PREV_PAGE_HEADER, TOTAL_HEADER, TOTAL_PAGES_HEADER
-
Constructor Summary
Constructors Constructor Description DiscussionsApi(GitLabApi gitLabApi)
-
Method Summary
Modifier and Type Method Description Note
addCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, String body, Date createdAt)
Adds a note to an existing commit discussion.Note
addIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, String body, Date createdAt)
Adds a new note to the thread.Note
addMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, String body, Date createdAt)
Adds a new note to the thread.Discussion
createCommitDiscussion(Object projectIdOrPath, String commitSha, String body, Date createdAt, String positionHash, Position position)
Creates a new discussion to a single project commit.Discussion
createIssueDiscussion(Object projectIdOrPath, Integer issueIid, String body, Date createdAt)
Creates a new thread to a single project issue.Discussion
createMergeRequestDiscussion(Object projectIdOrPath, Integer mergeRequestIid, String body, Date createdAt, String positionHash, Position position)
Creates a new discussion to a single project merge request.void
deleteCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId)
Deletes an existing discussion note of a commit.void
deleteIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, Integer noteId)
Deletes an existing thread note of an issue.void
deleteMergeRequestDiscussionNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Integer noteId)
Deletes an existing discussion note of a merge request.void
deleteMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Integer noteId)
Deletes an existing thread note of a merge request.Discussion
getCommitDiscussion(Object projectIdOrPath, String commitSha, String discussionId)
Get a single discussion for the specified commit.List<Discussion>
getCommitDiscussions(Object projectIdOrPath, String commitSha)
Get a list of all discussions for the specified commit.List<Discussion>
getCommitDiscussions(Object projectIdOrPath, String commitSha, int maxItems)
Get a list of discussions for the specified commit.Pager<Discussion>
getCommitDiscussionsPager(Object projectIdOrPath, String commitSha, int itemsPerPage)
Get a Pager of Discussion instances for the specified commit.Stream<Discussion>
getCommitDiscussionsStream(Object projectIdOrPath, String commitSha)
Get a Stream of Discussion instances for the specified commit.List<Discussion>
getEpicDiscussions(Object projectIdOrPath, Integer epicId)
Get a list of all discussions for the specified epic.List<Discussion>
getEpicDiscussions(Object projectIdOrPath, Integer epicId, int maxItems)
Get a list of discussions for the specified epic.Pager<Discussion>
getEpicDiscussionsPager(Object projectIdOrPath, Integer epicId, int itemsPerPage)
Get a Pager of Discussion instances for the specified epic.Stream<Discussion>
getEpicDiscussionsStream(Object projectIdOrPath, Integer epicId)
Get a Stream of Discussion instances for the specified epic.List<Discussion>
getIssueDiscussions(Object projectIdOrPath, Integer issueIid)
Get a list of all discussions for the specified issue.List<Discussion>
getIssueDiscussions(Object projectIdOrPath, Integer issueIid, int maxItems)
Get a list of discussions for the specified issue.Pager<Discussion>
getIssueDiscussionsPager(Object projectIdOrPath, Integer issueIid, int itemsPerPage)
Get a Pager of Discussion instances for the specified issue.Stream<Discussion>
getIssueDiscussionsStream(Object projectIdOrPath, Integer issueIid)
Get a Stream of Discussion instances for the specified issue.List<Discussion>
getMergeRequestDiscussions(Object projectIdOrPath, Integer mergeRequestIid)
Get a list of all discussions for the specified merge request.List<Discussion>
getMergeRequestDiscussions(Object projectIdOrPath, Integer mergeRequestIid, int maxItems)
Get a list of discussions for the specified merge request.Pager<Discussion>
getMergeRequestDiscussionsPager(Object projectIdOrPath, Integer mergeRequestIid, int itemsPerPage)
Get a Pager of Discussion instances for the specified merge request.Stream<Discussion>
getMergeRequestDiscussionsStream(Object projectIdOrPath, Integer mergeRequestIid)
Get a Stream of Discussion instances for the specified merge request.Optional<Discussion>
getOptionalCommitDiscussion(Object projectIdOrPath, String commitSha, String discussionId)
Get an Optional instance of a single discussion for the specified commit.List<Discussion>
getSnippetDiscussions(Object projectIdOrPath, Integer snippetId)
Get a list of all discussions for the specified snippet.List<Discussion>
getSnippetDiscussions(Object projectIdOrPath, Integer snippetId, int maxItems)
Get a list of discussions for the specified snippet.Pager<Discussion>
getSnippetDiscussionsPager(Object projectIdOrPath, Integer snippetId, int itemsPerPage)
Get a Pager of Discussion instances for the specified snippet.Stream<Discussion>
getSnippetDiscussionsStream(Object projectIdOrPath, Integer snippetId)
Get a Stream of Discussion instances for the specified snippet.Note
modifyCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId, String body)
Modify an existing discussion note of a commit.Note
modifyIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, Integer noteId, String body)
Modify existing thread note of an issue.Note
modifyMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Integer noteId, String body, Boolean resolved)
Modify or resolve an existing thread note of a merge request.Note
resolveCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId, Boolean resolved)
Resolve or unresolve an existing discussion note of a commit.Discussion
resolveMergeRequestDiscussion(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Boolean resolved)
Resolve or unresolve whole discussion of a merge request.Methods inherited from class org.gitlab4j.api.AbstractApi
addFormParam, addFormParam, delete, delete, get, get, getApiClient, getApiVersion, getDefaultPerPage, getDefaultPerPageParam, getDefaultPerPageParam, getGroupIdOrPath, getLabelIdOrName, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, upload, upload, upload, urlEncode, validate
-
Constructor Details
-
DiscussionsApi
-
-
Method Details
-
getIssueDiscussions
public List<Discussion> getIssueDiscussions(Object projectIdOrPath, Integer issueIid) throws GitLabApiExceptionGet 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 instanceissueIid
- 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 GitLabApiExceptionGet 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 instanceissueIid
- the internal ID of the issuemaxItems
- 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 GitLabApiExceptionGet 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 instanceissueIid
- the internal ID of the issueitemsPerPage
- 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 GitLabApiExceptionGet 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 instanceissueIid
- 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 GitLabApiExceptionGet 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 instancesnippetId
- 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 GitLabApiExceptionGet 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 instancesnippetId
- the ID of the snippetmaxItems
- 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 GitLabApiExceptionGet 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 instancesnippetId
- the ID of the snippetitemsPerPage
- 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 GitLabApiExceptionGet 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 instancesnippetId
- 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 GitLabApiExceptionGet 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 instanceepicId
- 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 GitLabApiExceptionGet 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 instanceepicId
- the internal ID of the epicmaxItems
- 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 GitLabApiExceptionGet 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 instanceepicId
- the internal ID of the epicitemsPerPage
- 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 GitLabApiExceptionGet 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 instanceepicId
- 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 GitLabApiExceptionGet 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 instancemergeRequestIid
- 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 GitLabApiExceptionGet 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 instancemergeRequestIid
- the internal ID of the merge requestmaxItems
- 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 GitLabApiExceptionGet 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 instancemergeRequestIid
- the internal ID of the merge requestitemsPerPage
- 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 GitLabApiExceptionGet 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 instancemergeRequestIid
- 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 GitLabApiExceptionCreates 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 instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestbody
- the content of a discussioncreatedAt
- date the discussion was created (requires admin or project/group owner rights)positionHash
- position when creating a diff noteposition
- 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, String discussionId, Boolean resolved) throws GitLabApiExceptionResolve or unresolve whole discussion of a merge request.GitLab Endpoint: PUT /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestdiscussionId
- the ID of a discussionresolved
- 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, String discussionId, Integer noteId) throws GitLabApiExceptionDeletes 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 instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestdiscussionId
- the ID of a discussionnoteId
- the note ID to delete- Throws:
GitLabApiException
- if any exception occurs during execution
-
getCommitDiscussions
public List<Discussion> getCommitDiscussions(Object projectIdOrPath, String commitSha) throws GitLabApiExceptionGet a list of all discussions for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions for- 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, String commitSha, int maxItems) throws GitLabApiExceptionGet a list of discussions for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions formaxItems
- 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, String commitSha, int itemsPerPage) throws GitLabApiExceptionGet a Pager of Discussion instances for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions foritemsPerPage
- 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, String commitSha) throws GitLabApiExceptionGet a Stream of Discussion instances for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions for- Returns:
- a Stream instance containing the Discussion instances for the specified commit
- Throws:
GitLabApiException
- if any exception occurs during execution
-
getCommitDiscussion
public Discussion getCommitDiscussion(Object projectIdOrPath, String commitSha, String discussionId) throws GitLabApiExceptionGet a single discussion for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions fordiscussionId
- the ID of the discussion- Returns:
- the Discussion instance specified by discussionId for the specified commit
- Throws:
GitLabApiException
- if any exception occurs during execution
-
getOptionalCommitDiscussion
public Optional<Discussion> getOptionalCommitDiscussion(Object projectIdOrPath, String commitSha, String discussionId)Get an Optional instance of a single discussion for the specified commit.GitLab Endpoint: GET /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the SHA of the commit to get discussions fordiscussionId
- the ID of the discussion- Returns:
- an Optional instance with the specified Discussion instance as a value
-
createCommitDiscussion
public Discussion createCommitDiscussion(Object projectIdOrPath, String commitSha, String body, Date createdAt, String positionHash, Position position) throws GitLabApiExceptionCreates a new discussion to a single project commit. This is similar to creating a note but other comments (replies) can be added to it later.GitLab Endpoint: POST /projects/:id/repository/commits/:commit_sha/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the commit SHA to create the discussion forbody
- the content of a discussioncreatedAt
- date the discussion was created (requires admin or project/group owner rights)positionHash
- position when creating a diff noteposition
- a Position instance holding the position attributes- Returns:
- a Discussion instance containing the newly created discussion
- Throws:
GitLabApiException
- if any exception occurs during execution
-
addCommitDiscussionNote
public Note addCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, String body, Date createdAt) throws GitLabApiExceptionAdds a note to an existing commit discussion.GitLab Endpoint: POST /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id/notes
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the commit SHA to create the discussion fordiscussionId
- the ID of a discussionbody
- the content of a discussioncreatedAt
- date the discussion was created (requires admin or project/group owner rights)- Returns:
- a Note instance containing the newly created discussion note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
modifyCommitDiscussionNote
public Note modifyCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId, String body) throws GitLabApiExceptionModify an existing discussion note of a commit.GitLab Endpoint: PUT /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id/notes
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the commit SHA to delete the discussion fromdiscussionId
- the ID of a discussionnoteId
- the note ID to modifybody
- the content of a discussion- Returns:
- a Note instance containing the updated discussion note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
resolveCommitDiscussionNote
public Note resolveCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId, Boolean resolved) throws GitLabApiExceptionResolve or unresolve an existing discussion note of a commit.GitLab Endpoint: PUT /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id/notes
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the commit SHA to delete the discussion fromdiscussionId
- the ID of a discussionnoteId
- the note ID to resolve or unresolveresolved
- if true will resolve the note, false will unresolve the note- Returns:
- a Note instance containing the updated discussion note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
deleteCommitDiscussionNote
public void deleteCommitDiscussionNote(Object projectIdOrPath, String commitSha, String discussionId, Integer noteId) throws GitLabApiExceptionDeletes an existing discussion note of a commit.GitLab Endpoint: DELETE /projects/:id/repository/commits/:commit_sha/discussions/:discussion_id/notes/:note_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancecommitSha
- the commit SHA to delete the discussion fromdiscussionId
- the ID of a discussionnoteId
- the note ID to delete- Throws:
GitLabApiException
- if any exception occurs during execution
-
addMergeRequestThreadNote
public Note addMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, String body, Date createdAt) throws GitLabApiExceptionAdds a new note to the thread. This can also create a thread from a single comment.GitLab Endpoint: POST /projects/:id/merge_requests/:merge_request_iid/discussions/:discussion_id/notes
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestdiscussionId
- the ID of a discussionbody
- the content of a discussioncreatedAt
- date the discussion was created (requires admin or project/group owner rights)- Returns:
- a Note instance containing the newly created discussion note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
modifyMergeRequestThreadNote
public Note modifyMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Integer noteId, String body, Boolean resolved) throws GitLabApiExceptionModify or resolve an existing thread note of a merge request.GitLab Endpoint: PUT /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 instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestdiscussionId
- the ID of a discussionnoteId
- the note ID to modifybody
- the content of a discussionresolved
- if true will resolve the note, false will unresolve the note- Returns:
- a Note instance containing the updated discussion note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
deleteMergeRequestThreadNote
public void deleteMergeRequestThreadNote(Object projectIdOrPath, Integer mergeRequestIid, String discussionId, Integer noteId) throws GitLabApiExceptionDeletes an existing thread 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 instancemergeRequestIid
- mergeRequestIid the internal ID of the merge requestdiscussionId
- the ID of a discussionnoteId
- the note ID to delete- Throws:
GitLabApiException
- if any exception occurs during execution
-
createIssueDiscussion
public Discussion createIssueDiscussion(Object projectIdOrPath, Integer issueIid, String body, Date createdAt) throws GitLabApiExceptionCreates a new thread to a single project issue. This is similar to creating a note but other comments (replies) can be added to it later.GitLab Endpoint: POST /projects/:id/issues/:issue_iid/discussions
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instanceissueIid
- The IID of an issuebody
- the content of the discussioncreatedAt
- (optional) date the discussion was created (requires admin or project/group owner rights)- Returns:
- a Discussion instance containing the newly created discussion
- Throws:
GitLabApiException
- if any exception occurs during execution
-
addIssueThreadNote
public Note addIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, String body, Date createdAt) throws GitLabApiExceptionAdds a new note to the thread.GitLab Endpoint: POST /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instanceissueIid
- The IID of an issuediscussionId
- the id of discussionbody
- the content of the notecreatedAt
- (optional) date the discussion was created (requires admin or project/group owner rights)- Returns:
- a Note instance containing the newly created note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
modifyIssueThreadNote
public Note modifyIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, Integer noteId, String body) throws GitLabApiExceptionModify existing thread note of an issue.GitLab Endpoint: PUT /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instanceissueIid
- The IID of an issuediscussionId
- the id of discussionnoteId
- the id of the notebody
- the content of the note- Returns:
- a Note instance containing the modified note
- Throws:
GitLabApiException
- if any exception occurs during execution
-
deleteIssueThreadNote
public void deleteIssueThreadNote(Object projectIdOrPath, Integer issueIid, String discussionId, Integer noteId) throws GitLabApiExceptionDeletes an existing thread note of an issue.GitLab Endpoint: DELETE /projects/:id/issues/:issue_iid/discussions/:discussion_id/notes/:note_id
- Parameters:
projectIdOrPath
- projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instanceissueIid
- The IID of an issuediscussionId
- the id of discussionnoteId
- the id of the note- Throws:
GitLabApiException
- if any exception occurs during execution
-