Search in sources :

Example 1 with ApiControlledResourceMetadata

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

the class ControlledResource method toApiMetadata.

@Override
public ApiResourceMetadata toApiMetadata() {
    ApiResourceMetadata metadata = super.toApiMetadata();
    var controlled = new ApiControlledResourceMetadata().accessScope(accessScope.toApiModel()).managedBy(managedBy.toApiModel()).privateResourceUser(// TODO: PF-616 figure out how to supply the assigned user's role
    new ApiPrivateResourceUser().userName(assignedUser)).privateResourceState(getPrivateResourceState().map(PrivateResourceState::toApiModel).orElse(null));
    metadata.controlledResourceMetadata(controlled);
    return metadata;
}
Also used : ApiControlledResourceMetadata(bio.terra.workspace.generated.model.ApiControlledResourceMetadata) ApiResourceMetadata(bio.terra.workspace.generated.model.ApiResourceMetadata) ApiPrivateResourceUser(bio.terra.workspace.generated.model.ApiPrivateResourceUser)

Aggregations

ApiControlledResourceMetadata (bio.terra.workspace.generated.model.ApiControlledResourceMetadata)1 ApiPrivateResourceUser (bio.terra.workspace.generated.model.ApiPrivateResourceUser)1 ApiResourceMetadata (bio.terra.workspace.generated.model.ApiResourceMetadata)1