getRecommendationSummaries method

Future<GetRecommendationSummariesResponse> getRecommendationSummaries({
  1. List<String>? accountIds,
  2. int? maxResults,
  3. String? nextToken,
})

Returns the optimization findings for an account.

For example, it returns the number of Amazon EC2 instances in an account that are under-provisioned, over-provisioned, or optimized. It also returns the number of Auto Scaling groups in an account that are not optimized, or optimized.

May throw OptInRequiredException. May throw InternalServerException. May throw ServiceUnavailableException. May throw AccessDeniedException. May throw InvalidParameterValueException. May throw MissingAuthenticationToken. May throw ThrottlingException.

Parameter accountIds : The IDs of the AWS accounts for which to return recommendation summaries.

If your account is the management account of an organization, use this parameter to specify the member accounts for which you want to return recommendation summaries.

Only one account ID can be specified per request.

Parameter maxResults : The maximum number of recommendation summaries to return with a single request.

To retrieve the remaining results, make another request with the returned NextToken value.

Parameter nextToken : The token to advance to the next page of recommendation summaries.

Implementation

Future<GetRecommendationSummariesResponse> getRecommendationSummaries({
  List<String>? accountIds,
  int? maxResults,
  String? nextToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'ComputeOptimizerService.GetRecommendationSummaries'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (accountIds != null) 'accountIds': accountIds,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return GetRecommendationSummariesResponse.fromJson(jsonResponse.body);
}