String jobId = req.execute().getJobId();
// Get the resulting job
addJobToHistory(jobId, "Import read group sets to " + dataset.getName() + " from "
+ Joiner.on(',').join(bamFiles));
Job job = getJob(genomics, jobId, pollForStatus);
System.out.println("Import job: ");
printJob(job);
// If the job is finished, get the imported ids
if (job.getImportedIds() != null) {
for (String id : job.getImportedIds()) {
ReadGroupSet readGroupSet = genomics.readgroupsets().get(id)
.setFields("id,name,filename").execute();
System.out.println("Imported read group set: " + readGroupSet.toPrettyString());
}
}