describeAggregateComplianceByConfigRules method

Future<DescribeAggregateComplianceByConfigRulesResponse> describeAggregateComplianceByConfigRules({
  1. required String configurationAggregatorName,
  2. ConfigRuleComplianceFilters? filters,
  3. int? limit,
  4. String? nextToken,
})

Returns a list of compliant and noncompliant rules with the number of resources for compliant and noncompliant rules.

May throw ValidationException. May throw InvalidLimitException. May throw InvalidNextTokenException. May throw NoSuchConfigurationAggregatorException.

Parameter configurationAggregatorName : The name of the configuration aggregator.

Parameter filters : Filters the results by ConfigRuleComplianceFilters object.

Parameter limit : The maximum number of evaluation results returned on each page. The default is maximum. If you specify 0, AWS Config uses the default.

Parameter nextToken : The nextToken string returned on a previous page that you use to get the next page of results in a paginated response.

Implementation

Future<DescribeAggregateComplianceByConfigRulesResponse>
    describeAggregateComplianceByConfigRules({
  required String configurationAggregatorName,
  ConfigRuleComplianceFilters? filters,
  int? limit,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(
      configurationAggregatorName, 'configurationAggregatorName');
  _s.validateStringLength(
    'configurationAggregatorName',
    configurationAggregatorName,
    1,
    256,
    isRequired: true,
  );
  _s.validateNumRange(
    'limit',
    limit,
    0,
    1000,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'StarlingDoveService.DescribeAggregateComplianceByConfigRules'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigurationAggregatorName': configurationAggregatorName,
      if (filters != null) 'Filters': filters,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeAggregateComplianceByConfigRulesResponse.fromJson(
      jsonResponse.body);
}