Skip to content

S3  >  Operations  >  put_bucket_request_payment

put_bucket_request_payment

Operation

put_bucket_request_payment async

put_bucket_request_payment(request: PutBucketRequestPaymentInput | PutBucketRequestPaymentInputDict, /, *, plugins: list[Plugin] | None = None) -> PutBucketRequestPaymentOutput
put_bucket_request_payment(*, plugins: list[Plugin] | None = None, **kwargs: Unpack[PutBucketRequestPaymentInputDict]) -> PutBucketRequestPaymentOutput
Note

This operation is not supported for directory buckets.

Sets the request payment configuration for a bucket. By default, the bucket owner pays for downloads from the bucket. This configuration parameter enables the bucket owner (only) to specify that the person requesting the download will be charged for the download. For more information, see Requester Pays Buckets.

The following operations are related to PutBucketRequestPayment:

Warning

You must URL encode any signed header values that contain spaces. For example, if your header value is my file.txt, containing two spaces after my, you must URL encode this value to my%20%20file.txt.

Parameters:

Name Type Description Default
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
PutBucketRequestPaymentOutput

An instance of PutBucketRequestPaymentOutput.

Input

Pass the input fields as keyword arguments, or pass a model or dictionary as the first positional argument. Pass plugins separately as a keyword argument.

Model

PutBucketRequestPaymentInput dataclass

Bases: _SerdeShape

Dataclass for PutBucketRequestPaymentInput structure.

Attributes
bucket class-attribute instance-attribute
bucket: str | None = ...

The bucket name.

checksum_algorithm class-attribute instance-attribute
checksum_algorithm: str | None = ...

Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

content_md5 class-attribute instance-attribute
content_md5: str | None = ...

The Base64 encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

expected_bucket_owner class-attribute instance-attribute
expected_bucket_owner: str | None = ...

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).

request_payment_configuration class-attribute instance-attribute
request_payment_configuration: RequestPaymentConfiguration | None = ...

Container for Payer.

Dictionaries

PutBucketRequestPaymentInputDict

Bases: TypedDict

Dictionary form of PutBucketRequestPaymentInput.

Attributes
bucket instance-attribute
bucket: Required[str]

The bucket name.

checksum_algorithm instance-attribute
checksum_algorithm: str | None

Indicates the algorithm used to create the checksum for the request when you use the SDK. This header will not provide any additional functionality if you don't use the SDK. When you send this header, there must be a corresponding x-amz-checksum or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the HTTP status code 400 Bad Request. For more information, see Checking object integrity in the Amazon S3 User Guide.

If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm parameter.

content_md5 instance-attribute
content_md5: str | None

The Base64 encoded 128-bit MD5 digest of the data. You must use this header as a message integrity check to verify that the request body was not corrupted in transit. For more information, see RFC 1864.

For requests made using the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is calculated automatically.

expected_bucket_owner instance-attribute
expected_bucket_owner: str | None

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).

request_payment_configuration instance-attribute

Container for Payer.

Output

PutBucketRequestPaymentOutput dataclass

Bases: _SerdeShape

Dataclass for PutBucketRequestPaymentOutput structure.

Attributes

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.