Waiters, Pagination, Presigning
Waiters¶
Waiters poll an operation until a resource reaches a desired state. If the operation supports waiters it will have a wait_until_ prefixed method.
from capo_s3 import AsyncS3Client
async with AsyncS3Client() as s3:
# Example: wait for bucket_exists
await s3.wait_until_bucket_exists(max_wait_time=300)
Pagination¶
Some operations in this SDK support pagination. If the operation supports pagination it will have an iter_ prefixed method that returns an async iterator.
from capo_s3 import AsyncS3Client
async with AsyncS3Client() as s3:
# Example: paginate over list_buckets
async for item in s3.iter_list_buckets():
print(item)
Presigning¶
Some operations support presigning, which generates a URL that can be used without credentials. Use the presigned_ prefixed method on the client to get a presigned URL.
from capo_s3 import AsyncS3Client
async def main():
async with AsyncS3Client() as s3:
# Example: get a presigned URL for delete_object
url = s3.presigned_delete_object()
print(url)
Note Smithy models don't indicate which operations support presigning, so presigned methods are added by maintainers rather than the code generator. If you notice an operation that should support presigning but has no
presigned_method, please open an issue.