Skip to content

Commit

Permalink
Undo
Browse files Browse the repository at this point in the history
  • Loading branch information
aherbst-broad committed Apr 19, 2024
1 parent fa55d39 commit bc258b8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ public ApiAzureLandingZoneList listLandingZonesByBillingProfile(
return result;
}

@Override
public ApiAzureLandingZoneList listLandingZones(BearerToken bearerToken) {
List<LandingZone> landingZones = landingZoneService.listLandingZones(bearerToken);
return new ApiAzureLandingZoneList()
.landingzones(
landingZones.stream().map(typeAdapter::toApiAzureLandingZoneFromApiClient).toList());
}

@Override
public String getLandingZoneRegion(BearerToken bearerToken, UUID landingZoneId) {
return landingZoneService.getLandingZoneRegion(bearerToken, landingZoneId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@ public ApiAzureLandingZoneList listLandingZonesByBillingProfile(
return result;
}

@Override
public ApiAzureLandingZoneList listLandingZones(BearerToken bearerToken) {
throw new RuntimeException("todo");
}

@Override
public String getLandingZoneRegion(BearerToken bearerToken, UUID landingZoneId)
throws InterruptedException {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package bio.terra.workspace.amalgam.landingzone.azure;

import bio.terra.common.exception.BadRequestException;
import bio.terra.common.iam.BearerToken;
import bio.terra.landingzone.library.landingzones.deployment.LandingZonePurpose;
import bio.terra.landingzone.library.landingzones.deployment.ResourcePurpose;
Expand Down Expand Up @@ -220,12 +219,13 @@ public ApiAzureLandingZone getAzureLandingZone(BearerToken bearerToken, UUID lan
public ApiAzureLandingZoneList listAzureLandingZones(
BearerToken bearerToken, UUID billingProfileId) {
features.azureEnabledCheck();
if (billingProfileId == null) {
throw new BadRequestException("billingProfileId is required");
if (billingProfileId != null) {
return Rethrow.onInterrupted(
() -> amalgamated.listLandingZonesByBillingProfile(bearerToken, billingProfileId),
"listLandingZonesByBillingProfile");
}
return Rethrow.onInterrupted(
() -> amalgamated.listLandingZonesByBillingProfile(bearerToken, billingProfileId),
"listLandingZonesByBillingProfile");
() -> amalgamated.listLandingZones(bearerToken), "listLandingZones");
}

public ApiResourceQuota getResourceQuota(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ ApiAzureLandingZone getAzureLandingZone(BearerToken bearerToken, UUID landingZon
ApiAzureLandingZoneList listLandingZonesByBillingProfile(
BearerToken bearerToken, UUID billingProfileId) throws InterruptedException;

ApiAzureLandingZoneList listLandingZones(BearerToken bearerToken);

String getLandingZoneRegion(BearerToken bearerToken, UUID landingZoneId)
throws InterruptedException;

Expand Down

0 comments on commit bc258b8

Please sign in to comment.