startAccessLogging method

Future<void> startAccessLogging({
  1. required String containerName,
})

Starts access logging on the specified container. When you enable access logging on a container, MediaStore delivers access logs for objects stored in that container to Amazon CloudWatch Logs.

May throw ContainerInUseException. May throw ContainerNotFoundException. May throw InternalServerError.

Parameter containerName : The name of the container that you want to start access logging on.

Implementation

Future<void> startAccessLogging({
  required String containerName,
}) async {
  ArgumentError.checkNotNull(containerName, 'containerName');
  _s.validateStringLength(
    'containerName',
    containerName,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MediaStore_20170901.StartAccessLogging'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContainerName': containerName,
    },
  );
}