Skip to content

S3ServiceResource

Index > S3 > S3ServiceResource

Auto-generated documentation for S3 type annotations stubs module mypy-boto3-s3.

S3ServiceResource

Type annotations and code completion for boto3.resource("s3"), included resources and collections. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import S3ServiceResource

def get_s3_resource() -> S3ServiceResource:
    return boto3.resource("s3")

Attributes

Collections

ServiceResourceBucketsCollection

Provides access to Bucket resource.

Type annotations and code completion for boto3.resource("s3").buckets collection. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import ServiceResourceBucketsCollection

def get_collection() -> ServiceResourceBucketsCollection:
    return boto3.resource("s3").buckets

Methods

S3ServiceResource.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
    name: str,
) -> Bucket:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketRequestTypeDef = {  # (1)
    "name": ...,
}

parent.Bucket(**kwargs)
  1. See ServiceResourceBucketRequestTypeDef

S3ServiceResource.BucketAcl method

Creates a BucketAcl resource.

Type annotations and code completion for boto3.resource("s3").BucketAcl method. boto3 documentation

Method definition
def BucketAcl(
    self,
    bucket_name: str,
) -> BucketAcl:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketAclRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketAcl(**kwargs)
  1. See ServiceResourceBucketAclRequestTypeDef

S3ServiceResource.BucketCors method

Creates a BucketCors resource.

Type annotations and code completion for boto3.resource("s3").BucketCors method. boto3 documentation

Method definition
def BucketCors(
    self,
    bucket_name: str,
) -> BucketCors:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketCorsRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketCors(**kwargs)
  1. See ServiceResourceBucketCorsRequestTypeDef

S3ServiceResource.BucketLifecycle method

Creates a BucketLifecycle resource.

Type annotations and code completion for boto3.resource("s3").BucketLifecycle method. boto3 documentation

Method definition
def BucketLifecycle(
    self,
    bucket_name: str,
) -> BucketLifecycle:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketLifecycleRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketLifecycle(**kwargs)
  1. See ServiceResourceBucketLifecycleRequestTypeDef

S3ServiceResource.BucketLifecycleConfiguration method

Creates a BucketLifecycleConfiguration resource.

Type annotations and code completion for boto3.resource("s3").BucketLifecycleConfiguration method. boto3 documentation

Method definition
def BucketLifecycleConfiguration(
    self,
    bucket_name: str,
) -> BucketLifecycleConfiguration:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketLifecycleConfigurationRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketLifecycleConfiguration(**kwargs)
  1. See ServiceResourceBucketLifecycleConfigurationRequestTypeDef

S3ServiceResource.BucketLogging method

Creates a BucketLogging resource.

Type annotations and code completion for boto3.resource("s3").BucketLogging method. boto3 documentation

Method definition
def BucketLogging(
    self,
    bucket_name: str,
) -> BucketLogging:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketLoggingRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketLogging(**kwargs)
  1. See ServiceResourceBucketLoggingRequestTypeDef

S3ServiceResource.BucketNotification method

Creates a BucketNotification resource.

Type annotations and code completion for boto3.resource("s3").BucketNotification method. boto3 documentation

Method definition
def BucketNotification(
    self,
    bucket_name: str,
) -> BucketNotification:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketNotificationRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketNotification(**kwargs)
  1. See ServiceResourceBucketNotificationRequestTypeDef

S3ServiceResource.BucketPolicy method

Creates a BucketPolicy resource.

Type annotations and code completion for boto3.resource("s3").BucketPolicy method. boto3 documentation

Method definition
def BucketPolicy(
    self,
    bucket_name: str,
) -> BucketPolicy:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketPolicyRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketPolicy(**kwargs)
  1. See ServiceResourceBucketPolicyRequestTypeDef

S3ServiceResource.BucketRequestPayment method

Creates a BucketRequestPayment resource.

Type annotations and code completion for boto3.resource("s3").BucketRequestPayment method. boto3 documentation

Method definition
def BucketRequestPayment(
    self,
    bucket_name: str,
) -> BucketRequestPayment:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketRequestPaymentRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketRequestPayment(**kwargs)
  1. See ServiceResourceBucketRequestPaymentRequestTypeDef

S3ServiceResource.BucketTagging method

Creates a BucketTagging resource.

Type annotations and code completion for boto3.resource("s3").BucketTagging method. boto3 documentation

Method definition
def BucketTagging(
    self,
    bucket_name: str,
) -> BucketTagging:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketTaggingRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketTagging(**kwargs)
  1. See ServiceResourceBucketTaggingRequestTypeDef

S3ServiceResource.BucketVersioning method

Creates a BucketVersioning resource.

Type annotations and code completion for boto3.resource("s3").BucketVersioning method. boto3 documentation

Method definition
def BucketVersioning(
    self,
    bucket_name: str,
) -> BucketVersioning:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketVersioningRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketVersioning(**kwargs)
  1. See ServiceResourceBucketVersioningRequestTypeDef

S3ServiceResource.BucketWebsite method

Creates a BucketWebsite resource.

Type annotations and code completion for boto3.resource("s3").BucketWebsite method. boto3 documentation

Method definition
def BucketWebsite(
    self,
    bucket_name: str,
) -> BucketWebsite:
    ...
Usage example with kwargs
kwargs: ServiceResourceBucketWebsiteRequestTypeDef = {  # (1)
    "bucket_name": ...,
}

parent.BucketWebsite(**kwargs)
  1. See ServiceResourceBucketWebsiteRequestTypeDef

S3ServiceResource.MultipartUpload method

Creates a MultipartUpload resource.

Type annotations and code completion for boto3.resource("s3").MultipartUpload method. boto3 documentation

Method definition
def MultipartUpload(
    self,
    bucket_name: str,
    object_key: str,
    id: str,
) -> MultipartUpload:
    ...
Usage example with kwargs
kwargs: ServiceResourceMultipartUploadRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "object_key": ...,
    "id": ...,
}

parent.MultipartUpload(**kwargs)
  1. See ServiceResourceMultipartUploadRequestTypeDef

S3ServiceResource.MultipartUploadPart method

Creates a MultipartUploadPart resource.

Type annotations and code completion for boto3.resource("s3").MultipartUploadPart method. boto3 documentation

Method definition
def MultipartUploadPart(
    self,
    bucket_name: str,
    object_key: str,
    multipart_upload_id: str,
    part_number: str,
) -> MultipartUploadPart:
    ...
Usage example with kwargs
kwargs: ServiceResourceMultipartUploadPartRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "object_key": ...,
    "multipart_upload_id": ...,
    "part_number": ...,
}

parent.MultipartUploadPart(**kwargs)
  1. See ServiceResourceMultipartUploadPartRequestTypeDef

S3ServiceResource.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
    bucket_name: str,
    key: str,
) -> Object:
    ...
Usage example with kwargs
kwargs: ServiceResourceObjectRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "key": ...,
}

parent.Object(**kwargs)
  1. See ServiceResourceObjectRequestTypeDef

S3ServiceResource.ObjectAcl method

Creates a ObjectAcl resource.

Type annotations and code completion for boto3.resource("s3").ObjectAcl method. boto3 documentation

Method definition
def ObjectAcl(
    self,
    bucket_name: str,
    object_key: str,
) -> ObjectAcl:
    ...
Usage example with kwargs
kwargs: ServiceResourceObjectAclRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "object_key": ...,
}

parent.ObjectAcl(**kwargs)
  1. See ServiceResourceObjectAclRequestTypeDef

S3ServiceResource.ObjectSummary method

Creates a ObjectSummary resource.

Type annotations and code completion for boto3.resource("s3").ObjectSummary method. boto3 documentation

