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: object

Implements ContentSource around an async build() -> bytes callback, run once on the first read/stream/export_range/ planned_bytes and cached; whatever build raises surfaces there. Construction does no I/O.

property size: int | None

None until the artifact has been assembled by a read, stream, export or planned_bytes call.

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) into writer. The artifact is assembled first, so size is known afterwards.

Raises:

ValueError – The range is not inside the artifact.

async planned_bytes(start, end)