synology_apm_repo.sdk.units.content.saas_artifact module¶
LazyArtifact: the shared ContentSource for application-layer
artifacts assembled in memory (Mail’s .eml, Calendar’s .ics,
Contact’s CSV, a Site List’s values, a Teams transcript’s HTML); each
provider supplies only a build callback. The whole artifact is held in
memory, which for a Teams transcript is the entire rendered history.
- class synology_apm_repo.sdk.units.content.saas_artifact.LazyArtifact(build)¶
Bases:
objectImplements
ContentSourcearound anasync build() -> bytescallback, run once on the firstread/stream/export_range/planned_bytesand cached; whateverbuildraises surfaces there. Construction does no I/O.- property size: int | None¶
Noneuntil the artifact has been assembled by a read, stream, export orplanned_bytescall.
- async read(offset=0, length=None)¶
- async stream(block=8388608)¶
- async export_range(writer, start, end, *, sparse=True, progress=None, tuning=None)¶
Writes the assembled artifact’s
[start, end)intowriter. The artifact is assembled first, sosizeis known afterwards.- Raises:
ValueError – The range is not inside the artifact.
- async planned_bytes(start, end)¶