listInsights method
Returns a list of insights in your Amazon Web Services account. You can
specify which insights are returned by their start time and status
(ONGOING, CLOSED, or ANY).
May throw AccessDeniedException.
May throw InternalServerException.
May throw ThrottlingException.
May throw ValidationException.
Parameter statusFilter :
A filter used to filter the returned insights by their status. You can
specify one status filter.
Parameter maxResults :
The maximum number of results to return with a single call. To retrieve
the remaining results, make another call with the returned
nextToken value.
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<ListInsightsResponse> listInsights({
required ListInsightsStatusFilter statusFilter,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $payload = <String, dynamic>{
'StatusFilter': statusFilter,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/insights',
exceptionFnMap: _exceptionFns,
);
return ListInsightsResponse.fromJson(response);
}