@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
82 lines (81 loc) • 3.65 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var BaseAPI_1 = require("../../../common/BaseAPI");
var DailyApi_1 = require("./daily/DailyApi");
var StatisticsPerLabel_1 = require("../../../models/StatisticsPerLabel");
var PaginationResponse_1 = require("../../../models/PaginationResponse");
var StatisticsPerLabelListQueryParams_1 = require("./StatisticsPerLabelListQueryParams");
var StatisticsPerLabelListByDateRangeQueryParams_1 = require("./StatisticsPerLabelListByDateRangeQueryParams");
/**
* LabelsApi - object-oriented interface
* @export
* @class LabelsApi
* @extends {BaseAPI}
*/
var LabelsApi = /** @class */ (function (_super) {
__extends(LabelsApi, _super);
function LabelsApi(configuration) {
var _this = _super.call(this, configuration) || this;
_this.daily = new DailyApi_1.default(configuration);
return _this;
}
/**
* @summary Get Statistics per Label
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof LabelsApi
*/
LabelsApi.prototype.list = function (queryParameters) {
var 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(function (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
*/
LabelsApi.prototype.listByDateRange = function (from, to, queryParameters) {
var pathParamMap = {
from: from,
to: to
};
var 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(function (response) {
return new PaginationResponse_1.default(response, StatisticsPerLabel_1.default);
});
};
return LabelsApi;
}(BaseAPI_1.BaseAPI));
exports.default = LabelsApi;