listAssessmentControlInsightsByControlDomain method

Future<ListAssessmentControlInsightsByControlDomainResponse> listAssessmentControlInsightsByControlDomain({
  1. required String assessmentId,
  2. required String controlDomainId,
  3. int? maxResults,
  4. String? nextToken,
})

Lists the latest analytics data for controls within a specific control domain and a specific active assessment.

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

Parameter assessmentId : The unique identifier for the active assessment.

Parameter controlDomainId : The unique identifier for the control domain.

Audit Manager supports the control domains that are provided by Amazon Web Services Control Catalog. For information about how to find a list of available control domains, see ListDomains in the Amazon Web Services Control Catalog API Reference.

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.

Implementation

Future<ListAssessmentControlInsightsByControlDomainResponse>
    listAssessmentControlInsightsByControlDomain({
  required String assessmentId,
  required String controlDomainId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $query = <String, List<String>>{
    'assessmentId': [assessmentId],
    'controlDomainId': [controlDomainId],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/insights/controls-by-assessment',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAssessmentControlInsightsByControlDomainResponse.fromJson(
      response);
}