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
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
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
kwargs: ServiceResourceBucketRequestTypeDef = { # (1)
"name": ...,
}
parent.Bucket(**kwargs)
S3ServiceResource.BucketAcl method
Creates a BucketAcl resource.
Type annotations and code completion for boto3.resource("s3").BucketAcl method.
boto3 documentation
kwargs: ServiceResourceBucketAclRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketAcl(**kwargs)
S3ServiceResource.BucketCors method
Creates a BucketCors resource.
Type annotations and code completion for boto3.resource("s3").BucketCors method.
boto3 documentation
kwargs: ServiceResourceBucketCorsRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketCors(**kwargs)
S3ServiceResource.BucketLifecycle method
Creates a BucketLifecycle resource.
Type annotations and code completion for boto3.resource("s3").BucketLifecycle method.
boto3 documentation
kwargs: ServiceResourceBucketLifecycleRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketLifecycle(**kwargs)
S3ServiceResource.BucketLifecycleConfiguration method
Creates a BucketLifecycleConfiguration resource.
Type annotations and code completion for boto3.resource("s3").BucketLifecycleConfiguration method.
boto3 documentation
def BucketLifecycleConfiguration(
self,
bucket_name: str,
) -> BucketLifecycleConfiguration:
...
kwargs: ServiceResourceBucketLifecycleConfigurationRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketLifecycleConfiguration(**kwargs)
S3ServiceResource.BucketLogging method
Creates a BucketLogging resource.
Type annotations and code completion for boto3.resource("s3").BucketLogging method.
boto3 documentation
kwargs: ServiceResourceBucketLoggingRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketLogging(**kwargs)
S3ServiceResource.BucketNotification method
Creates a BucketNotification resource.
Type annotations and code completion for boto3.resource("s3").BucketNotification method.
boto3 documentation
kwargs: ServiceResourceBucketNotificationRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketNotification(**kwargs)
S3ServiceResource.BucketPolicy method
Creates a BucketPolicy resource.
Type annotations and code completion for boto3.resource("s3").BucketPolicy method.
boto3 documentation
kwargs: ServiceResourceBucketPolicyRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketPolicy(**kwargs)
S3ServiceResource.BucketRequestPayment method
Creates a BucketRequestPayment resource.
Type annotations and code completion for boto3.resource("s3").BucketRequestPayment method.
boto3 documentation
kwargs: ServiceResourceBucketRequestPaymentRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketRequestPayment(**kwargs)
S3ServiceResource.BucketTagging method
Creates a BucketTagging resource.
Type annotations and code completion for boto3.resource("s3").BucketTagging method.
boto3 documentation
kwargs: ServiceResourceBucketTaggingRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketTagging(**kwargs)
S3ServiceResource.BucketVersioning method
Creates a BucketVersioning resource.
Type annotations and code completion for boto3.resource("s3").BucketVersioning method.
boto3 documentation
kwargs: ServiceResourceBucketVersioningRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketVersioning(**kwargs)
S3ServiceResource.BucketWebsite method
Creates a BucketWebsite resource.
Type annotations and code completion for boto3.resource("s3").BucketWebsite method.
boto3 documentation
kwargs: ServiceResourceBucketWebsiteRequestTypeDef = { # (1)
"bucket_name": ...,
}
parent.BucketWebsite(**kwargs)
S3ServiceResource.MultipartUpload method
Creates a MultipartUpload resource.
Type annotations and code completion for boto3.resource("s3").MultipartUpload method.
boto3 documentation
def MultipartUpload(
self,
bucket_name: str,
object_key: str,
id: str,
) -> MultipartUpload:
...
kwargs: ServiceResourceMultipartUploadRequestTypeDef = { # (1)
"bucket_name": ...,
"object_key": ...,
"id": ...,
}
parent.MultipartUpload(**kwargs)
S3ServiceResource.MultipartUploadPart method
Creates a MultipartUploadPart resource.
Type annotations and code completion for boto3.resource("s3").MultipartUploadPart method.
boto3 documentation
def MultipartUploadPart(
self,
bucket_name: str,
object_key: str,
multipart_upload_id: str,
part_number: str,
) -> MultipartUploadPart:
...
kwargs: ServiceResourceMultipartUploadPartRequestTypeDef = { # (1)
"bucket_name": ...,
"object_key": ...,
"multipart_upload_id": ...,
"part_number": ...,
}
parent.MultipartUploadPart(**kwargs)
S3ServiceResource.Object method
Creates a Object resource.
Type annotations and code completion for boto3.resource("s3").Object method.
boto3 documentation
kwargs: ServiceResourceObjectRequestTypeDef = { # (1)
"bucket_name": ...,
"key": ...,
}
parent.Object(**kwargs)
S3ServiceResource.ObjectAcl method
Creates a ObjectAcl resource.
Type annotations and code completion for boto3.resource("s3").ObjectAcl method.
boto3 documentation
kwargs: ServiceResourceObjectAclRequestTypeDef = { # (1)
"bucket_name": ...,
"object_key": ...,
}
parent.ObjectAcl(**kwargs)
S3ServiceResource.ObjectSummary method
Creates a ObjectSummary resource.
Type annotations and code completion for boto3.resource("s3").ObjectSummary method.
boto3 documentation
kwargs: ServiceResourceObjectSummaryRequestTypeDef = { # (1)
"bucket_name": ...,
"key": ...,
}
parent.ObjectSummary(**kwargs)
S3ServiceResource.ObjectVersion method
Creates a ObjectVersion resource.
Type annotations and code completion for boto3.resource("s3").ObjectVersion method.
boto3 documentation
def ObjectVersion(
self,
bucket_name: str,
object_key: str,
id: str,
) -> ObjectVersion:
...
kwargs: ServiceResourceObjectVersionRequestTypeDef = { # (1)
"bucket_name": ...,
"object_key": ...,
"id": ...,
}
parent.ObjectVersion(**kwargs)
S3ServiceResource.create_bucket method
Creates a new S3 bucket.
Type annotations and code completion for boto3.resource("s3").create_bucket method.
boto3 documentation
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:
...
kwargs: CreateBucketRequestServiceResourceCreateBucketTypeDef = { # (1)
"Bucket": ...,
}
parent.create_bucket(**kwargs)
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
Bucket
Type annotations and code completion for boto3.resource("s3").Bucket class.
boto3 documentation
from mypy_boto3_s3.service_resource import Bucket
def get_resource() -> Bucket:
return boto3.resource("s3").Bucket(...)
Bucket attributes
creation_date:datetimename:strmultipart_uploads: BucketMultipartUploadsCollectionobject_versions: BucketObjectVersionsCollectionobjects: BucketObjectsCollection
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
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
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
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
Bucket.Cors method
Creates a BucketCors resource.
Type annotations and code completion for boto3.resource("s3").Cors method.
boto3 documentation
Bucket.Lifecycle method
Creates a BucketLifecycle resource.
Type annotations and code completion for boto3.resource("s3").Lifecycle method.
boto3 documentation
Bucket.LifecycleConfiguration method
Creates a BucketLifecycleConfiguration resource.
Type annotations and code completion for boto3.resource("s3").LifecycleConfiguration method.
boto3 documentation
Bucket.Logging method
Creates a BucketLogging resource.
Type annotations and code completion for boto3.resource("s3").Logging method.
boto3 documentation
Bucket.Notification method
Creates a BucketNotification resource.
Type annotations and code completion for boto3.resource("s3").Notification method.
boto3 documentation
Bucket.Object method
Creates a Object resource.
Type annotations and code completion for boto3.resource("s3").Object method.
boto3 documentation
kwargs: BucketObjectRequestTypeDef = { # (1)
"key": ...,
}
parent.Object(**kwargs)
Bucket.Policy method
Creates a BucketPolicy resource.
Type annotations and code completion for boto3.resource("s3").Policy method.
boto3 documentation
Bucket.RequestPayment method
Creates a BucketRequestPayment resource.
Type annotations and code completion for boto3.resource("s3").RequestPayment method.
boto3 documentation
Bucket.Tagging method
Creates a BucketTagging resource.
Type annotations and code completion for boto3.resource("s3").Tagging method.
boto3 documentation
Bucket.Versioning method
Creates a BucketVersioning resource.
Type annotations and code completion for boto3.resource("s3").Versioning method.
boto3 documentation
Bucket.Website method
Creates a BucketWebsite resource.
Type annotations and code completion for boto3.resource("s3").Website method.
boto3 documentation
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
def copy(
self,
CopySource: CopySourceTypeDef, # (1)
Key: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
SourceClient: BaseClient = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: BucketCopyRequestTypeDef = { # (1)
"CopySource": ...,
"Key": ...,
}
parent.copy(**kwargs)
Bucket.create method
Creates a new S3 bucket.
Type annotations and code completion for boto3.resource("s3").create method.
boto3 documentation
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)
...
- See BucketCannedACLType
- See CreateBucketConfigurationTypeDef
- See ObjectOwnershipType
- See CreateBucketOutputTypeDef
kwargs: CreateBucketRequestBucketCreateTypeDef = { # (1)
"ACL": ...,
}
parent.create(**kwargs)
Bucket.delete method
Deletes the S3 bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketRequestBucketDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
Bucket.delete_objects method
This action enables you to delete multiple objects from a bucket using a single HTTP request.
Type annotations and code completion for boto3.resource("s3").delete_objects method.
boto3 documentation
def delete_objects(
self,
*,
Delete: DeleteTypeDef, # (1)
MFA: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (3)
) -> DeleteObjectsOutputTypeDef: # (4)
...
- See DeleteTypeDef
- See RequestPayerType
- See ChecksumAlgorithmType
- See DeleteObjectsOutputTypeDef
kwargs: DeleteObjectsRequestBucketDeleteObjectsTypeDef = { # (1)
"Delete": ...,
}
parent.delete_objects(**kwargs)
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
def download_file(
self,
Key: str,
Filename: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: BucketDownloadFileRequestTypeDef = { # (1)
"Key": ...,
"Filename": ...,
}
parent.download_file(**kwargs)
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
def download_fileobj(
self,
Key: str,
Fileobj: Union[IO[Any], StreamingBody],
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: BucketDownloadFileobjRequestTypeDef = { # (1)
"Key": ...,
"Fileobj": ...,
}
parent.download_fileobj(**kwargs)
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
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
Bucket.put_object method
Adds an object to a bucket.
Type annotations and code completion for boto3.resource("s3").put_object method.
boto3 documentation
def put_object(
self,
*,
Key: str,
ACL: ObjectCannedACLType = ..., # (1)
Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentLength: int = ...,
ContentMD5: str = ...,
ContentType: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (3)
StorageClass: StorageClassType = ..., # (4)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (5)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (6)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (7)
ExpectedBucketOwner: str = ...,
) -> Object:
...
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
kwargs: PutObjectRequestBucketPutObjectTypeDef = { # (1)
"Key": ...,
}
parent.put_object(**kwargs)
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
def upload_file(
self,
Filename: str,
Key: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: BucketUploadFileRequestTypeDef = { # (1)
"Filename": ...,
"Key": ...,
}
parent.upload_file(**kwargs)
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
def upload_fileobj(
self,
Fileobj: Union[IO[Any], StreamingBody],
Key: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: BucketUploadFileobjRequestTypeDef = { # (1)
"Fileobj": ...,
"Key": ...,
}
parent.upload_fileobj(**kwargs)
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
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
BucketAcl
Type annotations and code completion for boto3.resource("s3").BucketAcl class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketAcl
def get_resource() -> BucketAcl:
return boto3.resource("s3").BucketAcl(...)
BucketAcl attributes
owner: OwnerResponseMetadataTypeDefgrants:List[GrantTypeDef]bucket_name:str
BucketAcl methods
BucketAcl.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
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
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
BucketAcl.put method
Sets the permissions on an existing bucket using access control lists (ACL).
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
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:
...
kwargs: PutBucketAclRequestBucketAclPutTypeDef = { # (1)
"ACL": ...,
}
parent.put(**kwargs)
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
BucketCors
Type annotations and code completion for boto3.resource("s3").BucketCors class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketCors
def get_resource() -> BucketCors:
return boto3.resource("s3").BucketCors(...)
BucketCors attributes
cors_rules:List[CORSRuleTypeDef]bucket_name:str
BucketCors methods
BucketCors.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketCors.delete method
Deletes the cors configuration information set for the bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketCorsRequestBucketCorsDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
BucketCors.put method
Sets the cors configuration for your bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
CORSConfiguration: CORSConfigurationTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketCorsRequestBucketCorsPutTypeDef = { # (1)
"CORSConfiguration": ...,
}
parent.put(**kwargs)
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
BucketLifecycle
Type annotations and code completion for boto3.resource("s3").BucketLifecycle class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketLifecycle
def get_resource() -> BucketLifecycle:
return boto3.resource("s3").BucketLifecycle(...)
BucketLifecycle attributes
rules:List[RuleTypeDef]bucket_name:str
BucketLifecycle methods
BucketLifecycle.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketLifecycle.delete method
Deletes the lifecycle configuration from the specified bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketLifecycleRequestBucketLifecycleDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
BucketLifecycle.put method
.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
LifecycleConfiguration: LifecycleConfigurationTypeDef = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketLifecycleRequestBucketLifecyclePutTypeDef = { # (1)
"ChecksumAlgorithm": ...,
}
parent.put(**kwargs)
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
BucketLifecycleConfiguration
Type annotations and code completion for boto3.resource("s3").BucketLifecycleConfiguration class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketLifecycleConfiguration
def get_resource() -> BucketLifecycleConfiguration:
return boto3.resource("s3").BucketLifecycleConfiguration(...)
BucketLifecycleConfiguration attributes
rules:List[LifecycleRuleTypeDef]bucket_name:str
BucketLifecycleConfiguration methods
BucketLifecycleConfiguration.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketLifecycleConfiguration.delete method
Deletes the lifecycle configuration from the specified bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketLifecycleRequestBucketLifecycleConfigurationDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
BucketLifecycleConfiguration.put method
Creates a new lifecycle configuration for the bucket or replaces an existing lifecycle configuration.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
LifecycleConfiguration: BucketLifecycleConfigurationTypeDef = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketLifecycleConfigurationRequestBucketLifecycleConfigurationPutTypeDef = { # (1)
"ChecksumAlgorithm": ...,
}
parent.put(**kwargs)
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
BucketLogging
Type annotations and code completion for boto3.resource("s3").BucketLogging class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketLogging
def get_resource() -> BucketLogging:
return boto3.resource("s3").BucketLogging(...)
BucketLogging attributes
logging_enabled: LoggingEnabledResponseMetadataTypeDefbucket_name:str
BucketLogging methods
BucketLogging.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
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
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
BucketLogging.put method
Set the logging parameters for a bucket and to specify permissions for who can view and modify the logging parameters.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
BucketLoggingStatus: BucketLoggingStatusTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketLoggingRequestBucketLoggingPutTypeDef = { # (1)
"BucketLoggingStatus": ...,
}
parent.put(**kwargs)
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
BucketNotification
Type annotations and code completion for boto3.resource("s3").BucketNotification class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketNotification
def get_resource() -> BucketNotification:
return boto3.resource("s3").BucketNotification(...)
BucketNotification attributes
topic_configurations:List[TopicConfigurationTypeDef]queue_configurations:List[QueueConfigurationTypeDef]lambda_function_configurations:List[LambdaFunctionConfigurationTypeDef]event_bridge_configuration:Dict[str,Any]bucket_name:str
BucketNotification methods
BucketNotification.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
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
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
BucketNotification.put method
Enables notifications of specified events for a bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
NotificationConfiguration: NotificationConfigurationTypeDef, # (1)
ExpectedBucketOwner: str = ...,
SkipDestinationValidation: bool = ...,
) -> None:
...
kwargs: PutBucketNotificationConfigurationRequestBucketNotificationPutTypeDef = { # (1)
"NotificationConfiguration": ...,
}
parent.put(**kwargs)
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
BucketPolicy
Type annotations and code completion for boto3.resource("s3").BucketPolicy class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketPolicy
def get_resource() -> BucketPolicy:
return boto3.resource("s3").BucketPolicy(...)
BucketPolicy attributes
policy:strbucket_name:str
BucketPolicy methods
BucketPolicy.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketPolicy.delete method
This implementation of the DELETE action uses the policy subresource to delete the policy of a specified bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketPolicyRequestBucketPolicyDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
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
def put(
self,
*,
Policy: str,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
ConfirmRemoveSelfBucketAccess: bool = ...,
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketPolicyRequestBucketPolicyPutTypeDef = { # (1)
"Policy": ...,
}
parent.put(**kwargs)
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
BucketRequestPayment
Type annotations and code completion for boto3.resource("s3").BucketRequestPayment class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketRequestPayment
def get_resource() -> BucketRequestPayment:
return boto3.resource("s3").BucketRequestPayment(...)
BucketRequestPayment attributes
payer: PayerTypebucket_name:str
BucketRequestPayment methods
BucketRequestPayment.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
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
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
BucketRequestPayment.put method
Sets the request payment configuration for a bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
RequestPaymentConfiguration: RequestPaymentConfigurationTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketRequestPaymentRequestBucketRequestPaymentPutTypeDef = { # (1)
"RequestPaymentConfiguration": ...,
}
parent.put(**kwargs)
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
BucketTagging
Type annotations and code completion for boto3.resource("s3").BucketTagging class.
boto3 documentation
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
BucketTagging methods
BucketTagging.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketTagging.delete method
Deletes the tags from the bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketTaggingRequestBucketTaggingDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
BucketTagging.put method
Sets the tags for a bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
Tagging: TaggingTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
- See TaggingTypeDef
- See ChecksumAlgorithmType
kwargs: PutBucketTaggingRequestBucketTaggingPutTypeDef = { # (1)
"Tagging": ...,
}
parent.put(**kwargs)
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
BucketVersioning
Type annotations and code completion for boto3.resource("s3").BucketVersioning class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketVersioning
def get_resource() -> BucketVersioning:
return boto3.resource("s3").BucketVersioning(...)
BucketVersioning attributes
status: BucketVersioningStatusTypemfa_delete: MFADeleteStatusTypebucket_name:str
BucketVersioning methods
BucketVersioning.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketVersioning.enable method
Sets the versioning state of an existing bucket.
Type annotations and code completion for boto3.resource("s3").enable method.
boto3 documentation
def enable(
self,
*,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
MFA: str = ...,
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketVersioningRequestBucketVersioningEnableTypeDef = { # (1)
"ChecksumAlgorithm": ...,
}
parent.enable(**kwargs)
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
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
BucketVersioning.put method
Sets the versioning state of an existing bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
VersioningConfiguration: VersioningConfigurationTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
MFA: str = ...,
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketVersioningRequestBucketVersioningPutTypeDef = { # (1)
"VersioningConfiguration": ...,
}
parent.put(**kwargs)
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
BucketVersioning.suspend method
Sets the versioning state of an existing bucket.
Type annotations and code completion for boto3.resource("s3").suspend method.
boto3 documentation
def suspend(
self,
*,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
MFA: str = ...,
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketVersioningRequestBucketVersioningSuspendTypeDef = { # (1)
"ChecksumAlgorithm": ...,
}
parent.suspend(**kwargs)
BucketWebsite
Type annotations and code completion for boto3.resource("s3").BucketWebsite class.
boto3 documentation
from mypy_boto3_s3.service_resource import BucketWebsite
def get_resource() -> BucketWebsite:
return boto3.resource("s3").BucketWebsite(...)
BucketWebsite attributes
redirect_all_requests_to: RedirectAllRequestsToResponseMetadataTypeDefindex_document: IndexDocumentResponseMetadataTypeDeferror_document: ErrorDocumentResponseMetadataTypeDefrouting_rules:List[RoutingRuleTypeDef]bucket_name:str
BucketWebsite methods
BucketWebsite.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
BucketWebsite.delete method
This action removes the website configuration for a bucket.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
kwargs: DeleteBucketWebsiteRequestBucketWebsiteDeleteTypeDef = { # (1)
"ExpectedBucketOwner": ...,
}
parent.delete(**kwargs)
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
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
BucketWebsite.put method
Sets the configuration of the website that is specified in the website
subresource.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
WebsiteConfiguration: WebsiteConfigurationTypeDef, # (1)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> None:
...
kwargs: PutBucketWebsiteRequestBucketWebsitePutTypeDef = { # (1)
"WebsiteConfiguration": ...,
}
parent.put(**kwargs)
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
MultipartUpload
Type annotations and code completion for boto3.resource("s3").MultipartUpload class.
boto3 documentation
from mypy_boto3_s3.service_resource import MultipartUpload
def get_resource() -> MultipartUpload:
return boto3.resource("s3").MultipartUpload(...)
MultipartUpload attributes
upload_id:strkey:strinitiated:datetimestorage_class: StorageClassTypeowner: OwnerResponseMetadataTypeDefinitiator: InitiatorResponseMetadataTypeDefchecksum_algorithm: ChecksumAlgorithmTypebucket_name:strobject_key:strid:strparts: MultipartUploadPartsCollection
MultipartUpload collections
MultipartUpload.parts
Provides access to MultipartUploadPart resource.
Type annotations and code completion for boto3.resource("s3").MultipartUpload(...).parts collection.
boto3 documentation
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
MultipartUpload.Part method
Creates a MultipartUploadPart resource.
Type annotations and code completion for boto3.resource("s3").Part method.
boto3 documentation
kwargs: MultipartUploadPartRequestTypeDef = { # (1)
"part_number": ...,
}
parent.Part(**kwargs)
MultipartUpload.abort method
This action aborts a multipart upload.
Type annotations and code completion for boto3.resource("s3").abort method.
boto3 documentation
def abort(
self,
*,
RequestPayer: RequestPayerType = ..., # (1)
ExpectedBucketOwner: str = ...,
) -> AbortMultipartUploadOutputTypeDef: # (2)
...
kwargs: AbortMultipartUploadRequestMultipartUploadAbortTypeDef = { # (1)
"RequestPayer": ...,
}
parent.abort(**kwargs)
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
def complete(
self,
*,
MultipartUpload: CompletedMultipartUploadTypeDef = ..., # (1)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
ExpectedBucketOwner: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
) -> Object:
...
kwargs: CompleteMultipartUploadRequestMultipartUploadCompleteTypeDef = { # (1)
"MultipartUpload": ...,
}
parent.complete(**kwargs)
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
MultipartUploadPart
Type annotations and code completion for boto3.resource("s3").MultipartUploadPart class.
boto3 documentation
from mypy_boto3_s3.service_resource import MultipartUploadPart
def get_resource() -> MultipartUploadPart:
return boto3.resource("s3").MultipartUploadPart(...)
MultipartUploadPart attributes
last_modified:datetimee_tag:strsize:intchecksum_crc32:strchecksum_crc32_c:strchecksum_sha1:strchecksum_sha256:strbucket_name:strobject_key:strmultipart_upload_id:strpart_number:str
MultipartUploadPart methods
MultipartUploadPart.MultipartUpload method
Creates a MultipartUpload resource.
Type annotations and code completion for boto3.resource("s3").MultipartUpload method.
boto3 documentation
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
def copy_from(
self,
*,
CopySource: Union[str, CopySourceTypeDef], # (1)
CopySourceIfMatch: str = ...,
CopySourceIfModifiedSince: Union[datetime, str] = ...,
CopySourceIfNoneMatch: str = ...,
CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
CopySourceRange: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
CopySourceSSECustomerAlgorithm: str = ...,
CopySourceSSECustomerKey: str = ...,
CopySourceSSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
ExpectedBucketOwner: str = ...,
ExpectedSourceBucketOwner: str = ...,
) -> UploadPartCopyOutputTypeDef: # (3)
...
kwargs: UploadPartCopyRequestMultipartUploadPartCopyFromTypeDef = { # (1)
"CopySource": ...,
}
parent.copy_from(**kwargs)
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
MultipartUploadPart.upload method
Uploads a part in a multipart upload.
Type annotations and code completion for boto3.resource("s3").upload method.
boto3 documentation
def upload(
self,
*,
Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
ContentLength: int = ...,
ContentMD5: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (1)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (2)
ExpectedBucketOwner: str = ...,
) -> UploadPartOutputTypeDef: # (3)
...
kwargs: UploadPartRequestMultipartUploadPartUploadTypeDef = { # (1)
"Body": ...,
}
parent.upload(**kwargs)
Object
Type annotations and code completion for boto3.resource("s3").Object class.
boto3 documentation
from mypy_boto3_s3.service_resource import Object
def get_resource() -> Object:
return boto3.resource("s3").Object(...)
Object attributes
delete_marker:boolaccept_ranges:strexpiration:strrestore:strarchive_status: ArchiveStatusTypelast_modified:datetimecontent_length:intchecksum_crc32:strchecksum_crc32_c:strchecksum_sha1:strchecksum_sha256:stre_tag:strmissing_meta:intversion_id:strcache_control:strcontent_disposition:strcontent_encoding:strcontent_language:strcontent_type:strexpires:datetimewebsite_redirect_location:strserver_side_encryption: ServerSideEncryptionTypemetadata:Dict[str,str]sse_customer_algorithm:strsse_customer_key_md5:strssekms_key_id:strbucket_key_enabled:boolstorage_class: StorageClassTyperequest_charged:Literal['requester'](see RequestChargedType)replication_status: ReplicationStatusTypeparts_count:intobject_lock_mode: ObjectLockModeTypeobject_lock_retain_until_date:datetimeobject_lock_legal_hold_status: ObjectLockLegalHoldStatusTypebucket_name:strkey:str
Object methods
Object.Acl method
Creates a ObjectAcl resource.
Type annotations and code completion for boto3.resource("s3").Acl method.
boto3 documentation
Object.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
Object.MultipartUpload method
Creates a MultipartUpload resource.
Type annotations and code completion for boto3.resource("s3").MultipartUpload method.
boto3 documentation
kwargs: ObjectMultipartUploadRequestTypeDef = { # (1)
"id": ...,
}
parent.MultipartUpload(**kwargs)
Object.Version method
Creates a ObjectVersion resource.
Type annotations and code completion for boto3.resource("s3").Version method.
boto3 documentation
kwargs: ObjectVersionRequestTypeDef = { # (1)
"id": ...,
}
parent.Version(**kwargs)
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
def copy(
self,
CopySource: CopySourceTypeDef, # (1)
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
SourceClient: BaseClient = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: ObjectCopyRequestTypeDef = { # (1)
"CopySource": ...,
}
parent.copy(**kwargs)
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
def copy_from(
self,
*,
CopySource: str,
ACL: ObjectCannedACLType = ..., # (1)
CacheControl: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
CopySourceIfMatch: str = ...,
CopySourceIfModifiedSince: Union[datetime, str] = ...,
CopySourceIfNoneMatch: str = ...,
CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
MetadataDirective: MetadataDirectiveType = ..., # (3)
TaggingDirective: TaggingDirectiveType = ..., # (4)
ServerSideEncryption: ServerSideEncryptionType = ..., # (5)
StorageClass: StorageClassType = ..., # (6)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
CopySourceSSECustomerAlgorithm: str = ...,
CopySourceSSECustomerKey: str = ...,
CopySourceSSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (7)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (8)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (9)
ExpectedBucketOwner: str = ...,
ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef: # (10)
...
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See MetadataDirectiveType
- See TaggingDirectiveType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See CopyObjectOutputTypeDef
kwargs: CopyObjectRequestObjectCopyFromTypeDef = { # (1)
"CopySource": ...,
}
parent.copy_from(**kwargs)
Object.delete method
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
def delete(
self,
*,
MFA: str = ...,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef: # (2)
...
kwargs: DeleteObjectRequestObjectDeleteTypeDef = { # (1)
"MFA": ...,
}
parent.delete(**kwargs)
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
def download_file(
self,
Filename: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: ObjectDownloadFileRequestTypeDef = { # (1)
"Filename": ...,
}
parent.download_file(**kwargs)
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
def download_fileobj(
self,
Fileobj: Union[IO[Any], StreamingBody],
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: ObjectDownloadFileobjRequestTypeDef = { # (1)
"Fileobj": ...,
}
parent.download_fileobj(**kwargs)
Object.get method
Retrieves objects from Amazon S3.
Type annotations and code completion for boto3.resource("s3").get method.
boto3 documentation
def get(
self,
*,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
ResponseCacheControl: str = ...,
ResponseContentDisposition: str = ...,
ResponseContentEncoding: str = ...,
ResponseContentLanguage: str = ...,
ResponseContentType: str = ...,
ResponseExpires: Union[datetime, str] = ...,
VersionId: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> GetObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See GetObjectOutputTypeDef
kwargs: GetObjectRequestObjectGetTypeDef = { # (1)
"IfMatch": ...,
}
parent.get(**kwargs)
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
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
def initiate_multipart_upload(
self,
*,
ACL: ObjectCannedACLType = ..., # (1)
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (2)
StorageClass: StorageClassType = ..., # (3)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (4)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (5)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (6)
ExpectedBucketOwner: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (7)
) -> MultipartUpload:
...
- See ObjectCannedACLType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See ChecksumAlgorithmType
kwargs: CreateMultipartUploadRequestObjectInitiateMultipartUploadTypeDef = { # (1)
"ACL": ...,
}
parent.initiate_multipart_upload(**kwargs)
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
Object.put method
Adds an object to a bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
ACL: ObjectCannedACLType = ..., # (1)
Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentLength: int = ...,
ContentMD5: str = ...,
ContentType: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (3)
StorageClass: StorageClassType = ..., # (4)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (5)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (6)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (7)
ExpectedBucketOwner: str = ...,
) -> PutObjectOutputTypeDef: # (8)
...
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See PutObjectOutputTypeDef
kwargs: PutObjectRequestObjectPutTypeDef = { # (1)
"ACL": ...,
}
parent.put(**kwargs)
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
Object.restore_object method
Restores an archived copy of an object back into Amazon S3 This action is not supported by Amazon S3 on Outposts.
Type annotations and code completion for boto3.resource("s3").restore_object method.
boto3 documentation
def restore_object(
self,
*,
VersionId: str = ...,
RestoreRequest: RestoreRequestTypeDef = ..., # (1)
RequestPayer: RequestPayerType = ..., # (2)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (3)
ExpectedBucketOwner: str = ...,
) -> RestoreObjectOutputTypeDef: # (4)
...
- See RestoreRequestTypeDef
- See RequestPayerType
- See ChecksumAlgorithmType
- See RestoreObjectOutputTypeDef
kwargs: RestoreObjectRequestObjectRestoreObjectTypeDef = { # (1)
"VersionId": ...,
}
parent.restore_object(**kwargs)
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
def upload_file(
self,
Filename: str,
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: ObjectUploadFileRequestTypeDef = { # (1)
"Filename": ...,
}
parent.upload_file(**kwargs)
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
def upload_fileobj(
self,
Fileobj: Union[IO[Any], StreamingBody],
ExtraArgs: Dict[str, Any] = ...,
Callback: Callable[..., Any] = ...,
Config: TransferConfig = ...,
) -> None:
...
kwargs: ObjectUploadFileobjRequestTypeDef = { # (1)
"Fileobj": ...,
}
parent.upload_fileobj(**kwargs)
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
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
ObjectAcl
Type annotations and code completion for boto3.resource("s3").ObjectAcl class.
boto3 documentation
from mypy_boto3_s3.service_resource import ObjectAcl
def get_resource() -> ObjectAcl:
return boto3.resource("s3").ObjectAcl(...)
ObjectAcl attributes
owner: OwnerResponseMetadataTypeDefgrants:List[GrantTypeDef]request_charged:Literal['requester'](see RequestChargedType)bucket_name:strobject_key:str
ObjectAcl methods
ObjectAcl.Object method
Creates a Object resource.
Type annotations and code completion for boto3.resource("s3").Object method.
boto3 documentation
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
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
ObjectAcl.put method
Uses the acl subresource to set the access control list (ACL) permissions for
a new or existing object in an S3 bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
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)
...
- See ObjectCannedACLType
- See AccessControlPolicyTypeDef
- See ChecksumAlgorithmType
- See RequestPayerType
- See PutObjectAclOutputTypeDef
kwargs: PutObjectAclRequestObjectAclPutTypeDef = { # (1)
"ACL": ...,
}
parent.put(**kwargs)
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
ObjectSummary
Type annotations and code completion for boto3.resource("s3").ObjectSummary class.
boto3 documentation
from mypy_boto3_s3.service_resource import ObjectSummary
def get_resource() -> ObjectSummary:
return boto3.resource("s3").ObjectSummary(...)
ObjectSummary attributes
last_modified:datetimee_tag:strchecksum_algorithm:List[ChecksumAlgorithmType]size:intstorage_class: ObjectStorageClassTypeowner: OwnerResponseMetadataTypeDefbucket_name:strkey:str
ObjectSummary methods
ObjectSummary.Acl method
Creates a ObjectAcl resource.
Type annotations and code completion for boto3.resource("s3").Acl method.
boto3 documentation
ObjectSummary.Bucket method
Creates a Bucket resource.
Type annotations and code completion for boto3.resource("s3").Bucket method.
boto3 documentation
ObjectSummary.MultipartUpload method
Creates a MultipartUpload resource.
Type annotations and code completion for boto3.resource("s3").MultipartUpload method.
boto3 documentation
kwargs: ObjectSummaryMultipartUploadRequestTypeDef = { # (1)
"id": ...,
}
parent.MultipartUpload(**kwargs)
ObjectSummary.Object method
Creates a Object resource.
Type annotations and code completion for boto3.resource("s3").Object method.
boto3 documentation
ObjectSummary.Version method
Creates a ObjectVersion resource.
Type annotations and code completion for boto3.resource("s3").Version method.
boto3 documentation
kwargs: ObjectSummaryVersionRequestTypeDef = { # (1)
"id": ...,
}
parent.Version(**kwargs)
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
def copy_from(
self,
*,
CopySource: str,
ACL: ObjectCannedACLType = ..., # (1)
CacheControl: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
CopySourceIfMatch: str = ...,
CopySourceIfModifiedSince: Union[datetime, str] = ...,
CopySourceIfNoneMatch: str = ...,
CopySourceIfUnmodifiedSince: Union[datetime, str] = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
MetadataDirective: MetadataDirectiveType = ..., # (3)
TaggingDirective: TaggingDirectiveType = ..., # (4)
ServerSideEncryption: ServerSideEncryptionType = ..., # (5)
StorageClass: StorageClassType = ..., # (6)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
CopySourceSSECustomerAlgorithm: str = ...,
CopySourceSSECustomerKey: str = ...,
CopySourceSSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (7)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (8)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (9)
ExpectedBucketOwner: str = ...,
ExpectedSourceBucketOwner: str = ...,
) -> CopyObjectOutputTypeDef: # (10)
...
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See MetadataDirectiveType
- See TaggingDirectiveType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See CopyObjectOutputTypeDef
kwargs: CopyObjectRequestObjectSummaryCopyFromTypeDef = { # (1)
"CopySource": ...,
}
parent.copy_from(**kwargs)
ObjectSummary.delete method
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
def delete(
self,
*,
MFA: str = ...,
VersionId: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef: # (2)
...
kwargs: DeleteObjectRequestObjectSummaryDeleteTypeDef = { # (1)
"MFA": ...,
}
parent.delete(**kwargs)
ObjectSummary.get method
Retrieves objects from Amazon S3.
Type annotations and code completion for boto3.resource("s3").get method.
boto3 documentation
def get(
self,
*,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
ResponseCacheControl: str = ...,
ResponseContentDisposition: str = ...,
ResponseContentEncoding: str = ...,
ResponseContentLanguage: str = ...,
ResponseContentType: str = ...,
ResponseExpires: Union[datetime, str] = ...,
VersionId: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> GetObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See GetObjectOutputTypeDef
kwargs: GetObjectRequestObjectSummaryGetTypeDef = { # (1)
"IfMatch": ...,
}
parent.get(**kwargs)
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
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
def initiate_multipart_upload(
self,
*,
ACL: ObjectCannedACLType = ..., # (1)
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentType: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (2)
StorageClass: StorageClassType = ..., # (3)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (4)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (5)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (6)
ExpectedBucketOwner: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (7)
) -> MultipartUpload:
...
- See ObjectCannedACLType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See ChecksumAlgorithmType
kwargs: CreateMultipartUploadRequestObjectSummaryInitiateMultipartUploadTypeDef = { # (1)
"ACL": ...,
}
parent.initiate_multipart_upload(**kwargs)
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
ObjectSummary.put method
Adds an object to a bucket.
Type annotations and code completion for boto3.resource("s3").put method.
boto3 documentation
def put(
self,
*,
ACL: ObjectCannedACLType = ..., # (1)
Body: Union[str, bytes, IO[Any], StreamingBody] = ...,
CacheControl: str = ...,
ContentDisposition: str = ...,
ContentEncoding: str = ...,
ContentLanguage: str = ...,
ContentLength: int = ...,
ContentMD5: str = ...,
ContentType: str = ...,
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (2)
ChecksumCRC32: str = ...,
ChecksumCRC32C: str = ...,
ChecksumSHA1: str = ...,
ChecksumSHA256: str = ...,
Expires: Union[datetime, str] = ...,
GrantFullControl: str = ...,
GrantRead: str = ...,
GrantReadACP: str = ...,
GrantWriteACP: str = ...,
Metadata: Mapping[str, str] = ...,
ServerSideEncryption: ServerSideEncryptionType = ..., # (3)
StorageClass: StorageClassType = ..., # (4)
WebsiteRedirectLocation: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
SSEKMSKeyId: str = ...,
SSEKMSEncryptionContext: str = ...,
BucketKeyEnabled: bool = ...,
RequestPayer: RequestPayerType = ..., # (5)
Tagging: str = ...,
ObjectLockMode: ObjectLockModeType = ..., # (6)
ObjectLockRetainUntilDate: Union[datetime, str] = ...,
ObjectLockLegalHoldStatus: ObjectLockLegalHoldStatusType = ..., # (7)
ExpectedBucketOwner: str = ...,
) -> PutObjectOutputTypeDef: # (8)
...
- See ObjectCannedACLType
- See ChecksumAlgorithmType
- See ServerSideEncryptionType
- See StorageClassType
- See RequestPayerType
- See ObjectLockModeType
- See ObjectLockLegalHoldStatusType
- See PutObjectOutputTypeDef
kwargs: PutObjectRequestObjectSummaryPutTypeDef = { # (1)
"ACL": ...,
}
parent.put(**kwargs)
ObjectSummary.restore_object method
Restores an archived copy of an object back into Amazon S3 This action is not supported by Amazon S3 on Outposts.
Type annotations and code completion for boto3.resource("s3").restore_object method.
boto3 documentation
def restore_object(
self,
*,
VersionId: str = ...,
RestoreRequest: RestoreRequestTypeDef = ..., # (1)
RequestPayer: RequestPayerType = ..., # (2)
ChecksumAlgorithm: ChecksumAlgorithmType = ..., # (3)
ExpectedBucketOwner: str = ...,
) -> RestoreObjectOutputTypeDef: # (4)
...
- See RestoreRequestTypeDef
- See RequestPayerType
- See ChecksumAlgorithmType
- See RestoreObjectOutputTypeDef
kwargs: RestoreObjectRequestObjectSummaryRestoreObjectTypeDef = { # (1)
"VersionId": ...,
}
parent.restore_object(**kwargs)
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
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
ObjectVersion
Type annotations and code completion for boto3.resource("s3").ObjectVersion class.
boto3 documentation
from mypy_boto3_s3.service_resource import ObjectVersion
def get_resource() -> ObjectVersion:
return boto3.resource("s3").ObjectVersion(...)
ObjectVersion attributes
e_tag:strchecksum_algorithm:List[ChecksumAlgorithmType]size:intstorage_class:Literal['STANDARD'](see ObjectVersionStorageClassType)key:strversion_id:stris_latest:boollast_modified:datetimeowner: OwnerResponseMetadataTypeDefbucket_name:strobject_key:strid:str
ObjectVersion methods
ObjectVersion.Object method
Creates a Object resource.
Type annotations and code completion for boto3.resource("s3").Object method.
boto3 documentation
ObjectVersion.delete method
Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object.
Type annotations and code completion for boto3.resource("s3").delete method.
boto3 documentation
def delete(
self,
*,
MFA: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
BypassGovernanceRetention: bool = ...,
ExpectedBucketOwner: str = ...,
) -> DeleteObjectOutputTypeDef: # (2)
...
kwargs: DeleteObjectRequestObjectVersionDeleteTypeDef = { # (1)
"MFA": ...,
}
parent.delete(**kwargs)
ObjectVersion.get method
Retrieves objects from Amazon S3.
Type annotations and code completion for boto3.resource("s3").get method.
boto3 documentation
def get(
self,
*,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
ResponseCacheControl: str = ...,
ResponseContentDisposition: str = ...,
ResponseContentEncoding: str = ...,
ResponseContentLanguage: str = ...,
ResponseContentType: str = ...,
ResponseExpires: Union[datetime, str] = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> GetObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See GetObjectOutputTypeDef
kwargs: GetObjectRequestObjectVersionGetTypeDef = { # (1)
"IfMatch": ...,
}
parent.get(**kwargs)
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
ObjectVersion.head method
The HEAD action retrieves metadata from an object without returning the object itself.
Type annotations and code completion for boto3.resource("s3").head method.
boto3 documentation
def head(
self,
*,
IfMatch: str = ...,
IfModifiedSince: Union[datetime, str] = ...,
IfNoneMatch: str = ...,
IfUnmodifiedSince: Union[datetime, str] = ...,
Range: str = ...,
SSECustomerAlgorithm: str = ...,
SSECustomerKey: str = ...,
SSECustomerKeyMD5: str = ...,
RequestPayer: RequestPayerType = ..., # (1)
PartNumber: int = ...,
ExpectedBucketOwner: str = ...,
ChecksumMode: ChecksumModeType = ..., # (2)
) -> HeadObjectOutputTypeDef: # (3)
...
- See RequestPayerType
- See ChecksumModeType
- See HeadObjectOutputTypeDef