createTimelineEvent method
Creates a custom timeline event on the incident details page of an incident record. Incident Manager automatically creates timeline events that mark key moments during an incident. You can create custom timeline events to mark important events that Incident Manager can detect automatically.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter eventData :
A short description of the event.
Parameter eventTime :
The timestamp for when the event occurred.
Parameter eventType :
The type of event. You can create timeline events of type Custom
Event and Note.
To make a Note-type event appear on the Incident notes panel in the
console, specify eventType as Noteand enter the
Amazon Resource Name (ARN) of the incident as the value for
eventReference.
Parameter incidentRecordArn :
The Amazon Resource Name (ARN) of the incident record that the action adds
the incident to.
Parameter clientToken :
A token that ensures that a client calls the action only once with the
specified details.
Parameter eventReferences :
Adds one or more references to the TimelineEvent. A reference
is an Amazon Web Services resource involved or associated with the
incident. To specify a reference, enter its Amazon Resource Name (ARN).
You can also specify a related item associated with a resource. For
example, to specify an Amazon DynamoDB (DynamoDB) table as a resource, use
the table's ARN. You can also specify an Amazon CloudWatch metric
associated with the DynamoDB table as a related item.
Implementation
Future<CreateTimelineEventOutput> createTimelineEvent({
required String eventData,
required DateTime eventTime,
required String eventType,
required String incidentRecordArn,
String? clientToken,
List<EventReference>? eventReferences,
}) async {
final $payload = <String, dynamic>{
'eventData': eventData,
'eventTime': unixTimestampToJson(eventTime),
'eventType': eventType,
'incidentRecordArn': incidentRecordArn,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (eventReferences != null) 'eventReferences': eventReferences,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/createTimelineEvent',
exceptionFnMap: _exceptionFns,
);
return CreateTimelineEventOutput.fromJson(response);
}