listAssessments method

Future<ListAssessmentsResponse> listAssessments({
  1. int? maxResults,
  2. String? nextToken,
  3. AssessmentStatus? status,
})

Returns a list of current and past assessments from Audit Manager.

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

Parameter maxResults : Represents the maximum number of results on a page or for an API request call.

Parameter nextToken : The pagination token that's used to fetch the next set of results.

Parameter status : The current status of the assessment.

Implementation

Future<ListAssessmentsResponse> listAssessments({
  int? maxResults,
  String? nextToken,
  AssessmentStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (status != null) 'status': [status.value],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/assessments',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAssessmentsResponse.fromJson(response);
}