Attempt.fromJson constructor

Attempt.fromJson(
  1. Map<String, Object?> json
)

Implementation

factory Attempt.fromJson(Map<String, Object?> json) => Attempt(
      attemptedAt: decodeDateTime(json["attempted_at"]),
      contentType: json["content_type"] == null
          ? null
          : json["content_type"] as String,
      declaredSize: json["declared_size"] == null
          ? null
          : (json["declared_size"] as num).toInt(),
      error: json["error"] == null
          ? null
          : LatestError.fromJson(
              (json["error"] as Map).cast<String, Object?>(),
            ),
      failedAt: json["failed_at"] == null
          ? null
          : decodeDateTime(json["failed_at"]),
      fileId: json["file_id"] == null ? null : json["file_id"] as String,
      filename: json["filename"] == null ? null : json["filename"] as String,
      id: json["id"] as String,
      ordinal: (json["ordinal"] as num).toInt(),
      review: json["review"] == null
          ? null
          : Review.fromJson(
              (json["review"] as Map).cast<String, Object?>(),
            ),
      status: json["status"] as String,
      succeededAt: json["succeeded_at"] == null
          ? null
          : decodeDateTime(json["succeeded_at"]),
      uploadRequestId: json["upload_request_id"] as String,
    );