getBucketRequestPayment method
Returns the request payment configuration of a bucket. To use this version
of the operation, you must be the bucket owner. For more information, see
Requester
Pays Buckets.
The following operations are related to
GetBucketRequestPayment:
Parameter bucket :
The name of the bucket for which to get the payment request configuration
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<GetBucketRequestPaymentOutput> getBucketRequestPayment({
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)}?requestPayment',
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetBucketRequestPaymentOutput.fromXml($result.body);
}