use of org.dataportabilityproject.serviceProviders.rememberTheMilk.model.GetListResponse in project data-transfer-project by google.
the class RememberTheMilkTaskService method exportTaskList.
private TaskModelWrapper exportTaskList(Resource resource, Optional<PaginationInformation> paginationInformation) throws IOException {
int oldListId = Integer.parseInt(((IdOnlyResource) resource).getId());
GetListResponse oldList = getList(oldListId);
List<TaskList> taskLists = oldList.tasks.list;
List<TaskModel> tasks = new ArrayList<>();
for (TaskList taskList : taskLists) {
if (taskList.taskSeriesList != null) {
for (TaskSeries taskSeries : taskList.taskSeriesList) {
tasks.add(new TaskModel(Integer.toString(oldListId), taskSeries.name, taskSeries.notes.toString()));
for (Task task : taskSeries.tasks) {
// Do something here with completion date, but its odd there can be more than one.
}
}
}
}
return new TaskModelWrapper(null, tasks, null);
}
Aggregations