use of org.datatransferproject.transfer.rememberthemilk.model.tasks.ListInfo in project data-transfer-project by google.
the class RememberTheMilkTasksExporter method exportTaskList.
private ExportResult exportTaskList(RememberTheMilkService service) {
List<TaskListModel> lists = new ArrayList<>();
List<IdOnlyContainerResource> subResources = new ArrayList<>();
List<ListInfo> listInfoList;
try {
listInfoList = service.getLists().lists;
} catch (IOException e) {
return new ExportResult(e);
}
for (ListInfo oldListInfo : listInfoList) {
if (oldListInfo.name.equals("All Tasks")) {
// All Tasks is a special list that contains everything, don't copy that over
continue;
}
lists.add(new TaskListModel(Integer.toString(oldListInfo.id), oldListInfo.name));
subResources.add(new IdOnlyContainerResource(Integer.toString(oldListInfo.id)));
}
TaskContainerResource taskContainerResource = new TaskContainerResource(lists, null);
ContinuationData continuationData = new ContinuationData(null);
subResources.forEach(continuationData::addContainerResource);
// TODO: what do we do with pagination data?
return new ExportResult(ResultType.CONTINUE, taskContainerResource, continuationData);
}
Aggregations