Search in sources :

Example 1 with ApiWorkspaceApplicationDescriptionList

use of bio.terra.workspace.generated.model.ApiWorkspaceApplicationDescriptionList in project terra-workspace-manager by DataBiosphere.

the class WorkspaceApplicationApiController method listWorkspaceApplications.

@Override
public ResponseEntity<ApiWorkspaceApplicationDescriptionList> listWorkspaceApplications(@PathVariable("workspaceId") UUID workspaceId, @Valid @RequestParam(value = "offset", required = false, defaultValue = "0") Integer offset, @Valid @RequestParam(value = "limit", required = false, defaultValue = "10") Integer limit) {
    AuthenticatedUserRequest userRequest = getAuthenticatedInfo();
    ControllerValidationUtils.validatePaginationParams(offset, limit);
    List<WsmWorkspaceApplication> wsmApps = appService.listWorkspaceApplications(userRequest, workspaceId, offset, limit);
    var response = new ApiWorkspaceApplicationDescriptionList();
    for (WsmWorkspaceApplication wsmApp : wsmApps) {
        response.addApplicationsItem(makeApiWorkspaceApplication(wsmApp));
    }
    return new ResponseEntity<>(response, HttpStatus.OK);
}
Also used : ResponseEntity(org.springframework.http.ResponseEntity) ApiWorkspaceApplicationDescriptionList(bio.terra.workspace.generated.model.ApiWorkspaceApplicationDescriptionList) AuthenticatedUserRequest(bio.terra.workspace.service.iam.AuthenticatedUserRequest) WsmWorkspaceApplication(bio.terra.workspace.service.workspace.model.WsmWorkspaceApplication)

Aggregations

ApiWorkspaceApplicationDescriptionList (bio.terra.workspace.generated.model.ApiWorkspaceApplicationDescriptionList)1 AuthenticatedUserRequest (bio.terra.workspace.service.iam.AuthenticatedUserRequest)1 WsmWorkspaceApplication (bio.terra.workspace.service.workspace.model.WsmWorkspaceApplication)1 ResponseEntity (org.springframework.http.ResponseEntity)1