class CloudStorageManifester {

    public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment,
            ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) {
        CloudStorageRequest cloudStorageRequest = null;
        boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest)
                || isInternalCloudStorageConfigured(clusterRequest);
        boolean loggingConfigured = isLoggingConfigured(environment);
        if (isCloudStorageConfigured(sdxClusterRequest)) {
            LOGGER.debug("Cloud storage configurations found in SDX cluster request.");
            cloudStorageRequest =
                    initSdxCloudStorageRequest(environment,
                            clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest);
        } else if (isInternalCloudStorageConfigured(clusterRequest)) {
            LOGGER.debug("Cloud storage configurations found in internal SDX stack request.");
            cloudStorageRequest = clusterRequest.getCloudStorage();
        }

        if (loggingConfigured) {
            LOGGER.debug("Cloud storage logging is enabled.");
            if (!anyCloudStorageIsConfigured) {
                LOGGER.debug("Creating cloud storage request only for logging identity.");
                cloudStorageRequest = new CloudStorageRequest();
            }
            addLogIdentity(cloudStorageRequest, environment);
        }
        if (loggingConfigured || anyCloudStorageIsConfigured) {
            addS3Guard(cloudStorageRequest, environment);
        }
        return cloudStorageRequest;
    }

}