class CloudStorageDecorator {

    public CloudStorageRequest decorate(String blueprintName,
        String clusterName,
        CloudStorageRequest request,
        DetailedEnvironmentResponse environment) {
        if (environment != null) {
            if (request == null) {
                request = new CloudStorageRequest();
            }
            TelemetryResponse telemetry = environment.getTelemetry();
            if (telemetry != null && telemetry.getLogging() != null) {
                LoggingResponse logging = telemetry.getLogging();
                StorageIdentityBase identity = new StorageIdentityBase();
                identity.setType(CloudIdentityType.LOG);
                identity.setS3(logging.getS3());
                identity.setAdlsGen2(logging.getAdlsGen2());
                identity.setGcs(logging.getGcs());
                List<StorageIdentityBase> identities = request.getIdentities();
                if (identities == null) {
                    identities = new ArrayList<>();
                }
                boolean logConfiguredInRequest = false;
                for (StorageIdentityBase identityBase : identities) {
                    if (CloudIdentityType.LOG.equals(identityBase.getType())) {
                        logConfiguredInRequest = true;
                    }
                }
                if (!logConfiguredInRequest) {
                    identities.add(identity);
                }
                request.setIdentities(identities);
            }
            List<SdxClusterResponse> datalakes = sdxClientService.getByEnvironmentCrn(environment.getCrn());
            updateCloudStorageLocations(blueprintName, clusterName, request, datalakes);
            updateDynamoDBTable(request, environment);
        }
        return request;
    }

}