listCommonControls method

Future<ListCommonControlsResponse> listCommonControls({
  1. CommonControlFilter? commonControlFilter,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a paginated list of common controls from the Amazon Web Services Control Catalog.

You can apply an optional filter to see common controls that have a specific objective. If you don’t provide a filter, the operation returns all common controls.

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

Parameter commonControlFilter : An optional filter that narrows the results to a specific objective.

This filter allows you to specify one objective ARN at a time. Passing multiple ARNs in the CommonControlFilter isn’t supported.

Parameter maxResults : 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<ListCommonControlsResponse> listCommonControls({
  CommonControlFilter? commonControlFilter,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final $payload = <String, dynamic>{
    if (commonControlFilter != null)
      'CommonControlFilter': commonControlFilter,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/common-controls',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListCommonControlsResponse.fromJson(response);
}