createAssessment method

Future<CreateAssessmentResponse> createAssessment({
  1. required AssessmentReportsDestination assessmentReportsDestination,
  2. required String frameworkId,
  3. required String name,
  4. required List<Role> roles,
  5. required Scope scope,
  6. String? description,
  7. Map<String, String>? tags,
})

Creates an assessment in Audit Manager.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter assessmentReportsDestination : The assessment report storage destination for the assessment that's being created.

Parameter frameworkId : The identifier for the framework that the assessment will be created from.

Parameter name : The name of the assessment to be created.

Parameter roles : The list of roles for the assessment.

Parameter description : The optional description of the assessment to be created.

Parameter tags : The tags that are associated with the assessment.

Implementation

Future<CreateAssessmentResponse> createAssessment({
  required AssessmentReportsDestination assessmentReportsDestination,
  required String frameworkId,
  required String name,
  required List<Role> roles,
  required Scope scope,
  String? description,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'assessmentReportsDestination': assessmentReportsDestination,
    'frameworkId': frameworkId,
    'name': name,
    'roles': roles,
    'scope': scope,
    if (description != null) 'description': description,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/assessments',
    exceptionFnMap: _exceptionFns,
  );
  return CreateAssessmentResponse.fromJson(response);
}