class ComplianceController implements Constants {

    @RequestMapping(path = "/v1/targetType", method = RequestMethod.GET)
    
    public ResponseEntity<Object> getTargetType(@RequestParam("ag") String assetgroup,
            @RequestParam(name = "domain", required = false) String domain) {

        if (Strings.isNullOrEmpty(assetgroup)) {
            return ResponseUtils.buildFailureResponse(new Exception(ASSET_MANDATORY));
        }
        ResourceTypeResponse response;
        try {

            response = new ResourceTypeResponse(complianceService.getResourceType(assetgroup, domain));
        } catch (Exception e) {
            return ResponseUtils.buildFailureResponse(e);
        }
        return ResponseUtils.buildSucessResponse(response);
    }

}