public interface

InsightAnnotationService

com.atlassian.bitbucket.codeinsights.annotation.InsightAnnotationService

Summary

Public Methods
void addAnnotations(BulkAddInsightAnnotationRequest request)
Add annotations to a report.
void delete(DeleteAnnotationRequest request)
Delete all annotations that match the provided request.
@Nonnull Optional<InsightAnnotation> get(InsightReport report, String externalId)
Get the annotation with a given externalId on the provided report
void 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.

Public Methods

public void addAnnotations (BulkAddInsightAnnotationRequest request)

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
ArgumentValidationException if any of the annotations contains invalid data
AnnotationsLimitExceededException if the total number of annotations (stored + new) would exceed the maximum allowed

public void delete (DeleteAnnotationRequest request)

Delete all annotations that match the provided request. If no externalIds are provided all annotations matching the provided reportKey will be deleted.

Parameters
request a request describing the annotations to delete

@Nonnull public Optional<InsightAnnotation> get (InsightReport report, String externalId)

Get the annotation with a given externalId on the provided report

Parameters
report The report to which this annotation belongs
externalId The externalID to identify the annotation
Returns

public void 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.

Parameters
request request that details the annotation to update and the new data

public void stream (SearchAnnotationRequest request, AnnotationCallback callback)

Stream the annotations for a commit or a pull request. Annotations will continue to be streamed until the callback returns false or there are no more annotations to stream.

Parameters
request a request describing the annotations to stream
callback the callback onto which the annotations should be streamed