searchOrganizationInsights method

Future<SearchOrganizationInsightsResponse> searchOrganizationInsights({
  1. required List<String> accountIds,
  2. required StartTimeRange startTimeRange,
  3. required InsightType type,
  4. SearchOrganizationInsightsFilters? filters,
  5. int? maxResults,
  6. String? nextToken,
})

Returns a list of insights in your organization. You can specify which insights are returned by their start time, one or more statuses (ONGOING, CLOSED, and CLOSED), one or more severities (LOW, MEDIUM, and HIGH), and type (REACTIVE or PROACTIVE).

Use the Filters parameter to specify status and severity search parameters. Use the Type parameter to specify REACTIVE or PROACTIVE in your search.

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

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

Parameter type : The type of insights you are searching for (REACTIVE or PROACTIVE).

Parameter filters : A SearchOrganizationInsightsFilters object that is used to set the severity and status filters on your insight search.

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<SearchOrganizationInsightsResponse> searchOrganizationInsights({
  required List<String> accountIds,
  required StartTimeRange startTimeRange,
  required InsightType type,
  SearchOrganizationInsightsFilters? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'AccountIds': accountIds,
    'StartTimeRange': startTimeRange,
    'Type': type.value,
    if (filters != null) 'Filters': filters,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/organization/insights/search',
    exceptionFnMap: _exceptionFns,
  );
  return SearchOrganizationInsightsResponse.fromJson(response);
}