Map<String, Object?> toJson() => { if (bytesWritten != null) 'bytesWritten': bytesWritten, if (offset != null) 'offset': offset, };