@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
100 lines (99 loc) • 4.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../../../../common/BaseAPI");
const Mapper_1 = require("../../../../../../common/Mapper");
const CustomdataApi_1 = require("./customdata/CustomdataApi");
const BitmovinResponse_1 = require("../../../../../../models/BitmovinResponse");
const PlayReadyDrm_1 = require("../../../../../../models/PlayReadyDrm");
const PaginationResponse_1 = require("../../../../../../models/PaginationResponse");
const PlayReadyDrmListQueryParams_1 = require("./PlayReadyDrmListQueryParams");
/**
* PlayreadyApi - object-oriented interface
* @export
* @class PlayreadyApi
* @extends {BaseAPI}
*/
class PlayreadyApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
this.customdata = new CustomdataApi_1.default(configuration);
}
/**
* @summary Add PlayReady DRM to an MP4 muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MP4 muxing.
* @param {PlayReadyDrm} playReadyDrm The PlayReady DRM to be created
* @throws {BitmovinError}
* @memberof PlayreadyApi
*/
create(encodingId, muxingId, playReadyDrm) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/muxings/mp4/{muxing_id}/drm/playready', pathParamMap, playReadyDrm).then((response) => {
return (0, Mapper_1.map)(response, PlayReadyDrm_1.default);
});
}
/**
* @summary Delete PlayReady DRM from an MP4 muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MP4 muxing.
* @param {string} drmId Id of the PlayReady DRM configuration.
* @throws {BitmovinError}
* @memberof PlayreadyApi
*/
delete(encodingId, muxingId, drmId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId,
drm_id: drmId
};
return this.restClient.delete('/encoding/encodings/{encoding_id}/muxings/mp4/{muxing_id}/drm/playready/{drm_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
/**
* @summary PlayReady DRM Details of an MP4 muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MP4 muxing.
* @param {string} drmId Id of the PlayReady DRM configuration.
* @throws {BitmovinError}
* @memberof PlayreadyApi
*/
get(encodingId, muxingId, drmId) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId,
drm_id: drmId
};
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/mp4/{muxing_id}/drm/playready/{drm_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, PlayReadyDrm_1.default);
});
}
/**
* @summary List PlayReady DRMs of an MP4 muxing
* @param {string} encodingId Id of the encoding.
* @param {string} muxingId Id of the MP4 muxing.
* @param {*} [queryParameters] query parameters for filtering, sorting and pagination
* @throws {BitmovinError}
* @memberof PlayreadyApi
*/
list(encodingId, muxingId, queryParameters) {
const pathParamMap = {
encoding_id: encodingId,
muxing_id: muxingId
};
let queryParams = {};
if (typeof queryParameters === 'function') {
queryParams = queryParameters(new PlayReadyDrmListQueryParams_1.PlayReadyDrmListQueryParamsBuilder()).buildQueryParams();
}
else if (queryParameters) {
queryParams = queryParameters;
}
return this.restClient.get('/encoding/encodings/{encoding_id}/muxings/mp4/{muxing_id}/drm/playready', pathParamMap, queryParams).then((response) => {
return new PaginationResponse_1.default(response, PlayReadyDrm_1.default);
});
}
}
exports.default = PlayreadyApi;