getRecommendations method

Future<GetRecommendationsResponse> getRecommendations({
  1. required DateTime endTime,
  2. required String profilingGroupName,
  3. required DateTime startTime,
  4. String? locale,
})

Returns a list of Recommendation objects that contain recommendations for a profiling group for a given time period. A list of Anomaly objects that contains details about anomalies detected in the profiling group for the same time period is also returned.

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

Parameter endTime : The start time of the profile to get analysis data about. You must specify startTime and endTime. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.

Parameter profilingGroupName : The name of the profiling group to get analysis data about.

Parameter startTime : The end time of the profile to get analysis data about. You must specify startTime and endTime. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.

Parameter locale : The language used to provide analysis. Specify using a string that is one of the following BCP 47 language codes.

  • de-DE - German, Germany
  • en-GB - English, United Kingdom
  • en-US - English, United States
  • es-ES - Spanish, Spain
  • fr-FR - French, France
  • it-IT - Italian, Italy
  • ja-JP - Japanese, Japan
  • ko-KR - Korean, Republic of Korea
  • pt-BR - Portugese, Brazil
  • zh-CN - Chinese, China
  • zh-TW - Chinese, Taiwan

Implementation

Future<GetRecommendationsResponse> getRecommendations({
  required DateTime endTime,
  required String profilingGroupName,
  required DateTime startTime,
  String? locale,
}) async {
  ArgumentError.checkNotNull(endTime, 'endTime');
  ArgumentError.checkNotNull(profilingGroupName, 'profilingGroupName');
  _s.validateStringLength(
    'profilingGroupName',
    profilingGroupName,
    1,
    255,
    isRequired: true,
  );
  ArgumentError.checkNotNull(startTime, 'startTime');
  final $query = <String, List<String>>{
    'endTime': [_s.iso8601ToJson(endTime).toString()],
    'startTime': [_s.iso8601ToJson(startTime).toString()],
    if (locale != null) 'locale': [locale],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/internal/profilingGroups/${Uri.encodeComponent(profilingGroupName)}/recommendations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return GetRecommendationsResponse.fromJson(response);
}