use of bio.terra.workspace.generated.model.ApiResourceAttributesUnion in project terra-workspace-manager by DataBiosphere.
the class MakeApiResourceDescriptionTest method mapReferencedBigQueryDatasetTest.
@Test
public void mapReferencedBigQueryDatasetTest() throws Exception {
String projectId = RandomStringUtils.randomAlphabetic(12);
String datasetName = RandomStringUtils.randomAlphabetic(12);
var resource = new ReferencedBigQueryDatasetResource(workspaceId, resourceId, resourceName, description, cloning, projectId, datasetName);
ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
validateWsmResource(resourceDescription);
ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
ApiGcpBigQueryDatasetAttributes attributes = union.getGcpBqDataset();
assertThat(attributes, is(notNullValue()));
assertEquals(attributes.getDatasetId(), datasetName);
assertEquals(attributes.getProjectId(), projectId);
}
use of bio.terra.workspace.generated.model.ApiResourceAttributesUnion in project terra-workspace-manager by DataBiosphere.
the class MakeApiResourceDescriptionTest method mapReferencedGcsBucketTest.
@Test
public void mapReferencedGcsBucketTest() throws Exception {
String bucketName = RandomStringUtils.randomAlphabetic(5).toLowerCase();
var resource = new ReferencedGcsBucketResource(workspaceId, resourceId, resourceName, description, cloning, bucketName);
ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
validateWsmResource(resourceDescription);
ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
ApiGcpGcsBucketAttributes attributes = union.getGcpGcsBucket();
assertThat(attributes, is(notNullValue()));
assertEquals(attributes.getBucketName(), bucketName);
}
use of bio.terra.workspace.generated.model.ApiResourceAttributesUnion in project terra-workspace-manager by DataBiosphere.
the class ControlledAzureDiskResource method toApiAttributesUnion.
@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
union.azureDisk(toApiAttributes());
return union;
}
use of bio.terra.workspace.generated.model.ApiResourceAttributesUnion in project terra-workspace-manager by DataBiosphere.
the class ControlledAzureIpResource method toApiAttributesUnion.
@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
union.azureIp(toApiAttributes());
return union;
}
use of bio.terra.workspace.generated.model.ApiResourceAttributesUnion in project terra-workspace-manager by DataBiosphere.
the class ControlledAzureVmResource method toApiAttributesUnion.
@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
union.azureVm(toApiAttributes());
return union;
}
Aggregations