class PatchingRepositoryImpl implements PatchingRepository, Constants {

    public Map<String, Object> addParentConditionPatching(String targetType) {
        Map<String, Object> parentBool = new HashMap<>();
        List<Map<String, Object>> mustList = new ArrayList<>();
        Map<String, String> match = new HashMap<>();
        match.put(LATEST, "true");
        Map<String, Object> matchMap = new HashMap<>();
        matchMap.put(MATCH, match);
        mustList.add(matchMap);
        Map<String, Object> parentEntryMap = new LinkedHashMap<>();
        if ("ec2".equals(targetType)) {

            match = new HashMap<>();
            match.put(STATE_NAME, RUNNING);
            matchMap = new HashMap<>();
            matchMap.put(MATCH, match);
            mustList.add(matchMap);

            parentBool.put(MUST, mustList);

            match = new HashMap<>();
            match.put(PLATFORM, WINDOWS);
            matchMap = new HashMap<>();
            matchMap.put(MATCH, match);

            parentBool.put("must_not", matchMap);

            Map<String, Object> queryMap = new HashMap<>();
            queryMap.put("bool", parentBool);

            parentEntryMap.put("type", "ec2");
            parentEntryMap.put("query", queryMap);

        }
        return parentEntryMap;
    }

}