Skip to content

S3Client.upload_part_copy

rboto-s3==0.4.0 · Service index · Types

Model summary (excerpt): Uploads a part by copying data from an existing object as data source. To specify the data source, you add the request header x-amz-copy-source in your request. To specify a byte range, you add the request header x-amz-copy-source-range in your request. For information about maximum and minimum part sizes and other multipart upload specifications, see Multipart upload limits in the Amazon S3...

Install and imports

python -m pip install "rboto[s3]==0.4.0"
from rboto import S3Client
from rboto_s3.types import (
    RequestPayer,
    UploadPartCopyOutput,
)

Signature

async def upload_part_copy(
    *,
    bucket: str,
    copy_source: str,
    key: str,
    part_number: int,
    upload_id: str,
    copy_source_if_match: str | None = None,
    copy_source_if_modified_since: str | None = None,
    copy_source_if_none_match: str | None = None,
    copy_source_if_unmodified_since: str | None = None,
    copy_source_range: str | None = None,
    sse_customer_algorithm: str | None = None,
    sse_customer_key: str | None = None,
    sse_customer_key_md5: str | None = None,
    copy_source_sse_customer_algorithm: str | None = None,
    copy_source_sse_customer_key: str | None = None,
    copy_source_sse_customer_key_md5: str | None = None,
    request_payer: RequestPayer | None = None,
    expected_bucket_owner: str | None = None,
    expected_source_bucket_owner: str | None = None,
) -> UploadPartCopyOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
bucket Yes The bucket name. Directory buckets - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format Bucket-name .s3express- zone-id . region-code .amazonaws.com . Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format bucket-base-name --...
copy_source Yes Specifies the source object for the copy operation. You specify the value in one of two formats, depending on whether you want to access the source object through an access point : For objects not accessed through an access point, specify the name of the source bucket and key of the source object, separated by a slash (/). For example, to copy the object reports/january.pdf from the bucket...
key Yes Object key for which the multipart upload was initiated.
part_number Yes Part number of part being copied. This is a positive integer between 1 and 10,000.
upload_id Yes Upload ID identifying the multipart upload whose part is being copied.
copy_source_if_match No Copies the object if its entity tag (ETag) matches the specified tag. If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since headers are present in the request as follows: x-amz-copy-source-if-match condition evaluates to true , and; x-amz-copy-source-if-unmodified-since condition evaluates to false ; Amazon S3 returns 200 OK and copies the data.
copy_source_if_modified_since No Copies the object if it has been modified since the specified time. If both of the x-amz-copy-source-if-none-match and x-amz-copy-source-if-modified-since headers are present in the request as follows: x-amz-copy-source-if-none-match condition evaluates to false , and; x-amz-copy-source-if-modified-since condition evaluates to true ; Amazon S3 returns 412 Precondition Failed response code.
copy_source_if_none_match No Copies the object if its entity tag (ETag) is different than the specified ETag. If both of the x-amz-copy-source-if-none-match and x-amz-copy-source-if-modified-since headers are present in the request as follows: x-amz-copy-source-if-none-match condition evaluates to false , and; x-amz-copy-source-if-modified-since condition evaluates to true ; Amazon S3 returns 412 Precondition Failed...
copy_source_if_unmodified_since No Copies the object if it hasn't been modified since the specified time. If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since headers are present in the request as follows: x-amz-copy-source-if-match condition evaluates to true , and; x-amz-copy-source-if-unmodified-since condition evaluates to false ; Amazon S3 returns 200 OK and copies the data.
copy_source_range No The range of bytes to copy from the source object. The range value must use the form bytes=first-last, where the first and last are the zero-based byte offsets to copy. For example, bytes=0-9 indicates that you want to copy the first 10 bytes of the source. You can copy a range only if the source object is greater than 5 MB.
sse_customer_algorithm No Specifies the algorithm to use when encrypting the object (for example, AES256). This functionality is not supported when the destination bucket is a directory bucket.
sse_customer_key No Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm header. This must be the same encryption key specified in the initiate...
sse_customer_key_md5 No Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. This functionality is not supported when the destination bucket is a directory bucket.
copy_source_sse_customer_algorithm No Specifies the algorithm to use when decrypting the source object (for example, AES256 ). This functionality is not supported when the source object is in a directory bucket.
copy_source_sse_customer_key No Specifies the customer-provided encryption key for Amazon S3 to use to decrypt the source object. The encryption key provided in this header must be one that was used when the source object was created. This functionality is not supported when the source object is in a directory bucket.
copy_source_sse_customer_key_md5 No Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error. This functionality is not supported when the source object is in a directory bucket.
request_payer No
expected_bucket_owner No The account ID of the expected destination bucket owner. If the account ID that you provide does not match the actual owner of the destination bucket, the request fails with the HTTP status code 403 Forbidden (access denied).
expected_source_bucket_owner No The account ID of the expected source bucket owner. If the account ID that you provide does not match the actual owner of the source bucket, the request fails with the HTTP status code 403 Forbidden (access denied).

Output

UploadPartCopyOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
copy_source_version_id str | None Always present —
copy_part_result CopyPartResultOutput | None Always present CopyPartResultOutput
server_side_encryption ServerSideEncryptionOutput | None Always present ServerSideEncryptionOutput
sse_customer_algorithm str | None Always present —
sse_customer_key_md5 str | None Always present —
ssekms_key_id str | None Always present —
bucket_key_enabled bool | None Always present —
request_charged RequestChargedOutput | None Always present RequestChargedOutput
version_id str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

RequestPayer, UploadPartCopyOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

No modeled service errors for this operation.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model