toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final json = <String, dynamic>{};
  if (id != null) {
    json[r'id'] = id;
  }
  if (taskID != null) {
    json[r'taskID'] = taskID;
  }
  if (status != null) {
    json[r'status'] = status;
  }
  if (scheduledFor != null) {
    json[r'scheduledFor'] = scheduledFor!.toUtc().toIso8601String();
  }
  if (log != null) {
    json[r'log'] = log;
  }
  if (startedAt != null) {
    json[r'startedAt'] = startedAt!.toUtc().toIso8601String();
  }
  if (finishedAt != null) {
    json[r'finishedAt'] = finishedAt!.toUtc().toIso8601String();
  }
  if (requestedAt != null) {
    json[r'requestedAt'] = requestedAt!.toUtc().toIso8601String();
  }
  if (links != null) {
    json[r'links'] = links;
  }
  return json;
}