getBucketLogging method
Returns the logging status of a bucket and the permissions users have to
view and modify that status.
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 account ID that you
provide does not match the actual owner of the bucket, the request fails
with the HTTP status code 403 Forbidden (access denied).
Implementation
Future<GetBucketLoggingOutput> getBucketLogging({
required String bucket,
String? expectedBucketOwner,
}) async {
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);
}