@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
64 lines (63 loc) • 2.68 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../common/BaseAPI");
const DailyApi_1 = require("./daily/DailyApi");
const StatisticsPerLabel_1 = require("../../../models/StatisticsPerLabel");
const PaginationResponse_1 = require("../../../models/PaginationResponse");
const StatisticsPerLabelListQueryParams_1 = require("./StatisticsPerLabelListQueryParams");
const StatisticsPerLabelListByDateRangeQueryParams_1 = require("./StatisticsPerLabelListByDateRangeQueryParams");
/**
* LabelsApi - object-oriented interface
* @export
* @class LabelsApi
* @extends {BaseAPI}
*/
class LabelsApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.daily = new DailyApi_1.default(configuration);
}
/**
* @summary Get Statistics per Label
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof LabelsApi
*/
list(queryParameters) {
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new StatisticsPerLabelListQueryParams_1.StatisticsPerLabelListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/statistics/labels', {}, queryParams).then((response) => {
return new PaginationResponse_1.default(response, StatisticsPerLabel_1.default);
});
}
/**
* @summary Get statistics per label within specific dates
* @param {Date} from Start date. Format: yyyy-MM-dd
* @param {Date} to End date. Format: yyyy-MM-dd
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof LabelsApi
*/
listByDateRange(from, to, queryParameters) {
const pathParamMap = {
from: from,
to: to
};
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new StatisticsPerLabelListByDateRangeQueryParams_1.StatisticsPerLabelListByDateRangeQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/statistics/labels/{from}/{to}', pathParamMap, queryParams).then((response) => {
return new PaginationResponse_1.default(response, StatisticsPerLabel_1.default);
});
}
}
exports.default = LabelsApi;