createSessionLogger method

Future<CreateSessionLoggerResponse> createSessionLogger({
  1. required EventFilter eventFilter,
  2. required LogConfiguration logConfiguration,
  3. Map<String, String>? additionalEncryptionContext,
  4. String? clientToken,
  5. String? customerManagedKey,
  6. String? displayName,
  7. List<Tag>? tags,
})

Creates a session logger.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter eventFilter : The filter that specifies the events to monitor.

Parameter logConfiguration : The configuration that specifies where logs are delivered.

Parameter additionalEncryptionContext : The additional encryption context of the session logger.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, subsequent retries with the same client token returns the result from the original successful request. If you do not specify a client token, one is automatically generated by the AWS SDK.

Parameter customerManagedKey : The custom managed key of the session logger.

Parameter displayName : The human-readable display name for the session logger resource.

Parameter tags : The tags to add to the session logger.

Implementation

Future<CreateSessionLoggerResponse> createSessionLogger({
  required EventFilter eventFilter,
  required LogConfiguration logConfiguration,
  Map<String, String>? additionalEncryptionContext,
  String? clientToken,
  String? customerManagedKey,
  String? displayName,
  List<Tag>? tags,
}) async {
  final $payload = <String, dynamic>{
    'eventFilter': eventFilter,
    'logConfiguration': logConfiguration,
    if (additionalEncryptionContext != null)
      'additionalEncryptionContext': additionalEncryptionContext,
    'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    if (customerManagedKey != null) 'customerManagedKey': customerManagedKey,
    if (displayName != null) 'displayName': displayName,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/sessionLoggers',
    exceptionFnMap: _exceptionFns,
  );
  return CreateSessionLoggerResponse.fromJson(response);
}