putAuditEvents method

Future<PutAuditEventsResponse> putAuditEvents({
  1. required List<AuditEvent> auditEvents,
  2. required String channelArn,
  3. String? externalId,
})

Ingests your application events into CloudTrail Lake. A required parameter, auditEvents, accepts the JSON records (also called payload) of events that you want CloudTrail to ingest. You can add up to 100 of these events (or up to 1 MB) per PutAuditEvents request.

May throw ChannelInsufficientPermission. May throw ChannelNotFound. May throw ChannelUnsupportedSchema. May throw DuplicatedAuditEventId. May throw InvalidChannelARN. May throw UnsupportedOperationException.

Parameter auditEvents : The JSON payload of events that you want to ingest. You can also point to the JSON event payload in a file.

Parameter channelArn : The ARN or ID (the ARN suffix) of a channel.

Parameter externalId : A unique identifier that is conditionally required when the channel's resource policy includes an external ID. This value can be any string, such as a passphrase or account number.

Implementation

Future<PutAuditEventsResponse> putAuditEvents({
  required List<AuditEvent> auditEvents,
  required String channelArn,
  String? externalId,
}) async {
  final $query = <String, List<String>>{
    'channelArn': [channelArn],
    if (externalId != null) 'externalId': [externalId],
  };
  final $payload = <String, dynamic>{
    'auditEvents': auditEvents,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/PutAuditEvents',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return PutAuditEventsResponse.fromJson(response);
}