Skip to content

S3Client.put_object_annotation

rboto-s3==0.4.0 · Service index · Types

Model summary (excerpt): Attaches an annotation to an Amazon S3 object. An annotation is a named payload of 1 byte to 1 MiB that you can associate with a specific object or object version. Each object can have up to 1,000 annotations. For annotation naming rules and restrictions, see Annotation naming guidelines in the Amazon S3 User Guide . Annotations inherit the encryption of their parent object. For objects...

Install and imports

python -m pip install "rboto[s3]==0.4.0"
from rboto import S3Client
from collections.abc import AsyncIterator
from rboto_s3.types import (
    ChecksumAlgorithm,
    PutObjectAnnotationOutput,
    RequestPayer,
)

Signature

async def put_object_annotation(
    *,
    bucket: str,
    key: str,
    annotation_name: str,
    annotation_payload: bytes | _FileBody | AsyncIterator[bytes],
    version_id: str | None = None,
    object_if_match: str | None = None,
    checksum_algorithm: ChecksumAlgorithm | None = None,
    checksum_crc32: str | None = None,
    checksum_crc32_c: str | None = None,
    checksum_crc64_nvme: str | None = None,
    checksum_sha1: str | None = None,
    checksum_sha256: str | None = None,
    checksum_sha512: str | None = None,
    checksum_md5: str | None = None,
    checksum_xxhash64: str | None = None,
    checksum_xxhash3: str | None = None,
    checksum_xxhash128: str | None = None,
    content_md5: str | None = None,
    request_payer: RequestPayer | None = None,
    expected_bucket_owner: str | None = None,
) -> PutObjectAnnotationOutput: ...

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 name of the bucket that contains the object.
key Yes The object key.
annotation_name Yes The name of the annotation. Length Constraints: Minimum length of 1. Maximum length of 512 bytes.
annotation_payload Yes The annotation payload. Must be between 1 byte and 1 MiB in size, and must be valid UTF-8 encoded text. If the payload contains invalid UTF-8 bytes, the request fails with HTTP 415 (Unsupported Media Type). To store binary data, encode the payload using Base64 before uploading.
version_id No The version ID of the object to attach the annotation to.
object_if_match No If specified, the operation only succeeds if the object's ETag matches the provided value.
checksum_algorithm No The checksum algorithm to use. Supported values: CRC32 , CRC32C , CRC64NVME , SHA1 , SHA256 , SHA512 , MD5 , XXHASH64 , XXHASH3 , XXHASH128 .
checksum_crc32 No Base64-encoded CRC32 checksum of the annotation payload.
checksum_crc32_c No Base64-encoded CRC32C checksum of the annotation payload.
checksum_crc64_nvme No Base64-encoded CRC64NVME checksum of the annotation payload.
checksum_sha1 No Base64-encoded SHA1 checksum of the annotation payload.
checksum_sha256 No Base64-encoded SHA256 checksum of the annotation payload.
checksum_sha512 No Base64-encoded SHA512 checksum of the annotation payload.
checksum_md5 No Base64-encoded MD5 checksum of the annotation payload.
checksum_xxhash64 No Base64-encoded XXHASH64 checksum of the annotation payload.
checksum_xxhash3 No Base64-encoded XXHASH3 checksum of the annotation payload.
checksum_xxhash128 No Base64-encoded XXHASH128 checksum of the annotation payload.
content_md5 No Base64-encoded MD5 digest of the message.
request_payer No
expected_bucket_owner No The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with an HTTP 403 (Access Denied) error.

Output

PutObjectAnnotationOutput.

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
key str | None Always present —
annotation_name str | None Always present —
object_version_id str | None Always present —
e_tag str | None Always present —
checksum_crc32 str | None Always present —
checksum_crc32_c str | None Always present —
checksum_crc64_nvme str | None Always present —
checksum_sha1 str | None Always present —
checksum_sha256 str | None Always present —
checksum_sha512 str | None Always present —
checksum_md5 str | None Always present —
checksum_xxhash64 str | None Always present —
checksum_xxhash3 str | None Always present —
checksum_xxhash128 str | None Always present —
checksum_type ChecksumTypeOutput | None Always present ChecksumTypeOutput
server_side_encryption ServerSideEncryptionOutput | None Always present ServerSideEncryptionOutput
request_charged RequestChargedOutput | None Always present RequestChargedOutput

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

ChecksumAlgorithm, PutObjectAnnotationOutput, RequestPayer

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.

Input event streams accept the declared AsyncIterator of typed events.

Request byte bodies use bytes; they do not accept file objects or iterators.

Errors

Import from rboto_s3.exceptions:

AnnotationLimitExceededError, AnnotationNameTooLongError, InvalidAnnotationNameError, InvalidRequestError, NoSuchBucketError, NoSuchKeyError, UnsupportedMediaTypeError.

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

Service guide · Pinned model