getInsightEvents method

Future<GetInsightEventsResult> getInsightEvents({
  1. required String insightId,
  2. int? maxResults,
  3. String? nextToken,
})

X-Ray reevaluates insights periodically until they're resolved, and records each intermediate state as an event. You can review an insight's events in the Impact Timeline on the Inspect page in the X-Ray console.

May throw InvalidRequestException. May throw ThrottledException.

Parameter insightId : The insight's unique identifier. Use the GetInsightSummaries action to retrieve an InsightId.

Parameter maxResults : Used to retrieve at most the specified value of events.

Parameter nextToken : Specify the pagination token returned by a previous request to retrieve the next page of events.

Implementation

Future<GetInsightEventsResult> getInsightEvents({
  required String insightId,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(insightId, 'insightId');
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  _s.validateStringLength(
    'nextToken',
    nextToken,
    1,
    2000,
  );
  final $payload = <String, dynamic>{
    'InsightId': insightId,
    if (maxResults != null) 'MaxResults': maxResults,
    if (nextToken != null) 'NextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/InsightEvents',
    exceptionFnMap: _exceptionFns,
  );
  return GetInsightEventsResult.fromJson(response);
}