Skip to content

S3  >  Structures  >  Object

Object

Structure Class

Object dataclass

Bases: _SerdeShape

An object consists of data and its descriptive metadata.

Attributes

checksum_algorithm class-attribute instance-attribute
checksum_algorithm: list[str] | None = ...

The algorithm that was used to create a checksum of the object.

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

The checksum type that is used to calculate the object's checksum value. For more information, see Checking object integrity in the Amazon S3 User Guide.

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

The entity tag is a hash of the object. The ETag reflects changes only to the contents of an object, not its metadata. The ETag may or may not be an MD5 digest of the object data. Whether or not it is depends on how the object was created and how it is encrypted as described below:

  • Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object data.

  • Objects created by the PUT Object, POST Object, or Copy operation, or through the Amazon Web Services Management Console, and are encrypted by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object data.

  • If an object is created by either the Multipart Upload or Part Copy operation, the ETag is not an MD5 digest, regardless of the method of encryption. If an object is larger than 16 MB, the Amazon Web Services Management Console will upload or copy that object as a Multipart Upload, and therefore the ETag will not be an MD5 digest.

Note

Directory buckets - MD5 is not supported by directory buckets.

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

The name that you assign to an object. You use the object key to retrieve the object.

last_modified class-attribute instance-attribute
last_modified: datetime | None = ...

Creation date of the object.

owner class-attribute instance-attribute
owner: Owner | None = ...

The owner of the object

Note

Directory buckets - The bucket owner is returned as the object owner.

restore_status class-attribute instance-attribute
restore_status: RestoreStatus | None = ...

Specifies the restoration status of an object. Objects in certain storage classes must be restored before they can be retrieved. For more information about these storage classes and how to work with archived objects, see Working with archived objects in the Amazon S3 User Guide.

Note

This functionality is not supported for directory buckets. Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.

size class-attribute instance-attribute
size: int | None = ...

Size in bytes of the object

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

The class of storage used to store the object.

Note

Directory buckets - Directory buckets only support EXPRESS_ONEZONE (the S3 Express One Zone storage class) in Availability Zones and ONEZONE_IA (the S3 One Zone-Infrequent Access storage class) in Dedicated Local Zones.