toJson method
Implementation
Map<String, dynamic> toJson() {
final Map<String, String> hardwareSpecificationsAsString =
<String, String>{};
for (final HardwareSpecification spec in hardwareSpecifications.keys) {
hardwareSpecificationsAsString[spec.id.toString()] =
hardwareSpecifications[spec] ?? '';
}
final Map<String, dynamic> json = <String, dynamic>{};
json['logsDir'] = logsDir;
json['dataSource'] = dataSource.pointerId;
json['hardwareSpecifications'] = jsonEncode(hardwareSpecificationsAsString);
json['recordedTypes'] =
recordedTypes.map((final DataType type) => type.id).toList();
json['minDurationSeconds'] = minDurationSeconds;
json['videoQuality'] = videoQuality.id;
json['chunkDurationSeconds'] = chunkDurationSeconds;
json['bContinuousRecording'] = continuousRecording;
json['bEnableAudio'] = enableAudio;
json['maxDiskSpaceUsed'] = maxDiskSpaceUsed;
json['keepMinSeconds'] = keepMinSeconds;
json['deleteOlderThanKeepMin'] = deleteOlderThanKeepMin;
json['transportMode'] = transportMode.id;
return json;
}