sendDataIntegrationEvent method
Send the data payload for the event with real-time data for analysis or monitoring. The real-time data events are stored in an Amazon Web Services service before being processed and stored in data lake.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter data :
The data payload of the event, should follow the data schema of the target
dataset, or see Data
entities supported in AWS Supply Chain. To send single data record,
use JsonObject format; to send multiple data records, use JsonArray
format.
Note that for AWS Supply Chain dataset under asc namespace, it has a connection_id internal field that is not allowed to be provided by client directly, they will be auto populated.
Parameter eventGroupId :
Event identifier (for example, orderId for InboundOrder) used for data
sharding or partitioning. Noted under one eventGroupId of same eventType
and instanceId, events are processed sequentially in the order they are
received by the server.
Parameter eventType :
The data event type.
- scn.data.dataset - Send data directly to any specified dataset.
- scn.data.supplyplan - Send data to supply_plan dataset.
- scn.data.shipmentstoporder - Send data to shipment_stop_order dataset.
- scn.data.shipmentstop - Send data to shipment_stop dataset.
- scn.data.shipment - Send data to shipment dataset.
- scn.data.reservation - Send data to reservation dataset.
- scn.data.processproduct - Send data to process_product dataset.
- scn.data.processoperation - Send data to process_operation dataset.
- scn.data.processheader - Send data to process_header dataset.
- scn.data.forecast - Send data to forecast dataset.
- scn.data.inventorylevel - Send data to inv_level dataset.
- scn.data.inboundorder - Send data to inbound_order dataset.
- scn.data.inboundorderline - Send data to inbound_order_line dataset.
- scn.data.inboundorderlineschedule - Send data to inbound_order_line_schedule dataset.
- scn.data.outboundorderline - Send data to outbound_order_line dataset.
- scn.data.outboundshipment - Send data to outbound_shipment dataset.
Parameter instanceId :
The AWS Supply Chain instance identifier.
Parameter clientToken :
The idempotent client token. The token is active for 8 hours, and within
its lifetime, it ensures the request completes only once upon retry with
same client token. If omitted, the AWS SDK generates a unique value so
that AWS SDK can safely retry the request upon network errors.
Parameter datasetTarget :
The target dataset configuration for scn.data.dataset event type.
Parameter eventTimestamp :
The timestamp (in epoch seconds) associated with the event. If not
provided, it will be assigned with current timestamp.
Implementation
Future<SendDataIntegrationEventResponse> sendDataIntegrationEvent({
required String data,
required String eventGroupId,
required DataIntegrationEventType eventType,
required String instanceId,
String? clientToken,
DataIntegrationEventDatasetTargetConfiguration? datasetTarget,
DateTime? eventTimestamp,
}) async {
final $payload = <String, dynamic>{
'data': data,
'eventGroupId': eventGroupId,
'eventType': eventType.value,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (datasetTarget != null) 'datasetTarget': datasetTarget,
if (eventTimestamp != null)
'eventTimestamp': unixTimestampToJson(eventTimestamp),
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri:
'/api-data/data-integration/instance/${Uri.encodeComponent(instanceId)}/data-integration-events',
exceptionFnMap: _exceptionFns,
);
return SendDataIntegrationEventResponse.fromJson(response);
}