getRecommendation method
Returns both the current and recommended resource configuration and the estimated cost impact for a recommendation.
The recommendationId is only valid for up to a maximum of 24
hours as recommendations are refreshed daily. To retrieve the
recommendationId, use the ListRecommendations
API.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter recommendationId :
The ID for the recommendation.
Implementation
Future<GetRecommendationResponse> getRecommendation({
required String recommendationId,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'CostOptimizationHubService.GetRecommendation'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'recommendationId': recommendationId,
},
);
return GetRecommendationResponse.fromJson(jsonResponse.body);
}