class QueryVfModule extends CatalogQuery {

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

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

            boolean vfNull = o.getVfModule() == null;
            boolean hasVolumeGroup = false;
            HeatEnvironment envt = o.getVolumeHeatEnv();
            if (envt != null) {
                hasVolumeGroup = true;
            }

            put(valueMap, "MODEL_NAME", vfNull ? null : o.getVfModule().getModelName());
            put(valueMap, "MODEL_UUID", vfNull ? null : o.getVfModule().getModelUUID());
            put(valueMap, "MODEL_INVARIANT_ID", vfNull ? null : o.getVfModule().getModelInvariantUUID());
            put(valueMap, "MODEL_VERSION", vfNull ? null : o.getVfModule().getModelVersion());
            put(valueMap, "MODEL_CUSTOMIZATION_UUID", o.getModelCustomizationUUID());
            put(valueMap, "IS_BASE", !vfNull && (o.getVfModule().getIsBase()));
            put(valueMap, "VF_MODULE_LABEL", o.getLabel());
            put(valueMap, "INITIAL_COUNT", o.getInitialCount());
            put(valueMap, "HAS_VOLUME_GROUP", hasVolumeGroup);

            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  QueryVfModule();
    public  QueryVfModule(List<VfModuleCustomization> vlist);

}