RemoteUploadJob.fromJson constructor

RemoteUploadJob.fromJson(
  1. Map<String, dynamic> json
)

Converts a JSON map into a RemoteUploadJob object.

Implementation

factory RemoteUploadJob.fromJson(Map<String, dynamic> json) {
  return RemoteUploadJob(
    jobId: json['job_id'],
    type: json['type'],
    typeLabel: json['type_label'],
    folderId: json['folder_id'],
    url: json['url'],
    name: json['name'],
    size: json['size'],
    state: json['state'],
    stateLabel: json['state_label'],
    file: json['file'] != null ? FileInfo.fromJson(json['file']) : null,
    dlSize: json['dl_size'],
    speed: json['speed'],
    created: DateTime.fromMillisecondsSinceEpoch(json['created'] * 1000),
    updated: json['updated'] != null
        ? DateTime.fromMillisecondsSinceEpoch(json['updated'] * 1000)
        : null,
    error: json['error'],
  );
}