@ApiOperation(nickname = "accountCount",
value = "Counts the Accounts",
notes = "Counts the Accounts with the given AccountQuery parameter returning the number of matching Accounts",
response = CountResult.class)
@POST
@Path("_count")
@Consumes({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public CountResult count(
@ApiParam(value = "The ScopeId in which to count results", required = true, defaultValue = DEFAULT_SCOPE_ID) @PathParam("scopeId") ScopeId scopeId,
@ApiParam(value = "The AccountQuery to use to filter count results", required = true) AccountQuery query) throws Exception {
query.setScopeId(scopeId);
return new CountResult(accountService.count(query));
}