createAssessmentReport method

Future<CreateAssessmentReportResponse> createAssessmentReport({
  1. required String assessmentId,
  2. required String name,
  3. String? description,
  4. String? queryStatement,
})

Creates an assessment report for the specified assessment.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter assessmentId : The identifier for the assessment.

Parameter name : The name of the new assessment report.

Parameter description : The description of the assessment report.

Parameter queryStatement : A SQL statement that represents an evidence finder query.

Provide this parameter when you want to generate an assessment report from the results of an evidence finder search query. When you use this parameter, Audit Manager generates a one-time report using only the evidence from the query output. This report does not include any assessment evidence that was manually added to a report using the console, or associated with a report using the API.

To use this parameter, the enablementStatus of evidence finder must be ENABLED.

For examples and help resolving queryStatement validation exceptions, see Troubleshooting evidence finder issues in the Audit Manager User Guide.

Implementation

Future<CreateAssessmentReportResponse> createAssessmentReport({
  required String assessmentId,
  required String name,
  String? description,
  String? queryStatement,
}) async {
  final $payload = <String, dynamic>{
    'name': name,
    if (description != null) 'description': description,
    if (queryStatement != null) 'queryStatement': queryStatement,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/assessments/${Uri.encodeComponent(assessmentId)}/reports',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAssessmentReportResponse.fromJson(response);
}