listPerformanceAnalysisReportRecommendations method

Future<ListPerformanceAnalysisReportRecommendationsResponse> listPerformanceAnalysisReportRecommendations({
  1. required String analysisReportId,
  2. required String identifier,
  3. required ServiceType serviceType,
  4. int? maxResults,
  5. String? nextToken,
  6. List<String>? recommendationIds,
})

Retrieves recommendations for a performance analysis report.

May throw InternalServiceError. May throw InvalidArgumentException. May throw NotAuthorizedException.

Parameter analysisReportId : A unique identifier of the created analysis report. For example, report-12345678901234567

Parameter identifier : An immutable identifier for a data source that is unique for an Amazon Web Services Region. Performance Insights gathers metrics from this data source. In the console, the identifier is shown as ResourceID. When you call DescribeDBInstances, the identifier is returned as DbiResourceId.

To use a DB instance as a data source, specify its DbiResourceId value. For example, specify db-ABCDEFGHIJKLMNOPQRSTU1VW2X.

Parameter serviceType : The Amazon Web Services service for which Performance Insights returns metrics. Valid value is RDS.

Parameter maxResults : The maximum number of items to return in the response. If more items exist than the specified MaxResults value, a pagination token is included in the response so that the remaining results can be retrieved.

Parameter nextToken : An optional pagination token provided by a previous request. If this parameter is specified, the response includes only records beyond the token, up to the value specified by MaxResults.

Parameter recommendationIds : A list of recommendation identifiers to filter the results.

Implementation

Future<ListPerformanceAnalysisReportRecommendationsResponse>
    listPerformanceAnalysisReportRecommendations({
  required String analysisReportId,
  required String identifier,
  required ServiceType serviceType,
  int? maxResults,
  String? nextToken,
  List<String>? recommendationIds,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    0,
    25,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target':
        'PerformanceInsightsv20180227.ListPerformanceAnalysisReportRecommendations'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AnalysisReportId': analysisReportId,
      'Identifier': identifier,
      'ServiceType': serviceType.value,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (recommendationIds != null) 'RecommendationIds': recommendationIds,
    },
  );

  return ListPerformanceAnalysisReportRecommendationsResponse.fromJson(
      jsonResponse.body);
}