class TargetTypesController {

	@ApiOperation(httpMethod = "GET", value = "API to get all target type names by datasource name", response = Response.class, produces = MediaType.APPLICATION_JSON_VALUE)
	@RequestMapping(path = "/list-names-by-datasource", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
	public ResponseEntity<Object> getTargetTypesNamesByDataSourceName(
			@ApiParam(value = "provide valid dataSource name", required = true) @RequestParam(defaultValue="", name = "dataSourceName", required = true) String dataSourceName) {
		try {
			return ResponseUtils.buildSucessResponse(targetTypesService.getTargetTypesNamesByDataSourceName(dataSourceName));
		} catch (Exception exception) {
			log.error(UNEXPECTED_ERROR_OCCURRED, exception);
			return ResponseUtils.buildFailureResponse(new Exception(UNEXPECTED_ERROR_OCCURRED), exception.getMessage());
		}
	}

}