class AssetGroupUtil {

    public static Map<String, Object> fetchCertSummary(String compapiuri, String ag ,String token) throws Exception {
        Map<String, Object> certSummary = new HashMap<>();
        try {
            String certSummaryResponse = HttpUtil.get(compapiuri + "/certificates?ag=" + ag,token);
            JsonObject certSummaryJson = new JsonParser().parse(certSummaryResponse).getAsJsonObject();
            JsonObject certJsonObj = certSummaryJson.get("data").getAsJsonObject().get(OUTPUT).getAsJsonObject();
            long total = certJsonObj.get("certificates").getAsLong();
            long noncompliant = certJsonObj.get("certificates_expiring").getAsLong();
            long compliant = total - noncompliant;
            certSummary.put(TOTAL, total);
            certSummary.put(NON_COMPLIANT, noncompliant);
            certSummary.put(COMPLIANT, compliant);
        } catch (Exception e) {
            LOGGER.error("Error retrieving cert sumamary " , e);
            throw e;
        }
        return certSummary;
    }

    private  AssetGroupUtil();

}