public interface CommentService
Modifier and Type | Method and Description |
---|---|
Comment |
addComment(AddCommentRequest request)
Adds a general comment on a commentable
|
Comment |
addComment(AddFileCommentRequest request)
Adds a comment on a file in a diff
|
Comment |
addComment(AddLineCommentRequest request)
Adds a comment on a line on a file in a diff
|
Comment |
addReply(AddCommentReplyRequest request)
Adds a comment reply to a
tread |
long |
countComments(CommentSearchRequest request)
Count all the
comments matching the provided request. |
Map<CommentState,Long> |
countCommentsByState(CommentSearchRequest request)
|
long |
countThreads(CommentSearchRequest request)
Count all the
threads matching the provided request. |
boolean |
deleteComment(long commentId,
int version)
Delete a comment
|
Optional<Comment> |
getComment(long commentId)
Find a comment with the given ID
|
Page<Comment> |
search(CommentSearchRequest request,
PageRequest pageRequest)
Search for all
comments matching the provided request. |
Page<CommentThread> |
searchThreads(CommentSearchRequest request,
PageRequest pageRequest)
Search for all
threads matching the provided request. |
Comment |
updateComment(CommentUpdateRequest request)
Updates a
comment according to the provided request , with the
following restrictions:
only the author of the comment may update the text of the comment
only the author of the comment, the author of the pull request (in the case of comments on pull requests)
or repository admins and above may update the other fields of a comment
|
@Nonnull Comment addComment(@Nonnull AddCommentRequest request)
request
- describes the comment to create@Nonnull Comment addComment(@Nonnull AddFileCommentRequest request)
request
- describes the comment to create@Nonnull Comment addComment(@Nonnull AddLineCommentRequest request)
request
- describes the comment to create@Nonnull Comment addReply(@Nonnull AddCommentReplyRequest request)
tread
request
- a request describing the comment to be addedNoSuchCommentException
- if the parent comment cannot be foundlong countComments(@Nonnull CommentSearchRequest request)
comments
matching the provided request.
If present, each one of the properties in the search request applies an extra filter to the search
criteria. A null
value (or an empty collection) means no filter will be applied
for that property. Orphaned
comments are not
counted by this endpoint.
request
- the request describing the searchMap<CommentState,Long> countCommentsByState(@Nonnull CommentSearchRequest request)
comments
matching the provided request, grouped by state
.
If present, each one of the properties in the search request applies an extra filter to the search
criteria. A null
value (or an empty collection) means no filter will be applied
for that property.
request
- the request describing the searchlong countThreads(@Nonnull CommentSearchRequest request)
threads
matching the provided request.
If present, each one of the properties in the search request applies an extra filter to the search
criteria. A null
value (or an empty collection) means no filter will be applied
for that property. Orphaned
comments are not
counted by this endpoint.
request
- the request describing the searchboolean deleteComment(long commentId, int version)
commentId
- the ID for the comment that should be deletedversion
- the expected version for the comment to deletetrue
if the comment existed and was deleted, false
otherwiseCommentDeletionException
- if the comment has repliesCommentOutOfDateException
- if the provided version
doesn't match the comment's current versionNoSuchCommentException
- if the comment to delete cannot be found@Nonnull Optional<Comment> getComment(long commentId)
commentId
- the ID for the comment to look for@Nonnull Page<Comment> search(@Nonnull CommentSearchRequest request, @Nonnull PageRequest pageRequest)
comments
matching the provided request.
If present, each one of the properties in the search request applies an extra filter to the search
criteria. A null
value (or an empty collection) means no filter will be applied
for that property.
request
- the request describing the searchpageRequest
- the request specifying the start and limit of the page@Nonnull Page<CommentThread> searchThreads(@Nonnull CommentSearchRequest request, @Nonnull PageRequest pageRequest)
threads
matching the provided request.
If present, each one of the properties in the search request applies an extra filter to the search
criteria. A null
value (or an empty collection) means no filter will be applied
for that property. Orphaned
comments are not
returned by this endpoint.
request
- the request describing the searchpageRequest
- the request specifying the start and limit of the page@Nonnull Comment updateComment(@Nonnull CommentUpdateRequest request)
comment
according to the provided request
, with the
following restrictions:
request
- the request describing how the comment should be updatedCommentOutOfDateException
- if the provided version
doesn't match the comment's current versionNoSuchCommentException
- if the comment to update cannot be foundCopyright © 2019 Atlassian. All rights reserved.