class ClouderaManagerMgmtTelemetryService {

    @VisibleForTesting
    ApiConfigList buildTelemetryConfigList(Stack stack, WorkloadAnalytics wa, String sdxContextName,
            String sdxCrn, ProxyConfig proxyConfig) {
        final Map<String, String> configsToUpdate = new HashMap<>();
        Map<String, String> telemetrySafetyValveMap = new HashMap<>();
        telemetrySafetyValveMap.put(TELEMETRY_WA_CLUSTER_TYPE_HEADER,
                TELEMETRY_WA_DEFAULT_CLUSTER_TYPE);
        enrichWithSdxData(sdxContextName, sdxCrn, stack, wa, telemetrySafetyValveMap);
        telemetrySafetyValveMap.put(TELEMETRY_UPLOAD_LOGS, "true");
        configsToUpdate.put(TELEMETRY_SAFETY_VALVE, createStringFromSafetyValveMap(telemetrySafetyValveMap));
        if (proxyConfig != null) {
            configsToUpdate.put(TELEMETRY_PROXY_ENABLED, "true");
            configsToUpdate.put(TELEMETRY_PROXY_SERVER, proxyConfig.getServerHost());
            configsToUpdate.put(TELEMETRY_PROXY_PORT, String.valueOf(proxyConfig.getServerPort()));
            proxyConfig.getProxyAuthentication().ifPresent(auth -> {
                configsToUpdate.put(TELEMETRY_PROXY_USER, auth.getUserName());
                configsToUpdate.put(TELEMETRY_PROXY_PASSWORD, auth.getPassword());
            });
        }
        return makeApiConfigList(configsToUpdate);
    }

}