Method definition
def ObjectSummary(
    self,
    bucket_name: str,
    key: str,
) -> ObjectSummary:
    ...
Usage example with kwargs
kwargs: ServiceResourceObjectSummaryRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "key": ...,
}

parent.ObjectSummary(**kwargs)
  1. See ServiceResourceObjectSummaryRequestTypeDef

S3ServiceResource.ObjectVersion method

Creates a ObjectVersion resource.

Type annotations and code completion for boto3.resource("s3").ObjectVersion method. boto3 documentation

Method definition
def ObjectVersion(
    self,
    bucket_name: str,
    object_key: str,
    id: str,
) -> ObjectVersion:
    ...
Usage example with kwargs
kwargs: ServiceResourceObjectVersionRequestTypeDef = {  # (1)
    "bucket_name": ...,
    "object_key": ...,
    "id": ...,
}

parent.ObjectVersion(**kwargs)
  1. See ServiceResourceObjectVersionRequestTypeDef

S3ServiceResource.create_bucket method

Creates a new S3 bucket.

Type annotations and code completion for boto3.resource("s3").create_bucket method. boto3 documentation

Method definition
def create_bucket(
    self,
    *,
    Bucket: str,
    ACL: BucketCannedACLType = ...,  # (1)
    CreateBucketConfiguration: CreateBucketConfigurationTypeDef = ...,  # (2)
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWrite: str = ...,
    GrantWriteACP: str = ...,
    ObjectLockEnabledForBucket: bool = ...,
    ObjectOwnership: ObjectOwnershipType = ...,  # (3)
) -> Bucket:
    ...
  1. See BucketCannedACLType
  2. See CreateBucketConfigurationTypeDef
  3. See ObjectOwnershipType
Usage example with kwargs
kwargs: CreateBucketRequestServiceResourceCreateBucketTypeDef = {  # (1)
    "Bucket": ...,
}

parent.create_bucket(**kwargs)
  1. See CreateBucketRequestServiceResourceCreateBucketTypeDef

S3ServiceResource.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Bucket

Type annotations and code completion for boto3.resource("s3").Bucket class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import Bucket

def get_resource() -> Bucket:
    return boto3.resource("s3").Bucket(...)

Bucket attributes

Bucket collections

Bucket.multipart_uploads

Provides access to MultipartUpload resource.

Type annotations and code completion for boto3.resource("s3").Bucket(...).multipart_uploads collection. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketMultipartUploadsCollection

def get_collection() -> BucketMultipartUploadsCollection:
    resource = boto3.resource("s3").Bucket(...)
    return resource.multipart_uploads

Bucket.object_versions

Provides access to ObjectVersion resource.

Type annotations and code completion for boto3.resource("s3").Bucket(...).object_versions collection. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketObjectVersionsCollection

def get_collection() -> BucketObjectVersionsCollection:
    resource = boto3.resource("s3").Bucket(...)
    return resource.object_versions

Bucket.objects

Provides access to ObjectSummary resource.

Type annotations and code completion for boto3.resource("s3").Bucket(...).objects collection. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketObjectsCollection

def get_collection() -> BucketObjectsCollection:
    resource = boto3.resource("s3").Bucket(...)
    return resource.objects

Bucket methods

Bucket.Acl method

Creates a BucketAcl resource.

Type annotations and code completion for boto3.resource("s3").Acl method. boto3 documentation

Method definition
def Acl(
    self,
) -> BucketAcl:
    ...

Bucket.Cors method

Creates a BucketCors resource.

Type annotations and code completion for boto3.resource("s3").Cors method. boto3 documentation

Method definition
def Cors(
    self,
) -> BucketCors:
    ...

Bucket.Lifecycle method

Creates a BucketLifecycle resource.

Type annotations and code completion for boto3.resource("s3").Lifecycle method. boto3 documentation

Method definition
def Lifecycle(
    self,
) -> BucketLifecycle:
    ...

Bucket.LifecycleConfiguration method

Creates a BucketLifecycleConfiguration resource.

Type annotations and code completion for boto3.resource("s3").LifecycleConfiguration method. boto3 documentation

Method definition
def LifecycleConfiguration(
    self,
) -> BucketLifecycleConfiguration:
    ...

Bucket.Logging method

Creates a BucketLogging resource.

Type annotations and code completion for boto3.resource("s3").Logging method. boto3 documentation

Method definition
def Logging(
    self,
) -> BucketLogging:
    ...

Bucket.Notification method

Creates a BucketNotification resource.

Type annotations and code completion for boto3.resource("s3").Notification method. boto3 documentation

Method definition
def Notification(
    self,
) -> BucketNotification:
    ...

Bucket.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
    key: str,
) -> Object:
    ...
Usage example with kwargs
kwargs: BucketObjectRequestTypeDef = {  # (1)
    "key": ...,
}

parent.Object(**kwargs)
  1. See BucketObjectRequestTypeDef

Bucket.Policy method

Creates a BucketPolicy resource.

Type annotations and code completion for boto3.resource("s3").Policy method. boto3 documentation

Method definition
def Policy(
    self,
) -> BucketPolicy:
    ...

Bucket.RequestPayment method

Creates a BucketRequestPayment resource.

Type annotations and code completion for boto3.resource("s3").RequestPayment method. boto3 documentation

Method definition
def RequestPayment(
    self,
) -> BucketRequestPayment:
    ...

Bucket.Tagging method

Creates a BucketTagging resource.

Type annotations and code completion for boto3.resource("s3").Tagging method. boto3 documentation

Method definition
def Tagging(
    self,
) -> BucketTagging:
    ...

Bucket.Versioning method

Creates a BucketVersioning resource.

Type annotations and code completion for boto3.resource("s3").Versioning method. boto3 documentation

Method definition
def Versioning(
    self,
) -> BucketVersioning:
    ...

Bucket.Website method

Creates a BucketWebsite resource.

Type annotations and code completion for boto3.resource("s3").Website method. boto3 documentation

Method definition
def Website(
    self,
) -> BucketWebsite:
    ...

Bucket.copy method

Copy an object from one S3 location to an object in this bucket.

Type annotations and code completion for boto3.resource("s3").copy method. boto3 documentation

