Interface InsightAnnotationService
public interface InsightAnnotationService
- Since:
- 5.15
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add annotations to a report.void
delete
(DeleteAnnotationRequest request) Delete all annotations that match the provided request.get
(InsightReport report, String externalId) Get the annotation with a given externalId on the provided reportvoid
set
(SetInsightAnnotationRequest request) Update the existing annotation by replacing it with the data contained in the annotation request, or create it if it doesn't exist.void
stream
(SearchAnnotationRequest request, AnnotationCallback callback) Stream the annotations for a commit or a pull request.
-
Method Details
-
addAnnotations
Add annotations to a report.- Parameters:
request
- request that details what annotations to create. If one of the annotations fail validation the entire batch is rejected.- Throws:
com.atlassian.bitbucket.validation.ArgumentValidationException
- if any of the annotations contains invalid dataAnnotationsLimitExceededException
- if the total number of annotations (stored + new) would exceed the maximum allowed
-
delete
Delete all annotations that match the provided request. If noexternalIds
are provided all annotations matching the providedreportKey
will be deleted.- Parameters:
request
- a request describing the annotations to delete
-
get
Get the annotation with a given externalId on the provided report- Parameters:
report
- The report to which this annotation belongsexternalId
- The externalID to identify the annotation- Returns:
- The matching
InsightAnnotation
, orOptional.empty()
if none exists
-
stream
Stream the annotations for a commit or a pull request. Annotations will continue to be streamed until thecallback
returnsfalse
or there are no more annotations to stream.- Parameters:
request
- a request describing the annotations to streamcallback
- the callback onto which the annotations should be streamed
-
set
Update the existing annotation by replacing it with the data contained in the annotation request, or create it if it doesn't exist.- Parameters:
request
- request that details the annotation to update and the new data
-