Interface InsightAnnotationService


public interface InsightAnnotationService
Since:
5.15
  • Method Details

    • addAnnotations

      void addAnnotations(@Nonnull 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:
      com.atlassian.bitbucket.validation.ArgumentValidationException - if any of the annotations contains invalid data
      AnnotationsLimitExceededException - if the total number of annotations (stored + new) would exceed the maximum allowed
    • delete

      void delete(@Nonnull 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
    • get

      @Nonnull Optional<InsightAnnotation> get(@Nonnull InsightReport report, @Nonnull 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:
      The matching InsightAnnotation, or Optional.empty() if none exists
    • stream

      void stream(@Nonnull SearchAnnotationRequest request, @Nonnull 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
    • set

      void set(@Nonnull 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