2019-08-14 09:48:44 +00:00
|
|
|
/* global axios */
|
2020-03-09 17:57:10 +00:00
|
|
|
import ApiClient from './ApiClient';
|
2019-08-14 09:48:44 +00:00
|
|
|
|
2020-03-09 17:57:10 +00:00
|
|
|
class ReportsAPI extends ApiClient {
|
|
|
|
constructor() {
|
2020-05-11 06:10:14 +00:00
|
|
|
super('reports', { accountScoped: true, apiVersion: 'v2' });
|
2020-03-09 17:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
getAccountReports(metric, since, until) {
|
|
|
|
return axios.get(`${this.url}/account`, {
|
|
|
|
params: { metric, since, until },
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2020-11-16 14:11:52 +00:00
|
|
|
getAccountSummary(since, until) {
|
|
|
|
return axios.get(`${this.url}/account_summary`, {
|
2020-03-09 17:57:10 +00:00
|
|
|
params: { since, until },
|
|
|
|
});
|
|
|
|
}
|
2020-12-15 18:05:03 +00:00
|
|
|
|
|
|
|
getAgentReports(since, until) {
|
|
|
|
return axios.get(`${this.url}/agents`, {
|
|
|
|
params: { since, until },
|
|
|
|
});
|
|
|
|
}
|
2020-03-09 17:57:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export default new ReportsAPI();
|