roboto.storage.upload_transaction
Module Contents
TransactionFile
Bases: TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
UploadTransaction
Parameters
items collections.association roboto.device_id Optional[str]origination Optional[str]batch_size Optional[int]roboto_client Optional[roboto.caller_org_id Optional[str]UploadTransaction.await_uploads()
Wait for all registered uploads to complete, then report progress to API.
Must be called while still inside the object_store context manager, since the transfer manager may be shut down when that context exits.
Raises
ExceptionGroupIf any uploads fail, an ExceptionGroup containing all upload errors is raised after reporting successfully completed uploads.
If the server’s progress response reports (uri, file_id) pairs that do not correspond one-to-one with the uploads reported to it.
Return type
Properties
UploadTransaction.completed_uploads
Mapping from each uploaded local path to the ID of the file record it created.
Populated from the {uri, file_id} pairs in progress-report responses, and complete for every upload already reported to PUT v1/files/upload/<id>/progress, which await_uploads() does at each batch boundary. A pair set that does not correspond one-to-one with the reported uploads raises instead of degrading the mapping.
UploadTransaction.make_credential_provider()
UploadTransaction.register_upload()
Register a pending upload future.
Call this immediately after initiating each S3 transfer. The future will be awaited when await_uploads() is called.
Parameters
file UploadableFilefuture roboto.Return type
UploadableFile
Bases: TypedDict
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object’s (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)