listAggregateDiscoveredResources method

Future<ListAggregateDiscoveredResourcesResponse> listAggregateDiscoveredResources({
  1. required String configurationAggregatorName,
  2. required ResourceType resourceType,
  3. ResourceFilters? filters,
  4. int? limit,
  5. String? nextToken,
})

Accepts a resource type and returns a list of resource identifiers that are aggregated for a specific resource type across accounts and regions. A resource identifier includes the resource type, ID, (if available) the custom resource name, source account, and source region. You can narrow the results to include only resources that have specific resource IDs, or a resource name, or source account ID, or source region.

For example, if the input consists of accountID 12345678910 and the region is us-east-1 for resource type AWS::EC2::Instance then the API returns all the EC2 instance identifiers of accountID 12345678910 and region us-east-1.

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

Parameter configurationAggregatorName : The name of the configuration aggregator.

Parameter resourceType : The type of resources that you want AWS Config to list in the response.

Parameter filters : Filters the results based on the ResourceFilters object.

Parameter limit : The maximum number of resource identifiers returned on each page. The default is 100. You cannot specify a number greater than 100. 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<ListAggregateDiscoveredResourcesResponse>
    listAggregateDiscoveredResources({
  required String configurationAggregatorName,
  required ResourceType resourceType,
  ResourceFilters? filters,
  int? limit,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(
      configurationAggregatorName, 'configurationAggregatorName');
  _s.validateStringLength(
    'configurationAggregatorName',
    configurationAggregatorName,
    1,
    256,
    isRequired: true,
  );
  ArgumentError.checkNotNull(resourceType, 'resourceType');
  _s.validateNumRange(
    'limit',
    limit,
    0,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'StarlingDoveService.ListAggregateDiscoveredResources'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ConfigurationAggregatorName': configurationAggregatorName,
      'ResourceType': resourceType.toValue(),
      if (filters != null) 'Filters': filters,
      if (limit != null) 'Limit': limit,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListAggregateDiscoveredResourcesResponse.fromJson(jsonResponse.body);
}