listDiscoveredResources method

Future<ListDiscoveredResourcesResponse> listDiscoveredResources({
  1. required ResourceType resourceType,
  2. bool? includeDeletedResources,
  3. int? limit,
  4. String? nextToken,
  5. List<String>? resourceIds,
  6. String? resourceName,
})

Accepts a resource type and returns a list of resource identifiers for the resources of that type. A resource identifier includes the resource type, ID, and (if available) the custom resource name. The results consist of resources that AWS Config has discovered, including those that AWS Config is not currently recording. You can narrow the results to include only resources that have specific resource IDs or a resource name. The response is paginated. By default, AWS Config lists 100 resource identifiers on each page. You can customize this number with the limit parameter. The response includes a nextToken string. To get the next page of results, run the request again and specify the string for the nextToken parameter.

May throw ValidationException. May throw InvalidLimitException. May throw InvalidNextTokenException. May throw NoAvailableConfigurationRecorderException.

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

Parameter includeDeletedResources : Specifies whether AWS Config includes deleted resources in the results. By default, deleted resources are not included.

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.

Parameter resourceIds : The IDs of only those resources that you want AWS Config to list in the response. If you do not specify this parameter, AWS Config lists all resources of the specified type that it has discovered.

Parameter resourceName : The custom name of only those resources that you want AWS Config to list in the response. If you do not specify this parameter, AWS Config lists all resources of the specified type that it has discovered.

Implementation

Future<ListDiscoveredResourcesResponse> listDiscoveredResources({
  required ResourceType resourceType,
  bool? includeDeletedResources,
  int? limit,
  String? nextToken,
  List<String>? resourceIds,
  String? resourceName,
}) async {
  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.ListDiscoveredResources'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceType': resourceType.toValue(),
      if (includeDeletedResources != null)
        'includeDeletedResources': includeDeletedResources,
      if (limit != null) 'limit': limit,
      if (nextToken != null) 'nextToken': nextToken,
      if (resourceIds != null) 'resourceIds': resourceIds,
      if (resourceName != null) 'resourceName': resourceName,
    },
  );

  return ListDiscoveredResourcesResponse.fromJson(jsonResponse.body);
}