// TODO: currently response from metrics endpoint is not "regular", so it's not easy to return an object from here
// (e.g. metrics endpoint sometimes returns {"data":0} and other times returns {"data":[..]})
public JsonObject getMetric(String scope, String context, String metric, String timeRange) throws IOException,
UnAuthorizedAccessTokenException {
URL url = config.resolveURL(String.format("metrics/%s/%s/%s?%s", scope, context, metric, timeRange));
HttpResponse response = restClient.execute(HttpMethod.GET, url, config.getAccessToken());
return ObjectResponse.fromJsonBody(response, JsonObject.class).getResponseObject();
}