Search in sources :

Example 31 with Workspace

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;
}
Also used : Workspace(org.pmiops.workbench.model.Workspace)

Aggregations

Workspace (org.pmiops.workbench.model.Workspace)31 Test (org.junit.Test)23 DataJpaTest (org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest)23 ResearchPurpose (org.pmiops.workbench.model.ResearchPurpose)13 User (org.pmiops.workbench.db.model.User)9 CloneWorkspaceRequest (org.pmiops.workbench.model.CloneWorkspaceRequest)8 UserRole (org.pmiops.workbench.model.UserRole)7 ConflictException (org.pmiops.workbench.exceptions.ConflictException)6 ShareWorkspaceRequest (org.pmiops.workbench.model.ShareWorkspaceRequest)6 BadRequestException (org.pmiops.workbench.exceptions.BadRequestException)5 WorkspaceACLUpdate (org.pmiops.workbench.firecloud.model.WorkspaceACLUpdate)5 WorkspaceACLUpdateResponseList (org.pmiops.workbench.firecloud.model.WorkspaceACLUpdateResponseList)5 UpdateWorkspaceRequest (org.pmiops.workbench.model.UpdateWorkspaceRequest)5 Blob (com.google.cloud.storage.Blob)4 Matchers.anyString (org.mockito.Matchers.anyString)4 ApiException (org.pmiops.workbench.firecloud.ApiException)4 ResearchPurposeReviewRequest (org.pmiops.workbench.model.ResearchPurposeReviewRequest)4 Timestamp (java.sql.Timestamp)3 FirecloudWorkspaceId (org.pmiops.workbench.db.model.Workspace.FirecloudWorkspaceId)3 ShareWorkspaceResponse (org.pmiops.workbench.model.ShareWorkspaceResponse)3