getAssessmentReport method

Future<GetAssessmentReportResponse> getAssessmentReport({
  1. required String assessmentRunArn,
  2. required ReportFileFormat reportFileFormat,
  3. required ReportType reportType,
})

Produces an assessment report that includes detailed and comprehensive results of a specified assessment run.

May throw AccessDeniedException. May throw AssessmentRunInProgressException. May throw InternalException. May throw InvalidInputException. May throw NoSuchEntityException. May throw ServiceTemporarilyUnavailableException. May throw UnsupportedFeatureException.

Parameter assessmentRunArn : The ARN that specifies the assessment run for which you want to generate a report.

Parameter reportFileFormat : Specifies the file format (html or pdf) of the assessment report that you want to generate.

Parameter reportType : Specifies the type of the assessment report that you want to generate. There are two types of assessment reports: a finding report and a full report. For more information, see Assessment Reports.

Implementation

Future<GetAssessmentReportResponse> getAssessmentReport({
  required String assessmentRunArn,
  required ReportFileFormat reportFileFormat,
  required ReportType reportType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'InspectorService.GetAssessmentReport'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'assessmentRunArn': assessmentRunArn,
      'reportFileFormat': reportFileFormat.value,
      'reportType': reportType.value,
    },
  );

  return GetAssessmentReportResponse.fromJson(jsonResponse.body);
}