Jump to Content

New API Documentation - Developer Preview Available

We are excited to announce the developer preview of our new API documentation for AWS SDK for JavaScript v3. Please follow instructions on the landing page to leave us your feedback.

Class GetBucketRequestPaymentCommandProtected

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:

Example

Use a bare-bones client and the command you need to make an API call.

import { S3Client, GetBucketRequestPaymentCommand } from "@aws-sdk/client-s3"; // ES Modules import
// const { S3Client, GetBucketRequestPaymentCommand } = require("@aws-sdk/client-s3"); // CommonJS import
const client = new S3Client(config);
const input = { // GetBucketRequestPaymentRequest
Bucket: "STRING_VALUE", // required
ExpectedBucketOwner: "STRING_VALUE",
};
const command = new GetBucketRequestPaymentCommand(input);
const response = await client.send(command);
// { // GetBucketRequestPaymentOutput
// Payer: "Requester" || "BucketOwner",
// };

Param

GetBucketRequestPaymentCommandInput

Returns

GetBucketRequestPaymentCommandOutput

See

Throws

S3ServiceException

Base exception class for all service exceptions from S3 service.

Example

To get bucket versioning configuration

// The following example retrieves bucket versioning configuration.
const input = {
"Bucket": "examplebucket"
};
const command = new GetBucketRequestPaymentCommand(input);
const response = await client.send(command);
/* response ==
{
"Payer": "BucketOwner"
}
*/
// example id: to-get-bucket-versioning-configuration-1483037183929

Hierarchy

Constructors

Properties

Methods