getBucketLogging method
Returns the logging status of a bucket and the permissions users have to view and modify that status. To use GET, you must be the bucket owner.
The following operations are related to GetBucketLogging
:
Parameter bucket
:
The bucket name for which to get the logging information.
Parameter expectedBucketOwner
:
The account id of the expected bucket owner. If the bucket is owned by a
different account, the request will fail with an HTTP 403 (Access
Denied)
error.
Implementation
Future<GetBucketLoggingOutput> getBucketLogging({
required String bucket,
String? expectedBucketOwner,
}) async {
ArgumentError.checkNotNull(bucket, 'bucket');
final headers = <String, String>{
if (expectedBucketOwner != null)
'x-amz-expected-bucket-owner': expectedBucketOwner.toString(),
};
final $result = await _protocol.send(
method: 'GET',
requestUri: '/${Uri.encodeComponent(bucket)}?logging',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetBucketLoggingOutput.fromXml($result.body);
}