class QueryGroups extends CatalogQuery {

    @Override
    public String JSON2(boolean isArray, boolean isEmbed) {
        StringBuilder sb = new StringBuilder();
        if (!isEmbed && isArray)
            sb.append("{ ");
        if (isArray)
            sb.append("\"groups\": [");
        Map<String, String> valueMap = new HashMap<>();
        String sep = "";
        boolean first = true;

        for (VnfcInstanceGroupCustomization o : vnfcInstanceGroupCustomizations) {
            if (first)
                sb.append("\n");
            first = false;

            boolean vnfcCustomizationNull = o.getVnfcCustomizations() == null;
            InstanceGroup instanceGroup = o.getInstanceGroup();

            if (instanceGroup != null) {
                put(valueMap, "MODEL_NAME", instanceGroup.getModelName());
                put(valueMap, "MODEL_UUID", instanceGroup.getModelUUID());
                put(valueMap, "MODEL_INVARIANT_ID", instanceGroup.getModelInvariantUUID());
                put(valueMap, "MODEL_VERSION", instanceGroup.getModelVersion());
            }

            String subItem = new QueryVnfcs(vnfcCustomizationNull ? null : o.getVnfcCustomizations()).JSON2(true, true);
            valueMap.put("_VNFCS_", subItem.replaceAll("(?m)^", "\t\t"));
            sb.append(sep).append(this.setTemplate(TEMPLATE, valueMap));
            sep = ",\n";
        }
        if (!first)
            sb.append("\n");
        if (isArray)
            sb.append("]");
        if (!isEmbed && isArray)
            sb.append("}");
        return sb.toString();
    }

    public  QueryGroups();
    public  QueryGroups(List<VnfcInstanceGroupCustomization> vnfcInstanceGroupCustomizations);

}