@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
47 lines (46 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../common/BaseAPI");
const Mapper_1 = require("../../../common/Mapper");
const PlayerLicenseAnalytics_1 = require("../../../models/PlayerLicenseAnalytics");
/**
* AnalyticsApi - object-oriented interface
* @export
* @class AnalyticsApi
* @extends {BaseAPI}
*/
class AnalyticsApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Activate Analytics
* @param {string} licenseId Id of the Player License
* @param {PlayerLicenseAnalytics} playerLicenseAnalytics The Analytics key to be added to the Player License
* @throws {BitmovinError}
* @memberof AnalyticsApi
*/
create(licenseId, playerLicenseAnalytics) {
const pathParamMap = {
license_id: licenseId
};
return this.restClient.post('/player/licenses/{license_id}/analytics', pathParamMap, playerLicenseAnalytics).then((response) => {
return (0, Mapper_1.map)(response, PlayerLicenseAnalytics_1.default);
});
}
/**
* @summary Deactivate Analytics
* @param {string} licenseId Id of license
* @throws {BitmovinError}
* @memberof AnalyticsApi
*/
delete(licenseId) {
const pathParamMap = {
license_id: licenseId
};
return this.restClient.delete('/player/licenses/{license_id}/analytics', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, PlayerLicenseAnalytics_1.default);
});
}
}
exports.default = AnalyticsApi;