use of org.pmiops.workbench.model.Workspace in project workbench by all-of-us.
the class WorkspacesController method constructListWorkspaceFromFCAndDb.
// This does not populate the list of underserved research groups.
private static final Workspace constructListWorkspaceFromFCAndDb(org.pmiops.workbench.db.model.Workspace workspace, org.pmiops.workbench.firecloud.model.Workspace fcWorkspace, ResearchPurpose researchPurpose) {
Workspace result = new Workspace().etag(Etags.fromVersion(workspace.getVersion())).lastModifiedTime(workspace.getLastModifiedTime().getTime()).creationTime(workspace.getCreationTime().getTime()).dataAccessLevel(workspace.getDataAccessLevel()).name(workspace.getName()).id(fcWorkspace.getName()).namespace(fcWorkspace.getNamespace()).description(workspace.getDescription()).researchPurpose(researchPurpose);
if (fcWorkspace.getCreatedBy() != null) {
result.setCreator(fcWorkspace.getCreatedBy());
}
if (workspace.getCdrVersion() != null) {
result.setCdrVersionId(String.valueOf(workspace.getCdrVersion().getCdrVersionId()));
}
result.setUserRoles(workspace.getWorkspaceUserRoles().stream().map(TO_CLIENT_USER_ROLE).collect(Collectors.toList()));
return result;
}
Aggregations