use of bio.terra.workspace.model.GcpGcsBucketUpdateParameters in project terra-cli by DataBiosphere.
the class WorkspaceManagerService method updateControlledGcsBucket.
/**
* Call the Workspace Manager POST
* "/api/workspaces/v1/{workspaceId}/resources/controlled/gcp/buckets/{resourceId}" endpoint to
* update a GCS bucket controlled resource in the workspace.
*
* @param workspaceId the workspace where the resource exists
* @param resourceId the resource id
* @param updateParams resource properties to update
*/
public void updateControlledGcsBucket(UUID workspaceId, UUID resourceId, UpdateControlledGcsBucketParams updateParams) {
// convert the CLI lifecycle rule object into the WSM request objects
List<GcpGcsBucketLifecycleRule> lifecycleRules = fromCLIObject(updateParams.lifecycle);
// convert the CLI object to a WSM request object
UpdateControlledGcpGcsBucketRequestBody updateRequest = new UpdateControlledGcpGcsBucketRequestBody().name(updateParams.resourceFields.name).description(updateParams.resourceFields.description).updateParameters(new GcpGcsBucketUpdateParameters().defaultStorageClass(updateParams.defaultStorageClass).lifecycle(new GcpGcsBucketLifecycle().rules(lifecycleRules)));
callWithRetries(() -> new ControlledGcpResourceApi(apiClient).updateGcsBucket(updateRequest, workspaceId, resourceId), "Error updating controlled GCS bucket in the workspace.");
}
Aggregations