listTimelineEvents method

Future<ListTimelineEventsOutput> listTimelineEvents({
  1. required String incidentRecordArn,
  2. List<Filter>? filters,
  3. int? maxResults,
  4. String? nextToken,
  5. TimelineEventSort? sortBy,
  6. SortOrder? sortOrder,
})

Lists timeline events for the specified incident record.

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

Parameter incidentRecordArn : The Amazon Resource Name (ARN) of the incident that includes the timeline event.

Parameter filters : Filters the timeline events based on the provided conditional values. You can filter timeline events with the following keys:

  • eventReference
  • eventTime
  • eventType
Note the following when deciding how to use Filters:
  • If you don't specify a Filter, the response includes all timeline events.
  • If you specify more than one filter in a single request, the response returns timeline events that match all filters.
  • If you specify a filter with more than one value, the response returns timeline events that match any of the values provided.

Parameter maxResults : The maximum number of results per page.

Parameter nextToken : The pagination token for the next set of items to return. (You received this token from a previous call.)

Parameter sortBy : Sort timeline events by the specified key value pair.

Parameter sortOrder : Sorts the order of timeline events by the value specified in the sortBy field.

Implementation

Future<ListTimelineEventsOutput> listTimelineEvents({
  required String incidentRecordArn,
  List<Filter>? filters,
  int? maxResults,
  String? nextToken,
  TimelineEventSort? sortBy,
  SortOrder? sortOrder,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $payload = <String, dynamic>{
    'incidentRecordArn': incidentRecordArn,
    if (filters != null) 'filters': filters,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (sortBy != null) 'sortBy': sortBy.value,
    if (sortOrder != null) 'sortOrder': sortOrder.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/listTimelineEvents',
    exceptionFnMap: _exceptionFns,
  );
  return ListTimelineEventsOutput.fromJson(response);
}