deliveryBatchZip static method
ChartExportFile
deliveryBatchZip(
- ChartExportDeliveryBatchResult batch, {
- String filename = defaultDeliveryFilename,
- bool includeManifest = true,
- String manifestFilename = defaultManifestFilename,
- DateTime? createdAt,
Bundle successfully delivered files into a ZIP file.
Failed delivery results are not written as payload files, but they remain visible in the optional manifest so callers can inspect partial failures.
Implementation
static ChartExportFile deliveryBatchZip(
ChartExportDeliveryBatchResult batch, {
String filename = defaultDeliveryFilename,
bool includeManifest = true,
String manifestFilename = defaultManifestFilename,
DateTime? createdAt,
}) {
final files = <ChartExportFile>[...batch.files];
if (includeManifest) {
files.add(
ChartExportManifest.deliveryBatchFile(
batch,
filename: manifestFilename,
createdAt: createdAt,
),
);
}
return filesZip(
files,
filename: filename,
metadata: {
'source': 'deliveryBatch',
'sourceSuccess': batch.success,
'sourceCount': batch.results.length,
'sourceSuccessCount': batch.successCount,
'sourceFailureCount': batch.failureCount,
'includedManifest': includeManifest,
},
);
}