Search in sources :

Example 6 with ApiResourceAttributesUnion

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

the class ControlledAiNotebookInstanceResource method toApiAttributesUnion.

@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
    ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
    union.gcpAiNotebookInstance(toApiAttributes());
    return union;
}
Also used : ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion)

Example 7 with ApiResourceAttributesUnion

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

the class ControlledAzureNetworkResource method toApiAttributesUnion.

@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
    ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
    union.azureNetwork(toApiAttributes());
    return union;
}
Also used : ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion)

Example 8 with ApiResourceAttributesUnion

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

the class ControlledAzureRelayNamespaceResource method toApiAttributesUnion.

@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
    ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
    union.azureRelayNamespace(toApiAttributes());
    return union;
}
Also used : ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion)

Example 9 with ApiResourceAttributesUnion

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

the class ControlledAzureStorageResource method toApiAttributesUnion.

@Override
public ApiResourceAttributesUnion toApiAttributesUnion() {
    ApiResourceAttributesUnion union = new ApiResourceAttributesUnion();
    union.azureStorage(toApiAttributes());
    return union;
}
Also used : ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion)

Example 10 with ApiResourceAttributesUnion

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

the class MakeApiResourceDescriptionTest method mapReferencedDataRepoSnapshotTest.

@Test
public void mapReferencedDataRepoSnapshotTest() throws Exception {
    String snapshotId = UUID.randomUUID().toString();
    String instanceName = RandomStringUtils.randomAlphabetic(5);
    var resource = new ReferencedDataRepoSnapshotResource(workspaceId, resourceId, resourceName, description, cloning, instanceName, snapshotId);
    ApiResourceDescription resourceDescription = resourceController.makeApiResourceDescription(resource);
    validateWsmResource(resourceDescription);
    ApiResourceAttributesUnion union = resourceDescription.getResourceAttributes();
    ApiDataRepoSnapshotAttributes attributes = union.getGcpDataRepoSnapshot();
    assertThat(attributes, is(notNullValue()));
    assertEquals(attributes.getInstanceName(), instanceName);
    assertEquals(attributes.getSnapshot(), snapshotId);
}
Also used : ApiDataRepoSnapshotAttributes(bio.terra.workspace.generated.model.ApiDataRepoSnapshotAttributes) ApiResourceDescription(bio.terra.workspace.generated.model.ApiResourceDescription) ApiResourceAttributesUnion(bio.terra.workspace.generated.model.ApiResourceAttributesUnion) ReferencedDataRepoSnapshotResource(bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource) BaseUnitTest(bio.terra.workspace.common.BaseUnitTest) Test(org.junit.jupiter.api.Test)

Aggregations

ApiResourceAttributesUnion (bio.terra.workspace.generated.model.ApiResourceAttributesUnion)12 ApiResourceDescription (bio.terra.workspace.generated.model.ApiResourceDescription)5 BaseUnitTest (bio.terra.workspace.common.BaseUnitTest)4 Test (org.junit.jupiter.api.Test)4 ApiDataRepoSnapshotAttributes (bio.terra.workspace.generated.model.ApiDataRepoSnapshotAttributes)1 ApiGcpBigQueryDataTableAttributes (bio.terra.workspace.generated.model.ApiGcpBigQueryDataTableAttributes)1 ApiGcpBigQueryDatasetAttributes (bio.terra.workspace.generated.model.ApiGcpBigQueryDatasetAttributes)1 ApiGcpGcsBucketAttributes (bio.terra.workspace.generated.model.ApiGcpGcsBucketAttributes)1 ApiResourceMetadata (bio.terra.workspace.generated.model.ApiResourceMetadata)1 ReferencedBigQueryDatasetResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.bqdataset.ReferencedBigQueryDatasetResource)1 ReferencedBigQueryDataTableResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.bqdatatable.ReferencedBigQueryDataTableResource)1 ReferencedDataRepoSnapshotResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.datareposnapshot.ReferencedDataRepoSnapshotResource)1 ReferencedGcsBucketResource (bio.terra.workspace.service.resource.referenced.cloud.gcp.gcsbucket.ReferencedGcsBucketResource)1 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1