@bitmovin/api-sdk
Version:
Bitmovin JS/TS API SDK
54 lines (53 loc) • 2.26 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const BaseAPI_1 = require("../../../../../common/BaseAPI");
const Mapper_1 = require("../../../../../common/Mapper");
const BitmovinResponse_1 = require("../../../../../models/BitmovinResponse");
const ScheduledInsertableContent_1 = require("../../../../../models/ScheduledInsertableContent");
/**
* ScheduleApi - object-oriented interface
* @export
* @class ScheduleApi
* @extends {BaseAPI}
*/
class ScheduleApi extends BaseAPI_1.BaseAPI {
constructor(configuration) {
super(configuration);
}
/**
* @summary Schedule Insertable Content
* @param {string} encodingId Id of the encoding.
* @param {string} contentId Id of the insertable content.
* @param {ScheduledInsertableContent} scheduledInsertableContent The scheduled insertable content to be created
* @throws {BitmovinError}
* @memberof ScheduleApi
*/
create(encodingId, contentId, scheduledInsertableContent) {
const pathParamMap = {
encoding_id: encodingId,
content_id: contentId
};
return this.restClient.post('/encoding/encodings/{encoding_id}/live/insertable-content/{content_id}/schedule', pathParamMap, scheduledInsertableContent).then((response) => {
return (0, Mapper_1.map)(response, ScheduledInsertableContent_1.default);
});
}
/**
* @summary Deschedule Insertable Content
* @param {string} encodingId Id of the encoding.
* @param {string} contentId Id of the insertable content.
* @param {string} scheduledContentId Id of the scheduled insertable content
* @throws {BitmovinError}
* @memberof ScheduleApi
*/
delete(encodingId, contentId, scheduledContentId) {
const pathParamMap = {
encoding_id: encodingId,
content_id: contentId,
scheduled_content_id: scheduledContentId
};
return this.restClient.delete('/encoding/encodings/{encoding_id}/live/insertable-content/{content_id}/schedule/{scheduled_content_id}', pathParamMap).then((response) => {
return (0, Mapper_1.map)(response, BitmovinResponse_1.default);
});
}
}
exports.default = ScheduleApi;