fromJson static method
Returns a new Task instance and imports
Implementation
// ignore: prefer_constructors_over_static_methods
static Task fromJson(dynamic value) {
final json = value.cast<String, dynamic>();
return Task(
id: mapValueOfType<String>(json, r'id'),
type: mapValueOfType<String>(json, r'type'),
orgID: mapValueOfType<String>(json, r'orgID'),
org: mapValueOfType<String>(json, r'org'),
name: mapValueOfType<String>(json, r'name'),
ownerID: mapValueOfType<String>(json, r'ownerID'),
description: mapValueOfType<String>(json, r'description'),
status: json[r'status'] == null
? null
: TaskStatusType.fromJson(json[r'status']),
labels: Label.listFromJson(json[r'labels']),
authorizationID: mapValueOfType<String>(json, r'authorizationID'),
flux: mapValueOfType<String>(json, r'flux'),
every: mapValueOfType<String>(json, r'every'),
cron: mapValueOfType<String>(json, r'cron'),
offset: mapValueOfType<String>(json, r'offset'),
latestCompleted: mapDateTime(json, r'latestCompleted', ''),
lastRunStatus: TaskLastRunStatusEnum.fromJson(json[r'lastRunStatus']),
lastRunError: mapValueOfType<String>(json, r'lastRunError'),
createdAt: mapDateTime(json, r'createdAt', ''),
updatedAt: mapDateTime(json, r'updatedAt', ''),
links: json[r'links'] == null ? null : TaskLinks.fromJson(json[r'links']),
);
}