listComplianceSummaries method

Future<ListComplianceSummariesResult> listComplianceSummaries({
  1. List<ComplianceStringFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a summary count of compliant and non-compliant resources for a compliance type. For example, this call can return State Manager associations, patches, or custom compliance types according to the filter criteria that you specify.

May throw InvalidFilter. May throw InvalidNextToken. May throw InternalServerError.

Parameter filters : One or more compliance or inventory filters. Use a filter to return a more specific list of results.

Parameter maxResults : The maximum number of items to return for this call. Currently, you can specify null or 50. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : A token to start the list. Use this token to get the next set of results.

Implementation

Future<ListComplianceSummariesResult> listComplianceSummaries({
  List<ComplianceStringFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListComplianceSummaries'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListComplianceSummariesResult.fromJson(jsonResponse.body);
}