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

# S3ServiceResource usage example

from mypy_boto3_s3.service_resource import S3ServiceResource

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

Attributes#

  • meta: "S3ResourceMeta"

  • buckets: ServiceResourceBucketsCollection

Collections#

ServiceResourceBucketsCollection#

Provides access to Bucket resource.

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

# ServiceResourceBucketsCollection 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

# Bucket method definition

def Bucket(
    self,
    name: str,
) -> "_Bucket":
    ...

S3ServiceResource.BucketAcl method#

Creates a BucketAcl resource.

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

# BucketAcl method definition

def BucketAcl(
    self,
    bucket_name: str,
) -> "_BucketAcl":
    ...

S3ServiceResource.BucketCors method#

Creates a BucketCors resource.

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

# BucketCors method definition

def BucketCors(
    self,
    bucket_name: str,
) -> "_BucketCors":
    ...

S3ServiceResource.BucketLifecycle method#

Creates a BucketLifecycle resource.

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

# BucketLifecycle method definition

def BucketLifecycle(
    self,
    bucket_name: str,
) -> "_BucketLifecycle":
    ...

S3ServiceResource.BucketLifecycleConfiguration method#

Creates a BucketLifecycleConfiguration resource.

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

# BucketLifecycleConfiguration method definition

def BucketLifecycleConfiguration(
    self,
    bucket_name: str,
) -> "_BucketLifecycleConfiguration":
    ...

S3ServiceResource.BucketLogging method#

Creates a BucketLogging resource.

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

# BucketLogging method definition

def BucketLogging(
    self,
    bucket_name: str,
) -> "_BucketLogging":
    ...

S3ServiceResource.BucketNotification method#

Creates a BucketNotification resource.

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

# BucketNotification method definition

def BucketNotification(
    self,
    bucket_name: str,
) -> "_BucketNotification":
    ...

S3ServiceResource.BucketPolicy method#

Creates a BucketPolicy resource.

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

# BucketPolicy method definition

def BucketPolicy(
    self,
    bucket_name: str,
) -> "_BucketPolicy":
    ...

S3ServiceResource.BucketRequestPayment method#

Creates a BucketRequestPayment resource.

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

# BucketRequestPayment method definition

def BucketRequestPayment(
    self,
    bucket_name: str,
) -> "_BucketRequestPayment":
    ...

S3ServiceResource.BucketTagging method#

Creates a BucketTagging resource.

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

# BucketTagging method definition

def BucketTagging(
    self,
    bucket_name: str,
) -> "_BucketTagging":
    ...

S3ServiceResource.BucketVersioning method#

Creates a BucketVersioning resource.

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

# BucketVersioning method definition

def BucketVersioning(
    self,
    bucket_name: str,
) -> "_BucketVersioning":
    ...

S3ServiceResource.BucketWebsite method#

Creates a BucketWebsite resource.

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

# BucketWebsite method definition

def BucketWebsite(
    self,
    bucket_name: str,
) -> "_BucketWebsite":
    ...

S3ServiceResource.MultipartUpload method#

Creates a MultipartUpload resource.

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

# MultipartUpload method definition

def MultipartUpload(
    self,
    bucket_name: str,
    object_key: str,
    id: str,
) -> "_MultipartUpload":
    ...

S3ServiceResource.MultipartUploadPart method#

Creates a MultipartUploadPart resource.

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

# MultipartUploadPart method definition

def MultipartUploadPart(
    self,
    bucket_name: str,
    object_key: str,
    multipart_upload_id: str,
    part_number: int,
) -> "_MultipartUploadPart":
    ...

S3ServiceResource.Object method#

Creates a Object resource.

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

# Object method definition

def Object(
    self,
    bucket_name: str,
    key: str,
) -> "_Object":
    ...

S3ServiceResource.ObjectAcl method#

Creates a ObjectAcl resource.

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

# ObjectAcl method definition

def ObjectAcl(
    self,
    bucket_name: str,
    object_key: str,
) -> "_ObjectAcl":
    ...

S3ServiceResource.ObjectSummary method#

Creates a ObjectSummary resource.

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

# ObjectSummary method definition

def ObjectSummary(
    self,
    bucket_name: str,
    key: str,
) -> "_ObjectSummary":
    ...

S3ServiceResource.ObjectVersion method#

Creates a ObjectVersion resource.

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

# ObjectVersion method definition

