class DatahubRestResourceAuditEventConverter implements RestResourceAuditEventConverter {

    @Override
    public Map<String, Object> requestParameters(StructuredRestCallEvent structuredEvent) {
        Map<String, Object> params = legacyRestCommonService.addClusterCrnAndNameIfPresent(structuredEvent);
        OperationDetails operation = structuredEvent.getOperation();
        Optional<Stack> stack = stackService.findStackByNameAndWorkspaceId(operation.getResourceName(), operation.getWorkspaceId());
        AuditEventName auditEventName = auditEventName(structuredEvent);
        if (stack.isPresent() && auditEventName == AuditEventName.RESIZE_DATAHUB_CLUSTER) {
            Json json = new Json(structuredEvent.getRestCall().getRestRequest().getBody());
            String group = json.getValue("group");
            HostGroup hostGroup = hostGroupService.getByClusterIdAndNameWithRecipes(stack.get().getCluster().getId(), group);
            Integer desiredCount = json.getValue("desiredCount");
            Integer originalNodeCount = hostGroup.getInstanceGroup().getNodeCount();
            params.put("desiredCount", desiredCount);
            params.put("originalCount", originalNodeCount);
            params.put("hostGroup", group);
        }
        return params;
    }

}