CronJobStatus.fromJson constructor
Creates a CronJobStatus from JSON data.
Implementation
factory CronJobStatus.fromJson(Map<String, dynamic> json) {
final tempActiveJson = json['active'];
final tempLastScheduleTimeJson = json['lastScheduleTime'];
final tempLastSuccessfulTimeJson = json['lastSuccessfulTime'];
final List<ObjectReference>? tempActive = tempActiveJson != null
? List<dynamic>.from(tempActiveJson)
.map(
(e) => ObjectReference.fromJson(
Map<String, dynamic>.from(e),
),
)
.toList()
: null;
final DateTime? tempLastScheduleTime = tempLastScheduleTimeJson != null
? DateTime.tryParse(tempLastScheduleTimeJson)
: null;
final DateTime? tempLastSuccessfulTime = tempLastSuccessfulTimeJson != null
? DateTime.tryParse(tempLastSuccessfulTimeJson)
: null;
return CronJobStatus(
active: tempActive,
lastScheduleTime: tempLastScheduleTime,
lastSuccessfulTime: tempLastSuccessfulTime,
);
}