listRecommendations method

Future<ListRecommendationsResponse> listRecommendations({
  1. required String insightId,
  2. String? accountId,
  3. Locale? locale,
  4. String? nextToken,
})

Returns a list of a specified insight's recommendations. Each recommendation includes a list of related metrics and a list of related events.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter insightId : The ID of the requested insight.

Parameter accountId : The ID of the Amazon Web Services account.

Parameter locale : A locale that specifies the language to use for recommendations.

Parameter nextToken : The pagination token to use to retrieve the next page of results for this operation. If this value is null, it retrieves the first page.

Implementation

Future<ListRecommendationsResponse> listRecommendations({
  required String insightId,
  String? accountId,
  Locale? locale,
  String? nextToken,
}) async {
  final $payload = <String, dynamic>{
    'InsightId': insightId,
    if (accountId != null) 'AccountId': accountId,
    if (locale != null) 'Locale': locale.value,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/recommendations',
    exceptionFnMap: _exceptionFns,
  );
  return ListRecommendationsResponse.fromJson(response);
}