use of bio.terra.workspace.model.ClonedWorkspace in project terra-cli by DataBiosphere.
the class Clone method execute.
@Override
protected void execute() {
workspaceOption.overrideIfSpecified();
Workspace sourceWorkspace = Context.requireWorkspace();
ClonedWorkspace clonedWorkspace = sourceWorkspace.clone(workspaceNameAndDescription.displayName, workspaceNameAndDescription.description);
Workspace destinationWorkspaceHydrated = Workspace.get(clonedWorkspace.getDestinationWorkspaceId());
// Get a list of UFClonedResource objects based on the resources returned in the ClonedWorkspace
java.util.List<UFClonedResource> ufClonedResources = clonedWorkspace.getResources().stream().map(r -> buildUfClonedResource(sourceWorkspace, destinationWorkspaceHydrated, r)).collect(Collectors.toList());
// print results
formatOption.printReturnValue(new UFClonedWorkspace(new UFWorkspace(sourceWorkspace), new UFWorkspace(destinationWorkspaceHydrated), ufClonedResources), this::printText);
}
Aggregations