listControls method
Returns a list of controls from Audit Manager.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ValidationException.
Parameter controlType :
A filter that narrows the list of controls to a specific type.
Parameter controlCatalogId :
A filter that narrows the list of controls to a specific resource from the
Amazon Web Services Control Catalog.
To use this parameter, specify the ARN of the Control Catalog resource.
You can specify either a control domain, a control objective, or a common
control. For information about how to find the ARNs for these resources,
see
ListDomains ,
ListObjectives , and
ListCommonControls .
Alternatively, specify UNCATEGORIZED to list controls that
aren't mapped to a Control Catalog resource. For example, this operation
might return a list of custom controls that don't belong to any control
domain or control objective.
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<ListControlsResponse> listControls({
required ControlType controlType,
String? controlCatalogId,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
1000,
);
final $query = <String, List<String>>{
'controlType': [controlType.value],
if (controlCatalogId != null) 'controlCatalogId': [controlCatalogId],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/controls',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListControlsResponse.fromJson(response);
}