getSavingsPlansPurchaseRecommendation method
Retrieves the Savings Plans recommendations for your account. First use
StartSavingsPlansPurchaseRecommendationGeneration to generate
a new set of recommendations, and then use
GetSavingsPlansPurchaseRecommendation to retrieve them.
May throw InvalidNextTokenException.
May throw LimitExceededException.
Parameter lookbackPeriodInDays :
The lookback period that's used to generate the recommendation.
Parameter paymentOption :
The payment option that's used to generate these recommendations.
Parameter savingsPlansType :
The Savings Plans recommendation type that's requested.
Parameter termInYears :
The savings plan recommendation term that's used to generate these
recommendations.
Parameter accountScope :
The account scope that you want your recommendations for. Amazon Web
Services calculates recommendations including the management account and
member accounts if the value is set to PAYER. If the value is
LINKED, recommendations are calculated for individual member
accounts only.
Parameter filter :
You can filter your recommendations by Account ID with the
LINKED_ACCOUNT dimension. To filter your recommendations by
Account ID, specify Key as LINKED_ACCOUNT and
Value as the comma-separated Acount ID(s) that you want to
see Savings Plans purchase recommendations for.
For GetSavingsPlansPurchaseRecommendation, the Filter doesn't
include CostCategories or Tags. It only includes
Dimensions. With Dimensions, Key
must be LINKED_ACCOUNT and Value can be a single
Account ID or multiple comma-separated Account IDs that you want to see
Savings Plans Purchase Recommendations for. AND and
OR operators are not supported.
Parameter nextPageToken :
The token to retrieve the next set of results. Amazon Web Services
provides the token when the response from a previous call has more results
than the maximum page size.
Parameter pageSize :
The number of recommendations that you want returned in a single response
object.
Implementation
Future<GetSavingsPlansPurchaseRecommendationResponse>
getSavingsPlansPurchaseRecommendation({
required LookbackPeriodInDays lookbackPeriodInDays,
required PaymentOption paymentOption,
required SupportedSavingsPlansType savingsPlansType,
required TermInYears termInYears,
AccountScope? accountScope,
Expression? filter,
String? nextPageToken,
int? pageSize,
}) async {
_s.validateNumRange(
'pageSize',
pageSize,
0,
6000,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target':
'AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LookbackPeriodInDays': lookbackPeriodInDays.value,
'PaymentOption': paymentOption.value,
'SavingsPlansType': savingsPlansType.value,
'TermInYears': termInYears.value,
if (accountScope != null) 'AccountScope': accountScope.value,
if (filter != null) 'Filter': filter,
if (nextPageToken != null) 'NextPageToken': nextPageToken,
if (pageSize != null) 'PageSize': pageSize,
},
);
return GetSavingsPlansPurchaseRecommendationResponse.fromJson(
jsonResponse.body);
}