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.