Package org.gitlab4j.api
Class DiscussionsApi
- java.lang.Object
-
- org.gitlab4j.api.AbstractApi
-
- org.gitlab4j.api.DiscussionsApi
-
- All Implemented Interfaces:
org.gitlab4j.models.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.models.Constants
org.gitlab4j.models.Constants.ActionType, org.gitlab4j.models.Constants.ApplicationScope, org.gitlab4j.models.Constants.ArchiveFormat, org.gitlab4j.models.Constants.AutoCancelPendingPipelines, org.gitlab4j.models.Constants.AutoDevopsDeployStrategy, org.gitlab4j.models.Constants.BuildGitStrategy, org.gitlab4j.models.Constants.CommitBuildState, org.gitlab4j.models.Constants.ContributorOrderBy, org.gitlab4j.models.Constants.DefaultBranchProtectionLevel, org.gitlab4j.models.Constants.DeploymentOrderBy, org.gitlab4j.models.Constants.DeploymentStatus, org.gitlab4j.models.Constants.DeployTokenScope, org.gitlab4j.models.Constants.Encoding, org.gitlab4j.models.Constants.EpicOrderBy, org.gitlab4j.models.Constants.EventScope, org.gitlab4j.models.Constants.GroupOrderBy, org.gitlab4j.models.Constants.GroupSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.ImpersonationState, org.gitlab4j.models.Constants.IssueOrderBy, org.gitlab4j.models.Constants.IssueScope, org.gitlab4j.models.Constants.IssueState, org.gitlab4j.models.Constants.JobScope, org.gitlab4j.models.Constants.LineType, org.gitlab4j.models.Constants.MergeRequestOrderBy, org.gitlab4j.models.Constants.MergeRequestScope, org.gitlab4j.models.Constants.MergeRequestSearchIn, org.gitlab4j.models.Constants.MergeRequestState, org.gitlab4j.models.Constants.MilestoneState, org.gitlab4j.models.Constants.PackageOrderBy, org.gitlab4j.models.Constants.PackageStatus, org.gitlab4j.models.Constants.PipelineOrderBy, org.gitlab4j.models.Constants.PipelineScope, org.gitlab4j.models.Constants.PipelineSource, org.gitlab4j.models.Constants.ProjectAccessTokenScope, org.gitlab4j.models.Constants.ProjectCreationLevel, org.gitlab4j.models.Constants.ProjectFeatureVisibilityAccessLevel, org.gitlab4j.models.Constants.ProjectOrderBy, org.gitlab4j.models.Constants.ProjectSearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SearchScope<T extends java.lang.Object>, org.gitlab4j.models.Constants.SortOrder, org.gitlab4j.models.Constants.SquashOption, org.gitlab4j.models.Constants.StateEvent, org.gitlab4j.models.Constants.SubgroupCreationLevel, org.gitlab4j.models.Constants.TagOrderBy, org.gitlab4j.models.Constants.TargetType, org.gitlab4j.models.Constants.TodoAction, org.gitlab4j.models.Constants.TodoState, org.gitlab4j.models.Constants.TodoType, org.gitlab4j.models.Constants.TokenType
-
-
Field Summary
-
Fields inherited from class org.gitlab4j.api.AbstractApi
gitLabApi
-
-
Constructor Summary
Constructors Constructor Description DiscussionsApi(GitLabApi gitLabApi)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.gitlab4j.api.models.Note
addCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt)
Adds a note to an existing commit discussion.org.gitlab4j.api.models.Note
addIssueThreadNote(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt)
Adds a new note to the thread.org.gitlab4j.api.models.Note
addMergeRequestThreadNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt)
Adds a new note to the thread.org.gitlab4j.api.models.Discussion
createCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String body, java.util.Date createdAt)
Creates a new discussion to a single project commit.org.gitlab4j.api.models.Discussion
createCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String body, java.util.Date createdAt, java.lang.String positionHash, org.gitlab4j.api.models.Position position)
Creates a new discussion to a single project commit.org.gitlab4j.api.models.Discussion
createIssueDiscussion(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String body, java.util.Date createdAt)
Creates a new thread to a single project issue.org.gitlab4j.api.models.Discussion
createMergeRequestDiscussion(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String body, java.util.Date createdAt, java.lang.String positionHash, org.gitlab4j.api.models.Position position)
Creates a new discussion to a single project merge request.void
deleteCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId)
Deletes an existing discussion note of a commit.void
deleteIssueThreadNote(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.Long noteId)
Deletes an existing thread note of an issue.void
deleteMergeRequestDiscussionNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long noteId)
Deletes an existing discussion note of a merge request.void
deleteMergeRequestThreadNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long noteId)
Deletes an existing thread note of a merge request.org.gitlab4j.api.models.Discussion
getCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId)
Get a single discussion for the specified commit.java.util.List<org.gitlab4j.api.models.Discussion>
getCommitDiscussions(java.lang.Object projectIdOrPath, java.lang.String commitSha)
Get a list of all discussions for the specified commit.java.util.List<org.gitlab4j.api.models.Discussion>
getCommitDiscussions(java.lang.Object projectIdOrPath, java.lang.String commitSha, int maxItems)
Get a list of discussions for the specified commit.Pager<org.gitlab4j.api.models.Discussion>
getCommitDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.String commitSha, int itemsPerPage)
Get a Pager of Discussion instances for the specified commit.java.util.stream.Stream<org.gitlab4j.api.models.Discussion>
getCommitDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.String commitSha)
Get a Stream of Discussion instances for the specified commit.java.util.List<org.gitlab4j.api.models.Discussion>
getEpicDiscussions(java.lang.Object projectIdOrPath, java.lang.Long epicId)
Get a list of all discussions for the specified epic.java.util.List<org.gitlab4j.api.models.Discussion>
getEpicDiscussions(java.lang.Object projectIdOrPath, java.lang.Long epicId, int maxItems)
Get a list of discussions for the specified epic.Pager<org.gitlab4j.api.models.Discussion>
getEpicDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long epicId, int itemsPerPage)
Get a Pager of Discussion instances for the specified epic.java.util.stream.Stream<org.gitlab4j.api.models.Discussion>
getEpicDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long epicId)
Get a Stream of Discussion instances for the specified epic.java.util.List<org.gitlab4j.api.models.Discussion>
getIssueDiscussions(java.lang.Object projectIdOrPath, java.lang.Long issueIid)
Get a list of all discussions for the specified issue.java.util.List<org.gitlab4j.api.models.Discussion>
getIssueDiscussions(java.lang.Object projectIdOrPath, java.lang.Long issueIid, int maxItems)
Get a list of discussions for the specified issue.Pager<org.gitlab4j.api.models.Discussion>
getIssueDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long issueIid, int itemsPerPage)
Get a Pager of Discussion instances for the specified issue.java.util.stream.Stream<org.gitlab4j.api.models.Discussion>
getIssueDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long issueIid)
Get a Stream of Discussion instances for the specified issue.java.util.List<org.gitlab4j.api.models.Discussion>
getMergeRequestDiscussions(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid)
Get a list of all discussions for the specified merge request.java.util.List<org.gitlab4j.api.models.Discussion>
getMergeRequestDiscussions(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, int maxItems)
Get a list of discussions for the specified merge request.Pager<org.gitlab4j.api.models.Discussion>
getMergeRequestDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, int itemsPerPage)
Get a Pager of Discussion instances for the specified merge request.java.util.stream.Stream<org.gitlab4j.api.models.Discussion>
getMergeRequestDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid)
Get a Stream of Discussion instances for the specified merge request.java.util.Optional<org.gitlab4j.api.models.Discussion>
getOptionalCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId)
Get an Optional instance of a single discussion for the specified commit.java.util.List<org.gitlab4j.api.models.Discussion>
getSnippetDiscussions(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get a list of all discussions for the specified snippet.java.util.List<org.gitlab4j.api.models.Discussion>
getSnippetDiscussions(java.lang.Object projectIdOrPath, java.lang.Long snippetId, int maxItems)
Get a list of discussions for the specified snippet.Pager<org.gitlab4j.api.models.Discussion>
getSnippetDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long snippetId, int itemsPerPage)
Get a Pager of Discussion instances for the specified snippet.java.util.stream.Stream<org.gitlab4j.api.models.Discussion>
getSnippetDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long snippetId)
Get a Stream of Discussion instances for the specified snippet.org.gitlab4j.api.models.Note
modifyCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body)
Modify an existing discussion note of a commit.org.gitlab4j.api.models.Note
modifyIssueThreadNote(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body)
Modify existing thread note of an issue.org.gitlab4j.api.models.Note
modifyMergeRequestThreadNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body, java.lang.Boolean resolved)
Modify or resolve an existing thread note of a merge request.org.gitlab4j.api.models.Note
resolveCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId, java.lang.Boolean resolved)
Resolve or unresolve an existing discussion note of a commit.org.gitlab4j.api.models.Discussion
resolveMergeRequestDiscussion(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.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, getNamespaceIdOrPath, getPageQueryParams, getPageQueryParams, getPerPageQueryParam, getProjectIdOrPath, getUserIdOrUsername, getWithAccepts, handle, head, isApiVersion, patch, patch, post, post, post, post, post, put, put, put, putUpload, putUpload, putWithFormData, putWithFormData, upload, upload, upload, upload, urlEncode, validate
-
-
-
-
Constructor Detail
-
DiscussionsApi
public DiscussionsApi(GitLabApi gitLabApi)
-
-
Method Detail
-
getIssueDiscussions
public java.util.List<org.gitlab4j.api.models.Discussion> getIssueDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getIssueDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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<org.gitlab4j.api.models.Discussion> getIssueDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.stream.Stream<org.gitlab4j.api.models.Discussion> getIssueDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getSnippetDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getSnippetDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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<org.gitlab4j.api.models.Discussion> getSnippetDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.stream.Stream<org.gitlab4j.api.models.Discussion> getSnippetDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getEpicDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getEpicDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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<org.gitlab4j.api.models.Discussion> getEpicDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.stream.Stream<org.gitlab4j.api.models.Discussion> getEpicDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getMergeRequestDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getMergeRequestDiscussions(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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<org.gitlab4j.api.models.Discussion> getMergeRequestDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 java.util.stream.Stream<org.gitlab4j.api.models.Discussion> getMergeRequestDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.Long 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 Long(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 org.gitlab4j.api.models.Discussion createMergeRequestDiscussion(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String body, java.util.Date createdAt, java.lang.String positionHash, org.gitlab4j.api.models.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 Long(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 org.gitlab4j.api.models.Discussion resolveMergeRequestDiscussion(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Boolean resolved) throws GitLabApiException
Resolve 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 Long(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(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getCommitDiscussions(java.lang.Object projectIdOrPath, java.lang.String commitSha) throws GitLabApiException
Get 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 Long(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 java.util.List<org.gitlab4j.api.models.Discussion> getCommitDiscussions(java.lang.Object projectIdOrPath, java.lang.String commitSha, int maxItems) throws GitLabApiException
Get 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 Long(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<org.gitlab4j.api.models.Discussion> getCommitDiscussionsPager(java.lang.Object projectIdOrPath, java.lang.String commitSha, int itemsPerPage) throws GitLabApiException
Get 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 Long(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 java.util.stream.Stream<org.gitlab4j.api.models.Discussion> getCommitDiscussionsStream(java.lang.Object projectIdOrPath, java.lang.String commitSha) throws GitLabApiException
Get 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 Long(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 org.gitlab4j.api.models.Discussion getCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId) throws GitLabApiException
Get 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 Long(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 java.util.Optional<org.gitlab4j.api.models.Discussion> getOptionalCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.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 Long(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 org.gitlab4j.api.models.Discussion createCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String body, java.util.Date createdAt, java.lang.String positionHash, org.gitlab4j.api.models.Position position) throws GitLabApiException
Creates 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 Long(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
-
createCommitDiscussion
public org.gitlab4j.api.models.Discussion createCommitDiscussion(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String body, java.util.Date createdAt) throws GitLabApiException
Creates 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 Long(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) (Optional)- Returns:
- a Discussion instance containing the newly created discussion
- Throws:
GitLabApiException
- if any exception occurs during execution
-
addCommitDiscussionNote
public org.gitlab4j.api.models.Note addCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt) throws GitLabApiException
Adds 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 Long(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 org.gitlab4j.api.models.Note modifyCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body) throws GitLabApiException
Modify 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 Long(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 org.gitlab4j.api.models.Note resolveCommitDiscussionNote(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId, java.lang.Boolean resolved) throws GitLabApiException
Resolve 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 Long(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(java.lang.Object projectIdOrPath, java.lang.String commitSha, java.lang.String discussionId, java.lang.Long noteId) throws GitLabApiException
Deletes 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 Long(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 org.gitlab4j.api.models.Note addMergeRequestThreadNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt) throws GitLabApiException
Adds 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 Long(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 org.gitlab4j.api.models.Note modifyMergeRequestThreadNote(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body, java.lang.Boolean resolved) throws GitLabApiException
Modify 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 Long(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(java.lang.Object projectIdOrPath, java.lang.Long mergeRequestIid, java.lang.String discussionId, java.lang.Long noteId) throws GitLabApiException
Deletes 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 Long(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 org.gitlab4j.api.models.Discussion createIssueDiscussion(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String body, java.util.Date createdAt) throws GitLabApiException
Creates 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 Long(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 org.gitlab4j.api.models.Note addIssueThreadNote(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.String body, java.util.Date createdAt) throws GitLabApiException
Adds 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 Long(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 org.gitlab4j.api.models.Note modifyIssueThreadNote(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.Long noteId, java.lang.String body) throws GitLabApiException
Modify 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 Long(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(java.lang.Object projectIdOrPath, java.lang.Long issueIid, java.lang.String discussionId, java.lang.Long noteId) throws GitLabApiException
Deletes 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 Long(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
-
-