Method definition
def copy(
    self,
    CopySource: CopySourceTypeDef,  # (1)
    Key: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    SourceClient: BaseClient = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
  1. See CopySourceTypeDef
Usage example with kwargs
kwargs: BucketCopyRequestTypeDef = {  # (1)
    "CopySource": ...,
    "Key": ...,
}

parent.copy(**kwargs)
  1. See BucketCopyRequestTypeDef

Bucket.create method

Creates a new S3 bucket.

Type annotations and code completion for boto3.resource("s3").create method. boto3 documentation

Method definition
def create(
    self,
    *,
    ACL: BucketCannedACLType = ...,  # (1)
    CreateBucketConfiguration: CreateBucketConfigurationTypeDef = ...,  # (2)
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWrite: str = ...,
    GrantWriteACP: str = ...,
    ObjectLockEnabledForBucket: bool = ...,
    ObjectOwnership: ObjectOwnershipType = ...,  # (3)
) -> CreateBucketOutputTypeDef:  # (4)
    ...
  1. See BucketCannedACLType
  2. See CreateBucketConfigurationTypeDef
  3. See ObjectOwnershipType
  4. See CreateBucketOutputTypeDef
Usage example with kwargs
kwargs: CreateBucketRequestBucketCreateTypeDef = {  # (1)
    "ACL": ...,
}

parent.create(**kwargs)
  1. See CreateBucketRequestBucketCreateTypeDef

Bucket.delete method

Deletes the S3 bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketRequestBucketDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketRequestBucketDeleteTypeDef

Bucket.delete_objects method

This action enables you to delete multiple objects from a bucket using a single HTTP request.

Type annotations and code completion for boto3.resource("s3").delete_objects method. boto3 documentation

Method definition
def delete_objects(
    self,
    *,
    Delete: DeleteTypeDef,  # (1)
    MFA: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
) -> DeleteObjectsOutputTypeDef:  # (4)
    ...
  1. See DeleteTypeDef
  2. See RequestPayerType
  3. See ChecksumAlgorithmType
  4. See DeleteObjectsOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectsRequestBucketDeleteObjectsTypeDef = {  # (1)
    "Delete": ...,
}

parent.delete_objects(**kwargs)
  1. See DeleteObjectsRequestBucketDeleteObjectsTypeDef

Bucket.download_file method

Download an S3 object to a file.

Type annotations and code completion for boto3.resource("s3").download_file method. boto3 documentation

Method definition
def download_file(
    self,
    Key: str,
    Filename: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: BucketDownloadFileRequestTypeDef = {  # (1)
    "Key": ...,
    "Filename": ...,
}

parent.download_file(**kwargs)
  1. See BucketDownloadFileRequestTypeDef

Bucket.download_fileobj method

Download an object from this bucket to a file-like-object.

Type annotations and code completion for boto3.resource("s3").download_fileobj method. boto3 documentation

Method definition
def download_fileobj(
    self,
    Key: str,
    Fileobj: Union[IO[Any], StreamingBody],
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: BucketDownloadFileobjRequestTypeDef = {  # (1)
    "Key": ...,
    "Fileobj": ...,
}

parent.download_fileobj(**kwargs)
  1. See BucketDownloadFileobjRequestTypeDef

Bucket.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Bucket.load method

Calls s3.Client.list_buckets() to update the attributes of the Bucket resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

Bucket.put_object method

Adds an object to a bucket.

Type annotations and code completion for boto3.resource("s3").put_object method. boto3 documentation

Method definition
def put_object(
    self,
    *,
    Key: str,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentLength: int = ...,
    ContentMD5: str = ...,
    ContentType: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (3)
    StorageClass: StorageClassType = ...,  # (4)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (5)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (6)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (7)
    ExpectedBucketOwner: str = ...,
) -> Object:
    ...
  1. See ObjectCannedACLType
  2. See ChecksumAlgorithmType
  3. See ServerSideEncryptionType
  4. See StorageClassType
  5. See RequestPayerType
  6. See ObjectLockModeType
  7. See ObjectLockLegalHoldStatusType
Usage example with kwargs
kwargs: PutObjectRequestBucketPutObjectTypeDef = {  # (1)
    "Key": ...,
}

parent.put_object(**kwargs)
  1. See PutObjectRequestBucketPutObjectTypeDef

Bucket.upload_file method

Upload a file to an S3 object.

Type annotations and code completion for boto3.resource("s3").upload_file method. boto3 documentation

Method definition
def upload_file(
    self,
    Filename: str,
    Key: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: BucketUploadFileRequestTypeDef = {  # (1)
    "Filename": ...,
    "Key": ...,
}

parent.upload_file(**kwargs)
  1. See BucketUploadFileRequestTypeDef

Bucket.upload_fileobj method

Upload a file-like object to this bucket.

Type annotations and code completion for boto3.resource("s3").upload_fileobj method. boto3 documentation

Method definition
def upload_fileobj(
    self,
    Fileobj: Union[IO[Any], StreamingBody],
    Key: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: BucketUploadFileobjRequestTypeDef = {  # (1)
    "Fileobj": ...,
    "Key": ...,
}

parent.upload_fileobj(**kwargs)
  1. See BucketUploadFileobjRequestTypeDef

Bucket.wait_until_exists method

Waits until this Bucket is exists.

Type annotations and code completion for boto3.resource("s3").wait_until_exists method. boto3 documentation

Method definition
def wait_until_exists(
    self,
) -> None:
    ...

Bucket.wait_until_not_exists method

Waits until this Bucket is not exists.

Type annotations and code completion for boto3.resource("s3").wait_until_not_exists method. boto3 documentation

Method definition
def wait_until_not_exists(
    self,
) -> None:
    ...

BucketAcl

Type annotations and code completion for boto3.resource("s3").BucketAcl class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketAcl

def get_resource() -> BucketAcl:
    return boto3.resource("s3").BucketAcl(...)

BucketAcl attributes

BucketAcl methods

BucketAcl.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketAcl.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketAcl.load method

Calls 🇵🇾meth:S3.Client.get_bucket_acl to update the attributes of the BucketAcl resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketAcl.put method

Sets the permissions on an existing bucket using access control lists (ACL).

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ACL: BucketCannedACLType = ...,  # (1)
    AccessControlPolicy: AccessControlPolicyTypeDef = ...,  # (2)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWrite: str = ...,
    GrantWriteACP: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See BucketCannedACLType
  2. See AccessControlPolicyTypeDef
  3. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketAclRequestBucketAclPutTypeDef = {  # (1)
    "ACL": ...,
}

parent.put(**kwargs)
  1. See PutBucketAclRequestBucketAclPutTypeDef

BucketAcl.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_acl to update the attributes of the BucketAcl resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketCors

Type annotations and code completion for boto3.resource("s3").BucketCors class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketCors

def get_resource() -> BucketCors:
    return boto3.resource("s3").BucketCors(...)

BucketCors attributes

BucketCors methods

BucketCors.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketCors.delete method

Deletes the cors configuration information set for the bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketCorsRequestBucketCorsDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketCorsRequestBucketCorsDeleteTypeDef

BucketCors.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketCors.load method

Calls 🇵🇾meth:S3.Client.get_bucket_cors to update the attributes of the BucketCors resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketCors.put method

Sets the cors configuration for your bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    CORSConfiguration: CORSConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See CORSConfigurationTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketCorsRequestBucketCorsPutTypeDef = {  # (1)
    "CORSConfiguration": ...,
}

parent.put(**kwargs)
  1. See PutBucketCorsRequestBucketCorsPutTypeDef

BucketCors.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_cors to update the attributes of the BucketCors resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketLifecycle

Type annotations and code completion for boto3.resource("s3").BucketLifecycle class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketLifecycle

def get_resource() -> BucketLifecycle:
    return boto3.resource("s3").BucketLifecycle(...)

BucketLifecycle attributes

BucketLifecycle methods

BucketLifecycle.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketLifecycle.delete method

Deletes the lifecycle configuration from the specified bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketLifecycleRequestBucketLifecycleDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketLifecycleRequestBucketLifecycleDeleteTypeDef

BucketLifecycle.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketLifecycle.load method

Calls 🇵🇾meth:S3.Client.get_bucket_lifecycle to update the attributes of the BucketLifecycle resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketLifecycle.put method

.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    LifecycleConfiguration: LifecycleConfigurationTypeDef = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
  2. See LifecycleConfigurationTypeDef
Usage example with kwargs
kwargs: PutBucketLifecycleRequestBucketLifecyclePutTypeDef = {  # (1)
    "ChecksumAlgorithm": ...,
}

parent.put(**kwargs)
  1. See PutBucketLifecycleRequestBucketLifecyclePutTypeDef

BucketLifecycle.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_lifecycle to update the attributes of the BucketLifecycle resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketLifecycleConfiguration

Type annotations and code completion for boto3.resource("s3").BucketLifecycleConfiguration class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketLifecycleConfiguration

def get_resource() -> BucketLifecycleConfiguration:
    return boto3.resource("s3").BucketLifecycleConfiguration(...)

BucketLifecycleConfiguration attributes

BucketLifecycleConfiguration methods

BucketLifecycleConfiguration.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketLifecycleConfiguration.delete method

Deletes the lifecycle configuration from the specified bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketLifecycleRequestBucketLifecycleConfigurationDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketLifecycleRequestBucketLifecycleConfigurationDeleteTypeDef

BucketLifecycleConfiguration.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketLifecycleConfiguration.load method

Calls 🇵🇾meth:S3.Client.get_bucket_lifecycle_configuration to update the attributes of the BucketLifecycleConfiguration resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketLifecycleConfiguration.put method

Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    LifecycleConfiguration: BucketLifecycleConfigurationTypeDef = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
  2. See BucketLifecycleConfigurationTypeDef
Usage example with kwargs
kwargs: PutBucketLifecycleConfigurationRequestBucketLifecycleConfigurationPutTypeDef = {  # (1)
    "ChecksumAlgorithm": ...,
}

parent.put(**kwargs)
  1. See PutBucketLifecycleConfigurationRequestBucketLifecycleConfigurationPutTypeDef

BucketLifecycleConfiguration.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_lifecycle_configuration to update the attributes of the BucketLifecycleConfiguration resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketLogging

Type annotations and code completion for boto3.resource("s3").BucketLogging class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketLogging

def get_resource() -> BucketLogging:
    return boto3.resource("s3").BucketLogging(...)

BucketLogging attributes

BucketLogging methods

BucketLogging.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketLogging.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketLogging.load method

Calls 🇵🇾meth:S3.Client.get_bucket_logging to update the attributes of the BucketLogging resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketLogging.put method

Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    BucketLoggingStatus: BucketLoggingStatusTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See BucketLoggingStatusTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketLoggingRequestBucketLoggingPutTypeDef = {  # (1)
    "BucketLoggingStatus": ...,
}

parent.put(**kwargs)
  1. See PutBucketLoggingRequestBucketLoggingPutTypeDef

BucketLogging.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_logging to update the attributes of the BucketLogging resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketNotification

Type annotations and code completion for boto3.resource("s3").BucketNotification class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketNotification

def get_resource() -> BucketNotification:
    return boto3.resource("s3").BucketNotification(...)

BucketNotification attributes

BucketNotification methods

BucketNotification.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketNotification.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketNotification.load method

Calls 🇵🇾meth:S3.Client.get_bucket_notification_configuration to update the attributes of the BucketNotification resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketNotification.put method

Enables notifications of specified events for a bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    NotificationConfiguration: NotificationConfigurationTypeDef,  # (1)
    ExpectedBucketOwner: str = ...,
    SkipDestinationValidation: bool = ...,
) -> None:
    ...
  1. See NotificationConfigurationTypeDef
Usage example with kwargs
kwargs: PutBucketNotificationConfigurationRequestBucketNotificationPutTypeDef = {  # (1)
    "NotificationConfiguration": ...,
}

parent.put(**kwargs)
  1. See PutBucketNotificationConfigurationRequestBucketNotificationPutTypeDef

BucketNotification.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_notification_configuration to update the attributes of the BucketNotification resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketPolicy

Type annotations and code completion for boto3.resource("s3").BucketPolicy class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketPolicy

def get_resource() -> BucketPolicy:
    return boto3.resource("s3").BucketPolicy(...)

BucketPolicy attributes

  • policy: str
  • bucket_name: str

BucketPolicy methods

BucketPolicy.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketPolicy.delete method

This implementation of the DELETE action uses the policy subresource to delete the policy of a specified bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketPolicyRequestBucketPolicyDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketPolicyRequestBucketPolicyDeleteTypeDef

BucketPolicy.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketPolicy.load method

Calls 🇵🇾meth:S3.Client.get_bucket_policy to update the attributes of the BucketPolicy resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketPolicy.put method

Applies an Amazon S3 bucket policy to an Amazon S3 bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    Policy: str,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    ConfirmRemoveSelfBucketAccess: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketPolicyRequestBucketPolicyPutTypeDef = {  # (1)
    "Policy": ...,
}

parent.put(**kwargs)
  1. See PutBucketPolicyRequestBucketPolicyPutTypeDef

BucketPolicy.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_policy to update the attributes of the BucketPolicy resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketRequestPayment

Type annotations and code completion for boto3.resource("s3").BucketRequestPayment class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketRequestPayment

def get_resource() -> BucketRequestPayment:
    return boto3.resource("s3").BucketRequestPayment(...)

BucketRequestPayment attributes

BucketRequestPayment methods

BucketRequestPayment.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketRequestPayment.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketRequestPayment.load method

Calls 🇵🇾meth:S3.Client.get_bucket_request_payment to update the attributes of the BucketRequestPayment resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketRequestPayment.put method

Sets the request payment configuration for a bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    RequestPaymentConfiguration: RequestPaymentConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See RequestPaymentConfigurationTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketRequestPaymentRequestBucketRequestPaymentPutTypeDef = {  # (1)
    "RequestPaymentConfiguration": ...,
}

parent.put(**kwargs)
  1. See PutBucketRequestPaymentRequestBucketRequestPaymentPutTypeDef

BucketRequestPayment.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_request_payment to update the attributes of the BucketRequestPayment resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketTagging

Type annotations and code completion for boto3.resource("s3").BucketTagging class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketTagging

def get_resource() -> BucketTagging:
    return boto3.resource("s3").BucketTagging(...)

BucketTagging attributes

BucketTagging methods

BucketTagging.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketTagging.delete method

Deletes the tags from the bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketTaggingRequestBucketTaggingDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketTaggingRequestBucketTaggingDeleteTypeDef

BucketTagging.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketTagging.load method

Calls 🇵🇾meth:S3.Client.get_bucket_tagging to update the attributes of the BucketTagging resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketTagging.put method

Sets the tags for a bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    Tagging: TaggingTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See TaggingTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketTaggingRequestBucketTaggingPutTypeDef = {  # (1)
    "Tagging": ...,
}

parent.put(**kwargs)
  1. See PutBucketTaggingRequestBucketTaggingPutTypeDef

BucketTagging.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_tagging to update the attributes of the BucketTagging resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketVersioning

Type annotations and code completion for boto3.resource("s3").BucketVersioning class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketVersioning

def get_resource() -> BucketVersioning:
    return boto3.resource("s3").BucketVersioning(...)

BucketVersioning attributes

BucketVersioning methods

BucketVersioning.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketVersioning.enable method

Sets the versioning state of an existing bucket.

Type annotations and code completion for boto3.resource("s3").enable method. boto3 documentation

Method definition
def enable(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketVersioningRequestBucketVersioningEnableTypeDef = {  # (1)
    "ChecksumAlgorithm": ...,
}

parent.enable(**kwargs)
  1. See PutBucketVersioningRequestBucketVersioningEnableTypeDef

BucketVersioning.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketVersioning.load method

Calls 🇵🇾meth:S3.Client.get_bucket_versioning to update the attributes of the BucketVersioning resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketVersioning.put method

Sets the versioning state of an existing bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    VersioningConfiguration: VersioningConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See VersioningConfigurationTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketVersioningRequestBucketVersioningPutTypeDef = {  # (1)
    "VersioningConfiguration": ...,
}

parent.put(**kwargs)
  1. See PutBucketVersioningRequestBucketVersioningPutTypeDef

BucketVersioning.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_versioning to update the attributes of the BucketVersioning resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

BucketVersioning.suspend method

Sets the versioning state of an existing bucket.

Type annotations and code completion for boto3.resource("s3").suspend method. boto3 documentation

Method definition
def suspend(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketVersioningRequestBucketVersioningSuspendTypeDef = {  # (1)
    "ChecksumAlgorithm": ...,
}

parent.suspend(**kwargs)
  1. See PutBucketVersioningRequestBucketVersioningSuspendTypeDef

BucketWebsite

Type annotations and code completion for boto3.resource("s3").BucketWebsite class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import BucketWebsite

def get_resource() -> BucketWebsite:
    return boto3.resource("s3").BucketWebsite(...)

BucketWebsite attributes

BucketWebsite methods

BucketWebsite.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

BucketWebsite.delete method

This action removes the website configuration for a bucket.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: DeleteBucketWebsiteRequestBucketWebsiteDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

parent.delete(**kwargs)
  1. See DeleteBucketWebsiteRequestBucketWebsiteDeleteTypeDef

BucketWebsite.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

BucketWebsite.load method

Calls 🇵🇾meth:S3.Client.get_bucket_website to update the attributes of the BucketWebsite resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

BucketWebsite.put method

Sets the configuration of the website that is specified in the website subresource.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    WebsiteConfiguration: WebsiteConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See WebsiteConfigurationTypeDef
  2. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: PutBucketWebsiteRequestBucketWebsitePutTypeDef = {  # (1)
    "WebsiteConfiguration": ...,
}

parent.put(**kwargs)
  1. See PutBucketWebsiteRequestBucketWebsitePutTypeDef

BucketWebsite.reload method

Calls 🇵🇾meth:S3.Client.get_bucket_website to update the attributes of the BucketWebsite resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

MultipartUpload

Type annotations and code completion for boto3.resource("s3").MultipartUpload class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import MultipartUpload

def get_resource() -> MultipartUpload:
    return boto3.resource("s3").MultipartUpload(...)

MultipartUpload attributes

MultipartUpload collections

MultipartUpload.parts

Provides access to MultipartUploadPart resource.

Type annotations and code completion for boto3.resource("s3").MultipartUpload(...).parts collection. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import MultipartUploadPartsCollection

def get_collection() -> MultipartUploadPartsCollection:
    resource = boto3.resource("s3").MultipartUpload(...)
    return resource.parts

MultipartUpload methods

MultipartUpload.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
) -> Object:
    ...

MultipartUpload.Part method

Creates a MultipartUploadPart resource.

Type annotations and code completion for boto3.resource("s3").Part method. boto3 documentation

Method definition
def Part(
    self,
    part_number: str,
) -> MultipartUploadPart:
    ...
Usage example with kwargs
kwargs: MultipartUploadPartRequestTypeDef = {  # (1)
    "part_number": ...,
}

parent.Part(**kwargs)
  1. See MultipartUploadPartRequestTypeDef

MultipartUpload.abort method

This action aborts a multipart upload.

Type annotations and code completion for boto3.resource("s3").abort method. boto3 documentation

Method definition
def abort(
    self,
    *,
    RequestPayer: RequestPayerType = ...,  # (1)
    ExpectedBucketOwner: str = ...,
) -> AbortMultipartUploadOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See AbortMultipartUploadOutputTypeDef
Usage example with kwargs
kwargs: AbortMultipartUploadRequestMultipartUploadAbortTypeDef = {  # (1)
    "RequestPayer": ...,
}

parent.abort(**kwargs)
  1. See AbortMultipartUploadRequestMultipartUploadAbortTypeDef

MultipartUpload.complete method

Completes a multipart upload by assembling previously uploaded parts.

Type annotations and code completion for boto3.resource("s3").complete method. boto3 documentation

Method definition
def complete(
    self,
    *,
    MultipartUpload: CompletedMultipartUploadTypeDef = ...,  # (1)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
) -> Object:
    ...
  1. See CompletedMultipartUploadTypeDef
  2. See RequestPayerType
Usage example with kwargs
kwargs: CompleteMultipartUploadRequestMultipartUploadCompleteTypeDef = {  # (1)
    "MultipartUpload": ...,
}

parent.complete(**kwargs)
  1. See CompleteMultipartUploadRequestMultipartUploadCompleteTypeDef

MultipartUpload.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

MultipartUploadPart

Type annotations and code completion for boto3.resource("s3").MultipartUploadPart class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import MultipartUploadPart

def get_resource() -> MultipartUploadPart:
    return boto3.resource("s3").MultipartUploadPart(...)

MultipartUploadPart attributes

  • last_modified: datetime
  • e_tag: str
  • size: int
  • checksum_crc32: str
  • checksum_crc32_c: str
  • checksum_sha1: str
  • checksum_sha256: str
  • bucket_name: str
  • object_key: str
  • multipart_upload_id: str
  • part_number: str

MultipartUploadPart methods

MultipartUploadPart.MultipartUpload method

Creates a MultipartUpload resource.

Type annotations and code completion for boto3.resource("s3").MultipartUpload method. boto3 documentation

Method definition
def MultipartUpload(
    self,
) -> MultipartUpload:
    ...

MultipartUploadPart.copy_from method

Uploads a part by copying data from an existing object as data source.

Type annotations and code completion for boto3.resource("s3").copy_from method. boto3 documentation

Method definition
def copy_from(
    self,
    *,
    CopySource: Union[str, CopySourceTypeDef],  # (1)
    CopySourceIfMatch: str = ...,
    CopySourceIfModifiedSince: Union[datetime, str] = ...,
    CopySourceIfNoneMatch: str = ...,
    CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
    CopySourceRange: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    CopySourceSSECustomerAlgorithm: str = ...,
    CopySourceSSECustomerKey: str = ...,
    CopySourceSSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
    ExpectedSourceBucketOwner: str = ...,
) -> UploadPartCopyOutputTypeDef:  # (3)
    ...
  1. See CopySourceTypeDef
  2. See RequestPayerType
  3. See UploadPartCopyOutputTypeDef
Usage example with kwargs
kwargs: UploadPartCopyRequestMultipartUploadPartCopyFromTypeDef = {  # (1)
    "CopySource": ...,
}

parent.copy_from(**kwargs)
  1. See UploadPartCopyRequestMultipartUploadPartCopyFromTypeDef

MultipartUploadPart.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

MultipartUploadPart.upload method

Uploads a part in a multipart upload.

Type annotations and code completion for boto3.resource("s3").upload method. boto3 documentation

Method definition
def upload(
    self,
    *,
    Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
    ContentLength: int = ...,
    ContentMD5: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> UploadPartOutputTypeDef:  # (3)
    ...
  1. See ChecksumAlgorithmType
  2. See RequestPayerType
  3. See UploadPartOutputTypeDef
Usage example with kwargs
kwargs: UploadPartRequestMultipartUploadPartUploadTypeDef = {  # (1)
    "Body": ...,
}

parent.upload(**kwargs)
  1. See UploadPartRequestMultipartUploadPartUploadTypeDef

Object

Type annotations and code completion for boto3.resource("s3").Object class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import Object

def get_resource() -> Object:
    return boto3.resource("s3").Object(...)

Object attributes

  • delete_marker: bool
  • accept_ranges: str
  • expiration: str
  • restore: str
  • archive_status: ArchiveStatusType
  • last_modified: datetime
  • content_length: int
  • checksum_crc32: str
  • checksum_crc32_c: str
  • checksum_sha1: str
  • checksum_sha256: str
  • e_tag: str
  • missing_meta: int
  • version_id: str
  • cache_control: str
  • content_disposition: str
  • content_encoding: str
  • content_language: str
  • content_type: str
  • expires: datetime
  • website_redirect_location: str
  • server_side_encryption: ServerSideEncryptionType
  • metadata: Dict[str, str]
  • sse_customer_algorithm: str
  • sse_customer_key_md5: str
  • ssekms_key_id: str
  • bucket_key_enabled: bool
  • storage_class: StorageClassType
  • request_charged: Literal['requester'] (see RequestChargedType)
  • replication_status: ReplicationStatusType
  • parts_count: int
  • object_lock_mode: ObjectLockModeType
  • object_lock_retain_until_date: datetime
  • object_lock_legal_hold_status: ObjectLockLegalHoldStatusType
  • bucket_name: str
  • key: str

Object methods

Object.Acl method

Creates a ObjectAcl resource.

Type annotations and code completion for boto3.resource("s3").Acl method. boto3 documentation

Method definition
def Acl(
    self,
) -> ObjectAcl:
    ...

Object.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

Object.MultipartUpload method

Creates a MultipartUpload resource.

Type annotations and code completion for boto3.resource("s3").MultipartUpload method. boto3 documentation

Method definition
def MultipartUpload(
    self,
    id: str,
) -> MultipartUpload:
    ...
Usage example with kwargs
kwargs: ObjectMultipartUploadRequestTypeDef = {  # (1)
    "id": ...,
}

parent.MultipartUpload(**kwargs)
  1. See ObjectMultipartUploadRequestTypeDef

Object.Version method

Creates a ObjectVersion resource.

Type annotations and code completion for boto3.resource("s3").Version method. boto3 documentation

Method definition
def Version(
    self,
    id: str,
) -> ObjectVersion:
    ...
Usage example with kwargs
kwargs: ObjectVersionRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Version(**kwargs)
  1. See ObjectVersionRequestTypeDef

Object.copy method

Copy an object from one S3 location to this object.

Type annotations and code completion for boto3.resource("s3").copy method. boto3 documentation

Method definition
def copy(
    self,
    CopySource: CopySourceTypeDef,  # (1)
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    SourceClient: BaseClient = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
  1. See CopySourceTypeDef
Usage example with kwargs
kwargs: ObjectCopyRequestTypeDef = {  # (1)
    "CopySource": ...,
}

parent.copy(**kwargs)
  1. See ObjectCopyRequestTypeDef

Object.copy_from method

Creates a copy of an object that is already stored in Amazon S3.

Type annotations and code completion for boto3.resource("s3").copy_from method. boto3 documentation

Method definition
def copy_from(
    self,
    *,
    CopySource: str,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    CopySourceIfMatch: str = ...,
    CopySourceIfModifiedSince: Union[datetime, str] = ...,
    CopySourceIfNoneMatch: str = ...,
    CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    MetadataDirective: MetadataDirectiveType = ...,  # (3)
    TaggingDirective: TaggingDirectiveType = ...,  # (4)
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (5)
    StorageClass: StorageClassType = ...,  # (6)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    CopySourceSSECustomerAlgorithm: str = ...,
    CopySourceSSECustomerKey: str = ...,
    CopySourceSSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (7)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (8)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (9)
    ExpectedBucketOwner: str = ...,
    ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef:  # (10)
    ...
  1. See ObjectCannedACLType
  2. See ChecksumAlgorithmType
  3. See MetadataDirectiveType
  4. See TaggingDirectiveType
  5. See ServerSideEncryptionType
  6. See StorageClassType
  7. See RequestPayerType
  8. See ObjectLockModeType
  9. See ObjectLockLegalHoldStatusType
  10. See CopyObjectOutputTypeDef
Usage example with kwargs
kwargs: CopyObjectRequestObjectCopyFromTypeDef = {  # (1)
    "CopySource": ...,
}

parent.copy_from(**kwargs)
  1. See CopyObjectRequestObjectCopyFromTypeDef

Object.delete method

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    MFA: str = ...,
    VersionId: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectRequestObjectDeleteTypeDef = {  # (1)
    "MFA": ...,
}

parent.delete(**kwargs)
  1. See DeleteObjectRequestObjectDeleteTypeDef

Object.download_file method

Download an S3 object to a file.

Type annotations and code completion for boto3.resource("s3").download_file method. boto3 documentation

Method definition
def download_file(
    self,
    Filename: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ObjectDownloadFileRequestTypeDef = {  # (1)
    "Filename": ...,
}

parent.download_file(**kwargs)
  1. See ObjectDownloadFileRequestTypeDef

Object.download_fileobj method

Download this object from S3 to a file-like object.

Type annotations and code completion for boto3.resource("s3").download_fileobj method. boto3 documentation

Method definition
def download_fileobj(
    self,
    Fileobj: Union[IO[Any], StreamingBody],
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ObjectDownloadFileobjRequestTypeDef = {  # (1)
    "Fileobj": ...,
}

parent.download_fileobj(**kwargs)
  1. See ObjectDownloadFileobjRequestTypeDef

Object.get method

Retrieves objects from Amazon S3.

Type annotations and code completion for boto3.resource("s3").get method. boto3 documentation

Method definition
def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: Union[datetime, str] = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: Union[datetime, str] = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: Union[datetime, str] = ...,
    VersionId: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    PartNumber: int = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumMode: ChecksumModeType = ...,  # (2)
) -> GetObjectOutputTypeDef:  # (3)
    ...
  1. See RequestPayerType
  2. See ChecksumModeType
  3. See GetObjectOutputTypeDef
Usage example with kwargs
kwargs: GetObjectRequestObjectGetTypeDef = {  # (1)
    "IfMatch": ...,
}

parent.get(**kwargs)
  1. See GetObjectRequestObjectGetTypeDef

Object.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

Object.initiate_multipart_upload method

This action initiates a multipart upload and returns an upload ID.

Type annotations and code completion for boto3.resource("s3").initiate_multipart_upload method. boto3 documentation

Method definition
def initiate_multipart_upload(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (2)
    StorageClass: StorageClassType = ...,  # (3)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (4)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (5)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (6)
    ExpectedBucketOwner: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (7)
) -> MultipartUpload:
    ...
  1. See ObjectCannedACLType
  2. See ServerSideEncryptionType
  3. See StorageClassType
  4. See RequestPayerType
  5. See ObjectLockModeType
  6. See ObjectLockLegalHoldStatusType
  7. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: CreateMultipartUploadRequestObjectInitiateMultipartUploadTypeDef = {  # (1)
    "ACL": ...,
}

parent.initiate_multipart_upload(**kwargs)
  1. See CreateMultipartUploadRequestObjectInitiateMultipartUploadTypeDef

Object.load method

Calls 🇵🇾meth:S3.Client.head_object to update the attributes of the Object resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

Object.put method

Adds an object to a bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentLength: int = ...,
    ContentMD5: str = ...,
    ContentType: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (3)
    StorageClass: StorageClassType = ...,  # (4)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (5)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (6)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (7)
    ExpectedBucketOwner: str = ...,
) -> PutObjectOutputTypeDef:  # (8)
    ...
  1. See ObjectCannedACLType
  2. See ChecksumAlgorithmType
  3. See ServerSideEncryptionType
  4. See StorageClassType
  5. See RequestPayerType
  6. See ObjectLockModeType
  7. See ObjectLockLegalHoldStatusType
  8. See PutObjectOutputTypeDef
Usage example with kwargs
kwargs: PutObjectRequestObjectPutTypeDef = {  # (1)
    "ACL": ...,
}

parent.put(**kwargs)
  1. See PutObjectRequestObjectPutTypeDef

Object.reload method

Calls 🇵🇾meth:S3.Client.head_object to update the attributes of the Object resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

Object.restore_object method

Restores an archived copy of an object back into Amazon S3 This action is not supported by Amazon S3 on Outposts.

Type annotations and code completion for boto3.resource("s3").restore_object method. boto3 documentation

Method definition
def restore_object(
    self,
    *,
    VersionId: str = ...,
    RestoreRequest: RestoreRequestTypeDef = ...,  # (1)
    RequestPayer: RequestPayerType = ...,  # (2)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
    ExpectedBucketOwner: str = ...,
) -> RestoreObjectOutputTypeDef:  # (4)
    ...
  1. See RestoreRequestTypeDef
  2. See RequestPayerType
  3. See ChecksumAlgorithmType
  4. See RestoreObjectOutputTypeDef
Usage example with kwargs
kwargs: RestoreObjectRequestObjectRestoreObjectTypeDef = {  # (1)
    "VersionId": ...,
}

parent.restore_object(**kwargs)
  1. See RestoreObjectRequestObjectRestoreObjectTypeDef

Object.upload_file method

Upload a file to an S3 object.

Type annotations and code completion for boto3.resource("s3").upload_file method. boto3 documentation

Method definition
def upload_file(
    self,
    Filename: str,
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ObjectUploadFileRequestTypeDef = {  # (1)
    "Filename": ...,
}

parent.upload_file(**kwargs)
  1. See ObjectUploadFileRequestTypeDef

Object.upload_fileobj method

Upload a file-like object to this object.

Type annotations and code completion for boto3.resource("s3").upload_fileobj method. boto3 documentation

Method definition
def upload_fileobj(
    self,
    Fileobj: Union[IO[Any], StreamingBody],
    ExtraArgs: Dict[str, Any] = ...,
    Callback: Callable[..., Any] = ...,
    Config: TransferConfig = ...,
) -> None:
    ...
Usage example with kwargs
kwargs: ObjectUploadFileobjRequestTypeDef = {  # (1)
    "Fileobj": ...,
}

parent.upload_fileobj(**kwargs)
  1. See ObjectUploadFileobjRequestTypeDef

Object.wait_until_exists method

Waits until this Object is exists.

Type annotations and code completion for boto3.resource("s3").wait_until_exists method. boto3 documentation

Method definition
def wait_until_exists(
    self,
) -> None:
    ...

Object.wait_until_not_exists method

Waits until this Object is not exists.

Type annotations and code completion for boto3.resource("s3").wait_until_not_exists method. boto3 documentation

Method definition
def wait_until_not_exists(
    self,
) -> None:
    ...

ObjectAcl

Type annotations and code completion for boto3.resource("s3").ObjectAcl class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import ObjectAcl

def get_resource() -> ObjectAcl:
    return boto3.resource("s3").ObjectAcl(...)

ObjectAcl attributes

ObjectAcl methods

ObjectAcl.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
) -> Object:
    ...

ObjectAcl.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

ObjectAcl.load method

Calls 🇵🇾meth:S3.Client.get_object_acl to update the attributes of the ObjectAcl resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

ObjectAcl.put method

Uses the acl subresource to set the access control list (ACL) permissions for a new or existing object in an S3 bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    AccessControlPolicy: AccessControlPolicyTypeDef = ...,  # (2)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWrite: str = ...,
    GrantWriteACP: str = ...,
    RequestPayer: RequestPayerType = ...,  # (4)
    VersionId: str = ...,
    ExpectedBucketOwner: str = ...,
) -> PutObjectAclOutputTypeDef:  # (5)
    ...
  1. See ObjectCannedACLType
  2. See AccessControlPolicyTypeDef
  3. See ChecksumAlgorithmType
  4. See RequestPayerType
  5. See PutObjectAclOutputTypeDef
Usage example with kwargs
kwargs: PutObjectAclRequestObjectAclPutTypeDef = {  # (1)
    "ACL": ...,
}

parent.put(**kwargs)
  1. See PutObjectAclRequestObjectAclPutTypeDef

ObjectAcl.reload method

Calls 🇵🇾meth:S3.Client.get_object_acl to update the attributes of the ObjectAcl resource.

Type annotations and code completion for boto3.resource("s3").reload method. boto3 documentation

Method definition
def reload(
    self,
) -> None:
    ...

ObjectSummary

Type annotations and code completion for boto3.resource("s3").ObjectSummary class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import ObjectSummary

def get_resource() -> ObjectSummary:
    return boto3.resource("s3").ObjectSummary(...)

ObjectSummary attributes

ObjectSummary methods

ObjectSummary.Acl method

Creates a ObjectAcl resource.

Type annotations and code completion for boto3.resource("s3").Acl method. boto3 documentation

Method definition
def Acl(
    self,
) -> ObjectAcl:
    ...

ObjectSummary.Bucket method

Creates a Bucket resource.

Type annotations and code completion for boto3.resource("s3").Bucket method. boto3 documentation

Method definition
def Bucket(
    self,
) -> Bucket:
    ...

ObjectSummary.MultipartUpload method

Creates a MultipartUpload resource.

Type annotations and code completion for boto3.resource("s3").MultipartUpload method. boto3 documentation

Method definition
def MultipartUpload(
    self,
    id: str,
) -> MultipartUpload:
    ...
Usage example with kwargs
kwargs: ObjectSummaryMultipartUploadRequestTypeDef = {  # (1)
    "id": ...,
}

parent.MultipartUpload(**kwargs)
  1. See ObjectSummaryMultipartUploadRequestTypeDef

ObjectSummary.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
) -> Object:
    ...

ObjectSummary.Version method

Creates a ObjectVersion resource.

Type annotations and code completion for boto3.resource("s3").Version method. boto3 documentation

Method definition
def Version(
    self,
    id: str,
) -> ObjectVersion:
    ...
Usage example with kwargs
kwargs: ObjectSummaryVersionRequestTypeDef = {  # (1)
    "id": ...,
}

parent.Version(**kwargs)
  1. See ObjectSummaryVersionRequestTypeDef

ObjectSummary.copy_from method

Creates a copy of an object that is already stored in Amazon S3.

Type annotations and code completion for boto3.resource("s3").copy_from method. boto3 documentation

Method definition
def copy_from(
    self,
    *,
    CopySource: str,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    CopySourceIfMatch: str = ...,
    CopySourceIfModifiedSince: Union[datetime, str] = ...,
    CopySourceIfNoneMatch: str = ...,
    CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    MetadataDirective: MetadataDirectiveType = ...,  # (3)
    TaggingDirective: TaggingDirectiveType = ...,  # (4)
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (5)
    StorageClass: StorageClassType = ...,  # (6)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    CopySourceSSECustomerAlgorithm: str = ...,
    CopySourceSSECustomerKey: str = ...,
    CopySourceSSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (7)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (8)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (9)
    ExpectedBucketOwner: str = ...,
    ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef:  # (10)
    ...
  1. See ObjectCannedACLType
  2. See ChecksumAlgorithmType
  3. See MetadataDirectiveType
  4. See TaggingDirectiveType
  5. See ServerSideEncryptionType
  6. See StorageClassType
  7. See RequestPayerType
  8. See ObjectLockModeType
  9. See ObjectLockLegalHoldStatusType
  10. See CopyObjectOutputTypeDef
Usage example with kwargs
kwargs: CopyObjectRequestObjectSummaryCopyFromTypeDef = {  # (1)
    "CopySource": ...,
}

parent.copy_from(**kwargs)
  1. See CopyObjectRequestObjectSummaryCopyFromTypeDef

ObjectSummary.delete method

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    MFA: str = ...,
    VersionId: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectRequestObjectSummaryDeleteTypeDef = {  # (1)
    "MFA": ...,
}

parent.delete(**kwargs)
  1. See DeleteObjectRequestObjectSummaryDeleteTypeDef

ObjectSummary.get method

Retrieves objects from Amazon S3.

Type annotations and code completion for boto3.resource("s3").get method. boto3 documentation

Method definition
def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: Union[datetime, str] = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: Union[datetime, str] = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: Union[datetime, str] = ...,
    VersionId: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    PartNumber: int = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumMode: ChecksumModeType = ...,  # (2)
) -> GetObjectOutputTypeDef:  # (3)
    ...
  1. See RequestPayerType
  2. See ChecksumModeType
  3. See GetObjectOutputTypeDef
Usage example with kwargs
kwargs: GetObjectRequestObjectSummaryGetTypeDef = {  # (1)
    "IfMatch": ...,
}

parent.get(**kwargs)
  1. See GetObjectRequestObjectSummaryGetTypeDef

ObjectSummary.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

ObjectSummary.initiate_multipart_upload method

This action initiates a multipart upload and returns an upload ID.

Type annotations and code completion for boto3.resource("s3").initiate_multipart_upload method. boto3 documentation

Method definition
def initiate_multipart_upload(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (2)
    StorageClass: StorageClassType = ...,  # (3)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (4)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (5)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (6)
    ExpectedBucketOwner: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (7)
) -> MultipartUpload:
    ...
  1. See ObjectCannedACLType
  2. See ServerSideEncryptionType
  3. See StorageClassType
  4. See RequestPayerType
  5. See ObjectLockModeType
  6. See ObjectLockLegalHoldStatusType
  7. See ChecksumAlgorithmType
Usage example with kwargs
kwargs: CreateMultipartUploadRequestObjectSummaryInitiateMultipartUploadTypeDef = {  # (1)
    "ACL": ...,
}

parent.initiate_multipart_upload(**kwargs)
  1. See CreateMultipartUploadRequestObjectSummaryInitiateMultipartUploadTypeDef

ObjectSummary.load method

Calls s3.Client.head_object to update the attributes of the ObjectSummary resource.

Type annotations and code completion for boto3.resource("s3").load method. boto3 documentation

Method definition
def load(
    self,
) -> None:
    ...

ObjectSummary.put method

Adds an object to a bucket.

Type annotations and code completion for boto3.resource("s3").put method. boto3 documentation

Method definition
def put(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentLength: int = ...,
    ContentMD5: str = ...,
    ContentType: str = ...,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    Expires: Union[datetime, str] = ...,
    GrantFullControl: str = ...,
    GrantRead: str = ...,
    GrantReadACP: str = ...,
    GrantWriteACP: str = ...,
    Metadata: Mapping[str, str] = ...,
    ServerSideEncryption: ServerSideEncryptionType = ...,  # (3)
    StorageClass: StorageClassType = ...,  # (4)
    WebsiteRedirectLocation: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    SSEKMSKeyId: str = ...,
    SSEKMSEncryptionContext: str = ...,
    BucketKeyEnabled: bool = ...,
    RequestPayer: RequestPayerType = ...,  # (5)
    Tagging: str = ...,
    ObjectLockMode: ObjectLockModeType = ...,  # (6)
    ObjectLockRetainUntilDate: Union[datetime, str] = ...,
    ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ...,  # (7)
    ExpectedBucketOwner: str = ...,
) -> PutObjectOutputTypeDef:  # (8)
    ...
  1. See ObjectCannedACLType
  2. See ChecksumAlgorithmType
  3. See ServerSideEncryptionType
  4. See StorageClassType
  5. See RequestPayerType
  6. See ObjectLockModeType
  7. See ObjectLockLegalHoldStatusType
  8. See PutObjectOutputTypeDef
Usage example with kwargs
kwargs: PutObjectRequestObjectSummaryPutTypeDef = {  # (1)
    "ACL": ...,
}

parent.put(**kwargs)
  1. See PutObjectRequestObjectSummaryPutTypeDef

ObjectSummary.restore_object method

Restores an archived copy of an object back into Amazon S3 This action is not supported by Amazon S3 on Outposts.

Type annotations and code completion for boto3.resource("s3").restore_object method. boto3 documentation

Method definition
def restore_object(
    self,
    *,
    VersionId: str = ...,
    RestoreRequest: RestoreRequestTypeDef = ...,  # (1)
    RequestPayer: RequestPayerType = ...,  # (2)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (3)
    ExpectedBucketOwner: str = ...,
) -> RestoreObjectOutputTypeDef:  # (4)
    ...
  1. See RestoreRequestTypeDef
  2. See RequestPayerType
  3. See ChecksumAlgorithmType
  4. See RestoreObjectOutputTypeDef
Usage example with kwargs
kwargs: RestoreObjectRequestObjectSummaryRestoreObjectTypeDef = {  # (1)
    "VersionId": ...,
}

parent.restore_object(**kwargs)
  1. See RestoreObjectRequestObjectSummaryRestoreObjectTypeDef

ObjectSummary.wait_until_exists method

Waits until this ObjectSummary is exists.

Type annotations and code completion for boto3.resource("s3").wait_until_exists method. boto3 documentation

Method definition
def wait_until_exists(
    self,
) -> None:
    ...

ObjectSummary.wait_until_not_exists method

Waits until this ObjectSummary is not exists.

Type annotations and code completion for boto3.resource("s3").wait_until_not_exists method. boto3 documentation

Method definition
def wait_until_not_exists(
    self,
) -> None:
    ...

ObjectVersion

Type annotations and code completion for boto3.resource("s3").ObjectVersion class. boto3 documentation

Usage example
from mypy_boto3_s3.service_resource import ObjectVersion

def get_resource() -> ObjectVersion:
    return boto3.resource("s3").ObjectVersion(...)

ObjectVersion attributes

ObjectVersion methods

ObjectVersion.Object method

Creates a Object resource.

Type annotations and code completion for boto3.resource("s3").Object method. boto3 documentation

Method definition
def Object(
    self,
) -> Object:
    ...

ObjectVersion.delete method

Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.

Type annotations and code completion for boto3.resource("s3").delete method. boto3 documentation

Method definition
def delete(
    self,
    *,
    MFA: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
Usage example with kwargs
kwargs: DeleteObjectRequestObjectVersionDeleteTypeDef = {  # (1)
    "MFA": ...,
}

parent.delete(**kwargs)
  1. See DeleteObjectRequestObjectVersionDeleteTypeDef

ObjectVersion.get method

Retrieves objects from Amazon S3.

Type annotations and code completion for boto3.resource("s3").get method. boto3 documentation

Method definition
def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: Union[datetime, str] = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: Union[datetime, str] = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: Union[datetime, str] = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    PartNumber: int = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumMode: ChecksumModeType = ...,  # (2)
) -> GetObjectOutputTypeDef:  # (3)
    ...
  1. See RequestPayerType
  2. See ChecksumModeType
  3. See GetObjectOutputTypeDef
Usage example with kwargs
kwargs: GetObjectRequestObjectVersionGetTypeDef = {  # (1)
    "IfMatch": ...,
}

parent.get(**kwargs)
  1. See GetObjectRequestObjectVersionGetTypeDef

ObjectVersion.get_available_subresources method

Returns a list of all the available sub-resources for this Resource.

Type annotations and code completion for boto3.resource("s3").get_available_subresources method. boto3 documentation

Method definition
def get_available_subresources(
    self,
) -> Sequence[str]:
    ...

ObjectVersion.head method

The HEAD action retrieves metadata from an object without returning the object itself.

Type annotations and code completion for boto3.resource("s3").head method. boto3 documentation

Method definition
def head(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: Union[datetime, str] = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: Union[datetime, str] = ...,
    Range: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    PartNumber: int = ...,
    ExpectedBucketOwner: str = ...,
    ChecksumMode: ChecksumModeType = ...,  # (2)
) -> HeadObjectOutputTypeDef:  # (3)
    ...
  1. See RequestPayerType
  2. See ChecksumModeType
  3. See HeadObjectOutputTypeDef
Usage example with kwargs
kwargs: HeadObjectRequestObjectVersionHeadTypeDef = {  # (1)
    "IfMatch": ...,
}

parent.head(**kwargs)
  1. See HeadObjectRequestObjectVersionHeadTypeDef