toJson method

Map<String, Object?> toJson()

The job view as a JSON map.

Implementation

Map<String, Object?> toJson() => {
  'id': id,
  'status': status,
  'progress': ?(completed == null || total == null
      ? null
      : {'completed': completed, 'total': total}),
  'error': ?error,
  'video': ?video?.toJson(),
  'poster': ?poster?.toJson(),
  'code': ?code,
  'spec': ?spec,
  'createdAt': ?createdAt?.toUtc().toIso8601String(),
  'expiresAt': ?expiresAt?.toUtc().toIso8601String(),
};