getInsightSummaries method

Future<GetInsightSummariesResult> getInsightSummaries({
  1. required DateTime endTime,
  2. required DateTime startTime,
  3. String? groupARN,
  4. String? groupName,
  5. int? maxResults,
  6. String? nextToken,
  7. List<InsightState>? states,
})

Retrieves the summaries of all insights in the specified group matching the provided filter values.

May throw InvalidRequestException. May throw ThrottledException.

Parameter endTime : The end of the time frame in which the insights ended. The end time can't be more than 30 days old.

Parameter startTime : The beginning of the time frame in which the insights started. The start time can't be more than 30 days old.

Parameter groupARN : The Amazon Resource Name (ARN) of the group. Required if the GroupName isn't provided.

Parameter groupName : The name of the group. Required if the GroupARN isn't provided.

Parameter maxResults : The maximum number of results to display.

Parameter nextToken : Pagination token.

Parameter states : The list of insight states.

Implementation

Future<GetInsightSummariesResult> getInsightSummaries({
  required DateTime endTime,
  required DateTime startTime,
  String? groupARN,
  String? groupName,
  int? maxResults,
  String? nextToken,
  List<InsightState>? states,
}) async {
  ArgumentError.checkNotNull(endTime, 'endTime');
  ArgumentError.checkNotNull(startTime, 'startTime');
  _s.validateStringLength(
    'groupARN',
    groupARN,
    1,
    400,
  );
  _s.validateStringLength(
    'groupName',
    groupName,
    1,
    32,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2000,
  );
  final $payload = <String, dynamic>{
    'EndTime': unixTimestampToJson(endTime),
    'StartTime': unixTimestampToJson(startTime),
    if (groupARN != null) 'GroupARN': groupARN,
    if (groupName != null) 'GroupName': groupName,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
    if (states != null) 'States': states.map((e) => e.toValue()).toList(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/InsightSummaries',
    exceptionFnMap: _exceptionFns,
  );
  return GetInsightSummariesResult.fromJson(response);
}