def ObjectVersion(
    self,
    bucket_name: str,
    object_key: str,
    id: str,
) -> "_ObjectVersion":
    ...

S3ServiceResource.create_bucket method#

.

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

# create_bucket 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
# create_bucket method usage example with argument unpacking

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

# get_available_subresources method definition

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

Bucket#

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

# Bucket usage example

from mypy_boto3_s3.service_resource import Bucket

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

Bucket attributes#

  • creation_date: datetime
  • bucket_region: str
  • name: str
  • multipart_uploads: BucketMultipartUploadsCollection
  • object_versions: BucketObjectVersionsCollection
  • objects: BucketObjectsCollection
  • meta: "S3ResourceMeta"

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

# BucketMultipartUploadsCollection 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

# BucketObjectVersionsCollection 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

# BucketObjectsCollection 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

# Acl 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

# Cors 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

# Lifecycle 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

# LifecycleConfiguration 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

# Logging 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

# Notification 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

# Object method definition

def Object(
    self,
    key: str,
) -> "_Object":
    ...

Bucket.Policy method#

Creates a BucketPolicy resource.

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

# Policy 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

# RequestPayment 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

# Tagging 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

# Versioning 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

# Website 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

# copy method definition

def copy(
    self,
    CopySource: CopySourceTypeDef,  # (1)
    Key: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    SourceClient: Optional[BaseClient] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
  1. See CopySourceTypeDef
# copy method usage example with argument unpacking

kwargs: BucketCopyRequestTypeDef = {  # (1)
    "CopySource": ...,
    "Key": ...,
}

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

Bucket.create method#

.

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

# create 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
# create method usage example with argument unpacking

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

kwargs: DeleteBucketRequestBucketDeleteTypeDef = {  # (1)
    "ExpectedBucketOwner": ...,
}

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

Bucket.delete_objects method#

This operation 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

# delete_objects 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
# delete_objects method usage example with argument unpacking

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

# download_file method definition

def download_file(
    self,
    Key: str,
    Filename: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# download_file method usage example with argument unpacking

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

# download_fileobj method definition

def download_fileobj(
    self,
    Key: str,
    Fileobj: FileobjTypeDef,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# download_fileobj method usage example with argument unpacking

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

# get_available_subresources 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

# load 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

# put_object method definition

def put_object(
    self,
    *,
    Key: str,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: BlobTypeDef = ...,
    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: TimestampTypeDef = ...,
    IfNoneMatch: 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: TimestampTypeDef = ...,
    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
# put_object method usage example with argument unpacking

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

# upload_file method definition

def upload_file(
    self,
    Filename: str,
    Key: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# upload_file method usage example with argument unpacking

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

# upload_fileobj method definition

def upload_fileobj(
    self,
    Fileobj: FileobjTypeDef,
    Key: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# upload_fileobj method usage example with argument unpacking

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

# wait_until_exists 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

# wait_until_not_exists method definition

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

BucketAcl#

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

# BucketAcl 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

# Bucket 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

# get_available_subresources 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

# load method definition

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

BucketAcl.put method#

.

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

# put 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
# put method usage example with argument unpacking

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

# reload method definition

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

BucketCors#

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

# BucketCors 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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketCors.delete method#

.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketCors.put method#

.

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

# put method definition

def put(
    self,
    *,
    CORSConfiguration: CORSConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See CORSConfigurationTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketLifecycle#

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

# BucketLifecycle 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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketLifecycle.delete method#

.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketLifecycle.put method#

.

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

# put method definition

def put(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    LifecycleConfiguration: LifecycleConfigurationTypeDef = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
  2. See LifecycleConfigurationTypeDef
# put method usage example with argument unpacking

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

# reload method definition

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

BucketLifecycleConfiguration#

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

# BucketLifecycleConfiguration 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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketLifecycleConfiguration.delete method#

.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketLifecycleConfiguration.put method#

.

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

# put method definition

def put(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    LifecycleConfiguration: BucketLifecycleConfigurationTypeDef = ...,  # (2)
    ExpectedBucketOwner: str = ...,
    TransitionDefaultMinimumObjectSize: TransitionDefaultMinimumObjectSizeType = ...,  # (3)
) -> PutBucketLifecycleConfigurationOutputTypeDef:  # (4)
    ...
  1. See ChecksumAlgorithmType
  2. See BucketLifecycleConfigurationTypeDef
  3. See TransitionDefaultMinimumObjectSizeType
  4. See PutBucketLifecycleConfigurationOutputTypeDef
# put method usage example with argument unpacking

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

# reload method definition

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

BucketLogging#

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

# BucketLogging 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

# Bucket 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

# get_available_subresources 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

# load method definition

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

BucketLogging.put method#

.

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

# put method definition

def put(
    self,
    *,
    BucketLoggingStatus: BucketLoggingStatusTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See BucketLoggingStatusTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketNotification#

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

# BucketNotification 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

# Bucket 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

# get_available_subresources 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

# load method definition

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

BucketNotification.put method#

.

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

# put method definition

def put(
    self,
    *,
    NotificationConfiguration: NotificationConfigurationTypeDef,  # (1)
    ExpectedBucketOwner: str = ...,
    SkipDestinationValidation: bool = ...,
) -> None:
    ...
  1. See NotificationConfigurationTypeDef
# put method usage example with argument unpacking

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

# reload method definition

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

BucketPolicy#

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

# BucketPolicy 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
  • meta: "S3ResourceMeta"

BucketPolicy methods#

BucketPolicy.Bucket method#

Creates a Bucket resource.

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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketPolicy.delete method#

Deletes the policy of a specified bucket.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load 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

# put method definition

def put(
    self,
    *,
    Policy: str,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    ConfirmRemoveSelfBucketAccess: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketRequestPayment#

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

# BucketRequestPayment usage example

from mypy_boto3_s3.service_resource import BucketRequestPayment

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

BucketRequestPayment attributes#

  • payer: PayerType
  • bucket_name: str
  • meta: "S3ResourceMeta"

BucketRequestPayment methods#

BucketRequestPayment.Bucket method#

Creates a Bucket resource.

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

# Bucket 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

# get_available_subresources 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

# load method definition

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

BucketRequestPayment.put method#

.

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

# put method definition

def put(
    self,
    *,
    RequestPaymentConfiguration: RequestPaymentConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See RequestPaymentConfigurationTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketTagging#

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

# BucketTagging usage example

from mypy_boto3_s3.service_resource import BucketTagging

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

BucketTagging attributes#

  • tag_set: List[TagTypeDef]
  • bucket_name: str
  • meta: "S3ResourceMeta"

BucketTagging methods#

BucketTagging.Bucket method#

Creates a Bucket resource.

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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketTagging.delete method#

.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketTagging.put method#

.

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

# put method definition

def put(
    self,
    *,
    Tagging: TaggingTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See TaggingTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketVersioning#

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

# BucketVersioning 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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketVersioning.enable method#

.

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

# enable method definition

def enable(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
# enable method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketVersioning.put method#

.

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

# put method definition

def put(
    self,
    *,
    VersioningConfiguration: VersioningConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See VersioningConfigurationTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

BucketVersioning.suspend method#

.

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

# suspend method definition

def suspend(
    self,
    *,
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (1)
    MFA: str = ...,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See ChecksumAlgorithmType
# suspend method usage example with argument unpacking

kwargs: PutBucketVersioningRequestBucketVersioningSuspendTypeDef = {  # (1)
    "ChecksumAlgorithm": ...,
}

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

BucketWebsite#

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

# BucketWebsite 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

# Bucket method definition

def Bucket(
    self,
) -> "_Bucket":
    ...

BucketWebsite.delete method#

.

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

# delete method definition

def delete(
    self,
    *,
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
# delete method usage example with argument unpacking

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

# get_available_subresources 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

# load method definition

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

BucketWebsite.put method#

.

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

# put method definition

def put(
    self,
    *,
    WebsiteConfiguration: WebsiteConfigurationTypeDef,  # (1)
    ChecksumAlgorithm: ChecksumAlgorithmType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
) -> None:
    ...
  1. See WebsiteConfigurationTypeDef
  2. See ChecksumAlgorithmType
# put method usage example with argument unpacking

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

# reload method definition

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

MultipartUpload#

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

# MultipartUpload 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

# MultipartUploadPartsCollection 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

# Object 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

# Part method definition

def Part(
    self,
    part_number: int,
) -> "_MultipartUploadPart":
    ...

MultipartUpload.abort method#

This operation aborts a multipart upload.

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

# abort method definition

def abort(
    self,
    *,
    RequestPayer: RequestPayerType = ...,  # (1)
    ExpectedBucketOwner: str = ...,
) -> AbortMultipartUploadOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See AbortMultipartUploadOutputTypeDef
# abort method usage example with argument unpacking

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

# complete method definition

def complete(
    self,
    *,
    MultipartUpload: CompletedMultipartUploadTypeDef = ...,  # (1)
    ChecksumCRC32: str = ...,
    ChecksumCRC32C: str = ...,
    ChecksumSHA1: str = ...,
    ChecksumSHA256: str = ...,
    RequestPayer: RequestPayerType = ...,  # (2)
    ExpectedBucketOwner: str = ...,
    IfNoneMatch: str = ...,
    SSECustomerAlgorithm: str = ...,
    SSECustomerKey: str = ...,
    SSECustomerKeyMD5: str = ...,
) -> "_Object":
    ...
  1. See CompletedMultipartUploadTypeDef
  2. See RequestPayerType
# complete method usage example with argument unpacking

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

# get_available_subresources method definition

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

MultipartUploadPart#

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

# MultipartUploadPart 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: int
  • meta: "S3ResourceMeta"

MultipartUploadPart methods#

MultipartUploadPart.MultipartUpload method#

Creates a MultipartUpload resource.

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

# MultipartUpload 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

# copy_from method definition

def copy_from(
    self,
    *,
    CopySource: CopySourceOrStrTypeDef,  # (1)
    CopySourceIfMatch: str = ...,
    CopySourceIfModifiedSince: TimestampTypeDef = ...,
    CopySourceIfNoneMatch: str = ...,
    CopySourceIfUnmodifiedSince: TimestampTypeDef = ...,
    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
# copy_from method usage example with argument unpacking

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

# get_available_subresources 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

# upload method definition

def upload(
    self,
    *,
    Body: BlobTypeDef = ...,
    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
# upload method usage example with argument unpacking

kwargs: UploadPartRequestMultipartUploadPartUploadTypeDef = {  # (1)
    "Body": ...,
}

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

Object#

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

# Object 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
  • meta: "S3ResourceMeta"

Object methods#

Object.Acl method#

Creates a ObjectAcl resource.

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

# Acl 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

# Bucket 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

# MultipartUpload method definition

def MultipartUpload(
    self,
    id: str,
) -> "_MultipartUpload":
    ...

Object.Version method#

Creates a ObjectVersion resource.

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

# Version method definition

def Version(
    self,
    id: str,
) -> "_ObjectVersion":
    ...

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

# copy method definition

def copy(
    self,
    CopySource: CopySourceTypeDef,  # (1)
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    SourceClient: Optional[BaseClient] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
  1. See CopySourceTypeDef
# copy method usage example with argument unpacking

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

# copy_from method definition

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

kwargs: CopyObjectRequestObjectCopyFromTypeDef = {  # (1)
    "CopySource": ...,
}

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

Object.delete method#

Removes an object from a bucket.

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

# delete method definition

def delete(
    self,
    *,
    MFA: str = ...,
    VersionId: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
# delete method usage example with argument unpacking

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

# download_file method definition

def download_file(
    self,
    Filename: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# download_file method usage example with argument unpacking

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

# download_fileobj method definition

def download_fileobj(
    self,
    Fileobj: FileobjTypeDef,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# download_fileobj method usage example with argument unpacking

kwargs: ObjectDownloadFileobjRequestTypeDef = {  # (1)
    "Fileobj": ...,
}

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

Object.get method#

Retrieves an object from Amazon S3.

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

# get method definition

def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: TimestampTypeDef = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: TimestampTypeDef = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: TimestampTypeDef = ...,
    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
# get method usage example with argument unpacking

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

# get_available_subresources 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

# initiate_multipart_upload method definition

def initiate_multipart_upload(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    Expires: TimestampTypeDef = ...,
    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: TimestampTypeDef = ...,
    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
# initiate_multipart_upload method usage example with argument unpacking

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

# load 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

# put method definition

def put(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: BlobTypeDef = ...,
    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: TimestampTypeDef = ...,
    IfNoneMatch: 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: TimestampTypeDef = ...,
    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
# put method usage example with argument unpacking

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

# reload method definition

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

Object.restore_object method#

.

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

# restore_object 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
# restore_object method usage example with argument unpacking

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

# upload_file method definition

def upload_file(
    self,
    Filename: str,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# upload_file method usage example with argument unpacking

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

# upload_fileobj method definition

def upload_fileobj(
    self,
    Fileobj: FileobjTypeDef,
    ExtraArgs: Optional[Dict[str, Any]] = ...,
    Callback: Optional[Callable[..., Any]] = ...,
    Config: Optional[TransferConfig] = ...,
) -> None:
    ...
# upload_fileobj method usage example with argument unpacking

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

# wait_until_exists 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

# wait_until_not_exists method definition

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

ObjectAcl#

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

# ObjectAcl 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

# Object 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

# get_available_subresources 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

# load method definition

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

ObjectAcl.put method#

.

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

# put 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
# put method usage example with argument unpacking

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

# reload method definition

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

ObjectSummary#

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

# ObjectSummary 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

# Acl 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

# Bucket 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

# MultipartUpload method definition

def MultipartUpload(
    self,
    id: str,
) -> "_MultipartUpload":
    ...

ObjectSummary.Object method#

Creates a Object resource.

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

# Object 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

# Version method definition

def Version(
    self,
    id: str,
) -> "_ObjectVersion":
    ...

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

# copy_from method definition

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

kwargs: CopyObjectRequestObjectSummaryCopyFromTypeDef = {  # (1)
    "CopySource": ...,
}

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

ObjectSummary.delete method#

Removes an object from a bucket.

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

# delete method definition

def delete(
    self,
    *,
    MFA: str = ...,
    VersionId: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
# delete method usage example with argument unpacking

kwargs: DeleteObjectRequestObjectSummaryDeleteTypeDef = {  # (1)
    "MFA": ...,
}

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

ObjectSummary.get method#

Retrieves an object from Amazon S3.

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

# get method definition

def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: TimestampTypeDef = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: TimestampTypeDef = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: TimestampTypeDef = ...,
    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
# get method usage example with argument unpacking

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

# get_available_subresources 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

# initiate_multipart_upload method definition

def initiate_multipart_upload(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    CacheControl: str = ...,
    ContentDisposition: str = ...,
    ContentEncoding: str = ...,
    ContentLanguage: str = ...,
    ContentType: str = ...,
    Expires: TimestampTypeDef = ...,
    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: TimestampTypeDef = ...,
    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
# initiate_multipart_upload method usage example with argument unpacking

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

# load 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

# put method definition

def put(
    self,
    *,
    ACL: ObjectCannedACLType = ...,  # (1)
    Body: BlobTypeDef = ...,
    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: TimestampTypeDef = ...,
    IfNoneMatch: 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: TimestampTypeDef = ...,
    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
# put method usage example with argument unpacking

kwargs: PutObjectRequestObjectSummaryPutTypeDef = {  # (1)
    "ACL": ...,
}

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

ObjectSummary.restore_object method#

.

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

# restore_object 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
# restore_object method usage example with argument unpacking

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

# wait_until_exists 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

# wait_until_not_exists method definition

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

ObjectVersion#

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

# ObjectVersion 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

# Object method definition

def Object(
    self,
) -> "_Object":
    ...

ObjectVersion.delete method#

Removes an object from a bucket.

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

# delete method definition

def delete(
    self,
    *,
    MFA: str = ...,
    RequestPayer: RequestPayerType = ...,  # (1)
    BypassGovernanceRetention: bool = ...,
    ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef:  # (2)
    ...
  1. See RequestPayerType
  2. See DeleteObjectOutputTypeDef
# delete method usage example with argument unpacking

kwargs: DeleteObjectRequestObjectVersionDeleteTypeDef = {  # (1)
    "MFA": ...,
}

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

ObjectVersion.get method#

Retrieves an object from Amazon S3.

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

# get method definition

def get(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: TimestampTypeDef = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: TimestampTypeDef = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: TimestampTypeDef = ...,
    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
# get method usage example with argument unpacking

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

# get_available_subresources method definition

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

ObjectVersion.head method#

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

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

# head method definition

def head(
    self,
    *,
    IfMatch: str = ...,
    IfModifiedSince: TimestampTypeDef = ...,
    IfNoneMatch: str = ...,
    IfUnmodifiedSince: TimestampTypeDef = ...,
    Range: str = ...,
    ResponseCacheControl: str = ...,
    ResponseContentDisposition: str = ...,
    ResponseContentEncoding: str = ...,
    ResponseContentLanguage: str = ...,
    ResponseContentType: str = ...,
    ResponseExpires: TimestampTypeDef = ...,
    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
# head method usage example with argument unpacking

kwargs: HeadObjectRequestObjectVersionHeadTypeDef = {  # (1)
    "IfMatch": ...,
}

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